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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,281,108 | 03/12/2011 06:54:28 | 361,883 | 06/08/2010 23:03:09 | 390 | 0 | Using jQuery Labelify Plugin | This is Labelify: http://www.kryogenix.org/code/browser/labelify/
Basically, it allows me to put a light grey text into my text boxes that disappears when they're selected.
I only have two problems:
- I am using the jQuery UI Datapicker on a field that has this sort of label, and when I click on the date I want, the field shows the date but still grey (inputted text should appear black).
- For fields that have a password, is there a way to have the password still look like an input that is type=password, but to have the light grey label appear as plaintext? When I tried to Labelify the password fields, the label just showed up as the label's length in dots rather than plaintext.
Thank you! | jquery | jquery-ui | null | null | null | null | open | Using jQuery Labelify Plugin
===
This is Labelify: http://www.kryogenix.org/code/browser/labelify/
Basically, it allows me to put a light grey text into my text boxes that disappears when they're selected.
I only have two problems:
- I am using the jQuery UI Datapicker on a field that has this sort of label, and when I click on the date I want, the field shows the date but still grey (inputted text should appear black).
- For fields that have a password, is there a way to have the password still look like an input that is type=password, but to have the light grey label appear as plaintext? When I tried to Labelify the password fields, the label just showed up as the label's length in dots rather than plaintext.
Thank you! | 0 |
10,527,848 | 05/10/2012 05:12:27 | 139,667 | 07/16/2009 17:35:29 | 116 | 3 | Generics hell or what would it take to have assembly level type parameterization (assembly wide generics) in .NET | Not sure what this question is exactly about.
Here is the problem. Suppose, I am working on a framework that is going to be packed into an assembly without source code available and shipped as a product. From the very beginning the framework is developed with extensibility in mind, by which I mean that some target domain details/data/classes are to be defined by the end user / assembly that refers the framework. One of the ways to enable it is to use generics in the framework for everything to be defined later. But once a generic is introduced to a single class all dependent/referring classes and methods have to re-declare it with all the exact constraints. It's not a big deal to pass around a single generic, but things go very quickly out of control when you have to deal, say with 8 of them, which is not something uncommon at all. In every little class in your framework you have to put several lines of just redeclared type parameters that are all the same among all of your classes. It seems like a quick and dirty solution would be just to have some kind of c++like macro that would add the same generic declaration to all (most of) classes. But C# doesn't have macros, so you have to do it by hands. Here is where we come to a question: what would it take to get these parameters out of brackets and declare them once at the assembly (project) level? So that you don't have to write "public class Entity<TField> { ... }", because TField is defined and whenever you see it, it means the class knows about it implicitly using the same declaration as the one at the assembly level. By linking such generic assemblies a developer has to provide all type arguments before they are able to use it, or if some parameters are still unbound, to redeclare them for later use.
Questions:
- have you ever found yourself in a situation like this?
- do you think that having this feature might be helpful?
- if so, how do you currently get along without one?
- for those who is working on c#: what is a chance that you guys will add this to some new version of c#?
Thank you! | .net | generics | c#-4.0 | programming-languages | language-features | null | open | Generics hell or what would it take to have assembly level type parameterization (assembly wide generics) in .NET
===
Not sure what this question is exactly about.
Here is the problem. Suppose, I am working on a framework that is going to be packed into an assembly without source code available and shipped as a product. From the very beginning the framework is developed with extensibility in mind, by which I mean that some target domain details/data/classes are to be defined by the end user / assembly that refers the framework. One of the ways to enable it is to use generics in the framework for everything to be defined later. But once a generic is introduced to a single class all dependent/referring classes and methods have to re-declare it with all the exact constraints. It's not a big deal to pass around a single generic, but things go very quickly out of control when you have to deal, say with 8 of them, which is not something uncommon at all. In every little class in your framework you have to put several lines of just redeclared type parameters that are all the same among all of your classes. It seems like a quick and dirty solution would be just to have some kind of c++like macro that would add the same generic declaration to all (most of) classes. But C# doesn't have macros, so you have to do it by hands. Here is where we come to a question: what would it take to get these parameters out of brackets and declare them once at the assembly (project) level? So that you don't have to write "public class Entity<TField> { ... }", because TField is defined and whenever you see it, it means the class knows about it implicitly using the same declaration as the one at the assembly level. By linking such generic assemblies a developer has to provide all type arguments before they are able to use it, or if some parameters are still unbound, to redeclare them for later use.
Questions:
- have you ever found yourself in a situation like this?
- do you think that having this feature might be helpful?
- if so, how do you currently get along without one?
- for those who is working on c#: what is a chance that you guys will add this to some new version of c#?
Thank you! | 0 |
9,600,870 | 03/07/2012 11:43:05 | 1,092,220 | 12/11/2011 12:29:48 | 38 | 6 | SQL: Joining tables on primary key AND returning the primary key | I'm writing a C# application and am using an Access .mdb. I have a table with email messages and a table with message relations (each email msg can be assigned to several teams of workers), so the rows in the relations table have "msgId" and "teamName" fields.
I want to to get all messages from the first table which are assigned to a specified team. I'm using the following query:
"SELECT * FROM Mails INNER JOIN MailAssignments ON Mails.msgId = MailAssignments.msgId"
But it doesn't return the msgId for me, I guess, because the tables are joined on this field, but then I
m not able to identify messages in my C# code.
How can I make the query return the msgId for me? | c# | sql | ms-access | null | null | null | open | SQL: Joining tables on primary key AND returning the primary key
===
I'm writing a C# application and am using an Access .mdb. I have a table with email messages and a table with message relations (each email msg can be assigned to several teams of workers), so the rows in the relations table have "msgId" and "teamName" fields.
I want to to get all messages from the first table which are assigned to a specified team. I'm using the following query:
"SELECT * FROM Mails INNER JOIN MailAssignments ON Mails.msgId = MailAssignments.msgId"
But it doesn't return the msgId for me, I guess, because the tables are joined on this field, but then I
m not able to identify messages in my C# code.
How can I make the query return the msgId for me? | 0 |
4,315,045 | 11/30/2010 14:55:12 | 519,632 | 11/25/2010 03:28:48 | 16 | 0 | jQuery Address difference in behavior for browser back button vs link to previous page | My problem is best described with this screencast I recorded: http://www.youtube.com/watch?v=aI-p_jqzOdU
I'm using the jQuery Address plugin for Ajax deep-linking. For those who don't know how jQuery address works, it works by listening to the hash changes with the `change()` method. Pressing the back button and pressing a hyperlink that goes to the previous page URL should behave the same way because they call the same event handler.
Here it is in pseudo code:
$address.change(function(event) {
if (event.value != '/') { // is the image link
Get the URL to be loaded
Create an overlay, append it to body and set its height, width, opacity
Put overlay on top of gallery
Load URL into overlay then fade it in
Set BODY to overflow: hidden
} else { // is the gallery link
Set BODY to overflow: auto
Fade out overlay then remove it
}
});
If you watch the video, you'll see that pressing the link to the previous page causes the scroll of the page to jump back to 0. Pressing the browser back button keeps it which the the desired behavior.
What could be wrong? | jquery | ajax | jquery-plugins | jquery-ajax | jquery-address | null | open | jQuery Address difference in behavior for browser back button vs link to previous page
===
My problem is best described with this screencast I recorded: http://www.youtube.com/watch?v=aI-p_jqzOdU
I'm using the jQuery Address plugin for Ajax deep-linking. For those who don't know how jQuery address works, it works by listening to the hash changes with the `change()` method. Pressing the back button and pressing a hyperlink that goes to the previous page URL should behave the same way because they call the same event handler.
Here it is in pseudo code:
$address.change(function(event) {
if (event.value != '/') { // is the image link
Get the URL to be loaded
Create an overlay, append it to body and set its height, width, opacity
Put overlay on top of gallery
Load URL into overlay then fade it in
Set BODY to overflow: hidden
} else { // is the gallery link
Set BODY to overflow: auto
Fade out overlay then remove it
}
});
If you watch the video, you'll see that pressing the link to the previous page causes the scroll of the page to jump back to 0. Pressing the browser back button keeps it which the the desired behavior.
What could be wrong? | 0 |
10,706,110 | 05/22/2012 16:24:33 | 1,410,697 | 05/22/2012 16:20:58 | 1 | 0 | what is the lowest price for android applications? | I'm finishing my app, it's intended for donations but it seems donations is not very suitable for android market, so my intention is to sell it to the lowest price available for android market. Thanks in advance for your comments. | android | android-market | null | null | null | 05/22/2012 16:27:27 | off topic | what is the lowest price for android applications?
===
I'm finishing my app, it's intended for donations but it seems donations is not very suitable for android market, so my intention is to sell it to the lowest price available for android market. Thanks in advance for your comments. | 2 |
211,394 | 10/17/2008 08:21:39 | 3,050 | 08/26/2008 13:41:09 | 567 | 48 | When to use custom html tags? | What is the use case for using your own html tags? (In standard off the shelf browsers)
A colleague and myself were discussing it lately. I could not think of a use case. We discussed it could be used for styling with css but then decided to use the span tag with a class instead.
Thanks
Paul | html | xhtml | css | webbrowser | null | 05/10/2012 21:21:31 | not constructive | When to use custom html tags?
===
What is the use case for using your own html tags? (In standard off the shelf browsers)
A colleague and myself were discussing it lately. I could not think of a use case. We discussed it could be used for styling with css but then decided to use the span tag with a class instead.
Thanks
Paul | 4 |
8,649,450 | 12/27/2011 21:25:19 | 51,816 | 01/05/2009 21:39:06 | 11,472 | 21 | What are the correct names of unit interpolations and how to implement them? | I can't find for the life of me the correct names for interpolations like the ones below.
I am trying to look them up google using `ease-in interpolation`, `types of interpolation`, but without much luck.
All I want is to implement them in a fashion like this:
double Interp ( double value, double t )
where `value` if the value to be interpolated and `t` is the time value that can be any value between 0-1, including 0 and 1.
So if `Interp` was using a linear interpolation and `value` was 10, and `t` was 0.5, the return would be 5. But I want to get the values using other interpolations.
Any help on this?
I remember seeing a website with flash animations showing the formula of each one time but can't find it anymore.
![enter image description here][1]
![enter image description here][2]
[1]: http://i.stack.imgur.com/zbDPk.png
[2]: http://i.stack.imgur.com/4MM2v.png | c# | .net | math | interpolation | null | 12/28/2011 08:03:30 | off topic | What are the correct names of unit interpolations and how to implement them?
===
I can't find for the life of me the correct names for interpolations like the ones below.
I am trying to look them up google using `ease-in interpolation`, `types of interpolation`, but without much luck.
All I want is to implement them in a fashion like this:
double Interp ( double value, double t )
where `value` if the value to be interpolated and `t` is the time value that can be any value between 0-1, including 0 and 1.
So if `Interp` was using a linear interpolation and `value` was 10, and `t` was 0.5, the return would be 5. But I want to get the values using other interpolations.
Any help on this?
I remember seeing a website with flash animations showing the formula of each one time but can't find it anymore.
![enter image description here][1]
![enter image description here][2]
[1]: http://i.stack.imgur.com/zbDPk.png
[2]: http://i.stack.imgur.com/4MM2v.png | 2 |
1,638,720 | 10/28/2009 17:14:09 | 16,868 | 09/17/2008 21:43:09 | 452 | 30 | What kinds of problems have there been using Access databases with SharePoint? | Just curious what the experience has been in uploading MS Access tables to SharePoint 2007 list. We've been planning on doing so, but I seem to recall issues with SharePoint mangling Access tables in the resulting lists and generally the migrations not going so well. Your experiences? Best practices and recommendations? I'm particularly concerned on its ability to migrate forms and reports as well if it can do so. Thanks! | sharepoint | ms-access | migration | sharepoint-list | null | null | open | What kinds of problems have there been using Access databases with SharePoint?
===
Just curious what the experience has been in uploading MS Access tables to SharePoint 2007 list. We've been planning on doing so, but I seem to recall issues with SharePoint mangling Access tables in the resulting lists and generally the migrations not going so well. Your experiences? Best practices and recommendations? I'm particularly concerned on its ability to migrate forms and reports as well if it can do so. Thanks! | 0 |
3,568,212 | 08/25/2010 16:35:33 | 381,711 | 07/02/2010 03:49:44 | 8 | 0 | Javascript store locator to Jquery | I'm in a bit of a rut. I need to figure out how to convert all this code into jquery. Since I don't know too much jquery. http://www.lastyearsloss.com/store/javascript/map.js I'm not sure which lines I can use or which ones change fully. The main problem is where I'm importing the data from xml. If anyone can point me in the right direction that would be awesome! thanks! | jquery | google-maps-api-3 | null | null | null | null | open | Javascript store locator to Jquery
===
I'm in a bit of a rut. I need to figure out how to convert all this code into jquery. Since I don't know too much jquery. http://www.lastyearsloss.com/store/javascript/map.js I'm not sure which lines I can use or which ones change fully. The main problem is where I'm importing the data from xml. If anyone can point me in the right direction that would be awesome! thanks! | 0 |
8,550,622 | 12/18/2011 08:31:14 | 67,505 | 02/17/2009 18:30:08 | 2,253 | 161 | Looking for the right pattern to extend DOMElements | I'm new to js and need to extend dom Elements with my custom methods and data.
For data I'm using the dataset property built in html.
For methods I don't know what to do.
Is there a well known best practice to achieve this ? | javascript | html | dom | null | null | null | open | Looking for the right pattern to extend DOMElements
===
I'm new to js and need to extend dom Elements with my custom methods and data.
For data I'm using the dataset property built in html.
For methods I don't know what to do.
Is there a well known best practice to achieve this ? | 0 |
3,032,373 | 06/13/2010 13:26:34 | 202,184 | 11/03/2009 23:10:50 | 459 | 12 | Simplest way to match 2d array of keys/strings to search in perl? | Related to my previous question (<a href="http://stackoverflow.com/questions/3019708">found here</a>), I want to be able to implement the answers given with a 2 dimensional array, instead of one dimensional.
Reference Array
row[1][0]: 13, row[1][1]: Sony
row[0][0]: 19, row[0][1]: Canon
row[2][0]: 25, row[2][1]: HP
Search String: Sony's Cyber-shot DSC-S600
End Result: 13 | perl | string | full-text-search | implementation | null | null | open | Simplest way to match 2d array of keys/strings to search in perl?
===
Related to my previous question (<a href="http://stackoverflow.com/questions/3019708">found here</a>), I want to be able to implement the answers given with a 2 dimensional array, instead of one dimensional.
Reference Array
row[1][0]: 13, row[1][1]: Sony
row[0][0]: 19, row[0][1]: Canon
row[2][0]: 25, row[2][1]: HP
Search String: Sony's Cyber-shot DSC-S600
End Result: 13 | 0 |
11,332,749 | 07/04/2012 16:31:17 | 1,501,976 | 07/04/2012 15:30:23 | 1 | 0 | SAS programmer..............doubts | my graduation is bsc(computers),and completed MBA in 2011 ......after that i have done sas course ..i feel good with sas programming.Now i am searching for job .
but most of the people say SAS will have most openings in clinical domain ..... so with my present education can i enter into clinical sas programmer .....if yes ..should i learn any extra thing on clinical domain....
And to enter into banking or finance sector on sas , sas programming is enough? or any extra knowledge is required??.........and how will be openings and career.
so plz guide me...to build my career...
| sas | null | null | null | null | 07/04/2012 19:52:00 | off topic | SAS programmer..............doubts
===
my graduation is bsc(computers),and completed MBA in 2011 ......after that i have done sas course ..i feel good with sas programming.Now i am searching for job .
but most of the people say SAS will have most openings in clinical domain ..... so with my present education can i enter into clinical sas programmer .....if yes ..should i learn any extra thing on clinical domain....
And to enter into banking or finance sector on sas , sas programming is enough? or any extra knowledge is required??.........and how will be openings and career.
so plz guide me...to build my career...
| 2 |
1,025,081 | 06/22/2009 00:01:45 | 48,465 | 12/22/2008 20:24:42 | 1,373 | 42 | Would an open source project have "Copyright. All rights reserved." written on it's licensing disclaimer? | I was trying to make some code I wrote be published under LGPL. I included the [appropriate header](http://www.gnu.org/licenses/gpl-howto.html) in each file, but StyleCop told me to include a copyright notice also. But I think that "Copyright. All rights reserved." is not intended to free software. Should I remove it? | licensing | lgpl | copyright | stylecop | null | 05/16/2012 23:26:43 | not constructive | Would an open source project have "Copyright. All rights reserved." written on it's licensing disclaimer?
===
I was trying to make some code I wrote be published under LGPL. I included the [appropriate header](http://www.gnu.org/licenses/gpl-howto.html) in each file, but StyleCop told me to include a copyright notice also. But I think that "Copyright. All rights reserved." is not intended to free software. Should I remove it? | 4 |
4,768,744 | 01/22/2011 15:39:22 | 145,757 | 07/27/2009 13:42:57 | 565 | 13 | What is the difference between a Rule and a Policy | in the context of a database, we sometimes need to check values against some statements like **"the customer name is non-empty"** or **"the customer number of purchases is positive"**...
But do such statements constitute rules or policies ?
**In general how would you define these concepts, their differences and relations ?**
Thanks in advance. | database | rules | policy | rule | policies | 09/23/2011 23:40:36 | not constructive | What is the difference between a Rule and a Policy
===
in the context of a database, we sometimes need to check values against some statements like **"the customer name is non-empty"** or **"the customer number of purchases is positive"**...
But do such statements constitute rules or policies ?
**In general how would you define these concepts, their differences and relations ?**
Thanks in advance. | 4 |
11,163,225 | 06/22/2012 19:55:35 | 1,475,807 | 06/22/2012 19:44:48 | 1 | 0 | not sure about this assignment i have on dynamic arrays and inheritance, any help would be amazing | This is what I have so far, i have no idea about the RingUpSale on the register.cpp file.
i know my code is close but I hve so many errors that i am unsure about the whole thing.
enum ItemType {BOOK, DVD, SOFTWARE, CREDIT};
class Sale
{
public:
Sale();
void MakeSale(ItemType x, double amt);
ItemType Item();
double Price();
double Tax();
double Total();
void Display();
private:
double price;
double tax;
double total;
ItemType item;
}
//****************************SALE.CPP*******************************
#include<iostream>
#include<cmath>
#include "sales.h"
using namespace std;
Sale::Sale()
{
price = 0;
tax = 0;
total = 0;
}
// Credit are suppose to have no tax all other purchases have
void Sale::MakeSale(ItemType x, double amt)
{
item = x;
if(item == CREDIT)
total = amt;
else
total = (amt * tax);
}
ItemType Sale::Item()
{
return item;
}
double Sale::Price()
{
return price;
}
double Sale::Tax()
{
return tax;
}
double Sale::Total()
{
return Total;
}
// display function
void Sale::Display()
{
if(item = BOOK)
cout<<"BOOK"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = DVD)
cout<<"DVD"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = SOFTWARE)
cout<<"SOFTWARE"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = CREDIT)
cout<<"CREDIT" <<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
}
//****************************Register.h*******************************
#include<iostream>
#include "sales.h"
using namespace std;
const int BLOCKSIZE = 5;
class Register : Sales
{
public:
Register(int id, double start_amount);
~Register();
int GetID();
double GetAmount();
void RingUpSale(enum ItemType Saletype, double amount);
void ShowLast();
void ShowAll();
void Cancel();
double SalesTax();
private:
int Register_ID;
int Current_ArraySize;
int Number_of_Records;
double Register_Amount
Sale *Sales_Array;
Sale *Temp_Array;
void expandlist;
void shrinklist;
//******************************Register.cpp*********************************
I am not sure why certain functions are implemented but i think I have a preety good idea of what is going on with the program.
#include<iostream>
#include "register.h"
#include<cmath>
using namespace std;
// * Initializing these values
Sales_Array = new int[BLOCKSIZE];
Current_ArraySize = 0;
Number_of_Records = 0;
// * Function: Construct for Register
Register::Register(int id, double amount)
{
Register_Id = id;
Register_amount = amount;
}
why is this in () marks rather than brackets"(Sales_Array+1) i know there is addition but the point is going where?
void Register::ShowAll()
{
int i;
cout << " the elements int the array are:" <<endl;
for (i=0; i<Current_ArraySize; i++)
cout << *(Sales_Array+i) << endl;
}
void Register::ShowLast()
{
cout << "The last sale was:" << endl;
cout << Sale[Current_ArraySize - 1] << endl;
}
void Register::Cancel()
{
if( Current_ArraySize > 5 && (ArraySize%BLOCKSIZE)==1)
{
cout << "ArraySize to be resized" <<endl;
int *temp, i;
Current_ArraySize--;
Number_of_Records == Current_ArraySize;
temp = new int[Current_ArraySize];
for(i=0; i<Current_ArraySize; i++)
temp[i] = Sales_Array[i];
delete[] Sales_Array;
Sales_Array = temp;
}
else
{
ArraySize--;
Number_of_Records = Current_ArraySize;
}
Register::~Register()
{
delete[] Sales_Array;
}
int Register::GetID()
{
return Register_ID;
}
double Reister::GetAmount()
{
return Register_Amount;
}
double SalesTax()
{
return SalesTax;
}
void Register::expandlist
{
int i;
if(Current_ArraySize >= 5 && (Current_ArraySize%BLOCKSIZE) == 0)
{
cout<<"Array to be resized, adding 5 slots"<<endl;
//Allocate memory with added BLOCK
Temp_Array = new int[Current_ArraySize+BLOCKSIZE];
//Copy from array to temp
for(i=0; i<Current_ArraySize; i++)
Temp_Array[i] = Current_Array[i];
temp[Current_ArraySize] = x;
Current_ArraySize++;
Number_of_Records++;
//Deallocate space used by Array
delete [] Sales_Array;
Sales_Array = Temp_Array;
}
else
{
Sales_Array[Current_ArraySize] = x;
Current_Array_Size++;
Number_of_Records = Current_ArraySize
}
}
void Register::shrinklist
{
int i;
if(Current_ArraySize >= 5 && (Current_ArraySize%BLOCKSIZE) != 0)
{
cout<<"Array to be resized, substracting slots"<<endl;
//Alocate memory with added BLOCK
Temp_Array = new int[Current_ArraySize-BLOCKSIZE];
//Copy from array to temp
for(i=0; i<Current_ArraySize; i--)
Temp_Array[i] = Current_Array[i];
temp[Current_ArraySize] = x;
Current_ArraySize--;
Number_of_Records--;
//Deallocate space used by Array
delete [] Sales_Array;
Sales_Array = Temp_Array;
}
else
{
Sales_Array[Current_ArraySize] = x;
Current_Array_Size--;
Number_of_Records = Current_ArraySize
}
}
//***************************************************************************
//
//
// I made this makefile I am not sure if it works but it looks right!
//
//
//***************************************************************************
driver: driver.o register.o sale.o
g++ -o driver driver.o register.o sale.o
driver.o: driver.cpp register.o sale.o
g++ -c driver.cpp
register.o: register.cpp register.h
g++ -c mixed.cpp
g++ -c mixed.h
sale.o: sale.cpp sale.h
g++ -c sale.cpp
g++ -c sale.h | dynamic-arrays | null | null | null | null | 06/23/2012 16:50:02 | not a real question | not sure about this assignment i have on dynamic arrays and inheritance, any help would be amazing
===
This is what I have so far, i have no idea about the RingUpSale on the register.cpp file.
i know my code is close but I hve so many errors that i am unsure about the whole thing.
enum ItemType {BOOK, DVD, SOFTWARE, CREDIT};
class Sale
{
public:
Sale();
void MakeSale(ItemType x, double amt);
ItemType Item();
double Price();
double Tax();
double Total();
void Display();
private:
double price;
double tax;
double total;
ItemType item;
}
//****************************SALE.CPP*******************************
#include<iostream>
#include<cmath>
#include "sales.h"
using namespace std;
Sale::Sale()
{
price = 0;
tax = 0;
total = 0;
}
// Credit are suppose to have no tax all other purchases have
void Sale::MakeSale(ItemType x, double amt)
{
item = x;
if(item == CREDIT)
total = amt;
else
total = (amt * tax);
}
ItemType Sale::Item()
{
return item;
}
double Sale::Price()
{
return price;
}
double Sale::Tax()
{
return tax;
}
double Sale::Total()
{
return Total;
}
// display function
void Sale::Display()
{
if(item = BOOK)
cout<<"BOOK"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = DVD)
cout<<"DVD"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = SOFTWARE)
cout<<"SOFTWARE"<<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
if(item = CREDIT)
cout<<"CREDIT" <<" "<<'$'<<price<<" ";
cout<<"Tax"<<" "<<'$'<<tax<<" "<<"Total:";
cout<<" "<<'$'<<total<<endl;
}
//****************************Register.h*******************************
#include<iostream>
#include "sales.h"
using namespace std;
const int BLOCKSIZE = 5;
class Register : Sales
{
public:
Register(int id, double start_amount);
~Register();
int GetID();
double GetAmount();
void RingUpSale(enum ItemType Saletype, double amount);
void ShowLast();
void ShowAll();
void Cancel();
double SalesTax();
private:
int Register_ID;
int Current_ArraySize;
int Number_of_Records;
double Register_Amount
Sale *Sales_Array;
Sale *Temp_Array;
void expandlist;
void shrinklist;
//******************************Register.cpp*********************************
I am not sure why certain functions are implemented but i think I have a preety good idea of what is going on with the program.
#include<iostream>
#include "register.h"
#include<cmath>
using namespace std;
// * Initializing these values
Sales_Array = new int[BLOCKSIZE];
Current_ArraySize = 0;
Number_of_Records = 0;
// * Function: Construct for Register
Register::Register(int id, double amount)
{
Register_Id = id;
Register_amount = amount;
}
why is this in () marks rather than brackets"(Sales_Array+1) i know there is addition but the point is going where?
void Register::ShowAll()
{
int i;
cout << " the elements int the array are:" <<endl;
for (i=0; i<Current_ArraySize; i++)
cout << *(Sales_Array+i) << endl;
}
void Register::ShowLast()
{
cout << "The last sale was:" << endl;
cout << Sale[Current_ArraySize - 1] << endl;
}
void Register::Cancel()
{
if( Current_ArraySize > 5 && (ArraySize%BLOCKSIZE)==1)
{
cout << "ArraySize to be resized" <<endl;
int *temp, i;
Current_ArraySize--;
Number_of_Records == Current_ArraySize;
temp = new int[Current_ArraySize];
for(i=0; i<Current_ArraySize; i++)
temp[i] = Sales_Array[i];
delete[] Sales_Array;
Sales_Array = temp;
}
else
{
ArraySize--;
Number_of_Records = Current_ArraySize;
}
Register::~Register()
{
delete[] Sales_Array;
}
int Register::GetID()
{
return Register_ID;
}
double Reister::GetAmount()
{
return Register_Amount;
}
double SalesTax()
{
return SalesTax;
}
void Register::expandlist
{
int i;
if(Current_ArraySize >= 5 && (Current_ArraySize%BLOCKSIZE) == 0)
{
cout<<"Array to be resized, adding 5 slots"<<endl;
//Allocate memory with added BLOCK
Temp_Array = new int[Current_ArraySize+BLOCKSIZE];
//Copy from array to temp
for(i=0; i<Current_ArraySize; i++)
Temp_Array[i] = Current_Array[i];
temp[Current_ArraySize] = x;
Current_ArraySize++;
Number_of_Records++;
//Deallocate space used by Array
delete [] Sales_Array;
Sales_Array = Temp_Array;
}
else
{
Sales_Array[Current_ArraySize] = x;
Current_Array_Size++;
Number_of_Records = Current_ArraySize
}
}
void Register::shrinklist
{
int i;
if(Current_ArraySize >= 5 && (Current_ArraySize%BLOCKSIZE) != 0)
{
cout<<"Array to be resized, substracting slots"<<endl;
//Alocate memory with added BLOCK
Temp_Array = new int[Current_ArraySize-BLOCKSIZE];
//Copy from array to temp
for(i=0; i<Current_ArraySize; i--)
Temp_Array[i] = Current_Array[i];
temp[Current_ArraySize] = x;
Current_ArraySize--;
Number_of_Records--;
//Deallocate space used by Array
delete [] Sales_Array;
Sales_Array = Temp_Array;
}
else
{
Sales_Array[Current_ArraySize] = x;
Current_Array_Size--;
Number_of_Records = Current_ArraySize
}
}
//***************************************************************************
//
//
// I made this makefile I am not sure if it works but it looks right!
//
//
//***************************************************************************
driver: driver.o register.o sale.o
g++ -o driver driver.o register.o sale.o
driver.o: driver.cpp register.o sale.o
g++ -c driver.cpp
register.o: register.cpp register.h
g++ -c mixed.cpp
g++ -c mixed.h
sale.o: sale.cpp sale.h
g++ -c sale.cpp
g++ -c sale.h | 1 |
7,368,392 | 09/09/2011 23:11:35 | 444,134 | 09/10/2010 07:47:41 | 196 | 14 | Help to fix strange sqlite3 error - dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib | I am suddenly getting an sqlite3 error:
ActionView::Template::Error (dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib
Referenced from: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
Reason: no suitable image found. Did find:
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/local/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
I have no idea why I am suddenly getting this error. Rails 3.1.0 and Ruby 1.9.2 Mac OSX 10.5.8 | ruby-on-rails-3.1 | osx-leopard | null | null | null | null | open | Help to fix strange sqlite3 error - dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib
===
I am suddenly getting an sqlite3 error:
ActionView::Template::Error (dyld: Library not loaded: /usr/lib/libsqlite3.0.dylib
Referenced from: /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
Reason: no suitable image found. Did find:
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/local/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
/usr/lib/libsqlite3.0.dylib: mach-o, but wrong architecture
I have no idea why I am suddenly getting this error. Rails 3.1.0 and Ruby 1.9.2 Mac OSX 10.5.8 | 0 |
9,946,860 | 03/30/2012 16:26:21 | 962,085 | 09/23/2011 23:08:28 | 47 | 1 | Accessing the Web UI using Cloudera 4 beta 1 | I just recently upgraded my hadoop cluster to Cloudera 4 beta 1. I set up HDFS as instructed on their site and then installed both YARN system from MR2 and the jobtracker/tasktrackers from MR1.
For all my setups, i have a master node named krackenmaster that hosts the jobtracker, namenode, application manager, and history server (Note that i'm not running both MR1 and MR2 at the same time). Everything works as expected except for the web interfaces. I can access everything using `http://krackenmaster:<port_of_service>` correctly. However, the same node has a second ip on another network interface and response to another hostname, such as kracken.com.
I can't view the jobtracker, application manager, or history server ui's using kracken.com, however, I can view the namenode ui via `http://kracken.com:50070` just fine. I was also previously able to view the jobtracker ui when I used a manual installation of Hadoop 0.20.2.
I'm sure I failed to set some configuration, but I'm clueless as to what I missed and the documentation doesn't seem to describe this issue. Would anyone know what setting I have to fix?
Thanks in advance. | hadoop | mapreduce | cloudera | null | null | null | open | Accessing the Web UI using Cloudera 4 beta 1
===
I just recently upgraded my hadoop cluster to Cloudera 4 beta 1. I set up HDFS as instructed on their site and then installed both YARN system from MR2 and the jobtracker/tasktrackers from MR1.
For all my setups, i have a master node named krackenmaster that hosts the jobtracker, namenode, application manager, and history server (Note that i'm not running both MR1 and MR2 at the same time). Everything works as expected except for the web interfaces. I can access everything using `http://krackenmaster:<port_of_service>` correctly. However, the same node has a second ip on another network interface and response to another hostname, such as kracken.com.
I can't view the jobtracker, application manager, or history server ui's using kracken.com, however, I can view the namenode ui via `http://kracken.com:50070` just fine. I was also previously able to view the jobtracker ui when I used a manual installation of Hadoop 0.20.2.
I'm sure I failed to set some configuration, but I'm clueless as to what I missed and the documentation doesn't seem to describe this issue. Would anyone know what setting I have to fix?
Thanks in advance. | 0 |
10,673,689 | 05/20/2012 13:09:24 | 1,406,256 | 05/20/2012 12:59:28 | 1 | 0 | how can insert record by using VFpage insert record into custom object | i am created custom object ,how can insert record by using VFpage insert record into custom object.
how can i get one page input value in another apex page.
plz tell me sample code
thankyou
ram | title | null | null | null | null | 05/21/2012 19:06:49 | not a real question | how can insert record by using VFpage insert record into custom object
===
i am created custom object ,how can insert record by using VFpage insert record into custom object.
how can i get one page input value in another apex page.
plz tell me sample code
thankyou
ram | 1 |
6,370,118 | 06/16/2011 10:01:19 | 764,259 | 05/21/2011 19:52:38 | 42 | 0 | Display function prototype on bracket opening | I'm learning java using NetBeans. I want the IDE to display a function prototype after I type '(' so that if I forget some parameters I do not need to erase the function name and '.' and type '.' again in order to see all the functions of that class. How can I turn it on? | java | netbeans | null | null | null | null | open | Display function prototype on bracket opening
===
I'm learning java using NetBeans. I want the IDE to display a function prototype after I type '(' so that if I forget some parameters I do not need to erase the function name and '.' and type '.' again in order to see all the functions of that class. How can I turn it on? | 0 |
10,005,279 | 04/04/2012 05:12:33 | 1,311,907 | 04/04/2012 04:10:34 | 1 | 0 | Where is the error in my code? | /** Yields: a String that contains each capital Letter (in 'A'..'Z') whose representation is prime */
public static String primeChars() {
String s = "";
// inv: s contains each capital in "A'..c-1 whose representation is prime
for (char c = 'A'; c <= 'Z'; c=(char)(c+1)) {
if (Loops.isPrime((int)c)==true) {
s= s+1;}
}
// {s contains each capital in 'A' ..'Z' whose rep is a prime}
return s;
} | java | null | null | null | null | 04/04/2012 12:13:46 | not a real question | Where is the error in my code?
===
/** Yields: a String that contains each capital Letter (in 'A'..'Z') whose representation is prime */
public static String primeChars() {
String s = "";
// inv: s contains each capital in "A'..c-1 whose representation is prime
for (char c = 'A'; c <= 'Z'; c=(char)(c+1)) {
if (Loops.isPrime((int)c)==true) {
s= s+1;}
}
// {s contains each capital in 'A' ..'Z' whose rep is a prime}
return s;
} | 1 |
5,350,322 | 03/18/2011 09:54:18 | 581,587 | 01/19/2011 14:37:26 | 64 | 0 | jQuery in UpdatePanel Wrapper for PageRequestManager.getInstance().add_endRequest | When jQuery is applied to elements in an UpdatePanel, when the UpdatePanel refreshes, the jQuery is not applied to the newly injected HTML.
This issue is resolved by using
Sys.WebForms.PageRequestManager.getInstance().add_endRequest()
to register a function to be called when the AJAX request is complete:
I've written a function that registers the function with add_endRequest, and also calls it at the same time:
Async.RegisterAndRun = function(callback) {
//register function to be run when an update panel request is complete
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(callback);
//also run the function right now.
callback();
};
Now all we need to call is
Async.RegisterAndRun(AddFancyjQueryToMyHTML);
or
Async.RegisterAndRun(function(){
AddFancyjQueryToMyHTML();
AddMoreFancyjQueryToMyHTML('with', 'args');
});
My question is, can you think of a way to improve this? Currently it does what I need it to, and I never need to explicitly call add_endRequest which is nice. | jquery | asp.net | asp.net-ajax | updatepanel | null | null | open | jQuery in UpdatePanel Wrapper for PageRequestManager.getInstance().add_endRequest
===
When jQuery is applied to elements in an UpdatePanel, when the UpdatePanel refreshes, the jQuery is not applied to the newly injected HTML.
This issue is resolved by using
Sys.WebForms.PageRequestManager.getInstance().add_endRequest()
to register a function to be called when the AJAX request is complete:
I've written a function that registers the function with add_endRequest, and also calls it at the same time:
Async.RegisterAndRun = function(callback) {
//register function to be run when an update panel request is complete
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(callback);
//also run the function right now.
callback();
};
Now all we need to call is
Async.RegisterAndRun(AddFancyjQueryToMyHTML);
or
Async.RegisterAndRun(function(){
AddFancyjQueryToMyHTML();
AddMoreFancyjQueryToMyHTML('with', 'args');
});
My question is, can you think of a way to improve this? Currently it does what I need it to, and I never need to explicitly call add_endRequest which is nice. | 0 |
3,633,807 | 09/03/2010 07:34:01 | 438,728 | 09/03/2010 07:31:01 | 1 | 0 | installing Eclipse on ubuntu | hey everyone i am trying to install Eclipse helios for C/C++ developers on a ubntu OS
i am new with all this ubntu stuff - even though i downloaded a version of helios from the Eclipse site i have no idea how to install the program
i can't find the eclipse.exe file that it has when is installed it in windows!
thanks allot.
Brad
| linux | eclipse | null | null | null | 09/06/2010 00:36:20 | off topic | installing Eclipse on ubuntu
===
hey everyone i am trying to install Eclipse helios for C/C++ developers on a ubntu OS
i am new with all this ubntu stuff - even though i downloaded a version of helios from the Eclipse site i have no idea how to install the program
i can't find the eclipse.exe file that it has when is installed it in windows!
thanks allot.
Brad
| 2 |
7,788,594 | 10/17/2011 01:27:00 | 830,439 | 07/05/2011 20:43:55 | 246 | 14 | Observable Collection/ Binding - Resources | My current project is parsing some HTML and I want to bind through an Observable Collection.
I have a fairly limited knowledge of C# and I am looking for resources to learn about Observable Collection and Binding.
I have looked at MSDN content for this, but I am after a more real work tutorial or examples if possible.
http://msdn.microsoft.com/en-us/library/ms748365.aspx <-- More information on this
Thanks in advance. | c# | silverlight | windows-phone-7 | observablecollection | null | 10/17/2011 13:41:47 | not constructive | Observable Collection/ Binding - Resources
===
My current project is parsing some HTML and I want to bind through an Observable Collection.
I have a fairly limited knowledge of C# and I am looking for resources to learn about Observable Collection and Binding.
I have looked at MSDN content for this, but I am after a more real work tutorial or examples if possible.
http://msdn.microsoft.com/en-us/library/ms748365.aspx <-- More information on this
Thanks in advance. | 4 |
11,481,591 | 07/14/2012 06:26:04 | 394,736 | 07/17/2010 16:22:43 | 2,479 | 65 | Cocos2D Realistic Gravity? | I have tried many different techniques of applying a realistic looking gravity feature in my game but have had no luck so far. I plan on offering a *100 point bounty* on this for someone who can show me or (share) some code that applies gravity to a CCSprite in Cocos2D.
What I have done so far has just been ugly or unrealistic and I have asked in many different places on what the best approach is but I just have not found the answer.
Anyway, can anyone offer some tips/ideas or their approach only applying gravity to a CCSprite in Cocos2D **without** using a physics engine?
Thanks! | ios | cocos2d-iphone | gravity | null | null | null | open | Cocos2D Realistic Gravity?
===
I have tried many different techniques of applying a realistic looking gravity feature in my game but have had no luck so far. I plan on offering a *100 point bounty* on this for someone who can show me or (share) some code that applies gravity to a CCSprite in Cocos2D.
What I have done so far has just been ugly or unrealistic and I have asked in many different places on what the best approach is but I just have not found the answer.
Anyway, can anyone offer some tips/ideas or their approach only applying gravity to a CCSprite in Cocos2D **without** using a physics engine?
Thanks! | 0 |
11,409,027 | 07/10/2012 08:03:28 | 934,916 | 09/08/2011 13:37:06 | 56 | 3 | www.borgun.is -- payment gateway integration | I am looking for a Iceland based payment gateway '**www.borgun.is**' integration and can not find any help in php.
I cannot find any developers guide on their website..... | php | payment-gateway | null | null | null | 07/10/2012 08:07:26 | not a real question | www.borgun.is -- payment gateway integration
===
I am looking for a Iceland based payment gateway '**www.borgun.is**' integration and can not find any help in php.
I cannot find any developers guide on their website..... | 1 |
8,707,940 | 01/03/2012 04:32:22 | 36,602 | 11/11/2008 15:15:23 | 2,547 | 54 | Clojure - Quoting Confusion | Sorry for the terribly vague title :)
I am new to macros and am having trouble understanding the difference between these two statements:
`(+ 1 2 ~(+ 2 3)) ; => (clojure.core/+ 1 2 5)
'(+ 1 2 ~(+ 2 3)) ; => (+ 1 2 (clojure.core/unquote (+ 2 3)))
When I run them without the unquote, they seem rather identical other than qualifying?
`(+ 1 2 (+ 2 3)) ; => (clojure.core/+ 1 2 (clojure.core/+ 2 3))
'(+ 1 2 (+ 2 3)) ; => (+ 1 2 (+ 2 3))
So basically I'm confused by \` vs '. My understanding is that they both quote everything in the list, which is why I'm not sure why unquoting behaves differently. Basically \` behaves the way I would expect both \` and ' to behave.
Thanks! | macros | clojure | lisp | null | null | null | open | Clojure - Quoting Confusion
===
Sorry for the terribly vague title :)
I am new to macros and am having trouble understanding the difference between these two statements:
`(+ 1 2 ~(+ 2 3)) ; => (clojure.core/+ 1 2 5)
'(+ 1 2 ~(+ 2 3)) ; => (+ 1 2 (clojure.core/unquote (+ 2 3)))
When I run them without the unquote, they seem rather identical other than qualifying?
`(+ 1 2 (+ 2 3)) ; => (clojure.core/+ 1 2 (clojure.core/+ 2 3))
'(+ 1 2 (+ 2 3)) ; => (+ 1 2 (+ 2 3))
So basically I'm confused by \` vs '. My understanding is that they both quote everything in the list, which is why I'm not sure why unquoting behaves differently. Basically \` behaves the way I would expect both \` and ' to behave.
Thanks! | 0 |
7,324,119 | 09/06/2011 17:58:15 | 467,750 | 10/06/2010 08:49:37 | 455 | 36 | Debug mode restarts on the phone randomly | I have a strange issue with android development. I tried to debug my program with real device (samsung gt5660). I downloaded drivers from the official site - Samsung Kies. Then I switched phone into debug mode. After that usb connection was restarted every few seconds, so phone shows notifications "connection... debug mode on" again and again. I tried different usb port, then shut down Win7 and start Ubuntu 11.04 - and have the same result there. It's strange because on the other PC this phone works fine and doesn't restart debug mode every second.
Can anybody give an advice - what can I do to fix this issue? | android | debugging | device | null | null | null | open | Debug mode restarts on the phone randomly
===
I have a strange issue with android development. I tried to debug my program with real device (samsung gt5660). I downloaded drivers from the official site - Samsung Kies. Then I switched phone into debug mode. After that usb connection was restarted every few seconds, so phone shows notifications "connection... debug mode on" again and again. I tried different usb port, then shut down Win7 and start Ubuntu 11.04 - and have the same result there. It's strange because on the other PC this phone works fine and doesn't restart debug mode every second.
Can anybody give an advice - what can I do to fix this issue? | 0 |
5,185,239 | 03/03/2011 19:04:06 | 64,334 | 02/09/2009 21:08:32 | 3,661 | 79 | Trouble referencing WCF CustomBinding in web.config | I have created a custom binding to replace the wsHttpBinding that I was using before so that I could set the maxClockSkew setting ([http://blog.salamandersoft.co.uk/index.php/2009/01/wcf-wshttpbinding-and-clock-skew/][1]). The binding is created in web.config, not in code.
But I'm not sure how to tell my service to use this binding.
Here is my binding:
<customBinding>
<binding name="myWSHttpBinding">
<transactionFlow transactionProtocol="WSAtomicTransactionOctober2004" />
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation"
requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true"
keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="true" requireSignatureConfirmation="false">
<localClientSettings cacheCookies="true" detectReplays="true"
replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="false"
timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
<localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
reconnectTransportOnFailure="false" maxPendingSessions="128"
maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
<secureConversationBootstrap defaultAlgorithmSuite="Default"
authenticationMode="UserNameForSslNegotiated" requireDerivedKeys="true"
securityHeaderLayout="Strict" includeTimestamp="true" keyEntropyMode="CombinedEntropy"
messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="true" requireSignatureConfirmation="false">
<localClientSettings cacheCookies="true" detectReplays="true"
replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
<localServiceSettings detectReplays="true" issuedCookieLifetime="00:15:00"
maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
reconnectTransportOnFailure="true" maxPendingSessions="128"
maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
</secureConversationBootstrap>
</security>
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Default" writeEncoding="utf-8">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
[1]: http://blog.salamandersoft.co.uk/index.php/2009/01/wcf-wshttpbinding-and-clock-skew/ | c# | .net | wpf | silverlight | wcf | null | open | Trouble referencing WCF CustomBinding in web.config
===
I have created a custom binding to replace the wsHttpBinding that I was using before so that I could set the maxClockSkew setting ([http://blog.salamandersoft.co.uk/index.php/2009/01/wcf-wshttpbinding-and-clock-skew/][1]). The binding is created in web.config, not in code.
But I'm not sure how to tell my service to use this binding.
Here is my binding:
<customBinding>
<binding name="myWSHttpBinding">
<transactionFlow transactionProtocol="WSAtomicTransactionOctober2004" />
<security defaultAlgorithmSuite="Default" authenticationMode="SecureConversation"
requireDerivedKeys="true" securityHeaderLayout="Strict" includeTimestamp="true"
keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="true" requireSignatureConfirmation="false">
<localClientSettings cacheCookies="true" detectReplays="true"
replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="false"
timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
<localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
reconnectTransportOnFailure="false" maxPendingSessions="128"
maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
<secureConversationBootstrap defaultAlgorithmSuite="Default"
authenticationMode="UserNameForSslNegotiated" requireDerivedKeys="true"
securityHeaderLayout="Strict" includeTimestamp="true" keyEntropyMode="CombinedEntropy"
messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="true" requireSignatureConfirmation="false">
<localClientSettings cacheCookies="true" detectReplays="true"
replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
<localServiceSettings detectReplays="true" issuedCookieLifetime="00:15:00"
maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
reconnectTransportOnFailure="true" maxPendingSessions="128"
maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
</secureConversationBootstrap>
</security>
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Default" writeEncoding="utf-8">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</textMessageEncoding>
<httpTransport manualAddressing="false" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Anonymous"
bypassProxyOnLocal="false" decompressionEnabled="true" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" />
</binding>
</customBinding>
[1]: http://blog.salamandersoft.co.uk/index.php/2009/01/wcf-wshttpbinding-and-clock-skew/ | 0 |
5,536,121 | 04/04/2011 08:25:42 | 663,011 | 03/16/2011 17:45:22 | 10 | 0 | Which nonsql database to use | I am looking for someone nonsql database.
My requirements are as follow:
- Should be able to store data >10 billion records
- Should consume only 1 gb of memory atmost.
- User request should take less than 10 ms. (including processing time)
Java based would be great. | database | database-design | null | null | null | 04/04/2011 12:17:48 | off topic | Which nonsql database to use
===
I am looking for someone nonsql database.
My requirements are as follow:
- Should be able to store data >10 billion records
- Should consume only 1 gb of memory atmost.
- User request should take less than 10 ms. (including processing time)
Java based would be great. | 2 |
6,936,972 | 08/04/2011 06:18:26 | 461,807 | 09/29/2010 14:02:30 | 203 | 0 | Draw Circle using css alone | Is it possible to draw circle using css only which can work on mosat of the browsers (IE,Mozilla,Safari) ?
| html | css | null | null | null | null | open | Draw Circle using css alone
===
Is it possible to draw circle using css only which can work on mosat of the browsers (IE,Mozilla,Safari) ?
| 0 |
4,680,419 | 01/13/2011 13:10:48 | 574,262 | 01/13/2011 13:10:48 | 1 | 0 | installing magento without control panel | i want to try to install magento on a fresh install of centos 5.5 without any control panel to help. So akaik i just need to install lamp right?
Apache:
yum install httpd
Mysql:
yum install mysql mysql-server mysql-php
Php:
yum install php (possibly other modules too that magento might need)
Those are the only three things i need to install right? However php is outdated if i install from base repo so i need to install a newer php and perhaps newer mysql. Is there anything i'm missing here? I'm not an expert on configuring mysql from the command like so should i install phpmyadmin? Thanks. | php | apache | magento | centos | null | null | open | installing magento without control panel
===
i want to try to install magento on a fresh install of centos 5.5 without any control panel to help. So akaik i just need to install lamp right?
Apache:
yum install httpd
Mysql:
yum install mysql mysql-server mysql-php
Php:
yum install php (possibly other modules too that magento might need)
Those are the only three things i need to install right? However php is outdated if i install from base repo so i need to install a newer php and perhaps newer mysql. Is there anything i'm missing here? I'm not an expert on configuring mysql from the command like so should i install phpmyadmin? Thanks. | 0 |
11,028,743 | 06/14/2012 07:41:48 | 961,041 | 09/23/2011 11:29:53 | 69 | 20 | is there Best tutorials for WinRT developement? | I am already familiar with the WPF, Silverlight and Windows phone platforms....
Is there very good tutorials over the internet to learn the WinRT Metro style applications ? | c# | xaml | winrt | null | null | 06/14/2012 09:03:59 | not constructive | is there Best tutorials for WinRT developement?
===
I am already familiar with the WPF, Silverlight and Windows phone platforms....
Is there very good tutorials over the internet to learn the WinRT Metro style applications ? | 4 |
7,148,613 | 08/22/2011 13:59:41 | 808,372 | 06/21/2011 11:58:41 | 1 | 0 | the question about sql left join on? | the question about sql left join on, What different!
(1)
select * from A
LEFT JOIN B
ON A.field = B.field
(2)
select * from A
LEFT JOIN B
ON B.field = A.field
| sql | null | null | null | null | 08/22/2011 14:05:21 | not constructive | the question about sql left join on?
===
the question about sql left join on, What different!
(1)
select * from A
LEFT JOIN B
ON A.field = B.field
(2)
select * from A
LEFT JOIN B
ON B.field = A.field
| 4 |
4,853,739 | 01/31/2011 17:05:17 | 407,443 | 07/31/2010 12:07:33 | 311 | 8 | wpf treeview datatemplate | let's say I have something like this :
public class TopicFolder
{
#region Constants and Fields
private readonly List<TopicInfo> folderContent;
private readonly List<TopicFolder> subFolders;
#endregion
...
}
How do I implement data template for such type? Currently I have :
<HierarchicalDataTemplate DataType="{x:Type local:TopicFolder}" ItemsSource="{Binding SubFolders}" >
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:TopicInfo}" ItemsSource="{Binding FolderContent}">
<TextBlock Text="{Binding TopicName}"/>
</HierarchicalDataTemplate>
But this does not show any folder content...It seems that second's template DataType should be local:TopicFolder, but this is not allowed by WPF
Any suggestions? | c# | wpf | hierarchicaldatatemplate | null | null | null | open | wpf treeview datatemplate
===
let's say I have something like this :
public class TopicFolder
{
#region Constants and Fields
private readonly List<TopicInfo> folderContent;
private readonly List<TopicFolder> subFolders;
#endregion
...
}
How do I implement data template for such type? Currently I have :
<HierarchicalDataTemplate DataType="{x:Type local:TopicFolder}" ItemsSource="{Binding SubFolders}" >
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:TopicInfo}" ItemsSource="{Binding FolderContent}">
<TextBlock Text="{Binding TopicName}"/>
</HierarchicalDataTemplate>
But this does not show any folder content...It seems that second's template DataType should be local:TopicFolder, but this is not allowed by WPF
Any suggestions? | 0 |
811,330 | 05/01/2009 13:26:26 | 22,009 | 09/16/2008 02:07:02 | 49 | 6 | Infrastructure required for a large Scale PHP Project | My team is developing a large music portal in PHP. It is hoped that the portal will have 1 million+ users within a year of its launch. The portal will allow users to create playlists, stream and download music.
Till now, we have developed applications that have been used by a maximum of about a 1000 simultaneous users. This portal is of a different order of magnitude.
I want to know if there are any benchmarks available for calculating the hardware memory requirements and bandwidth requirements for such large projects.
Also, if a content delivery network (CDN) can handle all traffic related problems or something specific - like caching - needs to be done.
Which database would be suitable? Will mySQL be able to handle such loads or something else is required.
Thanks
Vinayak | hardware | music | php | mysql | infrastructure | null | open | Infrastructure required for a large Scale PHP Project
===
My team is developing a large music portal in PHP. It is hoped that the portal will have 1 million+ users within a year of its launch. The portal will allow users to create playlists, stream and download music.
Till now, we have developed applications that have been used by a maximum of about a 1000 simultaneous users. This portal is of a different order of magnitude.
I want to know if there are any benchmarks available for calculating the hardware memory requirements and bandwidth requirements for such large projects.
Also, if a content delivery network (CDN) can handle all traffic related problems or something specific - like caching - needs to be done.
Which database would be suitable? Will mySQL be able to handle such loads or something else is required.
Thanks
Vinayak | 0 |
2,831,802 | 05/14/2010 04:16:11 | 242,839 | 01/03/2010 21:07:52 | 73 | 0 | HTML href with css ie Problem | <pre>
<style type="text/css">
.web_westloh {
background-image: url(images/web_westloh.png);
background-repeat: no-repeat;
height: 100px;
width: 350px;
}
.web_westloh:hover {
border-bottom-width: 2px;
border-bottom-style: dashed;
border-bottom-color: #999999;
padding-bottom: 5px;
}
.web_money {
background-image: url(images/web_money.png);
background-repeat: no-repeat;
height: 100px;
width: 350px;
}
.web_money:hover {
border-bottom-width: 2px;
border-bottom-style: dashed;
border-bottom-color: #999999;
padding-bottom: 5px;
}
</style>
<a href="http://www.westloh.com" title="Click to Visit http://www.westloh.com" target="_blank" class="web_westloh">
<div class="web_westloh"></div>
</a>
<a href="http://www.money-mind-set.com" title="Click to Visit http://www.money-mind-set.com" target="_blank">
<div class="web_money"></div>
</a>
</pre>
<br />
**The Problem is:**<br />
In mozilla linking is ok. No problem.<br />
But in IE the link is a problem, it will not link in the target.<br />
<br />
**See this page to see Problem:** [http://replytowest.com][1] --> at the bottom.<br /><br />
**Thank You**
[1]: http://replytowest.com | href | html | css | null | null | null | open | HTML href with css ie Problem
===
<pre>
<style type="text/css">
.web_westloh {
background-image: url(images/web_westloh.png);
background-repeat: no-repeat;
height: 100px;
width: 350px;
}
.web_westloh:hover {
border-bottom-width: 2px;
border-bottom-style: dashed;
border-bottom-color: #999999;
padding-bottom: 5px;
}
.web_money {
background-image: url(images/web_money.png);
background-repeat: no-repeat;
height: 100px;
width: 350px;
}
.web_money:hover {
border-bottom-width: 2px;
border-bottom-style: dashed;
border-bottom-color: #999999;
padding-bottom: 5px;
}
</style>
<a href="http://www.westloh.com" title="Click to Visit http://www.westloh.com" target="_blank" class="web_westloh">
<div class="web_westloh"></div>
</a>
<a href="http://www.money-mind-set.com" title="Click to Visit http://www.money-mind-set.com" target="_blank">
<div class="web_money"></div>
</a>
</pre>
<br />
**The Problem is:**<br />
In mozilla linking is ok. No problem.<br />
But in IE the link is a problem, it will not link in the target.<br />
<br />
**See this page to see Problem:** [http://replytowest.com][1] --> at the bottom.<br /><br />
**Thank You**
[1]: http://replytowest.com | 0 |
6,538,079 | 06/30/2011 16:34:54 | 781,421 | 06/02/2011 15:40:35 | 3 | 1 | vba-excel meaning of <> (angled brackets or greater-than and less-than symbols) | I am working with find functions in VBA Excel, so when I ran into problems I pulled some example code from the help provided in Excel. I took their code that illustrates a basic
find function and pasted it into a macro. On running the macro, I get a "Runtime error '91'" and the debugger highlights the line of code containing the angled brackets <>. These are the part of the code that I cannot understand.
Can anyone tell me what these brackets represent?
Sub exampleFindReplace()
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
| excel-vba | find | null | null | null | null | open | vba-excel meaning of <> (angled brackets or greater-than and less-than symbols)
===
I am working with find functions in VBA Excel, so when I ran into problems I pulled some example code from the help provided in Excel. I took their code that illustrates a basic
find function and pasted it into a macro. On running the macro, I get a "Runtime error '91'" and the debugger highlights the line of code containing the angled brackets <>. These are the part of the code that I cannot understand.
Can anyone tell me what these brackets represent?
Sub exampleFindReplace()
With Worksheets(1).Range("a1:a500")
Set c = .Find(2, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Value = 5
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
| 0 |
8,117,414 | 11/14/2011 04:41:34 | 1,035,952 | 11/08/2011 15:53:42 | 1 | 0 | how to Include another application in my application? | in my application i was supposed to include another application in my application without copying the supporting files..?
Note: i don't have the source code of the application which i'm bring to invoke.. | iphone | ios4 | null | null | null | 11/14/2011 08:25:11 | not a real question | how to Include another application in my application?
===
in my application i was supposed to include another application in my application without copying the supporting files..?
Note: i don't have the source code of the application which i'm bring to invoke.. | 1 |
8,503,354 | 12/14/2011 10:58:37 | 627,006 | 02/21/2011 16:59:47 | 21 | 0 | appendChild Does not work in GWT | I am trying to create simple html table in GWT.
Code for table:
public class SimpleTable extends Widget {
private Element tr;
public SimpleTable() {
Element tableElem = DOM.createTable();
Element bodyElem = DOM.createTBody();
DOM.appendChild(tableElem, bodyElem);
setElement(tableElem);
tr = DOM.createTR();
DOM.appendChild(bodyElem, tr);
}
public void addCell(String text) {
Element td = DOM.createTD();
td.setInnerText(text);
DOM.appendChild(tr, td);
}
}
Code for extended class:
public class TimeLine extends SimpleTable {
public TimeLine() {
addCell("text 1");
}
}
But addCell(String text) method does not append new td element to the table. What is wrong with this code? | gwt | appendchild | null | null | null | 12/15/2011 16:15:34 | too localized | appendChild Does not work in GWT
===
I am trying to create simple html table in GWT.
Code for table:
public class SimpleTable extends Widget {
private Element tr;
public SimpleTable() {
Element tableElem = DOM.createTable();
Element bodyElem = DOM.createTBody();
DOM.appendChild(tableElem, bodyElem);
setElement(tableElem);
tr = DOM.createTR();
DOM.appendChild(bodyElem, tr);
}
public void addCell(String text) {
Element td = DOM.createTD();
td.setInnerText(text);
DOM.appendChild(tr, td);
}
}
Code for extended class:
public class TimeLine extends SimpleTable {
public TimeLine() {
addCell("text 1");
}
}
But addCell(String text) method does not append new td element to the table. What is wrong with this code? | 3 |
10,631,269 | 05/17/2012 07:01:10 | 862,795 | 07/26/2011 05:24:07 | 56 | 1 | Add a Control into two container | how to Add a Control into two container at the same time?
for example i have TabPage1 and TabPage2 and a textbox control witch want to be added into TabPage1 and TabPage2 at the same time. | winforms | control | null | null | null | null | open | Add a Control into two container
===
how to Add a Control into two container at the same time?
for example i have TabPage1 and TabPage2 and a textbox control witch want to be added into TabPage1 and TabPage2 at the same time. | 0 |
5,534,407 | 04/04/2011 03:52:51 | 676,603 | 03/25/2011 11:23:48 | 7 | 0 | Can i push an Activity to Background? | I want to push an activity to background, but the action specified in it should be done..
Is there any way to do this?
Thanks in advance | android | activity | null | null | null | null | open | Can i push an Activity to Background?
===
I want to push an activity to background, but the action specified in it should be done..
Is there any way to do this?
Thanks in advance | 0 |
2,067,013 | 01/14/2010 19:38:42 | 57,611 | 01/21/2009 18:00:27 | 301 | 16 | VB.Net Function Optimization (SSRS Report Code) | I came across the following code recently and would like to optimize it:
Public Shared Function ComputeLabel(ByVal Action As Integer, ByVal Flag1 As Boolean, ByVal Flag2 As Boolean) As String
Dim Prefix As String = ""
If Flag2 Then
Prefix = "Conditional "
ElseIf Flag1 Then
Prefix = "Held "
End If
Select Case nHVCOrderAction
Case 0
Return ""
Case 1
Return Prefix & "Cancelled"
Case 2
Return Prefix & "Discontinued"
Case 3
Return Prefix & "Suspended"
Case 4
Return Prefix & "Unsuspended"
Case 6
Return Prefix & "Collected"
Case 7
Return Prefix & "Released from Hold"
Case 8
Return Prefix & "Modified"
Case 9
Return Prefix & "Discontinued for the Future"
Case 10
Return Prefix & "Verified"
Case 11
Return Prefix & "Modified And Verified"
Case 12
Return "Hold " & Prefix & "Cancelled"
Case Else
Return ""
End Select
End Function
Note that Action 0 is the most common case.
Okay, I've already cleaned up this function a bit--it was using a variable and returning it at the end, and using Return seems better. But additionally, I think it would be better code to build an array at the beginning of the report execution, and then just access array elements each time this function is called, instead of using a Select statement. But case 12 is making things more complicated (as you can see, it adds the prefix in the middle instead of at the beginning.)
What do you think would be the best way:
- Building a 39-element array for the three cases, then accessing it like so:
Private Shared OrderActions() As String = {"", "Cancelled", ...}
' Then in the function:
If Action < 0 OrElse Action >= 13 Then Return ""
Return OrderActions(Action - Flag2 * 13 - (Flag1 AndAlso Not Flag2) * 26)
- Using a 13-element array with a Replace (something like `Return Replace(LabelList(Action), "{Prefix}", Prefix)`?)
- Using a 12-element array with a special case for Action 12
- Something else I haven't thought of
? | .net | optimization | reporting-services | null | null | null | open | VB.Net Function Optimization (SSRS Report Code)
===
I came across the following code recently and would like to optimize it:
Public Shared Function ComputeLabel(ByVal Action As Integer, ByVal Flag1 As Boolean, ByVal Flag2 As Boolean) As String
Dim Prefix As String = ""
If Flag2 Then
Prefix = "Conditional "
ElseIf Flag1 Then
Prefix = "Held "
End If
Select Case nHVCOrderAction
Case 0
Return ""
Case 1
Return Prefix & "Cancelled"
Case 2
Return Prefix & "Discontinued"
Case 3
Return Prefix & "Suspended"
Case 4
Return Prefix & "Unsuspended"
Case 6
Return Prefix & "Collected"
Case 7
Return Prefix & "Released from Hold"
Case 8
Return Prefix & "Modified"
Case 9
Return Prefix & "Discontinued for the Future"
Case 10
Return Prefix & "Verified"
Case 11
Return Prefix & "Modified And Verified"
Case 12
Return "Hold " & Prefix & "Cancelled"
Case Else
Return ""
End Select
End Function
Note that Action 0 is the most common case.
Okay, I've already cleaned up this function a bit--it was using a variable and returning it at the end, and using Return seems better. But additionally, I think it would be better code to build an array at the beginning of the report execution, and then just access array elements each time this function is called, instead of using a Select statement. But case 12 is making things more complicated (as you can see, it adds the prefix in the middle instead of at the beginning.)
What do you think would be the best way:
- Building a 39-element array for the three cases, then accessing it like so:
Private Shared OrderActions() As String = {"", "Cancelled", ...}
' Then in the function:
If Action < 0 OrElse Action >= 13 Then Return ""
Return OrderActions(Action - Flag2 * 13 - (Flag1 AndAlso Not Flag2) * 26)
- Using a 13-element array with a Replace (something like `Return Replace(LabelList(Action), "{Prefix}", Prefix)`?)
- Using a 12-element array with a special case for Action 12
- Something else I haven't thought of
? | 0 |
3,268,495 | 07/16/2010 20:07:40 | 1,228 | 08/13/2008 13:58:55 | 30,761 | 1,171 | x:Type and arrays--how? | Long story short, I need to do this:
ExpressionType="{x:Type sys:Byte[]}"
In other words, I need to do this:
foo.ExpressionType=typeof(byte[]);
Wat do? | wpf | arrays | types | markup-extensions | null | null | open | x:Type and arrays--how?
===
Long story short, I need to do this:
ExpressionType="{x:Type sys:Byte[]}"
In other words, I need to do this:
foo.ExpressionType=typeof(byte[]);
Wat do? | 0 |
10,448,153 | 05/04/2012 11:41:23 | 1,179,880 | 01/31/2012 08:45:40 | 172 | 11 | dollar-o-gram: how is this developed in excel? | [Here][1]
I've got a situation where a chart of this format would look great.
It will be possible in excel.
Has anyone ever tackled trying to do this in Excel?
I've got 10yrs of Excel vba experience although I'm not sure where to begin with this idea.
[1]: http://dashboardspy.com/?s=dollar%20o%20gram | excel | charts | null | null | null | 05/04/2012 20:15:37 | not a real question | dollar-o-gram: how is this developed in excel?
===
[Here][1]
I've got a situation where a chart of this format would look great.
It will be possible in excel.
Has anyone ever tackled trying to do this in Excel?
I've got 10yrs of Excel vba experience although I'm not sure where to begin with this idea.
[1]: http://dashboardspy.com/?s=dollar%20o%20gram | 1 |
9,544,083 | 03/03/2012 06:31:50 | 1,164,331 | 01/23/2012 04:58:47 | 5 | 0 | Android app Address family not supported by protocol error? | my code:
private static final String TAG = "TextToSpeechDemo";
private TextToSpeech mTts;
private Button mAgainButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.speak);
TextToSpeech mTts = new TextToSpeech(this,this);
// Initialize text-to-speech. This is an asynchronous operation.
// The OnInitListener (second argument) is called after initialization completes.
mTts = new TextToSpeech(this,
this // TextToSpeech.OnInitListener
);
// The button is disabled in the layout.
// It will be enabled upon initialization of the TTS engine.
mAgainButton = (Button) findViewById(R.id.again_button);
mAgainButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
sayHello();
}
});
@Override
public void onInit( int status) {
// TODO Auto-generated method stub
// status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR.
if (status == TextToSpeech.SUCCESS) {
// Set preferred language to US english.
// Note that a language may not be available, and the result will indicate this.
int result = mTts.setLanguage(Locale.US);
// Try this someday for some interesting results.
// int result mTts.setLanguage(Locale.FRANCE);
if (result == TextToSpeech.LANG_MISSING_DATA ||
result == TextToSpeech.LANG_NOT_SUPPORTED) {
// Language data is missing or the language is not supported.
Log.e(TAG, "Language is not available.");
} else {
// Check the documentation for other possible result codes.
// For example, the language may be available for the locale,
// but not for the specified country and variant.
// The TTS engine has been successfully initialized.
// Allow the user to press the button for the app to speak again.
mAgainButton.setEnabled(true);
// Greet the user.
sayHello();
}
}
else {
// Initialization failed.
Log.e(TAG, "Could not initialize TextToSpeech.");
}
}
private void sayHello() {
Bundle extras = getIntent().getExtras();
String filename = extras.getString("filename");
String filecontent = extras.getString("filecontent");
mTts.speak(filecontent,
TextToSpeech.QUEUE_FLUSH, // Drop all pending entries in the playback queue.
null);
}
it is showing 03-03 12:01:21.778: D/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol error!!!
| android | null | null | null | null | null | open | Android app Address family not supported by protocol error?
===
my code:
private static final String TAG = "TextToSpeechDemo";
private TextToSpeech mTts;
private Button mAgainButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.speak);
TextToSpeech mTts = new TextToSpeech(this,this);
// Initialize text-to-speech. This is an asynchronous operation.
// The OnInitListener (second argument) is called after initialization completes.
mTts = new TextToSpeech(this,
this // TextToSpeech.OnInitListener
);
// The button is disabled in the layout.
// It will be enabled upon initialization of the TTS engine.
mAgainButton = (Button) findViewById(R.id.again_button);
mAgainButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
sayHello();
}
});
@Override
public void onInit( int status) {
// TODO Auto-generated method stub
// status can be either TextToSpeech.SUCCESS or TextToSpeech.ERROR.
if (status == TextToSpeech.SUCCESS) {
// Set preferred language to US english.
// Note that a language may not be available, and the result will indicate this.
int result = mTts.setLanguage(Locale.US);
// Try this someday for some interesting results.
// int result mTts.setLanguage(Locale.FRANCE);
if (result == TextToSpeech.LANG_MISSING_DATA ||
result == TextToSpeech.LANG_NOT_SUPPORTED) {
// Language data is missing or the language is not supported.
Log.e(TAG, "Language is not available.");
} else {
// Check the documentation for other possible result codes.
// For example, the language may be available for the locale,
// but not for the specified country and variant.
// The TTS engine has been successfully initialized.
// Allow the user to press the button for the app to speak again.
mAgainButton.setEnabled(true);
// Greet the user.
sayHello();
}
}
else {
// Initialization failed.
Log.e(TAG, "Could not initialize TextToSpeech.");
}
}
private void sayHello() {
Bundle extras = getIntent().getExtras();
String filename = extras.getString("filename");
String filecontent = extras.getString("filecontent");
mTts.speak(filecontent,
TextToSpeech.QUEUE_FLUSH, // Drop all pending entries in the playback queue.
null);
}
it is showing 03-03 12:01:21.778: D/SntpClient(61): request time failed: java.net.SocketException: Address family not supported by protocol error!!!
| 0 |
5,798,233 | 04/27/2011 01:09:53 | 583,916 | 01/21/2011 03:41:19 | 51 | 8 | Page updates loading two views and not saving data | I have recently installed CKEditor and for some reason when I submit my data I am now getting two views (the same page) twice within my editpage and the data is not saving to the database -> it was working before CKEditor:
**View:**
<?php
//Setting form attributes
$formpageEdit = array('id' => 'pageEdit', 'name' => 'pageEdit');
$formInputTitle = array('id' => 'title', 'name' => 'title');
$formTextareaContent = array('id' => 'textContent', 'name' => 'textContent');
?>
<div id ="formLayout" class="form">
<?php echo form_open('admin/editpage/index/'.$page[0]['id'].'/'.url_title($page[0]['name'],'dash', TRUE),$formpageEdit); ?>
<?php echo form_fieldset(); ?>
<h4>You are editing: <?= $page[0]['name']; ?> </h4>
<section id = "validation"><?php echo validation_errors();?></section>
<?php
if($success == TRUE) {
echo '<section id = "validation">Page Updated</section>';
}
?>
<label><?php echo form_label ('Content:', 'content');?><span class="small">Required Field</span></label>
<?php echo form_textarea($formTextareaContent, $page[0]['content']); ?>
<script type="text/javascript">CKEDITOR.replace('textContent');</script>
<?php echo form_submit('submit','Submit'); ?>
<?php echo form_fieldset_close();
echo form_close(); ?>
</div>
**Controller:**
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Editpage extends CI_Controller {
function __construct(){
parent::__construct();
}
function index($id){
if(!$this->session->userdata('logged_in'))redirect('admin/home');
if ($this->input->post('submit')){
#The User has submitted updates, lets begin!
#Set The validation Rules
$this->form_validation->set_rules('content', 'Content', 'trim|required|xss_clean');
#if the form_validation rules fail then load the login page with the errors. Otherwise continue validating the user/pass
if ($this->form_validation->run() == FALSE){
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSCotent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}
#Form Validation passed, so lets continue updating.
#lets set some variables.
$content = $this->input->post('content', TRUE);
#Now if updatePage fails to update hte database then show "there was a problem", you could echo the db error itself
if($this->page_model->updatePage($id, $content)) {
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSContent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['success'] = TRUE;
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}//END if updatePage
}else{
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSCotent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}//END if post submitted
} //END function index()
}
| php | html | views | ckeditor | null | 02/16/2012 08:52:20 | too localized | Page updates loading two views and not saving data
===
I have recently installed CKEditor and for some reason when I submit my data I am now getting two views (the same page) twice within my editpage and the data is not saving to the database -> it was working before CKEditor:
**View:**
<?php
//Setting form attributes
$formpageEdit = array('id' => 'pageEdit', 'name' => 'pageEdit');
$formInputTitle = array('id' => 'title', 'name' => 'title');
$formTextareaContent = array('id' => 'textContent', 'name' => 'textContent');
?>
<div id ="formLayout" class="form">
<?php echo form_open('admin/editpage/index/'.$page[0]['id'].'/'.url_title($page[0]['name'],'dash', TRUE),$formpageEdit); ?>
<?php echo form_fieldset(); ?>
<h4>You are editing: <?= $page[0]['name']; ?> </h4>
<section id = "validation"><?php echo validation_errors();?></section>
<?php
if($success == TRUE) {
echo '<section id = "validation">Page Updated</section>';
}
?>
<label><?php echo form_label ('Content:', 'content');?><span class="small">Required Field</span></label>
<?php echo form_textarea($formTextareaContent, $page[0]['content']); ?>
<script type="text/javascript">CKEDITOR.replace('textContent');</script>
<?php echo form_submit('submit','Submit'); ?>
<?php echo form_fieldset_close();
echo form_close(); ?>
</div>
**Controller:**
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Editpage extends CI_Controller {
function __construct(){
parent::__construct();
}
function index($id){
if(!$this->session->userdata('logged_in'))redirect('admin/home');
if ($this->input->post('submit')){
#The User has submitted updates, lets begin!
#Set The validation Rules
$this->form_validation->set_rules('content', 'Content', 'trim|required|xss_clean');
#if the form_validation rules fail then load the login page with the errors. Otherwise continue validating the user/pass
if ($this->form_validation->run() == FALSE){
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSCotent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}
#Form Validation passed, so lets continue updating.
#lets set some variables.
$content = $this->input->post('content', TRUE);
#Now if updatePage fails to update hte database then show "there was a problem", you could echo the db error itself
if($this->page_model->updatePage($id, $content)) {
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSContent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['success'] = TRUE;
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}//END if updatePage
}else{
$data['cms_pages'] = $this->navigation_model->getCMSPages($id);
#connect to getCMSCotent and set the page info equal to the $data['page'] where the row is equal to the passed $id from the URL.
$data['page'] = $this->page_model->getCMSContent($id);
$data['content'] = $this->load->view('admin/editpage', $data, TRUE);
$this->load->view('admintemplate', $data);
}//END if post submitted
} //END function index()
}
| 3 |
7,149,857 | 08/22/2011 15:33:00 | 24,545 | 10/02/2008 15:44:37 | 24,619 | 600 | What is "Third Generation Scale"? | In the context of counting source lines of code (SLoC) what is the "Third Generation Scale" factor that is defined on each programming language? | metrics | lines-of-code | null | null | null | null | open | What is "Third Generation Scale"?
===
In the context of counting source lines of code (SLoC) what is the "Third Generation Scale" factor that is defined on each programming language? | 0 |
8,023,704 | 11/05/2011 22:19:37 | 1,031,605 | 11/05/2011 22:11:21 | 1 | 0 | What should I using and enjoying the Java API to download file HotFile.com | Do I need my software downloads files from HotFile.com but do not even know where to start. Can someone tell me or direct me to use API code ready. Any help will be greatly appreciated. I'm trying to do with java.
Thank you! | java | api | download | null | null | 11/05/2011 23:52:14 | not a real question | What should I using and enjoying the Java API to download file HotFile.com
===
Do I need my software downloads files from HotFile.com but do not even know where to start. Can someone tell me or direct me to use API code ready. Any help will be greatly appreciated. I'm trying to do with java.
Thank you! | 1 |
11,607,045 | 07/23/2012 05:46:11 | 1,087,149 | 12/08/2011 06:18:43 | 38 | 1 | Ubuntu 11.04,I touch a new file,Why it's owner is root? | Ubuntu 11.04,I touch a new file,Why it's owner is "root" ?
this computer ,i have a user named "vmuser"
I use vmuser login~~
Last month, create a file owner is "vmuser"
But when I return from vacation,owner changed to "root"
| linux | ubuntu | null | null | null | 07/23/2012 07:07:02 | not a real question | Ubuntu 11.04,I touch a new file,Why it's owner is root?
===
Ubuntu 11.04,I touch a new file,Why it's owner is "root" ?
this computer ,i have a user named "vmuser"
I use vmuser login~~
Last month, create a file owner is "vmuser"
But when I return from vacation,owner changed to "root"
| 1 |
7,471,638 | 09/19/2011 13:23:09 | 942,940 | 09/13/2011 16:06:30 | 1 | 0 | Till how much level collection association would be loaded in Hibernate | I am having basically three questions in mind:
1. If I am having an object inside which there is collection which further is collection of collection. So if lazy is true then what would be the output of the following & if its false then all objects would be loaded of all collection. Is it like all the collection would be loaded by default lazily and if I access child collection via parent collection then whole hierarchy of child collection would be loaded or what will happen.
2. When session.flush happens, does it closes session & what would be the state of object after flush.
3. And when session flush happens then would that query would be going to go on database layer or it would be flushed to second level cache?
Thanks | hibernate | session | null | null | null | 09/19/2011 19:28:05 | not constructive | Till how much level collection association would be loaded in Hibernate
===
I am having basically three questions in mind:
1. If I am having an object inside which there is collection which further is collection of collection. So if lazy is true then what would be the output of the following & if its false then all objects would be loaded of all collection. Is it like all the collection would be loaded by default lazily and if I access child collection via parent collection then whole hierarchy of child collection would be loaded or what will happen.
2. When session.flush happens, does it closes session & what would be the state of object after flush.
3. And when session flush happens then would that query would be going to go on database layer or it would be flushed to second level cache?
Thanks | 4 |
3,984,798 | 10/21/2010 06:21:07 | 472,537 | 10/11/2010 17:29:30 | 35 | 1 | Android removeview error when animating | private void kartyafeleanim(String idx1, String idx2) {
Animation anim1=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);
Animation anim2=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);
try {
for (int i=0; i<6; i++) {
LinearLayout LL = (LinearLayout) myLinearLayout.getChildAt(i);
for (int j=0; j<LL.getChildCount(); j++) {
if (LL.getChildAt(j).getTag().toString().equals(idx1) || LL.getChildAt(j).getTag().toString().equals(idx2)) {
final View v = LL.getChildAt(j);
int rtop=0;
if (v.getTag().toString().equals(idx1)) rtop=110+(53*((int)((Integer.parseInt(idx1)-100)/6)));
if (v.getTag().toString().equals(idx2)) rtop=110+(53*((int)((Integer.parseInt(idx2)-100)/6)));
int left=v.getLeft();
int top =v.getTop()+rtop-30;
FrameLayout.LayoutParams lp =new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.LEFT);
lp.setMargins(left, top, 0, 0);
if (v.getTag().toString().equals(idx1)) {
final ImageView img1 =new ImageView(mycontext);
img1.setBackgroundResource(R.drawable.match);
img1.setLayoutParams(lp);
myLinearLayoutAll.addView(img1);
img1.setVisibility(View.VISIBLE);
img1.startAnimation(anim1);
anim1.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
//img1.setVisibility(View.INVISIBLE);
myLinearLayoutAll.removeView(img1);
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) { }
});
}
else if (v.getTag().toString().equals(idx2)) {
final ImageView img2 =new ImageView(mycontext);
img2.setBackgroundResource(R.drawable.match);
img2.setLayoutParams(lp);
myLinearLayoutAll.addView(img2);
img2.setVisibility(View.VISIBLE);
img2.startAnimation(anim2);
anim2.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
//img2.setVisibility(View.INVISIBLE);
myLinearLayoutAll.removeView(img2);
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) { }
});
}
}
}
}
} catch (Exception ex) {}
}
in the animation end, i calling removeview, and then the error occure. Why?
| android | animation | null | null | null | null | open | Android removeview error when animating
===
private void kartyafeleanim(String idx1, String idx2) {
Animation anim1=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);
Animation anim2=AnimationUtils.loadAnimation(mycontext, R.anim.scalable_anim);
try {
for (int i=0; i<6; i++) {
LinearLayout LL = (LinearLayout) myLinearLayout.getChildAt(i);
for (int j=0; j<LL.getChildCount(); j++) {
if (LL.getChildAt(j).getTag().toString().equals(idx1) || LL.getChildAt(j).getTag().toString().equals(idx2)) {
final View v = LL.getChildAt(j);
int rtop=0;
if (v.getTag().toString().equals(idx1)) rtop=110+(53*((int)((Integer.parseInt(idx1)-100)/6)));
if (v.getTag().toString().equals(idx2)) rtop=110+(53*((int)((Integer.parseInt(idx2)-100)/6)));
int left=v.getLeft();
int top =v.getTop()+rtop-30;
FrameLayout.LayoutParams lp =new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.LEFT);
lp.setMargins(left, top, 0, 0);
if (v.getTag().toString().equals(idx1)) {
final ImageView img1 =new ImageView(mycontext);
img1.setBackgroundResource(R.drawable.match);
img1.setLayoutParams(lp);
myLinearLayoutAll.addView(img1);
img1.setVisibility(View.VISIBLE);
img1.startAnimation(anim1);
anim1.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
//img1.setVisibility(View.INVISIBLE);
myLinearLayoutAll.removeView(img1);
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) { }
});
}
else if (v.getTag().toString().equals(idx2)) {
final ImageView img2 =new ImageView(mycontext);
img2.setBackgroundResource(R.drawable.match);
img2.setLayoutParams(lp);
myLinearLayoutAll.addView(img2);
img2.setVisibility(View.VISIBLE);
img2.startAnimation(anim2);
anim2.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
//img2.setVisibility(View.INVISIBLE);
myLinearLayoutAll.removeView(img2);
}
@Override
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationStart(Animation animation) { }
});
}
}
}
}
} catch (Exception ex) {}
}
in the animation end, i calling removeview, and then the error occure. Why?
| 0 |
3,829,460 | 09/30/2010 09:47:18 | 149,998 | 08/03/2009 20:54:46 | 246 | 13 | How do I use a recursive array iterator to process a multidimensional array? | I'm trying to get something like this working:
function posts_formatter (&$posts){
foreach ($posts as $k => $v){
if (is_array($v)){
posts_formatter($v);
}else{
switch (strtolower($k)){
# make email addresses lowercase
case (strpos($k, 'email') !== FALSE):
$posts[$k] = strtolower($v);
break;
# make postcodes uppercase
case (strpos($k, 'postcode') !== FALSE):
$posts[$k] = strtoupper($v);
break;
# capitalize certain things
case (strpos($k, 'line1') !== FALSE):
case (strpos($k, 'line2') !== FALSE):
case (strpos($k, 'line3') !== FALSE):
case (strpos($k, 'forename') !== FALSE):
case (strpos($k, 'surname') !== FALSE):
$posts[$k] = capitalize($v);
break;
}
}
}
}
It will correctly go through the array and format the values but I can't get it to return them. I've played around with removing the `&` from the function declaration and adding a return at the end but it won't do anything.
Additionally, I'm thinking perhaps using a `RecursiveArrayIterator` might be the way to go. However, despite the presence of a book right in front of me with a chapter on SPL Iterators its examples are useless towards being able to achieve what I'm trying to. How would I go about implementing one? | php | recursion | iterator | multidimensional-array | null | null | open | How do I use a recursive array iterator to process a multidimensional array?
===
I'm trying to get something like this working:
function posts_formatter (&$posts){
foreach ($posts as $k => $v){
if (is_array($v)){
posts_formatter($v);
}else{
switch (strtolower($k)){
# make email addresses lowercase
case (strpos($k, 'email') !== FALSE):
$posts[$k] = strtolower($v);
break;
# make postcodes uppercase
case (strpos($k, 'postcode') !== FALSE):
$posts[$k] = strtoupper($v);
break;
# capitalize certain things
case (strpos($k, 'line1') !== FALSE):
case (strpos($k, 'line2') !== FALSE):
case (strpos($k, 'line3') !== FALSE):
case (strpos($k, 'forename') !== FALSE):
case (strpos($k, 'surname') !== FALSE):
$posts[$k] = capitalize($v);
break;
}
}
}
}
It will correctly go through the array and format the values but I can't get it to return them. I've played around with removing the `&` from the function declaration and adding a return at the end but it won't do anything.
Additionally, I'm thinking perhaps using a `RecursiveArrayIterator` might be the way to go. However, despite the presence of a book right in front of me with a chapter on SPL Iterators its examples are useless towards being able to achieve what I'm trying to. How would I go about implementing one? | 0 |
4,305,841 | 11/29/2010 16:37:14 | 478,687 | 10/17/2010 17:59:50 | 101 | 3 | facebook chat in delphi? | I want to connect to facebook chat from my delphi application , change the status message or post something on the wall? Do u know any way i can acomplish this ? | delphi | facebook | null | null | null | null | open | facebook chat in delphi?
===
I want to connect to facebook chat from my delphi application , change the status message or post something on the wall? Do u know any way i can acomplish this ? | 0 |
3,580,351 | 08/26/2010 23:33:56 | 19,875 | 09/21/2008 07:46:57 | 909 | 72 | What is the best way to save the contents of an ArrayList? | I want to save an ArrayList so that it is persistent. The contents can change. What is the best way of approaching this in android? | android | arraylist | sharedpreferences | null | null | null | open | What is the best way to save the contents of an ArrayList?
===
I want to save an ArrayList so that it is persistent. The contents can change. What is the best way of approaching this in android? | 0 |
1,220,103 | 08/02/2009 22:58:33 | 96,087 | 04/26/2009 00:19:04 | 117 | 2 | Where in the internet are the algorithm screencasts/lectures/videos/podcasts? | I like to watch programming screencasts and listen to podcasts on those topics.
Lately I got into doing online topcoder algorithm competitions and am studying algorithms day and night.
Where online can I find video/audio materials related to algorithms?
I know others here have asked about general programming videos and podcasts, but I'm interested in strictly algorithmical topics and not technologies like rails or java or whatever. Video lectures would be ok, but preferable greater than 2nd year of university material. Most video lectures I found online were intro or intermediate courses, i want more in depth stuff. | algorithm | video | podcasts | lectures | null | 09/18/2011 02:54:55 | not constructive | Where in the internet are the algorithm screencasts/lectures/videos/podcasts?
===
I like to watch programming screencasts and listen to podcasts on those topics.
Lately I got into doing online topcoder algorithm competitions and am studying algorithms day and night.
Where online can I find video/audio materials related to algorithms?
I know others here have asked about general programming videos and podcasts, but I'm interested in strictly algorithmical topics and not technologies like rails or java or whatever. Video lectures would be ok, but preferable greater than 2nd year of university material. Most video lectures I found online were intro or intermediate courses, i want more in depth stuff. | 4 |
11,626,080 | 07/24/2012 07:28:41 | 1,130,111 | 01/04/2012 14:19:52 | 11 | 7 | Resource file in aspx page "Eval" syntax | Hi All,
<asp:TemplateField>
<ItemTemplate>
<a id="btnShowPopup" runat="server" class="thickbox" title='<%# Eval("DB_TRAK_NO", "Details for Trak No. {0}") %>>
View</a>
</ItemTemplate>
<HeaderStyle VerticalAlign="Middle" />
</asp:TemplateField>
My Global resouce file name is Resource.resx and Resource.zh-CN.resx,
key for "Details for Trak No" is "DetailsforTrakNo" in resource files. How can I push the Chinese characters when the culture is Chinese. I dont know the syntax to write title in anchor tag.. can you pls help me in this.
Regards,
Abhi | asp.net | syntax | localization | globalization | null | null | open | Resource file in aspx page "Eval" syntax
===
Hi All,
<asp:TemplateField>
<ItemTemplate>
<a id="btnShowPopup" runat="server" class="thickbox" title='<%# Eval("DB_TRAK_NO", "Details for Trak No. {0}") %>>
View</a>
</ItemTemplate>
<HeaderStyle VerticalAlign="Middle" />
</asp:TemplateField>
My Global resouce file name is Resource.resx and Resource.zh-CN.resx,
key for "Details for Trak No" is "DetailsforTrakNo" in resource files. How can I push the Chinese characters when the culture is Chinese. I dont know the syntax to write title in anchor tag.. can you pls help me in this.
Regards,
Abhi | 0 |
4,189,131 | 11/15/2010 21:46:48 | 23,590 | 09/29/2008 20:05:23 | 2,502 | 147 | Passing a Func<T, TResult> where TResult is unknown |
Note: Please re-tag and/or re-name appropriately
------------------------------------------------
I have a class, `FooEnumerator`, that wraps a `Foo` and implements `IEnumerable<FooEnumerator>`. The `Foo`s represent a tree-like data structure, the `FooEnumerator`s that are enumerated are the child nodes of the current node.
`Foo` is a vendor supplied data object. `FooEnumerator` implements a bunch of custom filtering code.
class FooEnumerator : IEnumerable<FooEnumerator>
{
public Foo WrappedNode { get; private set; }
public string Name { get { return WrappedNode.Name; } }
public int Id { get{ return WrappedNode.Id; } }
public DateTime Created { get{ return WrappedNode.Created; } }
public FooEnumerator(Foo wrappedNode)
{
WrappedNode = wrappedNode;
}
public IEnumerator<FooEnumerator> GetEnumerator()
{
foreach (Foo child in this.GetChildren())
if(FilteringLogicInHere(child))
yield return new FooEnumerator(child);
}
...
}
I want to be able to sort each level of the tree with a given (arbitrary) expression, defined when the top level `FooEnumerator` is created, and have this expression passed down to each newly enumerated item to use.
I'd like to define the sort expression using lambda's, in the same way you would with the OrderBy function. In fact, it is my intention to pass the lambda to `OrderBy`.
The signiture for OrderBy is
OrderBy<TSource, TKey>(Func<TSource, TKey> keySelector)
where `TKey` is the return type of the given `Func`, but is a Type Parameter in the method signature and is figured out at compile time.
Example usage
var x = GetStartingNode();
var sort = n => n.DateTime;
var enu = new FooEnumerator(x, sort);
var sort2 = n => n.Name;
var enu2 = new FooEnumerator(x, sort2);
The sort expression would then be stored in a class variable and `FooEnumerator` would work like:
// Sudo-implementation
private Expression<Func<Foo, TKey>> _sortBy;
public FooEnumerator(Foo wrappedNode, Expression<Func<Foo, TKey>> sortBy)
{
WrappedNode = wrappedNode;
_sortBy = sortBy;
}
public IEnumerator<FooEnumerator> GetEnumerator()
{
foreach (Foo child in this.GetChildren().OrderBy(_sortBy))
if(FilteringLogicInHere(child))
yield return new FooEnumerator(child);
}
**How can I specify the type of TKey (implicitly or explicitly) in this use case?**
I don't want to hard code it as I want to be able to sort on any and all properties of the underlying `Foo`. | c# | linq | expression-trees | null | null | null | open | Passing a Func<T, TResult> where TResult is unknown
===
Note: Please re-tag and/or re-name appropriately
------------------------------------------------
I have a class, `FooEnumerator`, that wraps a `Foo` and implements `IEnumerable<FooEnumerator>`. The `Foo`s represent a tree-like data structure, the `FooEnumerator`s that are enumerated are the child nodes of the current node.
`Foo` is a vendor supplied data object. `FooEnumerator` implements a bunch of custom filtering code.
class FooEnumerator : IEnumerable<FooEnumerator>
{
public Foo WrappedNode { get; private set; }
public string Name { get { return WrappedNode.Name; } }
public int Id { get{ return WrappedNode.Id; } }
public DateTime Created { get{ return WrappedNode.Created; } }
public FooEnumerator(Foo wrappedNode)
{
WrappedNode = wrappedNode;
}
public IEnumerator<FooEnumerator> GetEnumerator()
{
foreach (Foo child in this.GetChildren())
if(FilteringLogicInHere(child))
yield return new FooEnumerator(child);
}
...
}
I want to be able to sort each level of the tree with a given (arbitrary) expression, defined when the top level `FooEnumerator` is created, and have this expression passed down to each newly enumerated item to use.
I'd like to define the sort expression using lambda's, in the same way you would with the OrderBy function. In fact, it is my intention to pass the lambda to `OrderBy`.
The signiture for OrderBy is
OrderBy<TSource, TKey>(Func<TSource, TKey> keySelector)
where `TKey` is the return type of the given `Func`, but is a Type Parameter in the method signature and is figured out at compile time.
Example usage
var x = GetStartingNode();
var sort = n => n.DateTime;
var enu = new FooEnumerator(x, sort);
var sort2 = n => n.Name;
var enu2 = new FooEnumerator(x, sort2);
The sort expression would then be stored in a class variable and `FooEnumerator` would work like:
// Sudo-implementation
private Expression<Func<Foo, TKey>> _sortBy;
public FooEnumerator(Foo wrappedNode, Expression<Func<Foo, TKey>> sortBy)
{
WrappedNode = wrappedNode;
_sortBy = sortBy;
}
public IEnumerator<FooEnumerator> GetEnumerator()
{
foreach (Foo child in this.GetChildren().OrderBy(_sortBy))
if(FilteringLogicInHere(child))
yield return new FooEnumerator(child);
}
**How can I specify the type of TKey (implicitly or explicitly) in this use case?**
I don't want to hard code it as I want to be able to sort on any and all properties of the underlying `Foo`. | 0 |
8,419,495 | 12/07/2011 17:12:34 | 27,404 | 10/13/2008 12:40:47 | 335 | 6 | RestKit: [RKObjectLoader loaderWithResourcePath:] doesn't return a RKManagedObjectLoader | I'm using
RKObjectLoader *peopleLoader = [RKObjectLoader loaderWithResourcePath:@"..." objectManager:[RKObjectManager sharedManager] delegate:self];
but I'm not getting back an `RKManagedObjectLoader`. No objects are stored in my sqlite-database if I'm using the loader. If I'm doing it with
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:...
it works. What am I missing to get the `RKManagedObjectLoader`? | ios | restkit | null | null | null | null | open | RestKit: [RKObjectLoader loaderWithResourcePath:] doesn't return a RKManagedObjectLoader
===
I'm using
RKObjectLoader *peopleLoader = [RKObjectLoader loaderWithResourcePath:@"..." objectManager:[RKObjectManager sharedManager] delegate:self];
but I'm not getting back an `RKManagedObjectLoader`. No objects are stored in my sqlite-database if I'm using the loader. If I'm doing it with
[[RKObjectManager sharedManager] loadObjectsAtResourcePath:...
it works. What am I missing to get the `RKManagedObjectLoader`? | 0 |
11,331,911 | 07/04/2012 15:27:20 | 1,501,834 | 07/04/2012 14:20:26 | 1 | 0 | iOS development -> Specific Languages | Can someone out there provide a list of all the current languages that can be used to program on iOS (iPad, iPhone, all that jazz) I've been searching for ages and found only rumor and speculation, most of which is untrue. I currently know of C, Objective-C and C# with monotouch.
Thanks in advance | ios | application | null | null | null | 07/05/2012 15:46:00 | not constructive | iOS development -> Specific Languages
===
Can someone out there provide a list of all the current languages that can be used to program on iOS (iPad, iPhone, all that jazz) I've been searching for ages and found only rumor and speculation, most of which is untrue. I currently know of C, Objective-C and C# with monotouch.
Thanks in advance | 4 |
7,000,200 | 08/09/2011 17:22:19 | 651,924 | 03/09/2011 16:10:54 | 130 | 3 | SEO - Do similar sites get frowned upon by Google if located at same IP? | I am undertaking a new project that will create about thirty new web sites. Each site will be focused on, say, a particular sport. So, there will be a football site, a baseball site, a soccer site, etc.
Each site will have links to external stores, like Amazon.com and other affiliates. Each site will have articles on sports in general and some sport-specific content. There will be forums on each sport.
In the past, when creating sites like this, some sites get indexed well and other sites get ignored. I can't quite figure out why.
Does Google and other search engines and directories frown upon having similar sites with overlapping content if they are located at different domains but use the same IP address?
| google | seo | null | null | null | 08/09/2011 17:28:34 | off topic | SEO - Do similar sites get frowned upon by Google if located at same IP?
===
I am undertaking a new project that will create about thirty new web sites. Each site will be focused on, say, a particular sport. So, there will be a football site, a baseball site, a soccer site, etc.
Each site will have links to external stores, like Amazon.com and other affiliates. Each site will have articles on sports in general and some sport-specific content. There will be forums on each sport.
In the past, when creating sites like this, some sites get indexed well and other sites get ignored. I can't quite figure out why.
Does Google and other search engines and directories frown upon having similar sites with overlapping content if they are located at different domains but use the same IP address?
| 2 |
1,755,471 | 11/18/2009 11:46:31 | 212,716 | 11/17/2009 09:02:12 | 1 | 0 | Synatx query please help me????? | Please can anyone tell me all the properties or methods which I can use while using the following method of HTML syntax
<%= Html.TextBox("email", "", new { maxlength = 200 })%>
<%= Html.ValidationMessage("email", "*")%>
Thanks
Ritz | syntax | null | null | null | null | 11/18/2009 13:15:31 | not a real question | Synatx query please help me?????
===
Please can anyone tell me all the properties or methods which I can use while using the following method of HTML syntax
<%= Html.TextBox("email", "", new { maxlength = 200 })%>
<%= Html.ValidationMessage("email", "*")%>
Thanks
Ritz | 1 |
9,109,638 | 02/02/2012 09:09:42 | 1,117,152 | 12/27/2011 06:06:32 | 9 | 1 | Is it possible to read cross domain cookie in C#? | Is it possible to read cross domain cookie in C#? if possible how can i read the cookie,
the cookie set in one domain like "dev-001" and get a cookie in another domain "localhost"
i used
Request.Cookies["userInfo"].Values
it shows a null value.
| c# | asp.net | null | null | null | 02/03/2012 15:56:52 | not a real question | Is it possible to read cross domain cookie in C#?
===
Is it possible to read cross domain cookie in C#? if possible how can i read the cookie,
the cookie set in one domain like "dev-001" and get a cookie in another domain "localhost"
i used
Request.Cookies["userInfo"].Values
it shows a null value.
| 1 |
8,033,088 | 11/07/2011 05:38:19 | 889,656 | 08/11/2011 10:02:26 | 462 | 4 | Android: json paring | I am getting the folowing response from server side> I need to parse this and then store it in database.
show {"navigation_entries":{
"home":{"forward_icon":"arrowright","link_name":"Home","highlighted_icon_with_text":"home_h","banner_image":"midbanner","children": ["favorites","calendar","offers","wineries","settings"],"icon_without_text":"home_n","type":"home_page","highlighted_icon_without_text":"home_h","icon_with_text":"home_n"},
"wineries":{"display_name":"Wineres","line_template":"wineries_list_template","forward_icon":"arrowright","link_name":"Wineries","highlighted_icon_with_text":"wineries_h","icon_without_text":"wineries","type":"leaf_list","leaf_template":"wineries_leaf_template","section":"wineries","icon_with_text":"wineries_n"},
"more":{"display_name":"More","forward_icon":"arrowright","link_name":"More","highlighted_icon_with_text":"more_h","children":["favorites","calendar","offers","wineries","settings"],"icon_without_text":"more","type":"navigation_list","icon_with_text":"more_n"},
"offers_all":{"display_name":"Offers : All","line_template":"offers_all_list_template","forward_icon":"arrowright","link_name":"All","children":["offers_all"],"type":"leaf_list","leaf_template":"offers_all_leaf_template","section":"offers_all"},
"calendar":{"line_template":"calendar_list_template","forward_icon":"arrowright","highlighted_icon_with_text":"calendar_h","icon_without_text":"calendar","list_name":"Calendar","type":"calendar","leaf_template":"calendar_leaf_template","section":"events","icon_with_text":"calendar_n"},
"offers":{"display_name":"Offers","forward_icon":"arrowright","link_name":"Offers","highlighted_icon_with_text":"offers_h","children":["offers_all"],"icon_without_text":"offers","type":"navigation_list","icon_with_text":"offers_n"}},"type":"navigation"}
I need to get the the names of entries like home, wineries, more, offers_all,calendar, offers or whatever the names come, And then get the values of forwardicon, link_name, highlighted_icon_with_text etc.
Can anyone help me over this?
Thanks
| android | json | null | null | null | 11/07/2011 07:32:11 | too localized | Android: json paring
===
I am getting the folowing response from server side> I need to parse this and then store it in database.
show {"navigation_entries":{
"home":{"forward_icon":"arrowright","link_name":"Home","highlighted_icon_with_text":"home_h","banner_image":"midbanner","children": ["favorites","calendar","offers","wineries","settings"],"icon_without_text":"home_n","type":"home_page","highlighted_icon_without_text":"home_h","icon_with_text":"home_n"},
"wineries":{"display_name":"Wineres","line_template":"wineries_list_template","forward_icon":"arrowright","link_name":"Wineries","highlighted_icon_with_text":"wineries_h","icon_without_text":"wineries","type":"leaf_list","leaf_template":"wineries_leaf_template","section":"wineries","icon_with_text":"wineries_n"},
"more":{"display_name":"More","forward_icon":"arrowright","link_name":"More","highlighted_icon_with_text":"more_h","children":["favorites","calendar","offers","wineries","settings"],"icon_without_text":"more","type":"navigation_list","icon_with_text":"more_n"},
"offers_all":{"display_name":"Offers : All","line_template":"offers_all_list_template","forward_icon":"arrowright","link_name":"All","children":["offers_all"],"type":"leaf_list","leaf_template":"offers_all_leaf_template","section":"offers_all"},
"calendar":{"line_template":"calendar_list_template","forward_icon":"arrowright","highlighted_icon_with_text":"calendar_h","icon_without_text":"calendar","list_name":"Calendar","type":"calendar","leaf_template":"calendar_leaf_template","section":"events","icon_with_text":"calendar_n"},
"offers":{"display_name":"Offers","forward_icon":"arrowright","link_name":"Offers","highlighted_icon_with_text":"offers_h","children":["offers_all"],"icon_without_text":"offers","type":"navigation_list","icon_with_text":"offers_n"}},"type":"navigation"}
I need to get the the names of entries like home, wineries, more, offers_all,calendar, offers or whatever the names come, And then get the values of forwardicon, link_name, highlighted_icon_with_text etc.
Can anyone help me over this?
Thanks
| 3 |
10,428,501 | 05/03/2012 09:21:55 | 1,372,044 | 05/03/2012 09:14:54 | 1 | 0 | Value cannot be null. give error when modelstate is clear | when I write a ModelState.Clear() in controller my Listbox showing a error as
cannot be null.
Parameter name: source
| asp.net-mvc-3 | asp.net-mvc-3-areas | null | null | null | null | open | Value cannot be null. give error when modelstate is clear
===
when I write a ModelState.Clear() in controller my Listbox showing a error as
cannot be null.
Parameter name: source
| 0 |
3,796,312 | 09/26/2010 02:04:16 | 404,020 | 07/28/2010 01:02:19 | 411 | 2 | Why doesn't this code produce the correct output? |
-(void) expand_combinations: (NSString *) remaining_string arg2:(NSString *)s arg3:(int) remain_depth
{
if(remain_depth==0)
{
printf("%s\n",[s UTF8String]);
return;
}
for(int k=0; k < [remaining_string length]; ++k)
{
s = [s stringByAppendingString:[[remaining_string substringFromIndex:k] substringToIndex:1]];
[self expand_combinations:[remaining_string substringFromIndex:k+1] arg2:s arg3:remain_depth - 1];
}
return;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self expand_combinations:@"abcd" arg2:@"" arg3:3];
}
The code above is supposed to produce the following output:
abc
abd
acd
bcd
Instead this is what it prints out
abc
abcd
abcd
abcd
| objective-c | cocoa | cocoa-touch | null | null | 09/28/2010 00:20:23 | not a real question | Why doesn't this code produce the correct output?
===
-(void) expand_combinations: (NSString *) remaining_string arg2:(NSString *)s arg3:(int) remain_depth
{
if(remain_depth==0)
{
printf("%s\n",[s UTF8String]);
return;
}
for(int k=0; k < [remaining_string length]; ++k)
{
s = [s stringByAppendingString:[[remaining_string substringFromIndex:k] substringToIndex:1]];
[self expand_combinations:[remaining_string substringFromIndex:k+1] arg2:s arg3:remain_depth - 1];
}
return;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self expand_combinations:@"abcd" arg2:@"" arg3:3];
}
The code above is supposed to produce the following output:
abc
abd
acd
bcd
Instead this is what it prints out
abc
abcd
abcd
abcd
| 1 |
727,111 | 04/07/2009 18:49:13 | 84,885 | 03/31/2009 00:00:51 | 27 | 1 | Java Restful Web Service Tutorial with Eclipse and Tomcat | I was wondering if anyone could post or know of instructions on creating a simple restful web service with eclipse and deployed on tomcat. | rest | web-services | eclipse | tomcat | java | 07/11/2012 11:47:45 | not constructive | Java Restful Web Service Tutorial with Eclipse and Tomcat
===
I was wondering if anyone could post or know of instructions on creating a simple restful web service with eclipse and deployed on tomcat. | 4 |
4,827,538 | 01/28/2011 11:09:33 | 507,401 | 11/14/2010 14:30:23 | 94 | 0 | regarding big integer | i want to know about the big integer in c or c++ .how to use it in the programming as i was doing a program on factorial on giving 1000 the result was not displayed.so can anyone provide tutorial on big integer.please help me out? | c++ | c | null | null | null | 01/29/2011 14:00:35 | not a real question | regarding big integer
===
i want to know about the big integer in c or c++ .how to use it in the programming as i was doing a program on factorial on giving 1000 the result was not displayed.so can anyone provide tutorial on big integer.please help me out? | 1 |
1,238,972 | 08/06/2009 13:43:19 | 100,894 | 05/04/2009 13:50:21 | 27 | 0 | Choosing Database and ORM for a .NET project | I'm working on a .NET application using Silverlight on the client side. Now I've come to the point where I want to throw out my static dummy data on the server side and add a database instead.
For the database I'd love to use one of them ORM's where I can simply tag my model classes and the database tables are built for me. I did some tests with Groovy and Grails earlier, and thought GORM did a smooth job. What's the best way to set up a database in .Net?
The first thing that strikes me is to use nHibernate. I don't really know anything about nHibernate, but I've heard numerous people mention it with enthusiasm. But then I see that ADO .Net also is an ORM, which is built into the framework.. Does nHibernate outbeat ADO? And what's the deal with LINQ? I see that's listed as an ORM too, but I though LINQ was more for the query part? Can I "define" the database through LINQ?
Any comments and recommendations are welcome. I'd also love to hear if you have opinions on what database to use. I assume MS SQL Server is the easiest choice?
| .net | database | orm | nhibernate | linq | null | open | Choosing Database and ORM for a .NET project
===
I'm working on a .NET application using Silverlight on the client side. Now I've come to the point where I want to throw out my static dummy data on the server side and add a database instead.
For the database I'd love to use one of them ORM's where I can simply tag my model classes and the database tables are built for me. I did some tests with Groovy and Grails earlier, and thought GORM did a smooth job. What's the best way to set up a database in .Net?
The first thing that strikes me is to use nHibernate. I don't really know anything about nHibernate, but I've heard numerous people mention it with enthusiasm. But then I see that ADO .Net also is an ORM, which is built into the framework.. Does nHibernate outbeat ADO? And what's the deal with LINQ? I see that's listed as an ORM too, but I though LINQ was more for the query part? Can I "define" the database through LINQ?
Any comments and recommendations are welcome. I'd also love to hear if you have opinions on what database to use. I assume MS SQL Server is the easiest choice?
| 0 |
6,333,044 | 06/13/2011 16:07:36 | 116,186 | 06/02/2009 19:20:34 | 396 | 13 | Using C# Assemblies from Python via pythonnet | I am using Windows 7, 64-bit. I have managed to download and install pythonnet, so
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Form
works fine. I have also downloaded and compiled/run a C# application which creates lots of assemblies. The application in question is ARDrone-Control-.NET.
How can I use the generated DLL files from Python (and not just the built-in C# classes).
Since I have never used C# (which is why I want to use the library from Python), I'd be happy to clarify the question. | .net | python | null | null | null | null | open | Using C# Assemblies from Python via pythonnet
===
I am using Windows 7, 64-bit. I have managed to download and install pythonnet, so
import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Form
works fine. I have also downloaded and compiled/run a C# application which creates lots of assemblies. The application in question is ARDrone-Control-.NET.
How can I use the generated DLL files from Python (and not just the built-in C# classes).
Since I have never used C# (which is why I want to use the library from Python), I'd be happy to clarify the question. | 0 |
8,653,129 | 12/28/2011 07:32:34 | 1,118,853 | 12/28/2011 07:09:06 | 1 | 0 | Migrate to an existing Facebook Page | I got a message that the application page will be closed on Feb 1, 2012. And the page should migrate to a fans page.
I fill in the fans page name and click to migrate to an existing Facebook Page, but I found nothing migrated to the fans page, and the original application page closed, can't access anymore.
Is the migrate unsuccessful ?
If unsuccessful, how can I re-open the application page to migrate again ?
My application page address is : http://www.facebook.com/apps/application.php?id=211449608917050
My fans page : https://www.facebook.com/pages/%E6%93%8D%E7%9B%A4%E9%81%94%E4%BA%BA%E6%B8%AF%E6%BE%B3%E7%89%88/297618230274923
Awaiting your advise. Thank you!!!
| page | migrate | null | null | null | 01/08/2012 05:43:48 | off topic | Migrate to an existing Facebook Page
===
I got a message that the application page will be closed on Feb 1, 2012. And the page should migrate to a fans page.
I fill in the fans page name and click to migrate to an existing Facebook Page, but I found nothing migrated to the fans page, and the original application page closed, can't access anymore.
Is the migrate unsuccessful ?
If unsuccessful, how can I re-open the application page to migrate again ?
My application page address is : http://www.facebook.com/apps/application.php?id=211449608917050
My fans page : https://www.facebook.com/pages/%E6%93%8D%E7%9B%A4%E9%81%94%E4%BA%BA%E6%B8%AF%E6%BE%B3%E7%89%88/297618230274923
Awaiting your advise. Thank you!!!
| 2 |
75,529 | 09/16/2008 18:36:18 | 11,889 | 09/16/2008 12:05:22 | 1 | 4 | What are the best anti-code sites? | What are the best anti-code sites that people have found? What I mean by "anti-code" is websites, books, blogs, etc. that describe or explain bad code with the tongue-in-cheek goal of showing us what we should not do. (I made up the phase anti-code for lack of a better term.)
These are the sites I'm familiar with:
- [How to write unmaintainable code](http://mindprod.com/jgloss/unmain.html)
- [Refuctoring](http://www.waterfall2006.com/gorman.html)
- [Anti-patterns](http://www.antipatterns.com/)
- [The Daily WTF](http://thedailywtf.com/)
I'm sure there are others? I'm not asking just to get laughs; I often find that seeing "just how far down the rabbit hole goes" is a better instructor and stronger argument for good development. | language-agnostic | fun | null | null | null | 08/01/2012 02:38:48 | not constructive | What are the best anti-code sites?
===
What are the best anti-code sites that people have found? What I mean by "anti-code" is websites, books, blogs, etc. that describe or explain bad code with the tongue-in-cheek goal of showing us what we should not do. (I made up the phase anti-code for lack of a better term.)
These are the sites I'm familiar with:
- [How to write unmaintainable code](http://mindprod.com/jgloss/unmain.html)
- [Refuctoring](http://www.waterfall2006.com/gorman.html)
- [Anti-patterns](http://www.antipatterns.com/)
- [The Daily WTF](http://thedailywtf.com/)
I'm sure there are others? I'm not asking just to get laughs; I often find that seeing "just how far down the rabbit hole goes" is a better instructor and stronger argument for good development. | 4 |
6,741,298 | 07/19/2011 01:18:20 | 158,865 | 08/18/2009 23:33:16 | 714 | 6 | Converting Code from PHP to MySQL | How would I convert the code below from PHP to MySQL?
$d = <number of days>;
$m = intval($d / 30); // completed months
$r = intval($d % 30); // remaining days beyond that
$score = ($m * ($m + 1) / 2) * 30 + ($m + 1) * $r; | php | mysql | null | null | null | 07/20/2011 03:07:25 | too localized | Converting Code from PHP to MySQL
===
How would I convert the code below from PHP to MySQL?
$d = <number of days>;
$m = intval($d / 30); // completed months
$r = intval($d % 30); // remaining days beyond that
$score = ($m * ($m + 1) / 2) * 30 + ($m + 1) * $r; | 3 |
2,100,433 | 01/20/2010 10:01:08 | 65,917 | 02/13/2009 06:25:50 | 290 | 7 | To use AES with 256 bits in inbuild java 1.4 api. | I am able to encrypt with AES 128 but with more key length it fails.
code using AES 128 is as below.
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.io.*;
/**
* This program generates a AES key, retrieves its raw bytes, and
* then reinstantiates a AES key from the key bytes.
* The reinstantiated key is used to initialize a AES cipher for
* encryption and decryption.
*/
public class AES {
/**
* Turns array of bytes into string
*
* @param buf Array of bytes to convert to hex string
* @return Generated hex string
*/
public static String asHex (byte buf[]) {
StringBuffer strbuf = new StringBuffer(buf.length * 2);
int i;
for (i = 0; i < buf.length; i++) {
if (((int) buf[i] & 0xff) < 0x10)
strbuf.append("0");
strbuf.append(Long.toString((int) buf[i] & 0xff, 16));
}
return strbuf.toString();
}
public static void main(String[] args) throws Exception {
String message="This is just an example";
// Get the KeyGenerator
KeyGenerator kgen = KeyGenerator.getInstance("AES");
kgen.init(128); // 192 and 256 bits may not be available
// Generate the secret key specs.
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
// Instantiate the cipher
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted =cipher.doFinal("welcome".getBytes());
System.out.println("encrypted string: " + asHex(encrypted));
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
byte[] original =
cipher.doFinal(encrypted);
String originalString = new String(original);
System.out.println("Original string: " +
originalString + " " + asHex(original));
}
}
| 256 | java1.4 | encryption | java | null | null | open | To use AES with 256 bits in inbuild java 1.4 api.
===
I am able to encrypt with AES 128 but with more key length it fails.
code using AES 128 is as below.
import java.security.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import java.io.*;
/**
* This program generates a AES key, retrieves its raw bytes, and
* then reinstantiates a AES key from the key bytes.
* The reinstantiated key is used to initialize a AES cipher for
* encryption and decryption.
*/
public class AES {
/**
* Turns array of bytes into string
*
* @param buf Array of bytes to convert to hex string
* @return Generated hex string
*/
public static String asHex (byte buf[]) {
StringBuffer strbuf = new StringBuffer(buf.length * 2);
int i;
for (i = 0; i < buf.length; i++) {
if (((int) buf[i] & 0xff) < 0x10)
strbuf.append("0");
strbuf.append(Long.toString((int) buf[i] & 0xff, 16));
}
return strbuf.toString();
}
public static void main(String[] args) throws Exception {
String message="This is just an example";
// Get the KeyGenerator
KeyGenerator kgen = KeyGenerator.getInstance("AES");
kgen.init(128); // 192 and 256 bits may not be available
// Generate the secret key specs.
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
// Instantiate the cipher
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted =cipher.doFinal("welcome".getBytes());
System.out.println("encrypted string: " + asHex(encrypted));
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
byte[] original =
cipher.doFinal(encrypted);
String originalString = new String(original);
System.out.println("Original string: " +
originalString + " " + asHex(original));
}
}
| 0 |
11,692,011 | 07/27/2012 16:35:42 | 1,555,505 | 07/26/2012 17:14:12 | 3 | 0 | Need help in File processing script | #!/bin/sh
p=`date '+20%y%m%d'`
cp Process_*"$p"*.txt /tmp/
cat /tmp/number.txt | egrep -v "Prefix|---|" | sed -e 's/ //g' -e '/^$/d' | nawk -F"->" 'BEGIN{FS="->";OFS=","} {print $1,$2}' > /tmp/numberserieslookup.txt
cat /tmp/numberserieslookup.txt | nawk 'BEGIN{FS=OFS=","} { print substr($1,3,14),$2}' > /tmp/lookup.txt
for i in `cat /tmp/lookup.txt |awk -F, '{print $2}' |sort -u`;
do
grep $i /tmp/lookup.txt > /tmp/$i.txt ;
done
I made one script in shell, but it is not running in my server. So i am trying to make perl for the same. Can anyone help me?
Steps:
1.Copying the Process_currentdate.txt file in to tmp path
2.Making one file numberserieslookup.txt from input file number.txt
number.txt will be like this
Prefix
`----------`
7777777 -> PPPP
8888888 -> QQQQ
I dont want that Prefix and ----. so using sed i am removing those Prefix,---- and blank space. This gives output numberserieslookup.txt as
numberseries.txt
7777777,PPPP
8888888,QQQQ
3. Using numberseries.txt, removing first 2 digit of first field.
lookup.txt
77777,PPPP
88888,QQQQ
4.for loop is used to make different files as per 2nd field.
Filename will be PPPP.txt inside that file
Eg:
PPPP.txt
77777,PPPP
QQQQ.txt
88888,QQQQ
can any one help me to make perl for this?
| perl | null | null | null | null | 07/28/2012 10:58:31 | not constructive | Need help in File processing script
===
#!/bin/sh
p=`date '+20%y%m%d'`
cp Process_*"$p"*.txt /tmp/
cat /tmp/number.txt | egrep -v "Prefix|---|" | sed -e 's/ //g' -e '/^$/d' | nawk -F"->" 'BEGIN{FS="->";OFS=","} {print $1,$2}' > /tmp/numberserieslookup.txt
cat /tmp/numberserieslookup.txt | nawk 'BEGIN{FS=OFS=","} { print substr($1,3,14),$2}' > /tmp/lookup.txt
for i in `cat /tmp/lookup.txt |awk -F, '{print $2}' |sort -u`;
do
grep $i /tmp/lookup.txt > /tmp/$i.txt ;
done
I made one script in shell, but it is not running in my server. So i am trying to make perl for the same. Can anyone help me?
Steps:
1.Copying the Process_currentdate.txt file in to tmp path
2.Making one file numberserieslookup.txt from input file number.txt
number.txt will be like this
Prefix
`----------`
7777777 -> PPPP
8888888 -> QQQQ
I dont want that Prefix and ----. so using sed i am removing those Prefix,---- and blank space. This gives output numberserieslookup.txt as
numberseries.txt
7777777,PPPP
8888888,QQQQ
3. Using numberseries.txt, removing first 2 digit of first field.
lookup.txt
77777,PPPP
88888,QQQQ
4.for loop is used to make different files as per 2nd field.
Filename will be PPPP.txt inside that file
Eg:
PPPP.txt
77777,PPPP
QQQQ.txt
88888,QQQQ
can any one help me to make perl for this?
| 4 |
8,923,147 | 01/19/2012 08:40:44 | 309,798 | 04/06/2010 07:15:54 | 930 | 10 | Are there any open source project like "sourceforge.net" or "codeplex.com"? | I want to create a web site like sourceforge.net or codeplex.com (for local network of our office).
There is no link to download for `codeplex.codeplex.com`. `sf.net` is too complex.
Are there any open source project like "sourceforge.net" or "codeplex.com"?
| open-source | project-management | null | null | null | 01/19/2012 09:07:12 | off topic | Are there any open source project like "sourceforge.net" or "codeplex.com"?
===
I want to create a web site like sourceforge.net or codeplex.com (for local network of our office).
There is no link to download for `codeplex.codeplex.com`. `sf.net` is too complex.
Are there any open source project like "sourceforge.net" or "codeplex.com"?
| 2 |
8,678,226 | 12/30/2011 09:54:51 | 794,434 | 06/12/2011 02:33:14 | 724 | 73 | Blackberry persistence store + user level access | I'm currently working on the saving the information using blackberry persistence store. I have to save the details according to the user level access.
**Scenario:** User 1 has logged in and saved some details to the persistence store, and then User2 logged in. The data saved by User1 shouldn't be available for User2. Can you please guide me how do i fix that.
I am using the below code.
try {
store = PersistentStore.getPersistentObject(key);
CodeSigningKey codeSigningKey = CodeSigningKey.get("ACME");
synchronized (store) {
objectsList = new Vector();
store.setContents(new ControlledAccess(objectsList, codeSigningKey));
store.commit();
}
} catch (Exception e) {
Dialog.inform(e.toString());
} | blackberry | blackberry-jde | persistent-storage | null | null | null | open | Blackberry persistence store + user level access
===
I'm currently working on the saving the information using blackberry persistence store. I have to save the details according to the user level access.
**Scenario:** User 1 has logged in and saved some details to the persistence store, and then User2 logged in. The data saved by User1 shouldn't be available for User2. Can you please guide me how do i fix that.
I am using the below code.
try {
store = PersistentStore.getPersistentObject(key);
CodeSigningKey codeSigningKey = CodeSigningKey.get("ACME");
synchronized (store) {
objectsList = new Vector();
store.setContents(new ControlledAccess(objectsList, codeSigningKey));
store.commit();
}
} catch (Exception e) {
Dialog.inform(e.toString());
} | 0 |
2,735,395 | 04/29/2010 07:13:09 | 290,535 | 03/10/2010 13:22:51 | 55 | 0 | how to find first and last record from mysql table | I have one table I want to find first and last record that satisfy criteria of particular month. | mysql | null | null | null | null | null | open | how to find first and last record from mysql table
===
I have one table I want to find first and last record that satisfy criteria of particular month. | 0 |
466,963 | 01/21/2009 20:58:47 | 75 | 08/01/2008 15:54:25 | 602 | 37 | Is it possible to kill a single query in oracle without killing the session? | I would like to be able to kill a user's query in Oracle 10.2.0.4 without killing their entire session. This would allow the query to end, but not log that user out of their session, so they can continue making other queries. Is this possible at all? Or is the blunt hammer of killing the session the only way to go about ending a query's execution? | oracle | oracle10g | null | null | null | null | open | Is it possible to kill a single query in oracle without killing the session?
===
I would like to be able to kill a user's query in Oracle 10.2.0.4 without killing their entire session. This would allow the query to end, but not log that user out of their session, so they can continue making other queries. Is this possible at all? Or is the blunt hammer of killing the session the only way to go about ending a query's execution? | 0 |
9,202,142 | 02/08/2012 21:57:45 | 1,093,694 | 12/12/2011 12:21:57 | 54 | 1 | Which NodeJS Rounter | Well! Question is on header. I want to developt a CMS and I need a good routing system for NodeJS.
I don't have any predecisions and I'm open any advice. | javascript | node.js | content-management-system | null | null | 02/10/2012 12:55:15 | not constructive | Which NodeJS Rounter
===
Well! Question is on header. I want to developt a CMS and I need a good routing system for NodeJS.
I don't have any predecisions and I'm open any advice. | 4 |
6,021,330 | 05/16/2011 17:54:02 | 429,040 | 08/24/2010 02:26:37 | 78 | 6 | TSQL/MySQL Equivalents | I've spent a lot of time in Microsoft's SQL product, but not so much in mySQL. I'm aware of the most basic differences in their SQL implementation, i.e. "TOP 1" == "LIMIT 1" and so forth, but once we enter the world of programmability, I am absolutely clueless as to what built-in functions mySQL does and does not have.
I can find documentation on the mySQL functions by themselves easily enough, but I'm wondering if there's a document of some kind that simply lists Microsoft SQL functions and their mySQL equivalents (or vice versa)? | mysql | sql | tsql | microsoft | null | null | open | TSQL/MySQL Equivalents
===
I've spent a lot of time in Microsoft's SQL product, but not so much in mySQL. I'm aware of the most basic differences in their SQL implementation, i.e. "TOP 1" == "LIMIT 1" and so forth, but once we enter the world of programmability, I am absolutely clueless as to what built-in functions mySQL does and does not have.
I can find documentation on the mySQL functions by themselves easily enough, but I'm wondering if there's a document of some kind that simply lists Microsoft SQL functions and their mySQL equivalents (or vice versa)? | 0 |
5,763,597 | 04/23/2011 10:11:21 | 275,218 | 02/17/2010 12:15:05 | 68 | 21 | PHP script for API Documentation | I'd like a PHP script that lets me put in api calls and variables it accepts. I don't want any automatic java applet. Just as simple insert, edit script.
Whats the best, simple script going?
Thanks | php | api | documentation | null | null | 04/27/2011 03:21:22 | not a real question | PHP script for API Documentation
===
I'd like a PHP script that lets me put in api calls and variables it accepts. I don't want any automatic java applet. Just as simple insert, edit script.
Whats the best, simple script going?
Thanks | 1 |
6,690,992 | 07/14/2011 09:19:33 | 831,025 | 07/06/2011 07:00:58 | 4 | 0 | Printing PDF using Dos command | How to print pdf using DOS command, I have tryed print /d:PDFGEN "C:\FILE\CS\1.txt", I am getting the error message "Unable to initialize device PDFGEN" | dos | ms-dos | null | null | null | 07/14/2011 11:10:16 | off topic | Printing PDF using Dos command
===
How to print pdf using DOS command, I have tryed print /d:PDFGEN "C:\FILE\CS\1.txt", I am getting the error message "Unable to initialize device PDFGEN" | 2 |
9,617,848 | 03/08/2012 12:43:22 | 1,256,908 | 03/08/2012 11:34:53 | 1 | 0 | Facebook page likes decreasing | The ‘Like This’ count on my Facebook Band Page has been decreasing since Feb 2, 2012. Looking in the Insights I noticed from 2/2/2012 to the present there have been 200 or so Unlikes. Likes by some close friends, family including my own Like were no longer listed, I then realized there must be a fault in the Like counter on my page. I tried using the Facebook Debug tool: developers.facebook.com/tools/debug but as I'm not a Facebook developer the utility won't activate. I searched Facebook's Blog on this isssue and no correct solution found. I then submitted a Bug Report to Facebook Pages- facebook.com/help/contact.php?show_form=pages_bug on Sat 3 March 2012, but no response yet. JustAnswer.com are trying to solve this for me also, and I searched all questions here at Stackoverflow but found no correct answer. | facebook | facebook-like | page | null | null | 03/09/2012 01:42:36 | off topic | Facebook page likes decreasing
===
The ‘Like This’ count on my Facebook Band Page has been decreasing since Feb 2, 2012. Looking in the Insights I noticed from 2/2/2012 to the present there have been 200 or so Unlikes. Likes by some close friends, family including my own Like were no longer listed, I then realized there must be a fault in the Like counter on my page. I tried using the Facebook Debug tool: developers.facebook.com/tools/debug but as I'm not a Facebook developer the utility won't activate. I searched Facebook's Blog on this isssue and no correct solution found. I then submitted a Bug Report to Facebook Pages- facebook.com/help/contact.php?show_form=pages_bug on Sat 3 March 2012, but no response yet. JustAnswer.com are trying to solve this for me also, and I searched all questions here at Stackoverflow but found no correct answer. | 2 |
7,719,780 | 10/10/2011 23:24:55 | 927,048 | 09/03/2011 21:32:27 | 1 | 0 | How to make lines in Visual C++ Studio | I am honestly a beginner with no idea how to use VIsual C++
I just need to figure out how to draw a basic line.
Can someone help me out? | c++ | visual-studio | null | null | null | 10/10/2011 23:40:53 | not a real question | How to make lines in Visual C++ Studio
===
I am honestly a beginner with no idea how to use VIsual C++
I just need to figure out how to draw a basic line.
Can someone help me out? | 1 |
10,365,568 | 04/28/2012 16:50:56 | 1,363,129 | 04/28/2012 16:40:37 | 1 | 0 | IOS : How to call a Window? | I learn the iPhone development and in my application I have some view but I should use a window , so I want to call a window in an IBaction how can I call a window , I try to use the example with AppDelegate you can see my code :
- (IBAction)start:(id)sender {
self.window = [[[Game1ViewController alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
[self.window makeKeyAndVisible];
}
Game1ViewController is type UIWindow.
Best Regards | ios | null | null | null | null | null | open | IOS : How to call a Window?
===
I learn the iPhone development and in my application I have some view but I should use a window , so I want to call a window in an IBaction how can I call a window , I try to use the example with AppDelegate you can see my code :
- (IBAction)start:(id)sender {
self.window = [[[Game1ViewController alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
[self.window makeKeyAndVisible];
}
Game1ViewController is type UIWindow.
Best Regards | 0 |
3,362 | 08/06/2008 13:27:05 | 357 | 08/05/2008 01:29:23 | 76 | 6 | JavaScript - Capturing TAB key in text box | Here on Stack Overflow, I would like to be able to use the tab key within the WMD editor text box to tab over 4 spaces. The way it is now, the tab key jumps my cursor down to the Tags.
Vote for this feature at UserVoice: [http://stackoverflow.uservoice.com/pages/general/suggestions/15889][1]
Is there some JavaScript that will capture the TAB key in the text box before it bubbles up to the UI?
[1]: http://stackoverflow.uservoice.com/pages/general/suggestions/15889 | stackoverflow | javascript | null | null | null | 02/10/2011 20:27:58 | too localized | JavaScript - Capturing TAB key in text box
===
Here on Stack Overflow, I would like to be able to use the tab key within the WMD editor text box to tab over 4 spaces. The way it is now, the tab key jumps my cursor down to the Tags.
Vote for this feature at UserVoice: [http://stackoverflow.uservoice.com/pages/general/suggestions/15889][1]
Is there some JavaScript that will capture the TAB key in the text box before it bubbles up to the UI?
[1]: http://stackoverflow.uservoice.com/pages/general/suggestions/15889 | 3 |
4,498,262 | 12/21/2010 10:24:52 | 309,816 | 04/06/2010 07:32:19 | 8 | 1 | Execute @PostLoad _after_ eagerly fetching? | Using JPA2/Hibernate, I've created an entity A that has a uni-directional mapping to an entity X (see below). Inside A, I also have a transient member "t" that I am trying to calculate using a @PostLoad method. The calculation requires access to the assosiated Xs:
<pre><code>@Entity
public class A {
// ...
@Transient
int t;
@OneToMany(orphanRemoval = false, fetch = FetchType.EAGER)
private List<X> listOfX;
@PostLoad
public void calculateT() {
t = 0;
for (X x : listOfX)
t = t + x.someMethod();
}
}
</code></pre>
However, when I try to load this entity, I get a "org.hibernate.LazyInitializationException: illegal access to loading collection" error.
<pre><code> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:363)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
at org.hibernate.collection.PersistentBag.get(PersistentBag.java:445)
at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
at mypackage.A.calculateT(A.java:32)</code></pre>
Looking at hibernate's code (AbstractPersistentCollection.java) while debugging, I found that:
1) My @PostLoad method is called BEFORE the "listOfX" member is initialized
2) Hibernate's code has an explicit check to prevent initialization of an eagerly fetched collection during a @PostLoad:
<pre><code> protected final void initialize(boolean writing) {
if (!initialized) {
if (initializing) {
throw new LazyInitializationException("illegal access to loading collection");
}
throwLazyInitializationExceptionIfNotConnected();
session.initializeCollection(this, writing);
}
}
</code></pre>
The only way I'm thinking to fix this is to stop using @PostLoad and move the initialization code into the getT() accessor, adding a synchronized block. However, I want to avoid that.
So, is there a way to have eager fetching executed prior to @PostLoad being called? I don't know of a JPA facility to do that, so I'm hoping there's something I don't know.
Also, perhaps Hibernate's proprietary API has something to control this behaviour?
| jpa-2.0 | hibernate3 | null | null | null | null | open | Execute @PostLoad _after_ eagerly fetching?
===
Using JPA2/Hibernate, I've created an entity A that has a uni-directional mapping to an entity X (see below). Inside A, I also have a transient member "t" that I am trying to calculate using a @PostLoad method. The calculation requires access to the assosiated Xs:
<pre><code>@Entity
public class A {
// ...
@Transient
int t;
@OneToMany(orphanRemoval = false, fetch = FetchType.EAGER)
private List<X> listOfX;
@PostLoad
public void calculateT() {
t = 0;
for (X x : listOfX)
t = t + x.someMethod();
}
}
</code></pre>
However, when I try to load this entity, I get a "org.hibernate.LazyInitializationException: illegal access to loading collection" error.
<pre><code> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:363)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
at org.hibernate.collection.PersistentBag.get(PersistentBag.java:445)
at java.util.Collections$UnmodifiableList.get(Collections.java:1154)
at mypackage.A.calculateT(A.java:32)</code></pre>
Looking at hibernate's code (AbstractPersistentCollection.java) while debugging, I found that:
1) My @PostLoad method is called BEFORE the "listOfX" member is initialized
2) Hibernate's code has an explicit check to prevent initialization of an eagerly fetched collection during a @PostLoad:
<pre><code> protected final void initialize(boolean writing) {
if (!initialized) {
if (initializing) {
throw new LazyInitializationException("illegal access to loading collection");
}
throwLazyInitializationExceptionIfNotConnected();
session.initializeCollection(this, writing);
}
}
</code></pre>
The only way I'm thinking to fix this is to stop using @PostLoad and move the initialization code into the getT() accessor, adding a synchronized block. However, I want to avoid that.
So, is there a way to have eager fetching executed prior to @PostLoad being called? I don't know of a JPA facility to do that, so I'm hoping there's something I don't know.
Also, perhaps Hibernate's proprietary API has something to control this behaviour?
| 0 |
7,889,452 | 10/25/2011 12:44:57 | 656,691 | 03/12/2011 15:32:36 | 28 | 1 | XMLHttpRequest Internet Explorer | I have a problem with an API I'm using: CaptchaTraderAPI. It is actually a JavaScript file that has a bunch of functions, but one of them isn't working. It's the one that submits the image URL.
Here is the code.
function submitJob(params, success, failure) {
var request = XMLHttpResponse();
request.open("POST", "http://api.captchatrader.com/submit", true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function() {
if(request.readyState == 4 && request.status == 200) {
var response = eval(request.responseText);
if(response[0] == -1) {
if(failure) {
failure(response[1]);
}
} else {
_activeJobId = response[0];
success(response[1]);
}
}
};
request.send(params);
}
Internet Explorer prompts an error at line 3 of the code I printed.
I tried changing the object call to ActiveXObject("Microsoft.XMLHTTP") and to ActiveXObject("MSXML2.XMLHTTP.3.0"), but with no luck.
If someone figure something out, please post here. | internet-explorer | xmlhttprequest | null | null | null | null | open | XMLHttpRequest Internet Explorer
===
I have a problem with an API I'm using: CaptchaTraderAPI. It is actually a JavaScript file that has a bunch of functions, but one of them isn't working. It's the one that submits the image URL.
Here is the code.
function submitJob(params, success, failure) {
var request = XMLHttpResponse();
request.open("POST", "http://api.captchatrader.com/submit", true);
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
request.setRequestHeader("Content-length", params.length);
request.setRequestHeader("Connection", "close");
request.onreadystatechange = function() {
if(request.readyState == 4 && request.status == 200) {
var response = eval(request.responseText);
if(response[0] == -1) {
if(failure) {
failure(response[1]);
}
} else {
_activeJobId = response[0];
success(response[1]);
}
}
};
request.send(params);
}
Internet Explorer prompts an error at line 3 of the code I printed.
I tried changing the object call to ActiveXObject("Microsoft.XMLHTTP") and to ActiveXObject("MSXML2.XMLHTTP.3.0"), but with no luck.
If someone figure something out, please post here. | 0 |
8,124,215 | 11/14/2011 15:54:58 | 364,651 | 06/11/2010 14:52:46 | 450 | 16 | Is cron reliable? | I am using the Windows Task Scheduler and it is not at all reliable. The scripts run sometime, sometime they don't and without a reason. I have heard about the cron utility in Linux environment and I wanted to know if is reliable.
| php | windows | null | null | null | 11/14/2011 16:33:24 | not a real question | Is cron reliable?
===
I am using the Windows Task Scheduler and it is not at all reliable. The scripts run sometime, sometime they don't and without a reason. I have heard about the cron utility in Linux environment and I wanted to know if is reliable.
| 1 |
10,975,512 | 06/11/2012 06:46:39 | 1,383,959 | 05/09/2012 07:32:21 | 3 | 0 | php mail function not working with info@ mails. | I have a issue with my mail function that is, it is not working with the info@ mails.
Does anyone know about this issue please help me.
Regards,
| email | null | null | null | null | 06/11/2012 07:47:04 | not a real question | php mail function not working with info@ mails.
===
I have a issue with my mail function that is, it is not working with the info@ mails.
Does anyone know about this issue please help me.
Regards,
| 1 |
11,316,017 | 07/03/2012 17:23:56 | 1,499,476 | 07/03/2012 17:07:39 | 1 | 0 | Java Operator Precedence : What would be the output | What will be the answer to :
class abcd
{
public static void main(String ar[])
{
int a=3, b=2, c;
c = a++ * --b - b++ + ++a;
System.out.println(a+" "+b+" "+c);
}
}
Compiler gave the output as : 4 3 6. I got a=4 and b=3, but i was unable to solve for c. I came out with c=7.
Too much confusion in operator precedence. Someone plz help. :( | java | null | null | null | null | 07/03/2012 17:29:56 | not a real question | Java Operator Precedence : What would be the output
===
What will be the answer to :
class abcd
{
public static void main(String ar[])
{
int a=3, b=2, c;
c = a++ * --b - b++ + ++a;
System.out.println(a+" "+b+" "+c);
}
}
Compiler gave the output as : 4 3 6. I got a=4 and b=3, but i was unable to solve for c. I came out with c=7.
Too much confusion in operator precedence. Someone plz help. :( | 1 |
5,334,566 | 03/17/2011 03:29:21 | 518,513 | 11/24/2010 08:57:04 | 539 | 14 | Form Security & PHP? | I was using something like this:
<input type="hidden" name="ids" value="1, 3, 5" />
<input type="hidden" name="cost" value="350" />
But I was thinking, somebody could just change the cost to say "3" and pay for it for $3.00.. so I was thinking, would a securer(sp) option be setting these values into sessions when they load page, like so:
<?
unset($_SESSION['total']);
unset($_SESSION['ids']);
$_SESSION['total'] = $grand;
$_SESSION['ids'] = implode(", ", $ids);
?>
Is this a good way of doing it? As they cannot edit the sessions, it's defined by whats in their basket, as opposed to storing it in hidden input fields which they could easily manipulate? | php | null | null | null | null | null | open | Form Security & PHP?
===
I was using something like this:
<input type="hidden" name="ids" value="1, 3, 5" />
<input type="hidden" name="cost" value="350" />
But I was thinking, somebody could just change the cost to say "3" and pay for it for $3.00.. so I was thinking, would a securer(sp) option be setting these values into sessions when they load page, like so:
<?
unset($_SESSION['total']);
unset($_SESSION['ids']);
$_SESSION['total'] = $grand;
$_SESSION['ids'] = implode(", ", $ids);
?>
Is this a good way of doing it? As they cannot edit the sessions, it's defined by whats in their basket, as opposed to storing it in hidden input fields which they could easily manipulate? | 0 |
11,482,258 | 07/14/2012 08:33:47 | 1,525,300 | 07/14/2012 08:23:51 | 1 | 0 | openexchangerates.org, java example | openexchangerates.org contains no java examples (http://openexchangerates.org/documentation#example-java is empty) for fetching the rates that I could find. I would very much like to see some example code which could be used in an android application.
| java | android | null | null | null | 07/15/2012 10:52:28 | not constructive | openexchangerates.org, java example
===
openexchangerates.org contains no java examples (http://openexchangerates.org/documentation#example-java is empty) for fetching the rates that I could find. I would very much like to see some example code which could be used in an android application.
| 4 |
4,500,878 | 12/21/2010 15:28:43 | 275,074 | 02/17/2010 08:59:21 | 334 | 2 | jQuery contents() causing problems in IE | I'm using the contents() function in jQuery in order to obtain some text within a LI which I can't target directly with a span or other selector.
The code I've written is as follows:
$('#tierArray_' + tierId).contents().each(function(i, node) {
if (node.nodeName == "#text") {
node.textContent = name;
}
});
This works fine in Firefox and changes the target text to what is set in 'name'. In IE however I get the following errors:
"Object doesn't support this property or method"
This seems to relate to the line "node.textContent = name" as when I comment this out the error disappears.
In a nutshell I'm simply trying to replace some text with newly created text, the HTML markup is as follows:
<li class="ui-state-default" id="tierArray_105">
<span style="display: block;" id="revoke_105">
<a class="tierStatus" title="Revoke" href="#">Revoke</a> |
<a class="tierEdit" id="edit_tier_105" title="Bla 3aaa11" href="#">Edit</a>
</span>
<span style="display: none;" id="active_105">
<a class="tierStatus" title="Activate" href="#">Activate</a> |
<a class="tierEdit" id="edit_tier_105" title="Bla 3aaa11" href="#">Edit</a>
</span>
Bla 3aaa11
</li>
So the text after the last span (Bla 4aaa11) will need to be replaced with some newly generated text. | jquery | text | contents | null | null | null | open | jQuery contents() causing problems in IE
===
I'm using the contents() function in jQuery in order to obtain some text within a LI which I can't target directly with a span or other selector.
The code I've written is as follows:
$('#tierArray_' + tierId).contents().each(function(i, node) {
if (node.nodeName == "#text") {
node.textContent = name;
}
});
This works fine in Firefox and changes the target text to what is set in 'name'. In IE however I get the following errors:
"Object doesn't support this property or method"
This seems to relate to the line "node.textContent = name" as when I comment this out the error disappears.
In a nutshell I'm simply trying to replace some text with newly created text, the HTML markup is as follows:
<li class="ui-state-default" id="tierArray_105">
<span style="display: block;" id="revoke_105">
<a class="tierStatus" title="Revoke" href="#">Revoke</a> |
<a class="tierEdit" id="edit_tier_105" title="Bla 3aaa11" href="#">Edit</a>
</span>
<span style="display: none;" id="active_105">
<a class="tierStatus" title="Activate" href="#">Activate</a> |
<a class="tierEdit" id="edit_tier_105" title="Bla 3aaa11" href="#">Edit</a>
</span>
Bla 3aaa11
</li>
So the text after the last span (Bla 4aaa11) will need to be replaced with some newly generated text. | 0 |
6,462,461 | 06/24/2011 01:40:10 | 35,693 | 11/08/2008 03:11:25 | 1,793 | 107 | What do you use the Debugger for? | What do you use the Debugger for?
Some scenarios that I can think of:
1. Reading/Understanding code
2. Understanding the flow (what happens when)
3. What is the actual program up to
a.Attach debugger
b.Exception -> Debug
*I would like this to be a community wiki, but cant find the checkbox... Do I miss here something* | debugging | null | null | null | null | 06/24/2011 02:00:37 | not a real question | What do you use the Debugger for?
===
What do you use the Debugger for?
Some scenarios that I can think of:
1. Reading/Understanding code
2. Understanding the flow (what happens when)
3. What is the actual program up to
a.Attach debugger
b.Exception -> Debug
*I would like this to be a community wiki, but cant find the checkbox... Do I miss here something* | 1 |
2,981,794 | 06/05/2010 19:39:07 | 119,973 | 06/09/2009 16:41:23 | 183 | 0 | Fighing system in Php & MYSQL | I am working on a game like Mafia Wars and i am trying to get the fighting system working but i keep getting lose trying to work out who is going to win the fight and it still needs to know if the stats are close then there is a random chace of them winning.
$strength = $my_strength;
$otherplayerinfo = mysql_query("SELECT * FROM accounts WHERE id='$player_id'");
$playerinfo = mysql_fetch_array($otherplayerinfo);
$players_strength = $playerinfo['stre'];
$players_speed = $playerinfo['speed'];
$players_def = $playerinfo['def'];
if($players_strength > $strength){
$strength_point_player = 1;
$strength_point_your = 0;
}else{
$strength_point_your = 1;
$strength_point_player = 0;
}
I was trying a point system but i still could not do it. | php | mysql | null | null | null | 06/07/2010 01:16:11 | not a real question | Fighing system in Php & MYSQL
===
I am working on a game like Mafia Wars and i am trying to get the fighting system working but i keep getting lose trying to work out who is going to win the fight and it still needs to know if the stats are close then there is a random chace of them winning.
$strength = $my_strength;
$otherplayerinfo = mysql_query("SELECT * FROM accounts WHERE id='$player_id'");
$playerinfo = mysql_fetch_array($otherplayerinfo);
$players_strength = $playerinfo['stre'];
$players_speed = $playerinfo['speed'];
$players_def = $playerinfo['def'];
if($players_strength > $strength){
$strength_point_player = 1;
$strength_point_your = 0;
}else{
$strength_point_your = 1;
$strength_point_player = 0;
}
I was trying a point system but i still could not do it. | 1 |
6,869,864 | 07/29/2011 07:23:44 | 449,856 | 09/16/2010 18:21:26 | 8,662 | 358 | Jira Book / Guide | My team have recently started using Jira, and first impressions are great. To use it as a simple bug tracking tool is very quick and easy to get going with, but there seems to be a lot of additional powerful functions both visible and hidden away within the application.
I would like to know if anyone has a good guide, or book to getting the most out of the Jira product. | bug-tracking | jira | null | null | null | 10/02/2011 22:27:10 | not constructive | Jira Book / Guide
===
My team have recently started using Jira, and first impressions are great. To use it as a simple bug tracking tool is very quick and easy to get going with, but there seems to be a lot of additional powerful functions both visible and hidden away within the application.
I would like to know if anyone has a good guide, or book to getting the most out of the Jira product. | 4 |
8,777,173 | 01/08/2012 11:37:58 | 282,635 | 02/27/2010 10:29:10 | 1,217 | 33 | Why do we need a limit register in paging? | If I understand paging correctly, a given page is always mapped to a specific frame. Since all frames have the same, constant size, what do we need the limit register for? If the page limit is smaller than the frame size, aren't we simply wasting memory? | paging | null | null | null | null | 01/09/2012 13:49:51 | off topic | Why do we need a limit register in paging?
===
If I understand paging correctly, a given page is always mapped to a specific frame. Since all frames have the same, constant size, what do we need the limit register for? If the page limit is smaller than the frame size, aren't we simply wasting memory? | 2 |
2,619,469 | 04/12/2010 01:53:26 | 136,126 | 07/10/2009 07:52:33 | 126 | 3 | about enum's syntax | What the help of using **: int** in the enum declaretion as following?
public enum ArchiveAssetType : int
{
Folder = 0,
File = 1,
Link = 2
}
| c# | null | null | null | null | null | open | about enum's syntax
===
What the help of using **: int** in the enum declaretion as following?
public enum ArchiveAssetType : int
{
Folder = 0,
File = 1,
Link = 2
}
| 0 |
6,255,472 | 06/06/2011 17:01:26 | 681,904 | 03/29/2011 10:59:45 | 6 | 0 | python dealing with SSH [many clients ] |
i mange 3 server [ Linux ] and i have to turn on scripts on these servers every 6 hours
so it's take a lite bit time to login in each one .. so i made this code
import paramiko
import os
ZI1={"ip":"192.168.1.2","pass":"server-1"}
ZI2={"ip":"192.168.1.3","pass":"Server-2"}
ZI3={"ip":"192.168.1.2","pass":"server-3"}
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
SPAM=1
while SPAM==3:
ssh.connect(ZI1["ip"],username='root', password=ZI1["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
SPAM+=1
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
SPAM+=1
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
ssh.close()
SPAM+=1
well it's not work as well ;( i wana to enter each one and run the script and go to another server without close the connection or close the script so please help me <3 | python | ssh | paramiko | null | null | null | open | python dealing with SSH [many clients ]
===
i mange 3 server [ Linux ] and i have to turn on scripts on these servers every 6 hours
so it's take a lite bit time to login in each one .. so i made this code
import paramiko
import os
ZI1={"ip":"192.168.1.2","pass":"server-1"}
ZI2={"ip":"192.168.1.3","pass":"Server-2"}
ZI3={"ip":"192.168.1.2","pass":"server-3"}
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
SPAM=1
while SPAM==3:
ssh.connect(ZI1["ip"],username='root', password=ZI1["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
SPAM+=1
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
SPAM+=1
ssh.connect(ZI2["ip"],username='root', password=ZI2["pass"])
stdin, stdout, stderr = ssh.exec_command('perl Register.pl')
print stdout.readlines()
ssh.close()
SPAM+=1
well it's not work as well ;( i wana to enter each one and run the script and go to another server without close the connection or close the script so please help me <3 | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.