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,095,936 | 02/23/2011 19:22:41 | 630,285 | 02/23/2011 13:46:43 | 6 | 0 | Are flash cookies the same as http cookies? | Are flash cookies the same as http cookies? Libolai hammen akhen? | c# | flash | eclipse | cookies | null | null | open | Are flash cookies the same as http cookies?
===
Are flash cookies the same as http cookies? Libolai hammen akhen? | 0 |
9,054,644 | 01/29/2012 16:19:01 | 1,161,054 | 01/20/2012 16:53:28 | 16 | 0 | mysql 'as' using table name | i want to use string as table name in mysql like below
select ('user' as b) from b;
does anyone want to help me in this case?
------------------------------------------------------
mysql> select 'user' as b from b;
ERROR 1146 (42S02): Table 'test.b' doesn't exist
mysql> select ('user' as b) from b;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'as b)
from b' at line 1
mysql> select ('user' as b) from b;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'as b)
from b' at line 1
mysql> | mysql | sql | table | sql-injection | null | 01/30/2012 17:55:15 | not a real question | mysql 'as' using table name
===
i want to use string as table name in mysql like below
select ('user' as b) from b;
does anyone want to help me in this case?
------------------------------------------------------
mysql> select 'user' as b from b;
ERROR 1146 (42S02): Table 'test.b' doesn't exist
mysql> select ('user' as b) from b;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'as b)
from b' at line 1
mysql> select ('user' as b) from b;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'as b)
from b' at line 1
mysql> | 1 |
10,572,866 | 05/13/2012 15:17:16 | 289,246 | 03/08/2010 23:30:38 | 2,495 | 69 | jquery validate according to radio button | I am using jQuery validation plugin.
I have two radio button A and B. When A is chosen, I display 3 input fields. When B is chosen I display other 3 input fields.
How can I use the validation plugin in order to validate the relevant items only according to the radio buttons? | jquery | validation | jquery-validate | null | null | 05/14/2012 17:35:04 | not a real question | jquery validate according to radio button
===
I am using jQuery validation plugin.
I have two radio button A and B. When A is chosen, I display 3 input fields. When B is chosen I display other 3 input fields.
How can I use the validation plugin in order to validate the relevant items only according to the radio buttons? | 1 |
7,275,364 | 09/01/2011 19:21:04 | 722,233 | 04/24/2011 00:15:21 | 6 | 0 | Error in code block | i am getting two errors in code block cant able to remove them.i think they are linking errors.
ERRORS :
ld can't find -lc
ld can't find -lm
plz suggest me some solution | c | codeblocks | null | null | null | 09/02/2011 01:50:28 | not a real question | Error in code block
===
i am getting two errors in code block cant able to remove them.i think they are linking errors.
ERRORS :
ld can't find -lc
ld can't find -lm
plz suggest me some solution | 1 |
4,152,321 | 11/11/2010 07:50:41 | 413,016 | 08/06/2010 12:17:29 | 41 | 0 | How to automate an INSERT INTO process in SQLite ? | I have created a database - tasks.db - with SQLite.
This database has one table - todo - with the following fields :
id (pk), date (NOW with trigger), project, duedate, status, description
To enter a new row in SQLite from the command line, I have to write :
sqlite3 tasks.db "insert into todo (project,duedate,status,description) values (2010-11_18,'Home','Urgent','Call the plumber');"
which is a rather long and error-prone process. So I decided to "automate" it with a shell script (bsq) which runs as follows :
#!/bin/sh
echo "What project ?"
read Proj
echo "For when ?"
read Due
echo "What status ?"
read Stat
echo "What to do ?"
read Descr
echo sqlite3 tasks.db "insert into todo (project,duedate,status,description) values ('$Proj',$Due,'$Stat','$Descr');"
… and nothing happens when I run : sh bsq. The sequence appears then brings me back to the prompt.
Where did I go wrong or what did I omit (ENTER ? but how do I do that ?) ?
Thanks for your help
ThG | bash | scripting | sqlite3 | null | null | null | open | How to automate an INSERT INTO process in SQLite ?
===
I have created a database - tasks.db - with SQLite.
This database has one table - todo - with the following fields :
id (pk), date (NOW with trigger), project, duedate, status, description
To enter a new row in SQLite from the command line, I have to write :
sqlite3 tasks.db "insert into todo (project,duedate,status,description) values (2010-11_18,'Home','Urgent','Call the plumber');"
which is a rather long and error-prone process. So I decided to "automate" it with a shell script (bsq) which runs as follows :
#!/bin/sh
echo "What project ?"
read Proj
echo "For when ?"
read Due
echo "What status ?"
read Stat
echo "What to do ?"
read Descr
echo sqlite3 tasks.db "insert into todo (project,duedate,status,description) values ('$Proj',$Due,'$Stat','$Descr');"
… and nothing happens when I run : sh bsq. The sequence appears then brings me back to the prompt.
Where did I go wrong or what did I omit (ENTER ? but how do I do that ?) ?
Thanks for your help
ThG | 0 |
4,284,242 | 11/26/2010 10:00:29 | 434,457 | 08/29/2010 22:23:26 | 6 | 2 | How to override CursorAdapter bindView | I'm trying to display information from a Cursor in a ListView, each row contains a ImageView and a TextView. I have a CustomCursorAdapter extending CursorAdapter, in bindView I evaluate the data from the cursor and based on that set the views image and text.
When I run the app the ListView displayes the correct amount of rows, but they are empty. I know I have missed something when overriding bindView, but I'm not sure what.
Any help would be greatly appreciated.
private class CustomCursorAdapter extends CursorAdapter {
public CustomCursorAdapter() {
super(Lmw.this, monitorsCursor);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
LayoutInflater layoutInflater = getLayoutInflater();
return layoutInflater.inflate(R.layout.row, null);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
try {
int monitorNameIndex = cursor.getColumnIndexOrThrow(DbAdapter.MONITORS_COLUMN_MONITOR_NAME);
int resultTotalResponseTimeIndex = cursor.getColumnIndexOrThrow(DbAdapter.RESULTS_COLUMN_TOTAL_RESPONSE_TIME);
String monitorName = cursor.getString(monitorNameIndex);
int warningThreshold = cursor.getInt(resultTotalResponseTimeIndex);
String lbl = monitorName + "\n" + Integer.toString(warningThreshold) + " ms";
TextView label = (TextView) view.findViewById(R.id.label);
label.setText(lbl);
ImageView icon = (ImageView)view.findViewById(R.id.icon);
if(warningThreshold < 1000) {
icon.setImageResource(R.drawable.ok);
} else {
icon.setImageResource(R.drawable.alarm);
}
} catch (IllegalArgumentException e) {
// TODO: handle exception
}
}
}
| android | sqlite | cursor | override | null | null | open | How to override CursorAdapter bindView
===
I'm trying to display information from a Cursor in a ListView, each row contains a ImageView and a TextView. I have a CustomCursorAdapter extending CursorAdapter, in bindView I evaluate the data from the cursor and based on that set the views image and text.
When I run the app the ListView displayes the correct amount of rows, but they are empty. I know I have missed something when overriding bindView, but I'm not sure what.
Any help would be greatly appreciated.
private class CustomCursorAdapter extends CursorAdapter {
public CustomCursorAdapter() {
super(Lmw.this, monitorsCursor);
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
LayoutInflater layoutInflater = getLayoutInflater();
return layoutInflater.inflate(R.layout.row, null);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
try {
int monitorNameIndex = cursor.getColumnIndexOrThrow(DbAdapter.MONITORS_COLUMN_MONITOR_NAME);
int resultTotalResponseTimeIndex = cursor.getColumnIndexOrThrow(DbAdapter.RESULTS_COLUMN_TOTAL_RESPONSE_TIME);
String monitorName = cursor.getString(monitorNameIndex);
int warningThreshold = cursor.getInt(resultTotalResponseTimeIndex);
String lbl = monitorName + "\n" + Integer.toString(warningThreshold) + " ms";
TextView label = (TextView) view.findViewById(R.id.label);
label.setText(lbl);
ImageView icon = (ImageView)view.findViewById(R.id.icon);
if(warningThreshold < 1000) {
icon.setImageResource(R.drawable.ok);
} else {
icon.setImageResource(R.drawable.alarm);
}
} catch (IllegalArgumentException e) {
// TODO: handle exception
}
}
}
| 0 |
4,066,295 | 11/01/2010 02:18:15 | 359,984 | 06/07/2010 01:56:25 | 30 | 6 | Validating iPhone http requests | I have an iPhone game and I use a LASSO web page to add scores to a MySQL database.
It now works fine, but I am getting one 'user' that submitted hundreds of impossibly good scores in succession. I know this could not have done the 'legal' way.
I am now updating the app and want to avoid such nonsense.
My initial thought was to go to Game Center, which I will, but this update is almost perfect so I rather not open it up again.
What would be a good way to test if an HTTP request came from my app from an iOS deviced and not from some robot or script?
Thanks!
Hanaan
This is my request code:
int gameTypeId = 1; // Nonograms=1, Nonograms iPad=2, LoopMaster=3
NSString *name = [[NSUserDefaults standardUserDefaults] objectForKey:@"player_name"];
NSString *place = [[NSUserDefaults standardUserDefaults] objectForKey:@"player_where_from"];
NSString *scoreString = [self formatFinalScore];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue: name forKey: @"name"];
[parameters setValue: place forKey: @"place"];
NSString *post1_encodestrings = [@"" stringByAppendingString: [parameters urlEncodedString]];
NSString *post1 = [NSString stringWithFormat: @"game_id=%d&game_size=%d&game_level=1&score=%f&score_string=%@&%@",gameTypeId,self.thisGameSize,self.gameFinalScore,scoreString,post1_encodestrings];
NSData *postData = [post1 dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init]autorelease]; //
[request setURL:[NSURL URLWithString:@"http://www.tmipublishing.com/hotcocoa/lasso/add_score_to_database.lasso"]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLConnection *conn=[[NSURLConnection alloc] initWithRequest:request delegate:self];
| iphone | mysql | http | null | null | null | open | Validating iPhone http requests
===
I have an iPhone game and I use a LASSO web page to add scores to a MySQL database.
It now works fine, but I am getting one 'user' that submitted hundreds of impossibly good scores in succession. I know this could not have done the 'legal' way.
I am now updating the app and want to avoid such nonsense.
My initial thought was to go to Game Center, which I will, but this update is almost perfect so I rather not open it up again.
What would be a good way to test if an HTTP request came from my app from an iOS deviced and not from some robot or script?
Thanks!
Hanaan
This is my request code:
int gameTypeId = 1; // Nonograms=1, Nonograms iPad=2, LoopMaster=3
NSString *name = [[NSUserDefaults standardUserDefaults] objectForKey:@"player_name"];
NSString *place = [[NSUserDefaults standardUserDefaults] objectForKey:@"player_where_from"];
NSString *scoreString = [self formatFinalScore];
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
[parameters setValue: name forKey: @"name"];
[parameters setValue: place forKey: @"place"];
NSString *post1_encodestrings = [@"" stringByAppendingString: [parameters urlEncodedString]];
NSString *post1 = [NSString stringWithFormat: @"game_id=%d&game_size=%d&game_level=1&score=%f&score_string=%@&%@",gameTypeId,self.thisGameSize,self.gameFinalScore,scoreString,post1_encodestrings];
NSData *postData = [post1 dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init]autorelease]; //
[request setURL:[NSURL URLWithString:@"http://www.tmipublishing.com/hotcocoa/lasso/add_score_to_database.lasso"]];
[request setHTTPMethod:@"POST"];
[request setValue:postLength forHTTPHeaderField:@"Content-Length"];
[request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:postData];
NSURLConnection *conn=[[NSURLConnection alloc] initWithRequest:request delegate:self];
| 0 |
1,721,408 | 11/12/2009 10:51:46 | 39,709 | 11/21/2008 16:22:36 | 4,196 | 138 | Dependency Injection - is this how it's meant to look? | Our project is using constructor-based Dependency Injection (we're using Unity as our container) and we have a number of constructors which have acquired a large number of parameters.
For example:
public FooRequestService(
ITransactionDataBuilder transactionDataBuilder,
IMapper<SaveFooRequest, FooRequestMessage> saveFooRequestToFooRequestMapper,
IFooRequestedThingRepository fooRequestedThingRepository,
IFooRequestedThingBuilder fooRequestedThingBuilder,
IMapper<IEnumerable<FooRequestedThing>, IEnumerable<FoundFooRequestedThing>> fooRequestedThingsToFoundFooRequestedThingsMapper,
IAutomatedFooWcfService automatedFooService,
IFooArrivalMessageProvider fooArrivalMessageProvider,
ISeatCancellation cancellation,
IPostSalesService postSalesService,
ITransactionEnquiryService transactionService,
IMapper<IEnumerable<FooRequestedThing>, List<ThingArrivedForFoo>> thingArrivalRequestDocumentMapper,
IMapper<SaveFooRejected, FooRejectedMessage> saveFooRejectedToFooRejectedMapper,
IPartialFooConfiguration partialFooConfiguration,
ICurrentDateTimeProvider currentDateTimeProvider,
IMapper<FooRequestMessage, List<FooRequested>> tracsFooRequestMapper,
IThreeWayMerger<Transaction, TransactionService.Contract.Transaction, NotifyFooRequestedRequest, SaveFooRequest> saveFooRequestMerger,
KioskWebServiceSoap kioskServiceGateway)
{
// code here to set injected values to member variables
}
This class has a total of around 370 lines of code and represents a core part of the system, hence the large number of dependencies.
- From a DI perspective, is is usual to have so many parameters passed to a constructor?
- The general approach concerns me from an encapsulation and scoping aspect. All dependencies can be used from anywhere within a class, even if they should (strictly speaking) only be used from, for example, a single method
| unity | dependency-injection | discussion | null | null | 04/05/2012 14:38:17 | not constructive | Dependency Injection - is this how it's meant to look?
===
Our project is using constructor-based Dependency Injection (we're using Unity as our container) and we have a number of constructors which have acquired a large number of parameters.
For example:
public FooRequestService(
ITransactionDataBuilder transactionDataBuilder,
IMapper<SaveFooRequest, FooRequestMessage> saveFooRequestToFooRequestMapper,
IFooRequestedThingRepository fooRequestedThingRepository,
IFooRequestedThingBuilder fooRequestedThingBuilder,
IMapper<IEnumerable<FooRequestedThing>, IEnumerable<FoundFooRequestedThing>> fooRequestedThingsToFoundFooRequestedThingsMapper,
IAutomatedFooWcfService automatedFooService,
IFooArrivalMessageProvider fooArrivalMessageProvider,
ISeatCancellation cancellation,
IPostSalesService postSalesService,
ITransactionEnquiryService transactionService,
IMapper<IEnumerable<FooRequestedThing>, List<ThingArrivedForFoo>> thingArrivalRequestDocumentMapper,
IMapper<SaveFooRejected, FooRejectedMessage> saveFooRejectedToFooRejectedMapper,
IPartialFooConfiguration partialFooConfiguration,
ICurrentDateTimeProvider currentDateTimeProvider,
IMapper<FooRequestMessage, List<FooRequested>> tracsFooRequestMapper,
IThreeWayMerger<Transaction, TransactionService.Contract.Transaction, NotifyFooRequestedRequest, SaveFooRequest> saveFooRequestMerger,
KioskWebServiceSoap kioskServiceGateway)
{
// code here to set injected values to member variables
}
This class has a total of around 370 lines of code and represents a core part of the system, hence the large number of dependencies.
- From a DI perspective, is is usual to have so many parameters passed to a constructor?
- The general approach concerns me from an encapsulation and scoping aspect. All dependencies can be used from anywhere within a class, even if they should (strictly speaking) only be used from, for example, a single method
| 4 |
5,586,868 | 04/07/2011 19:59:31 | 670,111 | 03/21/2011 20:13:39 | 91 | 12 | why does my direct traffic have 70% New visits | I thought direct traffic are people who type the website name or click the bookmark meaning they are returning visitors. but why does GA show 70% new visits in my direct traffic | seo | google-analytics | webmaster | null | null | 04/19/2011 13:08:56 | off topic | why does my direct traffic have 70% New visits
===
I thought direct traffic are people who type the website name or click the bookmark meaning they are returning visitors. but why does GA show 70% new visits in my direct traffic | 2 |
1,823 | 08/05/2008 02:17:45 | 145 | 08/02/2008 14:40:17 | 93 | 5 | Writing A "Conway's Game of Life" Program | Alright, so I've always wanted to write myself a nice little **Game of Life** program where you could play with the rules and adjust the number of cells and such; I've just never really had the time to mess around to do this (until recently). I understand the basic algorithm and such (if you don't, go to the [Game of Life](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) Wikipedia page to check it out.) but only have a little experience with GUI programming. I'm considering doing this in python, but I was really wanting to figure out how to go about doing this in general, so feel free to give code snippets in your language of choice.
To summarise:
- **How would you go about programming a "Conway's Game of Life" simulation in your language of choice?** | language-agnostic | gui | simulation | null | null | 05/21/2012 17:07:23 | not constructive | Writing A "Conway's Game of Life" Program
===
Alright, so I've always wanted to write myself a nice little **Game of Life** program where you could play with the rules and adjust the number of cells and such; I've just never really had the time to mess around to do this (until recently). I understand the basic algorithm and such (if you don't, go to the [Game of Life](http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) Wikipedia page to check it out.) but only have a little experience with GUI programming. I'm considering doing this in python, but I was really wanting to figure out how to go about doing this in general, so feel free to give code snippets in your language of choice.
To summarise:
- **How would you go about programming a "Conway's Game of Life" simulation in your language of choice?** | 4 |
10,286,861 | 04/23/2012 19:22:07 | 1,013,338 | 10/25/2011 18:46:50 | 29 | 0 | PHP: Another regex I can't figure out | I'm having trouble with 2 regular expressions in PHP
**1. stripping http(s):// and www.**
https://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
http://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
https://google.be/search?sclient=psy-ab&q=regex&oq=regex
http://google.be/search?sclient=psy-ab&q=regex&oq=regex
=> google.be/search?sclient=psy-ab&q=regex&oq=regex
**2. 3-30 characters, may contain a-zA-Z0-9.-_* but need at least one letter or number**
Valid: -_l*96d.*
Invalid: *-_.
I've searched so long without any result so please help !
Many thanks! | php | regex | null | null | null | 04/23/2012 22:37:22 | not a real question | PHP: Another regex I can't figure out
===
I'm having trouble with 2 regular expressions in PHP
**1. stripping http(s):// and www.**
https://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
http://www.google.be/search?sclient=psy-ab&q=regex&oq=regex
https://google.be/search?sclient=psy-ab&q=regex&oq=regex
http://google.be/search?sclient=psy-ab&q=regex&oq=regex
=> google.be/search?sclient=psy-ab&q=regex&oq=regex
**2. 3-30 characters, may contain a-zA-Z0-9.-_* but need at least one letter or number**
Valid: -_l*96d.*
Invalid: *-_.
I've searched so long without any result so please help !
Many thanks! | 1 |
4,154,790 | 11/11/2010 13:18:34 | 502,980 | 11/10/2010 09:28:08 | 1 | 0 | in an array how to find a no whish is near to zero | in an array how to find a element which is near about zero,
and how to delete duplicate element from an array...............
| java | null | null | null | null | 11/11/2010 13:34:01 | not a real question | in an array how to find a no whish is near to zero
===
in an array how to find a element which is near about zero,
and how to delete duplicate element from an array...............
| 1 |
7,090,726 | 08/17/2011 09:38:46 | 898,359 | 08/17/2011 09:38:46 | 1 | 0 | Sell a component that I made what website engine do I use? | I want to sell a component that I made. a single component, I am looking for a website engine that will deal with collecting payments, and sending the component once bought.
If anyone has experiance with this please give a shout what product I can use!
Thank you.
| web-services | null | null | null | null | 08/17/2011 11:14:18 | off topic | Sell a component that I made what website engine do I use?
===
I want to sell a component that I made. a single component, I am looking for a website engine that will deal with collecting payments, and sending the component once bought.
If anyone has experiance with this please give a shout what product I can use!
Thank you.
| 2 |
2,046,792 | 01/12/2010 04:57:07 | 52,752 | 01/08/2009 03:11:25 | 1,018 | 13 | How to Server.Transfer Response.Redirect using System.Web.Routing in Web Forms? | I am using System.Web.Routing with ASP.NET (3.5) Web Forms that will URL rewrite the following URL from
- http://www.myurl.com/campaign/abc
to
- http://www.myurl.com/default.aspx?campaign=abc
The code is as below:
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("CampaignRoute", new Route
(
"campaign/{code}",
new CustomRouteHandler("~/default.aspx")
));
}
IRouteHandler implementation:
public class CustomRouteHandler : IRouteHandler
{
public CustomRouteHandler(string virtualPath)
{
VirtualPath = virtualPath;
}
public string VirtualPath { get; private set; }
public IHttpHandler GetHttpHandler(RequestContext
requestContext)
{
if (requestContext.RouteData.Values.ContainsKey("code"))
{
var code = requestContext.RouteData.Values["code"].ToString();
HttpContext.Current.RewritePath(
string.Concat(
VirtualPath,
"?campaign=" + code));
}
var page = BuildManager.CreateInstanceFromVirtualPath
(VirtualPath, typeof(Page)) as IHttpHandler;
return page;
}
However I noticed there are too many things to change on my existing aspx pages (i.e. links to javascript, links to css files). So that I decided to instead of URL rewrite I now want to do a redirect. But I am not sure how I can tell my CustomRouteHandler to do the actul redirect than URL rewrite.
Thanks. | asp.net | url-rewriting | url-routing | webforms | null | null | open | How to Server.Transfer Response.Redirect using System.Web.Routing in Web Forms?
===
I am using System.Web.Routing with ASP.NET (3.5) Web Forms that will URL rewrite the following URL from
- http://www.myurl.com/campaign/abc
to
- http://www.myurl.com/default.aspx?campaign=abc
The code is as below:
public static void RegisterRoutes(RouteCollection routes)
{
routes.Add("CampaignRoute", new Route
(
"campaign/{code}",
new CustomRouteHandler("~/default.aspx")
));
}
IRouteHandler implementation:
public class CustomRouteHandler : IRouteHandler
{
public CustomRouteHandler(string virtualPath)
{
VirtualPath = virtualPath;
}
public string VirtualPath { get; private set; }
public IHttpHandler GetHttpHandler(RequestContext
requestContext)
{
if (requestContext.RouteData.Values.ContainsKey("code"))
{
var code = requestContext.RouteData.Values["code"].ToString();
HttpContext.Current.RewritePath(
string.Concat(
VirtualPath,
"?campaign=" + code));
}
var page = BuildManager.CreateInstanceFromVirtualPath
(VirtualPath, typeof(Page)) as IHttpHandler;
return page;
}
However I noticed there are too many things to change on my existing aspx pages (i.e. links to javascript, links to css files). So that I decided to instead of URL rewrite I now want to do a redirect. But I am not sure how I can tell my CustomRouteHandler to do the actul redirect than URL rewrite.
Thanks. | 0 |
8,282,903 | 11/27/2011 01:06:16 | 190,234 | 10/14/2009 22:54:27 | 54 | 2 | Machine parsable list of html5 tags and attributes | I looked almost everywhere, but I simply cannot find any machine parsable html5 reference.
For html 4 / xhtml I could simply parse DTD, but for html5 there's no dtd.
Is there ANY reference except for draft at http://dev.w3.org/html5/ ? (btw. html sructure of this draft is crap).
I need:
- list of tags
- list of arguments with types.
- list of required arguments | html5 | w3c | null | null | null | null | open | Machine parsable list of html5 tags and attributes
===
I looked almost everywhere, but I simply cannot find any machine parsable html5 reference.
For html 4 / xhtml I could simply parse DTD, but for html5 there's no dtd.
Is there ANY reference except for draft at http://dev.w3.org/html5/ ? (btw. html sructure of this draft is crap).
I need:
- list of tags
- list of arguments with types.
- list of required arguments | 0 |
6,773,589 | 07/21/2011 08:59:40 | 855,547 | 07/21/2011 08:58:44 | 1 | 0 | PHP Security Flaws? | Our team is developing a web app in the financial space using PHP. The big question that comes up first is always security related. What are the main security risks associated with PHP or scripted languages in general verus a more accepted (in the space) Java written app? | java | php | security | null | null | 07/21/2011 09:15:53 | not constructive | PHP Security Flaws?
===
Our team is developing a web app in the financial space using PHP. The big question that comes up first is always security related. What are the main security risks associated with PHP or scripted languages in general verus a more accepted (in the space) Java written app? | 4 |
7,047,978 | 08/13/2011 01:35:38 | 892,655 | 08/13/2011 01:35:38 | 1 | 0 | Photo post processing issue | I am facing a very annoying problem of photography.
I am using DPP (Digital Photo Professional) for post processing of raw file, same photographs looks good on one monitor but becomes dark (high contrast) on other.
Is there any way I can save color profile of photo with photograph it self, so that its appearance do not get changed with different displays?
Please help | image | processing | photography | null | null | 08/13/2011 05:47:28 | off topic | Photo post processing issue
===
I am facing a very annoying problem of photography.
I am using DPP (Digital Photo Professional) for post processing of raw file, same photographs looks good on one monitor but becomes dark (high contrast) on other.
Is there any way I can save color profile of photo with photograph it self, so that its appearance do not get changed with different displays?
Please help | 2 |
8,792,712 | 01/09/2012 17:41:12 | 1,139,252 | 01/09/2012 17:39:24 | 1 | 0 | Redirect all m. subdomain traffic to the normal tld.com site | Can I just make a normal m.domain.com subdomain and then somehow use .htaccess to redirect/rewrite it to the tld?
I'm using Wordpress and all I will do at that point is detect if there is a m. subdomain and show a mobile template instead of the regular site. | apache | wordpress | .htaccess | godaddy | null | 01/10/2012 20:35:10 | off topic | Redirect all m. subdomain traffic to the normal tld.com site
===
Can I just make a normal m.domain.com subdomain and then somehow use .htaccess to redirect/rewrite it to the tld?
I'm using Wordpress and all I will do at that point is detect if there is a m. subdomain and show a mobile template instead of the regular site. | 2 |
10,488,927 | 05/07/2012 20:49:47 | 1,218,317 | 02/18/2012 16:42:38 | 65 | 0 | What is the HASH in a torrent the hash of? | I noticed while downloading a torrent that a hash is given. I tried calculating the hash of the .torrent file but they did not match. So I assumed that it is the hash of the files the torrent will download. But a hash is calculated on a single file and there are multiple files that are downloading using a single torrent file.
So what is the single hash given on torrent sites the hash of? | hash | null | null | null | null | 05/07/2012 21:15:36 | off topic | What is the HASH in a torrent the hash of?
===
I noticed while downloading a torrent that a hash is given. I tried calculating the hash of the .torrent file but they did not match. So I assumed that it is the hash of the files the torrent will download. But a hash is calculated on a single file and there are multiple files that are downloading using a single torrent file.
So what is the single hash given on torrent sites the hash of? | 2 |
2,608,448 | 04/09/2010 14:55:11 | 312,902 | 04/09/2010 14:55:11 | 1 | 0 | Ajax : Internet Explorer error | I am working on a login form. The Ajax code is as follows:
/* ---------------------------- */
/* XMLHTTPRequest Enable */
/* ---------------------------- */
function createObject()
{
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}
var http = createObject();
/* -------------------------- */
/* LOGIN */
/* -------------------------- */
/* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */
var nocache = 0;
function login() {
// Optional: Show a waiting message in the layer with ID ajax_response
document.getElementById('login_response').innerHTML = "<img src='images/ispinner.gif'/>"
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
var email = encodeURI(document.getElementById('emailLogin').value);
var psw = encodeURI(document.getElementById('pswLogin').value);
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
http.open('get', 'login.php?email='+email+'&psw='+psw+'&nocache = '+nocache);
http.onreadystatechange = loginReply;
if(window.XMLHttpRequest)
{
http.send(null);
}
else
{
http.send()
}
}
function loginReply() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('login_response').innerHTML = response;
}
}
The code wors absoultely fine on google chrome and mozilla firefox. It just doesnt work on IE 5 and IE 6. I cannot figure out why?
Please help | ajax | php | null | null | null | null | open | Ajax : Internet Explorer error
===
I am working on a login form. The Ajax code is as follows:
/* ---------------------------- */
/* XMLHTTPRequest Enable */
/* ---------------------------- */
function createObject()
{
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}
var http = createObject();
/* -------------------------- */
/* LOGIN */
/* -------------------------- */
/* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */
var nocache = 0;
function login() {
// Optional: Show a waiting message in the layer with ID ajax_response
document.getElementById('login_response').innerHTML = "<img src='images/ispinner.gif'/>"
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
var email = encodeURI(document.getElementById('emailLogin').value);
var psw = encodeURI(document.getElementById('pswLogin').value);
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
http.open('get', 'login.php?email='+email+'&psw='+psw+'&nocache = '+nocache);
http.onreadystatechange = loginReply;
if(window.XMLHttpRequest)
{
http.send(null);
}
else
{
http.send()
}
}
function loginReply() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('login_response').innerHTML = response;
}
}
The code wors absoultely fine on google chrome and mozilla firefox. It just doesnt work on IE 5 and IE 6. I cannot figure out why?
Please help | 0 |
6,607,097 | 07/07/2011 07:11:14 | 833,023 | 07/07/2011 07:11:14 | 1 | 0 | Filter tree in Vaadin | I want to hide leafs from vaadin tree according to text in some editbox (on text change).
ie if text in editbox is "ab" i want to show only leafs with text starting with "ab".
and if text is empty, i want to show all leafs.
How can i make that? | java | tree | filtering | vaadin | null | null | open | Filter tree in Vaadin
===
I want to hide leafs from vaadin tree according to text in some editbox (on text change).
ie if text in editbox is "ab" i want to show only leafs with text starting with "ab".
and if text is empty, i want to show all leafs.
How can i make that? | 0 |
10,272,374 | 04/22/2012 21:43:15 | 1,078,381 | 12/02/2011 23:27:33 | 102 | 3 | Wrapper function for unkown formula | Is there any way to create such function?
For ex: i need to calculate the area of triangle, and i don't remember the right formula to calculate this and there is no internet or other sources of some info neer to me. What i do remember that arguments for such function are some side **b** and height **h**. So i want to create some function which would look like this:
public static void calculate(String forgottenFunc, int... params) {/*implementation*/};
I tought of implementation based on JavaScript eval function from Java, withough using RegExp. I've stucked on converting string (forgottenFunc) to some real function that would use given parametrs to calculate what i need. Or any alternatives on Python's eval or some other feature.
Thanks | java | python | function | null | null | null | open | Wrapper function for unkown formula
===
Is there any way to create such function?
For ex: i need to calculate the area of triangle, and i don't remember the right formula to calculate this and there is no internet or other sources of some info neer to me. What i do remember that arguments for such function are some side **b** and height **h**. So i want to create some function which would look like this:
public static void calculate(String forgottenFunc, int... params) {/*implementation*/};
I tought of implementation based on JavaScript eval function from Java, withough using RegExp. I've stucked on converting string (forgottenFunc) to some real function that would use given parametrs to calculate what i need. Or any alternatives on Python's eval or some other feature.
Thanks | 0 |
8,369,619 | 12/03/2011 17:45:09 | 1,079,229 | 12/03/2011 17:40:23 | 1 | 0 | Error code while watch Flowplayer videos | I trying to watch the videos flowplayer type, but when i click play the video it keep on coming out this error code >> 200,stream not found,netstream.play.streamnotfound,clip:[Clip]
Can you tell me how to fix this? is it my computer or the web server problem?i got windows 7 64 bit. | flowplayer | null | null | null | null | 12/04/2011 18:20:11 | off topic | Error code while watch Flowplayer videos
===
I trying to watch the videos flowplayer type, but when i click play the video it keep on coming out this error code >> 200,stream not found,netstream.play.streamnotfound,clip:[Clip]
Can you tell me how to fix this? is it my computer or the web server problem?i got windows 7 64 bit. | 2 |
4,080,796 | 11/02/2010 18:16:37 | 353,953 | 05/30/2010 11:07:43 | 3 | 0 | How to write sequential commands in batch file | I want ot execute the following commands using batch file:
1.ftp 127.0.0.1
2.USERNAME
3.PASSWORD
4.put
5.D:\\zz.xml
6.mmm.xml
Each command is a sequence of the prev command
I want to move file from local to ftp server
I googled for that and I found that insert ; between commands is the solution but itsn't correct for me
Please support me | c# | batch-file | command-prompt | null | null | null | open | How to write sequential commands in batch file
===
I want ot execute the following commands using batch file:
1.ftp 127.0.0.1
2.USERNAME
3.PASSWORD
4.put
5.D:\\zz.xml
6.mmm.xml
Each command is a sequence of the prev command
I want to move file from local to ftp server
I googled for that and I found that insert ; between commands is the solution but itsn't correct for me
Please support me | 0 |
7,509,002 | 09/22/2011 02:47:01 | 958,191 | 09/22/2011 02:47:01 | 1 | 0 | vb.net activated fires multiple times | I want to update a database based on the form that is currently activated. I had originally decided to use the GotFocus event. However I now understand that will not work as the form has controls on it. So I then thought I wouls use the activated event. This works but seems to fire multiple times. I put in the following code:
Private Sub frmNewTicket_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
MsgBox("Form Activated")
End Sub
I select the form and make it activated and the message box appears about 15 times.
Why does it do this? How should I handle this. I only want my code to execute once when the form is activated.
NOTE: There are several forms that the users will be changing between, incuding forms from other applications.
Thanks
Stephen | vb.net | multiple | activated | null | null | null | open | vb.net activated fires multiple times
===
I want to update a database based on the form that is currently activated. I had originally decided to use the GotFocus event. However I now understand that will not work as the form has controls on it. So I then thought I wouls use the activated event. This works but seems to fire multiple times. I put in the following code:
Private Sub frmNewTicket_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
MsgBox("Form Activated")
End Sub
I select the form and make it activated and the message box appears about 15 times.
Why does it do this? How should I handle this. I only want my code to execute once when the form is activated.
NOTE: There are several forms that the users will be changing between, incuding forms from other applications.
Thanks
Stephen | 0 |
9,527,995 | 03/02/2012 04:30:24 | 1,244,279 | 03/02/2012 04:12:41 | 1 | 0 | vimeo simple api suddenly stopped working without change to php | On a client's website I have set up the vimeo simple api to pull a list of videos in an album and display them when they are clicked. Without change, the pages have suddenly stopped working.
I did a bit of troubleshooting and was able to pinpoint what was causing the problem but can't seem to figure out a solution to my problem.
His webpage calls for two categories of vimeo videos to stream > animation and videography. So, on each respective page I had the album built into the api_endpoint. Note that this was working since the site had been launched a couple months ago.
$api_endpoint = 'http://vimeo.com/api/v2/album/1789358/videos.xml';
Upon removal of the '/album...' the script works again, but it doesn't do what I need it to do anymore.
$api_endpoint = 'http://vimeo.com/api/v2/';
PHP is not my strong suit so any help that could get these pages working as intended is great... just want to get the site back up to par for the client as soon as possible.
Here is the rest of the code that you need
<?php
// The Simple API URL
$api_endpoint = 'http://vimeo.com/api/v2/';
// The NOT WORKING API URL
$api_endpoint_not_working = 'http://vimeo.com/api/v2/album/1789358/videos.xml';
// Curl helper function
function curl_get($url) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($curl);
curl_close($curl);
return $return;
}
if ($_GET['album']) {
// Get the album
$album_id = $_GET['album'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/info.xml'));
// Thumbnail and title
$image = $info->album->thumbnail;
$title = $info->album->title;
}
else if ($_GET['group']) {
// Get the group
$group_id = $_GET['group'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/info.xml'));
// Thumbnail and title
$image = $info->group->thumbnail;
$title = $info->group->name;
}
else if ($_GET['channel']) {
// Get the channel
$channel_id = $_GET['channel'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/info.xml'));
// Thumbnail and title
$image = null;
$title = $info->channel->name;
}
else {
// Change this to your username to load in your videos
$vimeo_user_name = ($_GET['user']) ? $_GET['user'] : 'user1459664';
// Load the user's videos
$videos = simplexml_load_string(curl_get($api_endpoint.$vimeo_user_name . '/videos.xml'));
// Thumbnail and title
$image = $videos->video[0]->user_portrait_medium;
$title = $videos->video[0]->user_name . "'s Videos";
}
?>
HTML
<section id="content">
</section>
<section id="aside">
<ul id="videos">
<?php foreach ($videos->video as $video): ?>
<li>
<a href="<?php echo $video->url ?>">
<p><?=$video->title?></p>
</a>
</li>
<?php endforeach ?>
</ul>
</section>
You can see the page here at [his live site](http://benpacochamedia.com/animation.php). | php | api | gallery | vimeo | null | null | open | vimeo simple api suddenly stopped working without change to php
===
On a client's website I have set up the vimeo simple api to pull a list of videos in an album and display them when they are clicked. Without change, the pages have suddenly stopped working.
I did a bit of troubleshooting and was able to pinpoint what was causing the problem but can't seem to figure out a solution to my problem.
His webpage calls for two categories of vimeo videos to stream > animation and videography. So, on each respective page I had the album built into the api_endpoint. Note that this was working since the site had been launched a couple months ago.
$api_endpoint = 'http://vimeo.com/api/v2/album/1789358/videos.xml';
Upon removal of the '/album...' the script works again, but it doesn't do what I need it to do anymore.
$api_endpoint = 'http://vimeo.com/api/v2/';
PHP is not my strong suit so any help that could get these pages working as intended is great... just want to get the site back up to par for the client as soon as possible.
Here is the rest of the code that you need
<?php
// The Simple API URL
$api_endpoint = 'http://vimeo.com/api/v2/';
// The NOT WORKING API URL
$api_endpoint_not_working = 'http://vimeo.com/api/v2/album/1789358/videos.xml';
// Curl helper function
function curl_get($url) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$return = curl_exec($curl);
curl_close($curl);
return $return;
}
if ($_GET['album']) {
// Get the album
$album_id = $_GET['album'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'album/' . $album_id . '/info.xml'));
// Thumbnail and title
$image = $info->album->thumbnail;
$title = $info->album->title;
}
else if ($_GET['group']) {
// Get the group
$group_id = $_GET['group'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'group/' . $group_id . '/info.xml'));
// Thumbnail and title
$image = $info->group->thumbnail;
$title = $info->group->name;
}
else if ($_GET['channel']) {
// Get the channel
$channel_id = $_GET['channel'];
// Load the videos and info
$videos = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/videos.xml'));
$info = simplexml_load_string(curl_get($api_endpoint . 'channel/' . $channel_id . '/info.xml'));
// Thumbnail and title
$image = null;
$title = $info->channel->name;
}
else {
// Change this to your username to load in your videos
$vimeo_user_name = ($_GET['user']) ? $_GET['user'] : 'user1459664';
// Load the user's videos
$videos = simplexml_load_string(curl_get($api_endpoint.$vimeo_user_name . '/videos.xml'));
// Thumbnail and title
$image = $videos->video[0]->user_portrait_medium;
$title = $videos->video[0]->user_name . "'s Videos";
}
?>
HTML
<section id="content">
</section>
<section id="aside">
<ul id="videos">
<?php foreach ($videos->video as $video): ?>
<li>
<a href="<?php echo $video->url ?>">
<p><?=$video->title?></p>
</a>
</li>
<?php endforeach ?>
</ul>
</section>
You can see the page here at [his live site](http://benpacochamedia.com/animation.php). | 0 |
8,460,437 | 12/10/2011 22:31:20 | 238,099 | 12/24/2009 07:15:18 | 117 | 5 | Lightweight Objective-C XMPP Sever | How would I go about building an Objective-C server? Atleast a wrapper for an existing C server? I require the XMPP Sever to be independent: self-contained, and doesn't require extra libs/ mySQL/ etc. Where do I start? | objective-c | cocoa | xmpp | null | null | 12/11/2011 14:41:34 | not a real question | Lightweight Objective-C XMPP Sever
===
How would I go about building an Objective-C server? Atleast a wrapper for an existing C server? I require the XMPP Sever to be independent: self-contained, and doesn't require extra libs/ mySQL/ etc. Where do I start? | 1 |
3,925,982 | 10/13/2010 16:44:59 | 253,489 | 01/18/2010 20:07:08 | 16 | 0 | clock in/out time logging program | I would like to make an application that can be run directly from the computer. What I want to do Is allow employees to clock in and out through out the day. I want it to send the the time of check in/out to a remote database. I would like to make an .exe file and I would like for it to have a few input fields along with a field that lets me type and Ip of the database and a port number.
What program language would be the best for this?
Thanks | c# | c++ | null | null | null | 10/13/2010 17:22:37 | not a real question | clock in/out time logging program
===
I would like to make an application that can be run directly from the computer. What I want to do Is allow employees to clock in and out through out the day. I want it to send the the time of check in/out to a remote database. I would like to make an .exe file and I would like for it to have a few input fields along with a field that lets me type and Ip of the database and a port number.
What program language would be the best for this?
Thanks | 1 |
8,882,799 | 01/16/2012 16:11:42 | 1,014,732 | 10/26/2011 14:13:10 | 6 | 0 | Visual Studio 2010 ASP.NET Website issue with IIS | I have built a web application ASP.NET perfectly working when deployed within visual studio. The problem occurs when I try to publish it within my web application: all the files are correctly deployed into c\inetpub\wwwroot, my welcome.aspx page is displayed correctly, but NONE of the other pages/pictures are available, whereas they are present in the file system. I assume there is a right problem, or something like that, but I'm unable to figure it out...
Any help is welcomed :)
Thank you ! | asp.net | iis7 | null | null | null | null | open | Visual Studio 2010 ASP.NET Website issue with IIS
===
I have built a web application ASP.NET perfectly working when deployed within visual studio. The problem occurs when I try to publish it within my web application: all the files are correctly deployed into c\inetpub\wwwroot, my welcome.aspx page is displayed correctly, but NONE of the other pages/pictures are available, whereas they are present in the file system. I assume there is a right problem, or something like that, but I'm unable to figure it out...
Any help is welcomed :)
Thank you ! | 0 |
8,475,351 | 12/12/2011 13:51:11 | 1,042,721 | 11/12/2011 02:08:51 | 51 | 5 | TDebugInterfacedObject in which unit? | I need to find TDebugInterfacedObject defined in which unit ? Do you know where it is ? | delphi | null | null | null | null | 12/12/2011 18:22:40 | too localized | TDebugInterfacedObject in which unit?
===
I need to find TDebugInterfacedObject defined in which unit ? Do you know where it is ? | 3 |
3,340,672 | 07/27/2010 04:05:28 | 364,314 | 06/11/2010 07:36:11 | 1 | 1 | array of Type in xaml? | is there a way to declare an array of types in xaml?
maybe something like this?
<x:Array Type="x:Type">
<x:Type se:MyType1/>
<x:Type se:MyType2/>
<x:Type se:MyType3/>
</x:Array> | wpf | xaml | null | null | null | null | open | array of Type in xaml?
===
is there a way to declare an array of types in xaml?
maybe something like this?
<x:Array Type="x:Type">
<x:Type se:MyType1/>
<x:Type se:MyType2/>
<x:Type se:MyType3/>
</x:Array> | 0 |
9,238,485 | 02/11/2012 07:06:05 | 1,118,218 | 12/27/2011 20:05:43 | 5 | 0 | How do I see if my silverlight control is "Minimized" or "Maximized" | Silverlight newbie here, so I apologize if this question isn't even worded correctly.
I am playing around with a richtextbox and storyboard animations. Basically, on mouseenter animate to 100px, on mouseleave animate to 0px.
This is fairly basic, but what I can't figure out is how to see if it is in the minimize or maximize state.
Here is the XAML:
<UserControl x:Class="AnotherTester.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<Storyboard x:Name="Shrink">
<DoubleAnimation Storyboard.TargetName="textBox"
Storyboard.TargetProperty="Height"
From="100" To="0" Duration="00:00:00.5" />
</Storyboard>
<Storyboard x:Name="Grow">
<DoubleAnimation Storyboard.TargetName="textBox"
Storyboard.TargetProperty="Height"
From="0" To="100" Duration="00:00:00.5" />
</Storyboard>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Width="100">
<Rectangle x:Name="rectangle" Fill="#FF0202F9" Height="20" Stroke="Black" Width="100" MouseEnter="rectangle_MouseEnter" MouseLeave="rectangle_MouseLeave" />
<RichTextBox x:Name="textBox" Height="100">
<Paragraph><Run Text="This"/></Paragraph>
<Paragraph><Run Text="is"/></Paragraph>
<Paragraph><Run Text="some"/></Paragraph>
<Paragraph><Run Text="awesome"/></Paragraph>
<Paragraph><Run Text="text"/></Paragraph>
</RichTextBox>
</StackPanel>
</Grid>
</UserControl>
And the code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace AnotherTester
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void rectangle_MouseEnter(object sender, MouseEventArgs e)
{
Grow.Begin();
}
private void rectangle_MouseLeave(object sender, MouseEventArgs e)
{
Shrink.Begin();
}
}
}
Thanks in advance!
-David
Ok, I just changed the starting height of the control to 0px, which gave me the effect I was looking for (all collapsed boxes until we mouse over them), but I would still like to know how to check against things like this.. | silverlight | state | null | null | null | null | open | How do I see if my silverlight control is "Minimized" or "Maximized"
===
Silverlight newbie here, so I apologize if this question isn't even worded correctly.
I am playing around with a richtextbox and storyboard animations. Basically, on mouseenter animate to 100px, on mouseleave animate to 0px.
This is fairly basic, but what I can't figure out is how to see if it is in the minimize or maximize state.
Here is the XAML:
<UserControl x:Class="AnotherTester.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<Storyboard x:Name="Shrink">
<DoubleAnimation Storyboard.TargetName="textBox"
Storyboard.TargetProperty="Height"
From="100" To="0" Duration="00:00:00.5" />
</Storyboard>
<Storyboard x:Name="Grow">
<DoubleAnimation Storyboard.TargetName="textBox"
Storyboard.TargetProperty="Height"
From="0" To="100" Duration="00:00:00.5" />
</Storyboard>
</UserControl.Resources>
<Grid x:Name="LayoutRoot" Background="White">
<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Width="100">
<Rectangle x:Name="rectangle" Fill="#FF0202F9" Height="20" Stroke="Black" Width="100" MouseEnter="rectangle_MouseEnter" MouseLeave="rectangle_MouseLeave" />
<RichTextBox x:Name="textBox" Height="100">
<Paragraph><Run Text="This"/></Paragraph>
<Paragraph><Run Text="is"/></Paragraph>
<Paragraph><Run Text="some"/></Paragraph>
<Paragraph><Run Text="awesome"/></Paragraph>
<Paragraph><Run Text="text"/></Paragraph>
</RichTextBox>
</StackPanel>
</Grid>
</UserControl>
And the code Behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace AnotherTester
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void rectangle_MouseEnter(object sender, MouseEventArgs e)
{
Grow.Begin();
}
private void rectangle_MouseLeave(object sender, MouseEventArgs e)
{
Shrink.Begin();
}
}
}
Thanks in advance!
-David
Ok, I just changed the starting height of the control to 0px, which gave me the effect I was looking for (all collapsed boxes until we mouse over them), but I would still like to know how to check against things like this.. | 0 |
9,774,453 | 03/19/2012 17:00:02 | 822,718 | 06/30/2011 09:11:26 | 1 | 0 | Create an Array of Objects in Javascript | I want to create this structure dynamically in Javascript:
var myCols = [
{data1: 'A', data2: '0', data3: 1},
{data1: 'B', data2: '1', data3: 1},
{data1: 'C', data2: '2', data3: 1}
];
How can I do this?
Thank you in Advance. | javascript | object | dynamic-arrays | null | null | 03/19/2012 17:19:39 | not a real question | Create an Array of Objects in Javascript
===
I want to create this structure dynamically in Javascript:
var myCols = [
{data1: 'A', data2: '0', data3: 1},
{data1: 'B', data2: '1', data3: 1},
{data1: 'C', data2: '2', data3: 1}
];
How can I do this?
Thank you in Advance. | 1 |
7,814,605 | 10/18/2011 22:36:05 | 1,002,114 | 10/18/2011 22:33:49 | 1 | 0 | Android Autostart app every some interval | I have developed an app and I need it the hole day up. But somethimes it just crash. I was thinking on creating an autostart with an interval, for ex, every 30 min, the app gets up, but I can't find the way. Any ideas? thanks in advance | android | multithreading | application | intervals | autostart | 10/19/2011 10:32:16 | not constructive | Android Autostart app every some interval
===
I have developed an app and I need it the hole day up. But somethimes it just crash. I was thinking on creating an autostart with an interval, for ex, every 30 min, the app gets up, but I can't find the way. Any ideas? thanks in advance | 4 |
5,890,817 | 05/04/2011 22:55:58 | 69,520 | 02/22/2009 07:31:39 | 131 | 3 | Postgres nested loop order | I have the following query:
SELECT t1.c1 FROM t1,t2 WHERE t1.c2 = 'X' AND t1.id = t2.id AND t2.c3 = 'Y';
Postgres produces two plans for this query, something like:
Nested Loop (rows=1 width=7) (actual rows=1 loops=1)
-> Index Scan using idx1 on t1 (rows=1 width=7) (actual rows=4 loops=1)
-> Index Scan using idx2 on t2 (rows=1 width=7) (actual rows=0 loops=7)
or:
Nested Loop (rows=1 width=7) (actual rows=1 loops=1)
-> Index Scan using idx2 on t2 (rows=4 width=7) (actual rows=1000000 loops=1)
-> Index Scan using idx1 on t1 (rows=1 width=7) (actual rows=0 loops=1000000)
So, sometimes t1 is chosen for the outer loop, sometimes t2. And if the second plan is chosen performance is absolutely awful.
My question is, how can I force Postgres to always use the first query plan, with t1 in the outer loop?
I've tried using explicit join order and join_collapse_limit set to 1 but it doesn't seem to be working for just two tables.
| postgresql | inner-join | null | null | null | null | open | Postgres nested loop order
===
I have the following query:
SELECT t1.c1 FROM t1,t2 WHERE t1.c2 = 'X' AND t1.id = t2.id AND t2.c3 = 'Y';
Postgres produces two plans for this query, something like:
Nested Loop (rows=1 width=7) (actual rows=1 loops=1)
-> Index Scan using idx1 on t1 (rows=1 width=7) (actual rows=4 loops=1)
-> Index Scan using idx2 on t2 (rows=1 width=7) (actual rows=0 loops=7)
or:
Nested Loop (rows=1 width=7) (actual rows=1 loops=1)
-> Index Scan using idx2 on t2 (rows=4 width=7) (actual rows=1000000 loops=1)
-> Index Scan using idx1 on t1 (rows=1 width=7) (actual rows=0 loops=1000000)
So, sometimes t1 is chosen for the outer loop, sometimes t2. And if the second plan is chosen performance is absolutely awful.
My question is, how can I force Postgres to always use the first query plan, with t1 in the outer loop?
I've tried using explicit join order and join_collapse_limit set to 1 but it doesn't seem to be working for just two tables.
| 0 |
7,504,854 | 09/21/2011 18:36:00 | 957,635 | 09/21/2011 18:36:00 | 1 | 0 | Exchange Server 2003 transport issues | I am having trouble with our Exchange server at the moment and cannot work out what is wrong.
Basically I can receive internal mail on the domain between exchange users but nothing from an external address comes through at all.
Does anyone know what could be wrong?
SBS2003 SP2
| exchange | null | null | null | null | 09/22/2011 07:31:03 | off topic | Exchange Server 2003 transport issues
===
I am having trouble with our Exchange server at the moment and cannot work out what is wrong.
Basically I can receive internal mail on the domain between exchange users but nothing from an external address comes through at all.
Does anyone know what could be wrong?
SBS2003 SP2
| 2 |
8,521,120 | 12/15/2011 13:50:48 | 177,790 | 09/23/2009 12:53:25 | 36 | 8 | Getting the full column name from jdbc's metadata object | I'm processing a resultset where the number of returned columns vary and thus I need to know which columns are present. I found that I can extract the returned column names like this:
ResultSetMetaData meta = rs.getMetaData();
ArrayList<String> columns = new ArrayList<String>();
for (int i = 0; i < meta.getColumnCount(); i++) {
columns.add(meta.getColumnLabel(i+1));
}
This however does not give me the full column name defined in my SQL. Ie.
select events.id, events.name from events;
shows up as "id, name" and not "events.id, events.name" which is pretty bad when joining tables and wanting to differ on the column names returned. | java | jdbc | null | null | null | null | open | Getting the full column name from jdbc's metadata object
===
I'm processing a resultset where the number of returned columns vary and thus I need to know which columns are present. I found that I can extract the returned column names like this:
ResultSetMetaData meta = rs.getMetaData();
ArrayList<String> columns = new ArrayList<String>();
for (int i = 0; i < meta.getColumnCount(); i++) {
columns.add(meta.getColumnLabel(i+1));
}
This however does not give me the full column name defined in my SQL. Ie.
select events.id, events.name from events;
shows up as "id, name" and not "events.id, events.name" which is pretty bad when joining tables and wanting to differ on the column names returned. | 0 |
8,838,351 | 01/12/2012 16:14:42 | 1,129,078 | 01/04/2012 02:36:42 | 1 | 0 | Asp.net c# cshtml with jquery Datatables 1.9 update | I have just start using razor 2 days ago, and i like it very much and at the midst of learning as well.
Now, i am working on a Accounting project and I got stuck with jquery datatables 1.9
I am trying to create an editable datatable like the example I have found [jquery-datatables-editable][1]
This is what I have done using the cshtml, [My Website][2].
Currently I am facing with a problem... I not able to save what I have type and I cannot see what is wrong with my code.
Can someone helps me with it? I am using cshtml with MSSQL 2008 Express at this moment only.
Here is my code for ChartOfAccounts.cshtml
@{
Layout = "~/WorldSoft.cshtml";
Page.Title = "Chart of Accounts";
AccountingDataContext db = new AccountingDataContext();
//var varAccounts = db.mChartofAccounts.ToList();
var varAccounts = (from Accounts in db.mChartofAccounts
select new { Accounts.AccountID, Accounts.AccountName,
Accounts.AcctID, Accounts.AccountType, Accounts.GroupID,
Accounts.GroupName}).ToList();
}
@section Javascript {
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.jeditable.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.editable.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.rowGrouping.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable({
"iDisplayLength": 25, // Default No of Records per page on 1st load
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], // Set no of records in per page
"aaSorting": [[0, "asc"]], // Default 1st column sorting
//"bJQueryUI": true, //No themeroller
"aoColumnDefs": [{ "bVisible": false, "aTargets": [0]}], // Hide Column
"bStateSave": true, // Remember paging & filters
"bDeferRender": true, // Delay loading of DOM
"sPaginationType": "full_numbers" // Include page number
});
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable().rowGrouping({ iGroupingColumnIndex: 0 });
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable().makeEditable({
sUpdateURL: "Ajax_Functions/ChartOfAccountsUpdate.cshtml",
"aoColumns": [
{},
{},
{
indicator: 'Saving...',
tooltip: 'Click to select Type',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'':'Please select', 'Credit':'Credit','Debit':'Debit'}"
}
]
});
});
</script>
}
<div>
<table id="tModuleListing" width="100%" class="display">
<thead><tr><th>Group</th><th>Code</th><th>Account</th><th>Type</th></tr></thead>
<tbody>
@foreach (var p in varAccounts)
{
<tr id="@p.AcctID"><td>@p.GroupID - @p.GroupName</td><td>@p.AccountID</td><td>@p.AccountName</td><td>@p.AccountType</td></tr>
}
</tbody>
</table>
</div>
This is the codes for ajaxsource needed by the datatable.
@{
var ModuleID = Request["id"];
var NewValue = Request["value"];
var RowID = Request["rowid"];
var ColumnPosition = Request["columnPosition"];
var ColumnID = Request["columnId"];
var ColumnName = Request["columnName"];
// Find the correct data
AccountingDataContext db = new AccountingDataContext();
var varAccount = from b in db.mChartofAccounts where b.AcctID == int.Parse(ModuleID) select b;
switch(ColumnName)
{
case "Code":
varAccount.First().AccountID = NewValue;
break;
case "Account":
varAccount.First().AccountName = NewValue;
break;
case "Type":
varAccount.First().AccountType = NewValue;
break;
}
try
{
db.SubmitChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
// Provide for exceptions.
}
Json.Write(NewValue, Response.Output);
}
If you look at my website, you will see that textbox do appear. And we can change the wordings. But, it just unable to update into the database..
Please advice. Thanks in advance.
Smile
Chankl78
[1]: http://code.google.com/p/jquery-datatables-editable/wiki/Demo
[2]: http://worldsoft.dyndns.org:81/Accounts/ChartofAccounts.cshtml | c# | jquery | razor | asp.net-4.0 | datatables | 01/14/2012 02:59:20 | too localized | Asp.net c# cshtml with jquery Datatables 1.9 update
===
I have just start using razor 2 days ago, and i like it very much and at the midst of learning as well.
Now, i am working on a Accounting project and I got stuck with jquery datatables 1.9
I am trying to create an editable datatable like the example I have found [jquery-datatables-editable][1]
This is what I have done using the cshtml, [My Website][2].
Currently I am facing with a problem... I not able to save what I have type and I cannot see what is wrong with my code.
Can someone helps me with it? I am using cshtml with MSSQL 2008 Express at this moment only.
Here is my code for ChartOfAccounts.cshtml
@{
Layout = "~/WorldSoft.cshtml";
Page.Title = "Chart of Accounts";
AccountingDataContext db = new AccountingDataContext();
//var varAccounts = db.mChartofAccounts.ToList();
var varAccounts = (from Accounts in db.mChartofAccounts
select new { Accounts.AccountID, Accounts.AccountName,
Accounts.AcctID, Accounts.AccountType, Accounts.GroupID,
Accounts.GroupName}).ToList();
}
@section Javascript {
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.jeditable.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.editable.js"></script>
<script type="text/javascript" language="javascript"
src="Scripts/jquery.dataTables.rowGrouping.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable({
"iDisplayLength": 25, // Default No of Records per page on 1st load
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]], // Set no of records in per page
"aaSorting": [[0, "asc"]], // Default 1st column sorting
//"bJQueryUI": true, //No themeroller
"aoColumnDefs": [{ "bVisible": false, "aTargets": [0]}], // Hide Column
"bStateSave": true, // Remember paging & filters
"bDeferRender": true, // Delay loading of DOM
"sPaginationType": "full_numbers" // Include page number
});
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable().rowGrouping({ iGroupingColumnIndex: 0 });
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#tModuleListing').dataTable().makeEditable({
sUpdateURL: "Ajax_Functions/ChartOfAccountsUpdate.cshtml",
"aoColumns": [
{},
{},
{
indicator: 'Saving...',
tooltip: 'Click to select Type',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'':'Please select', 'Credit':'Credit','Debit':'Debit'}"
}
]
});
});
</script>
}
<div>
<table id="tModuleListing" width="100%" class="display">
<thead><tr><th>Group</th><th>Code</th><th>Account</th><th>Type</th></tr></thead>
<tbody>
@foreach (var p in varAccounts)
{
<tr id="@p.AcctID"><td>@p.GroupID - @p.GroupName</td><td>@p.AccountID</td><td>@p.AccountName</td><td>@p.AccountType</td></tr>
}
</tbody>
</table>
</div>
This is the codes for ajaxsource needed by the datatable.
@{
var ModuleID = Request["id"];
var NewValue = Request["value"];
var RowID = Request["rowid"];
var ColumnPosition = Request["columnPosition"];
var ColumnID = Request["columnId"];
var ColumnName = Request["columnName"];
// Find the correct data
AccountingDataContext db = new AccountingDataContext();
var varAccount = from b in db.mChartofAccounts where b.AcctID == int.Parse(ModuleID) select b;
switch(ColumnName)
{
case "Code":
varAccount.First().AccountID = NewValue;
break;
case "Account":
varAccount.First().AccountName = NewValue;
break;
case "Type":
varAccount.First().AccountType = NewValue;
break;
}
try
{
db.SubmitChanges();
}
catch (Exception e)
{
Console.WriteLine(e);
// Provide for exceptions.
}
Json.Write(NewValue, Response.Output);
}
If you look at my website, you will see that textbox do appear. And we can change the wordings. But, it just unable to update into the database..
Please advice. Thanks in advance.
Smile
Chankl78
[1]: http://code.google.com/p/jquery-datatables-editable/wiki/Demo
[2]: http://worldsoft.dyndns.org:81/Accounts/ChartofAccounts.cshtml | 3 |
4,847,020 | 01/31/2011 01:57:42 | 197,791 | 10/28/2009 03:01:14 | 138 | 2 | Are files created on Office 2010 compatible with Office 2007? | In particular, will Word 2007, Excel 2007, PowerPoint 2007 and Access 2007 be able to open the files created by Word 2010, Excel 2010, PowerPoint 2010 and Access 2010, respectively? | ms-office | office-2007 | null | null | null | 01/31/2011 04:44:09 | off topic | Are files created on Office 2010 compatible with Office 2007?
===
In particular, will Word 2007, Excel 2007, PowerPoint 2007 and Access 2007 be able to open the files created by Word 2010, Excel 2010, PowerPoint 2010 and Access 2010, respectively? | 2 |
3,390,847 | 08/02/2010 18:53:25 | 408,963 | 08/02/2010 18:53:25 | 1 | 0 | what should I charge for this side gig | This is not really technical but I could not find a better place to ask this Question than SO.
I have a full time gig but recently someone I know wanted to get an application done that would send mass emails/texts to users who are related to a particular group.
I am an OK RoR developer so have decided to do it in RoR. Following is brief overview of the functionality:
- Login
- CRUD Groups
- CRUD Users (related to groups)
- CRUD Notifications (email / sms)
- Screens for displaying when last notification was sent to a particular group etc.
- Unsubscribe link in the emails pointing back to the application
- be on https
- set up the whole app on their network (Windows server)
- Code will belong to him
- NDA signed
- finished in 3-4 weeks
Initially I had asked the client for around 1K for the whole thing but I had told him that it will be set up on heroku. I think setting up the application on Windows server should be outside of the cost as it is more work.
This is my first side gig so I would like a second opinion from experienced folks out there. | ruby-on-rails | null | null | null | null | 08/02/2010 19:17:28 | off topic | what should I charge for this side gig
===
This is not really technical but I could not find a better place to ask this Question than SO.
I have a full time gig but recently someone I know wanted to get an application done that would send mass emails/texts to users who are related to a particular group.
I am an OK RoR developer so have decided to do it in RoR. Following is brief overview of the functionality:
- Login
- CRUD Groups
- CRUD Users (related to groups)
- CRUD Notifications (email / sms)
- Screens for displaying when last notification was sent to a particular group etc.
- Unsubscribe link in the emails pointing back to the application
- be on https
- set up the whole app on their network (Windows server)
- Code will belong to him
- NDA signed
- finished in 3-4 weeks
Initially I had asked the client for around 1K for the whole thing but I had told him that it will be set up on heroku. I think setting up the application on Windows server should be outside of the cost as it is more work.
This is my first side gig so I would like a second opinion from experienced folks out there. | 2 |
2,946,539 | 05/31/2010 23:51:34 | 198,729 | 10/29/2009 08:13:14 | 2,091 | 1 | How many kinds of drivers are there ? | Like **device driver**, I don't know whether there are some **other drivers** ? | device-driver | drivers | null | null | null | 06/01/2010 10:20:29 | not a real question | How many kinds of drivers are there ?
===
Like **device driver**, I don't know whether there are some **other drivers** ? | 1 |
7,227,494 | 08/29/2011 07:52:24 | 903,455 | 08/20/2011 05:32:26 | 45 | 0 | Deleting accounts kept inactive for 45 days | In my project I wanna automatically delete accounts that are kept inactive for more that 45days. For testing purpose I took 2 minutes and wrote the following code. But its not working. Can anybody tell me how to perform "Record deletion" if kept inactive for 2 minutes.
My code follows.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Odbc;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=inactive;" + "UID=root;" + "PASSWORD=*********;" + "OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
try
{
MyConnection.Open();
OdbcCommand cmd = new OdbcCommand("DELETE name FROM email WHERE date < DATE_SUB(NOW(), INTERVAL 2 MIN)", MyConnection);
MyConnection.Close();
Label1.Text = "Done";
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=inactive;" + "UID=root;" + "PASSWORD=*********;" + "OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
try
{
MyConnection.Open();
OdbcCommand cmd = new OdbcCommand("Select name from email where email=?", MyConnection);
cmd.Parameters.Add("@email", OdbcType.VarChar, 255).Value = TextBox1.Text;
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.HasRows == false)
{
throw new Exception();
}
if (dr.Read())
{
Response.Write(dr[0].ToString());
}
}
catch
{
}
}
} | c# | mysql | odbc | null | null | null | open | Deleting accounts kept inactive for 45 days
===
In my project I wanna automatically delete accounts that are kept inactive for more that 45days. For testing purpose I took 2 minutes and wrote the following code. But its not working. Can anybody tell me how to perform "Record deletion" if kept inactive for 2 minutes.
My code follows.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Odbc;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=inactive;" + "UID=root;" + "PASSWORD=*********;" + "OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
try
{
MyConnection.Open();
OdbcCommand cmd = new OdbcCommand("DELETE name FROM email WHERE date < DATE_SUB(NOW(), INTERVAL 2 MIN)", MyConnection);
MyConnection.Close();
Label1.Text = "Done";
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=inactive;" + "UID=root;" + "PASSWORD=*********;" + "OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
try
{
MyConnection.Open();
OdbcCommand cmd = new OdbcCommand("Select name from email where email=?", MyConnection);
cmd.Parameters.Add("@email", OdbcType.VarChar, 255).Value = TextBox1.Text;
OdbcDataReader dr = cmd.ExecuteReader();
if (dr.HasRows == false)
{
throw new Exception();
}
if (dr.Read())
{
Response.Write(dr[0].ToString());
}
}
catch
{
}
}
} | 0 |
10,329,436 | 04/26/2012 08:05:13 | 165,078 | 08/28/2009 19:49:39 | 201 | 10 | Copy one List to another List and SubList with LINQ | I have a list of employees, and all of them have another list nested which is called the EmployeeValuesCollection.
So my class is something like :-
public Employee(int employeeID, string jobTitle, int companyID, List<EmployeeValues> employeeValuesCollection)
{
EmployeeID = employeeID;
JobTitle = jobTitle;
CompanyID = companyID;
EmployeeValuesCollection = employeeValuesCollection;
}
Now I wish to populate this object from another object with LINQ, and so far I have :-
List<DataFileRow> dataFiles = dfRow.Rows;
dataFiles.ForEach(l => employeeList.Add(new Employee(l.EmpID, l.JobTitle, l.CompID)));
That works however I do not know how to add the employeeValuesCollection in the statement. Is it possible to do?
So I was thinking something like :-
dataFiles.ForEach(l => employeeList.Add(new Employee(l.EmpID, l.JobTitle, l.CompID, new List<EmployeeValuesCollection> .............)));
Thanks for your help and time. | c# | linq | c#-4.0 | linq-to-objects | null | null | open | Copy one List to another List and SubList with LINQ
===
I have a list of employees, and all of them have another list nested which is called the EmployeeValuesCollection.
So my class is something like :-
public Employee(int employeeID, string jobTitle, int companyID, List<EmployeeValues> employeeValuesCollection)
{
EmployeeID = employeeID;
JobTitle = jobTitle;
CompanyID = companyID;
EmployeeValuesCollection = employeeValuesCollection;
}
Now I wish to populate this object from another object with LINQ, and so far I have :-
List<DataFileRow> dataFiles = dfRow.Rows;
dataFiles.ForEach(l => employeeList.Add(new Employee(l.EmpID, l.JobTitle, l.CompID)));
That works however I do not know how to add the employeeValuesCollection in the statement. Is it possible to do?
So I was thinking something like :-
dataFiles.ForEach(l => employeeList.Add(new Employee(l.EmpID, l.JobTitle, l.CompID, new List<EmployeeValuesCollection> .............)));
Thanks for your help and time. | 0 |
9,975,279 | 04/02/2012 11:07:15 | 1,005,335 | 10/20/2011 13:50:35 | 188 | 2 | Open a file in c# | I am wondering when why I try to read all the files in a folder, if the name is index.html, nothing is happening, It's not even opening the file in the browser ...
Can someone help me ?
This is the code I use .
foreach (System.IO.FileInfo thefile in fiArr)
{
if (thefile.Name == "index.html")
{
FileStream fileStream = new FileStream(path + thefile.Name, FileMode.Open, FileAccess.Read);
}
} | c# | asp.net | file | io | null | 04/03/2012 11:09:35 | not a real question | Open a file in c#
===
I am wondering when why I try to read all the files in a folder, if the name is index.html, nothing is happening, It's not even opening the file in the browser ...
Can someone help me ?
This is the code I use .
foreach (System.IO.FileInfo thefile in fiArr)
{
if (thefile.Name == "index.html")
{
FileStream fileStream = new FileStream(path + thefile.Name, FileMode.Open, FileAccess.Read);
}
} | 1 |
11,229,498 | 06/27/2012 15:14:24 | 901,336 | 08/18/2011 20:14:14 | 35 | 0 | Trouble with CSS sprites in sharepoint 2007 | I am trying to reduce the overall number of images on my site so I have implemented a css sprite menu. This code works fine in Internet Explorer 8 on my desktop, and when I implemented the code to sharepoint 2007 it works fine when using FireFox, but not for ie8 for some reason. Is there any known fixes or bugs with css in sharepoint 2007 when using ie8? I just find it odd that it only wont work with MOSS2007 and ie8 combined.
Heres the code:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#navlist{position:relative;}
#navlist li{margin:0;padding:0;list-style:none;position:absolute;}
#navlist li, #navlist a{height:150px;display:block;}
#exec{left:0px;width:428px;}
#exec{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px 0px;}
#exec a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -299px;}
#bgcn{left:430px;width:428px;}
#bgcn{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px 0px;}
#bgcn a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -299px;}
#tria{left:0px;width:428px;top:150px;}
#tria{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -150px;}
#tria a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -450px;}
#rprt{left:430px;width:428px;top:150px}
#rprt{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -150px;}
#rprt a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -450px;}
</style>
</head>
<body>
<ul id="navlist">
<li id="exec"><a href="css_syntax.asp"></a></li>
<li id="bgcn"><a href="css_syntax.asp"></a></li>
<li id="tria"><a href="css_syntax.asp"></a></li>
<li id="rprt"><a href="whatever.com"></a></li>
</ul>
<li id="rprt"><a href="css_syntax.asp"></a></li>
</body>
</html>
Thanks, | html | css | sharepoint | null | null | null | open | Trouble with CSS sprites in sharepoint 2007
===
I am trying to reduce the overall number of images on my site so I have implemented a css sprite menu. This code works fine in Internet Explorer 8 on my desktop, and when I implemented the code to sharepoint 2007 it works fine when using FireFox, but not for ie8 for some reason. Is there any known fixes or bugs with css in sharepoint 2007 when using ie8? I just find it odd that it only wont work with MOSS2007 and ie8 combined.
Heres the code:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#navlist{position:relative;}
#navlist li{margin:0;padding:0;list-style:none;position:absolute;}
#navlist li, #navlist a{height:150px;display:block;}
#exec{left:0px;width:428px;}
#exec{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px 0px;}
#exec a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -299px;}
#bgcn{left:430px;width:428px;}
#bgcn{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px 0px;}
#bgcn a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -299px;}
#tria{left:0px;width:428px;top:150px;}
#tria{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -150px;}
#tria a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') 0px -450px;}
#rprt{left:430px;width:428px;top:150px}
#rprt{background:url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -150px;}
#rprt a:hover{background: url('../imgz/CurrentDefaultButtons/defaultMasterImage.jpeg') -430px -450px;}
</style>
</head>
<body>
<ul id="navlist">
<li id="exec"><a href="css_syntax.asp"></a></li>
<li id="bgcn"><a href="css_syntax.asp"></a></li>
<li id="tria"><a href="css_syntax.asp"></a></li>
<li id="rprt"><a href="whatever.com"></a></li>
</ul>
<li id="rprt"><a href="css_syntax.asp"></a></li>
</body>
</html>
Thanks, | 0 |
11,438,227 | 07/11/2012 17:33:43 | 1,480,041 | 06/25/2012 12:54:53 | 22 | 0 | Need to search for a specific file and see if it is increasing in size in perl | I need to first search for a file, then see if it is increasing. Basically my plan is to do a find, then get it's size. sleep for 30 seconds and repeat the procedure and compare the sizes. I don't really know where to start. I'm not too familiar with the syntax | perl | search | null | null | null | 07/11/2012 21:53:52 | not a real question | Need to search for a specific file and see if it is increasing in size in perl
===
I need to first search for a file, then see if it is increasing. Basically my plan is to do a find, then get it's size. sleep for 30 seconds and repeat the procedure and compare the sizes. I don't really know where to start. I'm not too familiar with the syntax | 1 |
8,265,026 | 11/25/2011 05:13:34 | 862,663 | 07/26/2011 03:09:34 | 43 | 4 | Why isn't this toggling? | I'm trying to get #content to toggle, but it won't work.
$("button").click(function () {
$("#content").slideToggle("slow");
});
<div id="container">
<button>toggggle</button>
<?php get_sidebar(); ?>
<div id="content"> | jquery | null | null | null | null | 11/25/2011 21:39:35 | not a real question | Why isn't this toggling?
===
I'm trying to get #content to toggle, but it won't work.
$("button").click(function () {
$("#content").slideToggle("slow");
});
<div id="container">
<button>toggggle</button>
<?php get_sidebar(); ?>
<div id="content"> | 1 |
6,908,634 | 08/02/2011 07:32:41 | 871,894 | 07/31/2011 20:22:30 | 21 | 2 | What programming language can be run on any operating system without installing any framework? | I write a program on C#, but in order to run the application .NET framework is needed and I'm have no authority to install any program on systems (most of them are XP),
I want to know is any way to run C# application without .NET framework?(I search stackoverflow and google and most of people say NO, but I ask again for a little hope!)
If above question in NO, what language is very similar to C# and there is no other program to be installed to run. (most of my systems are XP SP1)
Best Regards. | c# | .net | null | null | null | 08/02/2011 07:40:37 | not constructive | What programming language can be run on any operating system without installing any framework?
===
I write a program on C#, but in order to run the application .NET framework is needed and I'm have no authority to install any program on systems (most of them are XP),
I want to know is any way to run C# application without .NET framework?(I search stackoverflow and google and most of people say NO, but I ask again for a little hope!)
If above question in NO, what language is very similar to C# and there is no other program to be installed to run. (most of my systems are XP SP1)
Best Regards. | 4 |
8,095,938 | 11/11/2011 15:11:33 | 475,821 | 10/14/2010 13:32:59 | 56 | 4 | Inserting many objects in CoreData | I am trying to insert about 400 objects in CoreData with in memory storage, but it is to long. For about 20-30 seconds. Is it normal? May be exists some special case for many insertions? | iphone | ios | core-data | insert | null | null | open | Inserting many objects in CoreData
===
I am trying to insert about 400 objects in CoreData with in memory storage, but it is to long. For about 20-30 seconds. Is it normal? May be exists some special case for many insertions? | 0 |
6,126,227 | 05/25/2011 14:40:14 | 769,777 | 05/25/2011 14:38:38 | 1 | 0 | C++: Templating throws out a lot of errors | this has been torturing me for the last 24 hours now.
I am creating a helper namespace for one of my projects, i wanted it to be able to use all types like ints, floats, doubles etc. But it seems like i just cant get the templating right.
Anyways, here is my current code, my compiler doesn't spit out errors about the file itself, though when i compile it it spits out hundreds of errors in other files.
These errors aren't there when i remove the templating in the file:
#include "..\util\Logger.hpp"
namespace gm
{
namespace math
{
namespace MathHelper
{
// Value of Pi
const double PI = 3.1415926535897932384626433832795028841972;
// Value of euler
const double E = 2.7182818284590452353602874713526624977572;
// Convert radians to degrees
template <typename T>
T Rad2Deg(T angle)
{
return angle * (180 / (T)PI);
}
// Convert degrees to radians
template <typename T>
T Deg2Rad(T angle)
{
return angle * ((T)PI / 180);
}
// Clamp a value in between the given min and max
template <typename T>
T Clamp(T value, T min, T max)
{
if(min > max) { gm::util::Logger::DisplayError("Invalid argument in MathHelper::Clamp, max is over min"); }
if(value < min) { value = min; }
if(value > max) { value = max; }
return value;
}
// Exponentiate value a with value b
template <typename T>
T Exp(T a, int b)
{
if(b < 0) { gm::util::Logger::DisplayError("Invalid argument in MathHelper::Exp, b must be positive"); }
T value = a;
for(int i = 1; i < b; i++) { value *= a; }
return value;
}
// Get the absolute value of the value passed
template <typename T>
T Abs(T a, T b)
{
if(value < 0) { value = -value;
return value;
}
};
};
};
In advance, thanks | c++ | templates | null | null | null | null | open | C++: Templating throws out a lot of errors
===
this has been torturing me for the last 24 hours now.
I am creating a helper namespace for one of my projects, i wanted it to be able to use all types like ints, floats, doubles etc. But it seems like i just cant get the templating right.
Anyways, here is my current code, my compiler doesn't spit out errors about the file itself, though when i compile it it spits out hundreds of errors in other files.
These errors aren't there when i remove the templating in the file:
#include "..\util\Logger.hpp"
namespace gm
{
namespace math
{
namespace MathHelper
{
// Value of Pi
const double PI = 3.1415926535897932384626433832795028841972;
// Value of euler
const double E = 2.7182818284590452353602874713526624977572;
// Convert radians to degrees
template <typename T>
T Rad2Deg(T angle)
{
return angle * (180 / (T)PI);
}
// Convert degrees to radians
template <typename T>
T Deg2Rad(T angle)
{
return angle * ((T)PI / 180);
}
// Clamp a value in between the given min and max
template <typename T>
T Clamp(T value, T min, T max)
{
if(min > max) { gm::util::Logger::DisplayError("Invalid argument in MathHelper::Clamp, max is over min"); }
if(value < min) { value = min; }
if(value > max) { value = max; }
return value;
}
// Exponentiate value a with value b
template <typename T>
T Exp(T a, int b)
{
if(b < 0) { gm::util::Logger::DisplayError("Invalid argument in MathHelper::Exp, b must be positive"); }
T value = a;
for(int i = 1; i < b; i++) { value *= a; }
return value;
}
// Get the absolute value of the value passed
template <typename T>
T Abs(T a, T b)
{
if(value < 0) { value = -value;
return value;
}
};
};
};
In advance, thanks | 0 |
4,473,844 | 12/17/2010 18:55:02 | 140,652 | 07/18/2009 13:07:49 | 155 | 4 | Outlook macro to prompt user info | I want to create a macro for Outlook that will prompt the user to enter their name in an input box, when they hit Send. Once they input the info and click Ok, I want to Append the name to the end of the message and then let the message go. Any ideas? | outlook | outlook-addin | outlook-2007 | outlook-2003 | outlook-vba | null | open | Outlook macro to prompt user info
===
I want to create a macro for Outlook that will prompt the user to enter their name in an input box, when they hit Send. Once they input the info and click Ok, I want to Append the name to the end of the message and then let the message go. Any ideas? | 0 |
6,501,001 | 06/28/2011 02:41:04 | 807,771 | 06/21/2011 04:33:15 | 21 | 0 | how i can make my web site refresh or reload by itself in (HTML) code ? | i need make my web sity refresh itself every 5 min in HTML code
i'm using PHP also | php | html | null | null | null | 06/28/2011 03:31:45 | not a real question | how i can make my web site refresh or reload by itself in (HTML) code ?
===
i need make my web sity refresh itself every 5 min in HTML code
i'm using PHP also | 1 |
10,934,137 | 06/07/2012 14:44:21 | 1,442,496 | 06/07/2012 14:36:55 | 1 | 0 | Xcode/objective-C 2 button combo | The application I'm working on is a stat app for the iPad. There are buttons going down the center of the screen. These buttons in the middle say goal or goalie save and such. Since i wanted them to work for both teams i decided a nice feature would be to click a middle button, then drag my finger to the upper left or right corner which i have labeled home and away. These corners are currently buttons but really just need to register a drag in. So when someone clicks a button and drags their finger to the upper left corner they add 1 to the home team and if they move it to the right then away team.
I need to click a button and drag the finger to another button, and then let up the finger to create an ibaction.
Some ways this is possible, maybe clicking a middle button leads to an if statement. But how do i:
if(buttonispressed){blah;}
this is to prevent from accidentally hitting a button and more, please help
what do i replace for button is pressed.
anything similar like locking a button on and then allowing one of the corner buttons to be hit after, just anything similar to a 2 button combo would help. | iphone | objective-c | ios | xcode | ipad | 06/09/2012 18:46:27 | not a real question | Xcode/objective-C 2 button combo
===
The application I'm working on is a stat app for the iPad. There are buttons going down the center of the screen. These buttons in the middle say goal or goalie save and such. Since i wanted them to work for both teams i decided a nice feature would be to click a middle button, then drag my finger to the upper left or right corner which i have labeled home and away. These corners are currently buttons but really just need to register a drag in. So when someone clicks a button and drags their finger to the upper left corner they add 1 to the home team and if they move it to the right then away team.
I need to click a button and drag the finger to another button, and then let up the finger to create an ibaction.
Some ways this is possible, maybe clicking a middle button leads to an if statement. But how do i:
if(buttonispressed){blah;}
this is to prevent from accidentally hitting a button and more, please help
what do i replace for button is pressed.
anything similar like locking a button on and then allowing one of the corner buttons to be hit after, just anything similar to a 2 button combo would help. | 1 |
11,488,583 | 07/15/2012 01:01:18 | 1,355,207 | 04/25/2012 03:53:08 | 36 | 1 | Automatic FormsAuthentication.Signout() when user close tab in asp.net | How to make automatic FormsAuthentication.Signout() when user close the tab/pages in asp.net C# | c# | asp.net | null | null | null | 07/16/2012 09:44:50 | not a real question | Automatic FormsAuthentication.Signout() when user close tab in asp.net
===
How to make automatic FormsAuthentication.Signout() when user close the tab/pages in asp.net C# | 1 |
8,497,995 | 12/14/2011 00:01:55 | 1,096,822 | 12/13/2011 23:48:10 | 1 | 0 | jQuery UI droppable Not Working | so I just starting using UI today for the first time. I am trying to make a form building tool. Anyways, everything was working just fine. I was able to drag my first icon and drop it on the main form body, just fine. When I do this, it appends a new div of class panel. I make panel droppable as well, however when I try to drop something on it nothing happens. If I hard code the div in it works fine, however when I append the div it does not. I'm having a lot of trouble figuring this out, and any help would be much appreciated. Here's my code:
<html>
<head>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.16.min.js"></script>
<style type="text/css">
#toolbox
{
width: 100%;
height: 200px;
position: fixed;
top: 0;
left: 0;
background-color: #666666;
z-index: 2;
}
.icon
{
padding-top: 20px;
padding-left: 20px;
text-align: center;
display: table-cell;
}
#formbuilder
{
width: 100%;
position: absolute;
top: 200px;
left: 0px;
bottom: 0px;
padding-top: 5%;
background-color: orange;
opacity: 0.4;
overflow: visible;
}
.panel
{
margin: 0 auto;
margin-bottom: 20px;
height: 150px;
width: 150px;
background-color: blue;
opacity: 0.4;
}
</style>
</head>
<body>
<script type="text/javascript">
function formDropHandler(event, ui)
{
if(ui.draggable.hasClass("pan"))
{
var form = $("#formbuilder");
form.append('<div class="panel ui-droppable"></div>');
$(".panel").droppable({
drop: panelDropHandler
});
}
}
function panelDropHandler(event, ui)
{
if(ui.draggable.hasClass("tab")) alert("TRUE");
}
$(document).ready(function() {
var icons = $('.icon');
$('.icon').draggable({
cursor: 'move',
helper: 'clone',
revert: true
});
$(".panel").droppable({
drop: panelDropHandler
});
$("#formbuilder").droppable({
drop: formDropHandler
});
});
</script>
<div id="toolbox">
<div class="icon pan">Panel<br /><img src="panel.png" alt="PANEL.PNG" /></div>
<div class="icon tab">Table<br /><img src="table.png" alt="TABLE.PNG" /></div>
</div>
<div id="formbuilder">
<div class="panel"></div>
<div class="panel"></div>
</div>
</body>
</html>
| javascript | jquery | html | css | null | null | open | jQuery UI droppable Not Working
===
so I just starting using UI today for the first time. I am trying to make a form building tool. Anyways, everything was working just fine. I was able to drag my first icon and drop it on the main form body, just fine. When I do this, it appends a new div of class panel. I make panel droppable as well, however when I try to drop something on it nothing happens. If I hard code the div in it works fine, however when I append the div it does not. I'm having a lot of trouble figuring this out, and any help would be much appreciated. Here's my code:
<html>
<head>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.16.min.js"></script>
<style type="text/css">
#toolbox
{
width: 100%;
height: 200px;
position: fixed;
top: 0;
left: 0;
background-color: #666666;
z-index: 2;
}
.icon
{
padding-top: 20px;
padding-left: 20px;
text-align: center;
display: table-cell;
}
#formbuilder
{
width: 100%;
position: absolute;
top: 200px;
left: 0px;
bottom: 0px;
padding-top: 5%;
background-color: orange;
opacity: 0.4;
overflow: visible;
}
.panel
{
margin: 0 auto;
margin-bottom: 20px;
height: 150px;
width: 150px;
background-color: blue;
opacity: 0.4;
}
</style>
</head>
<body>
<script type="text/javascript">
function formDropHandler(event, ui)
{
if(ui.draggable.hasClass("pan"))
{
var form = $("#formbuilder");
form.append('<div class="panel ui-droppable"></div>');
$(".panel").droppable({
drop: panelDropHandler
});
}
}
function panelDropHandler(event, ui)
{
if(ui.draggable.hasClass("tab")) alert("TRUE");
}
$(document).ready(function() {
var icons = $('.icon');
$('.icon').draggable({
cursor: 'move',
helper: 'clone',
revert: true
});
$(".panel").droppable({
drop: panelDropHandler
});
$("#formbuilder").droppable({
drop: formDropHandler
});
});
</script>
<div id="toolbox">
<div class="icon pan">Panel<br /><img src="panel.png" alt="PANEL.PNG" /></div>
<div class="icon tab">Table<br /><img src="table.png" alt="TABLE.PNG" /></div>
</div>
<div id="formbuilder">
<div class="panel"></div>
<div class="panel"></div>
</div>
</body>
</html>
| 0 |
10,948,773 | 06/08/2012 12:21:50 | 1,100,014 | 12/15/2011 14:03:28 | 13 | 0 | CSS to be changed to be compatible with all the browsers | html, body {
margin: 0px;
padding: 0px;
font: normal 14px/16px Helvetica, Sans-serif;
}
body {
background: #cbd2d8;
background-image:
-webkit-gradient(linear, left top, right top,
from(#c5ccd4),
color-stop(0.75, #c5ccd4),
color-stop(0.75, transparent),
to(transparent));
-webkit-background-size: 5px 100%;
background-size: 5px 100%;
-webkit-user-select: none;
}
header.navigation-bar {
position: relative;
width: 10display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack:justify;
-webkit-box-sizing: border-box;0%;
height: 45px;
padding: 6px 10px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#b2bbca),
color-stop(0.25, #a7b0c3),
color-stop(0.5, #909cb3),
color-stop(0.5, #8593ac),
color-stop(0.75, #7c8ba5),
to(#73839f));
border-top: 1px solid #cdd5df;
border-bottom: 1px solid #2d3642;
}
header.navigation-bar.black {
position: relative;
width: 100%;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack:justify;
-webkit-box-sizing: border-box;
height: 45px;
padding: 6px 10px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#636363),
color-stop(0.25, #424242),
color-stop(0.5, #202020),
color-stop(0.5, #000000));
border-top: 1px solid #858585;
border-bottom: 1px solid #858585;
}
h1 {
-webkit-box-flex: 1;
text-align: center;
margin: 0px;
font: bold 20px/32px Helvetica, Sans-serif;
letter-spacing: -1px;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.5);
color: #fff;
}
h2 {
font-size: 16px;
line-height: 22px;
text-shadow: 0 -1px 1px #fff;
color: #666;
text-align: center;
}
/* Bordered Button Styles */
.button.bordered {
-webkit-box-shadow: 0 1px 1px #9aa5bb, 0 -1px 1px #8e96a5;
border: solid 1px #54617d;
border-color: #484e59 #54617d #4c5c7a #54617d;
display: inline-block;
cursor: pointer;
padding: 0px 10px;
font-size: 12px;
line-height: 28px;
height: 30px;
margin-top: 1px;
-webkit-box-sizing: border-box;
-webkit-border-radius: 5px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#92a1bf),
color-stop(0.25, #798aad),
color-stop(0.5, #6276a0),
color-stop(0.5, #556a97),
color-stop(0.75, #566c98),
to(#546993));
color: #fff;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
}
.button.bordered:hover, .button.bordered.touched {
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#7d88a5),
color-stop(0.25, #58698c),
color-stop(0.5, #3a4e78),
color-stop(0.5, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
-webkit-tap-highlight-color: transparent;
}
/* End Bordered Button Styles */
/* Back Bordered Button Styles */
.button.bordered.back {
padding: 0px 7px 0px 3px;
margin-left: 10px;
position: relative;
}
.button.bordered.back > span {
position: relative;
z-index: 1;
}
.button.bordered.back > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#92a1bf),
color-stop(0.3, #798aad),
color-stop(0.51, #6276a0),
color-stop(0.51, #556a97),
color-stop(0.75, #566c98),
to(#546993));
border-left: solid 1px #484e59;
border-bottom: solid 1px #9aa5bb;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 4px;
height: 23.5px;
width: 23.5px;
display: inline-block;
-webkit-transform: rotate(45deg);
-webkit-mask-image:
-webkit-gradient(linear, left bottom, right top,
from(#000000),
color-stop(0.5,#000000),
color-stop(0.5, transparent),
to(transparent));
position: absolute;
left: -9px;
top: 2.5px;
-webkit-background-clip: content;
}
.button.bordered.back:hover > span.pointer, .button.bordered.back.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#7d88a5),
color-stop(0.3, #58698c),
color-stop(0.51, #3a4e78),
color-stop(0.51, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
}
/* End Back Bordered Button Styles */
/* Next Bordered Button Styles */
.button.bordered.next {
padding: 0px 3px 0px 7px;
margin-right: 10px;
position: relative;
}
.button.bordered.next > span {
position: relative;
z-index: 1;
}
.button.bordered.next > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#92a1bf),
color-stop(0.3, #798aad),
color-stop(0.51, #6276a0),
color-stop(0.51, #556a97),
color-stop(0.75, #566c98),
to(#546993));
border-right: solid 1px #9aa5bb;
border-top: solid 1px #484e59;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-top-right-radius: 4px;
height: 23.5px;
width: 23.5px;
display: inline-block;
-webkit-transform: rotate(45deg);
-webkit-mask-image:
-webkit-gradient(linear, right top, left bottom,
from(#000000),
color-stop(0.5,#000000),
color-stop(0.5, transparent),
to(transparent));
position: absolute;
right: -9px;
top: 2.5px;
-webkit-background-clip: content;
}
.button.bordered.next:hover > span.pointer, .button.bordered.next.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#7d88a5),
color-stop(0.3, #58698c),
color-stop(0.51, #3a4e78),
color-stop(0.51, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
}
/* End Next Bordered Button Styles */
header.navigation-bar.black > .button.bordered {
-webkit-box-shadow: 0 1px 1px #242424, 0 -1px 1px #323232;
border: solid 1px #54617d;
border-color: #404040 #262626 #404040 #262626;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
to(#333333));
}
header.navigation-bar.black > .button.bordered.back > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
color-stop(0.05, #838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
color-stop(0.98, #333333));
border-left: solid 1px #262626;
border-bottom: solid 1px #404040;
top: 2.35px;
}
header.navigation-bar.black > .button.bordered.next > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
color-stop(0.05, #838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
color-stop(0.98, #333333));
border-right: solid 1px #404040;
border-top: solid 1px #262626;
top: 2.35px;
}
header.navigation-bar.black > .button.bordered:hover, header.navigation-bar.black > .button.bordered.touched {
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#4286f5),
color-stop(0.5, #4286f5),
color-stop(0.5, #194fdb),
to(#194fdb));
-webkit-tap-highlight-color: transparent;
}
header.navigation-bar.black > .button.bordered.back:hover > span.pointer, header.navigation-bar.black > .button.back.touched > span.pointer, header.navigation-bar.black > .button.bordered.next:hover > span.pointer, header.navigation-bar.black > .button.next.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#4286f5),
color-stop(0.5, #4286f5),
color-stop(0.5, #194fdb),
to(#194fdb));
}
Hi,
This is the css for a header and its button. it is styled to be like iPhone header and button. However, it only works in chrome or safari (webkit based browsers).I want this code to converted for it to work in mozilla and IE also..please help | css | css3 | null | null | null | 06/09/2012 04:20:54 | not a real question | CSS to be changed to be compatible with all the browsers
===
html, body {
margin: 0px;
padding: 0px;
font: normal 14px/16px Helvetica, Sans-serif;
}
body {
background: #cbd2d8;
background-image:
-webkit-gradient(linear, left top, right top,
from(#c5ccd4),
color-stop(0.75, #c5ccd4),
color-stop(0.75, transparent),
to(transparent));
-webkit-background-size: 5px 100%;
background-size: 5px 100%;
-webkit-user-select: none;
}
header.navigation-bar {
position: relative;
width: 10display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack:justify;
-webkit-box-sizing: border-box;0%;
height: 45px;
padding: 6px 10px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#b2bbca),
color-stop(0.25, #a7b0c3),
color-stop(0.5, #909cb3),
color-stop(0.5, #8593ac),
color-stop(0.75, #7c8ba5),
to(#73839f));
border-top: 1px solid #cdd5df;
border-bottom: 1px solid #2d3642;
}
header.navigation-bar.black {
position: relative;
width: 100%;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack:justify;
-webkit-box-sizing: border-box;
height: 45px;
padding: 6px 10px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#636363),
color-stop(0.25, #424242),
color-stop(0.5, #202020),
color-stop(0.5, #000000));
border-top: 1px solid #858585;
border-bottom: 1px solid #858585;
}
h1 {
-webkit-box-flex: 1;
text-align: center;
margin: 0px;
font: bold 20px/32px Helvetica, Sans-serif;
letter-spacing: -1px;
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.5);
color: #fff;
}
h2 {
font-size: 16px;
line-height: 22px;
text-shadow: 0 -1px 1px #fff;
color: #666;
text-align: center;
}
/* Bordered Button Styles */
.button.bordered {
-webkit-box-shadow: 0 1px 1px #9aa5bb, 0 -1px 1px #8e96a5;
border: solid 1px #54617d;
border-color: #484e59 #54617d #4c5c7a #54617d;
display: inline-block;
cursor: pointer;
padding: 0px 10px;
font-size: 12px;
line-height: 28px;
height: 30px;
margin-top: 1px;
-webkit-box-sizing: border-box;
-webkit-border-radius: 5px;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#92a1bf),
color-stop(0.25, #798aad),
color-stop(0.5, #6276a0),
color-stop(0.5, #556a97),
color-stop(0.75, #566c98),
to(#546993));
color: #fff;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
}
.button.bordered:hover, .button.bordered.touched {
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#7d88a5),
color-stop(0.25, #58698c),
color-stop(0.5, #3a4e78),
color-stop(0.5, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
-webkit-tap-highlight-color: transparent;
}
/* End Bordered Button Styles */
/* Back Bordered Button Styles */
.button.bordered.back {
padding: 0px 7px 0px 3px;
margin-left: 10px;
position: relative;
}
.button.bordered.back > span {
position: relative;
z-index: 1;
}
.button.bordered.back > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#92a1bf),
color-stop(0.3, #798aad),
color-stop(0.51, #6276a0),
color-stop(0.51, #556a97),
color-stop(0.75, #566c98),
to(#546993));
border-left: solid 1px #484e59;
border-bottom: solid 1px #9aa5bb;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 4px;
height: 23.5px;
width: 23.5px;
display: inline-block;
-webkit-transform: rotate(45deg);
-webkit-mask-image:
-webkit-gradient(linear, left bottom, right top,
from(#000000),
color-stop(0.5,#000000),
color-stop(0.5, transparent),
to(transparent));
position: absolute;
left: -9px;
top: 2.5px;
-webkit-background-clip: content;
}
.button.bordered.back:hover > span.pointer, .button.bordered.back.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#7d88a5),
color-stop(0.3, #58698c),
color-stop(0.51, #3a4e78),
color-stop(0.51, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
}
/* End Back Bordered Button Styles */
/* Next Bordered Button Styles */
.button.bordered.next {
padding: 0px 3px 0px 7px;
margin-right: 10px;
position: relative;
}
.button.bordered.next > span {
position: relative;
z-index: 1;
}
.button.bordered.next > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#92a1bf),
color-stop(0.3, #798aad),
color-stop(0.51, #6276a0),
color-stop(0.51, #556a97),
color-stop(0.75, #566c98),
to(#546993));
border-right: solid 1px #9aa5bb;
border-top: solid 1px #484e59;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-top-right-radius: 4px;
height: 23.5px;
width: 23.5px;
display: inline-block;
-webkit-transform: rotate(45deg);
-webkit-mask-image:
-webkit-gradient(linear, right top, left bottom,
from(#000000),
color-stop(0.5,#000000),
color-stop(0.5, transparent),
to(transparent));
position: absolute;
right: -9px;
top: 2.5px;
-webkit-background-clip: content;
}
.button.bordered.next:hover > span.pointer, .button.bordered.next.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#7d88a5),
color-stop(0.3, #58698c),
color-stop(0.51, #3a4e78),
color-stop(0.51, #253c6a),
color-stop(0.75, #273f6d),
to(#273f6d));
}
/* End Next Bordered Button Styles */
header.navigation-bar.black > .button.bordered {
-webkit-box-shadow: 0 1px 1px #242424, 0 -1px 1px #323232;
border: solid 1px #54617d;
border-color: #404040 #262626 #404040 #262626;
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
to(#333333));
}
header.navigation-bar.black > .button.bordered.back > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
color-stop(0.05, #838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
color-stop(0.98, #333333));
border-left: solid 1px #262626;
border-bottom: solid 1px #404040;
top: 2.35px;
}
header.navigation-bar.black > .button.bordered.next > span.pointer {
z-index: 0;
background-image:
-webkit-gradient(linear, left top, right bottom,
color-stop(0.05, #838383),
color-stop(0.5, #444444),
color-stop(0.5, #303030),
color-stop(0.98, #333333));
border-right: solid 1px #404040;
border-top: solid 1px #262626;
top: 2.35px;
}
header.navigation-bar.black > .button.bordered:hover, header.navigation-bar.black > .button.bordered.touched {
background-image:
-webkit-gradient(linear, left top, left bottom,
from(#4286f5),
color-stop(0.5, #4286f5),
color-stop(0.5, #194fdb),
to(#194fdb));
-webkit-tap-highlight-color: transparent;
}
header.navigation-bar.black > .button.bordered.back:hover > span.pointer, header.navigation-bar.black > .button.back.touched > span.pointer, header.navigation-bar.black > .button.bordered.next:hover > span.pointer, header.navigation-bar.black > .button.next.touched > span.pointer {
background-image:
-webkit-gradient(linear, left top, right bottom,
from(#4286f5),
color-stop(0.5, #4286f5),
color-stop(0.5, #194fdb),
to(#194fdb));
}
Hi,
This is the css for a header and its button. it is styled to be like iPhone header and button. However, it only works in chrome or safari (webkit based browsers).I want this code to converted for it to work in mozilla and IE also..please help | 1 |
5,530,681 | 04/03/2011 15:57:24 | 527,298 | 12/01/2010 23:15:11 | 236 | 11 | Normalize an Address | I am trying to normalize an address.
The diagram below shows the relevant tables for this question I believe. I want to know how ZipCodes should be integrated into the model. This would be for international addresses so I know that a Zip/PostalCode is not used everywhere. I know City::ZipCode is 1::0-n. Since each Address can only have at most one ZipCode (I believe even though I have read others saying this is not always the case without providing evidence) while a ZipCode can contain many addresses I am lost at how to normalize this model.
Since the Address may or may not contain a contain a ZipCode I need to refrain from having that as a nullable FK in the Address table.
![enter image description here][1]
[1]: http://i.stack.imgur.com/dNVJx.png | database | database-design | relational-database | normalization | zipcode | null | open | Normalize an Address
===
I am trying to normalize an address.
The diagram below shows the relevant tables for this question I believe. I want to know how ZipCodes should be integrated into the model. This would be for international addresses so I know that a Zip/PostalCode is not used everywhere. I know City::ZipCode is 1::0-n. Since each Address can only have at most one ZipCode (I believe even though I have read others saying this is not always the case without providing evidence) while a ZipCode can contain many addresses I am lost at how to normalize this model.
Since the Address may or may not contain a contain a ZipCode I need to refrain from having that as a nullable FK in the Address table.
![enter image description here][1]
[1]: http://i.stack.imgur.com/dNVJx.png | 0 |
5,177,277 | 03/03/2011 06:05:15 | 642,440 | 03/03/2011 05:44:22 | 1 | 1 | Why does LINQ Date Column comparison not work? | For a LINQ query like:
var entities = from Account p in context.Accounts
where p.LastTimeServerSettingsChanged > p.LastTimeDeviceConnected
select p;
the query that is generated is:
SELECT
[Extent1].[Username] AS [Username],
[Extent1].[LastTimeDeviceConnected] AS [LastTimeDeviceConnected],
[Extent1].[LastTimeServerSettingsChanged] AS [LastTimeServerSettingsChanged]
FROM [dbo].[Policy] AS [Extent1]
WHERE [Extent1].[LastTimeServerSettingsChanged] > [Extent1].[LastTimeDeviceConnected]
And this does not work (no results).
My question is why, and how can this query be performed (using LINQ)? | linq | linq-to-sql | datetime | linq-to-entities | null | null | open | Why does LINQ Date Column comparison not work?
===
For a LINQ query like:
var entities = from Account p in context.Accounts
where p.LastTimeServerSettingsChanged > p.LastTimeDeviceConnected
select p;
the query that is generated is:
SELECT
[Extent1].[Username] AS [Username],
[Extent1].[LastTimeDeviceConnected] AS [LastTimeDeviceConnected],
[Extent1].[LastTimeServerSettingsChanged] AS [LastTimeServerSettingsChanged]
FROM [dbo].[Policy] AS [Extent1]
WHERE [Extent1].[LastTimeServerSettingsChanged] > [Extent1].[LastTimeDeviceConnected]
And this does not work (no results).
My question is why, and how can this query be performed (using LINQ)? | 0 |
4,606,970 | 01/05/2011 17:12:47 | 217,992 | 11/24/2009 17:43:37 | 271 | 17 | setting timeout for a long running WCF Service | I have a WCF service method which takes more than two hours to execute (runs some reports). how can I make sure that it doesn't timeout regardless of the time it takes? I think there are many timeout settings in WCF config, I am not sure which one is relevant for me. for ASMX webservices, there was an option to specify infinite timeout setting, is there a similar one for WCF?. also do I need to alter any IIS settings for this (WCF servcie is hosted in IIS), like recycling of worker processes, idle timeouts etc? | iis | timeout | wcf | null | null | null | open | setting timeout for a long running WCF Service
===
I have a WCF service method which takes more than two hours to execute (runs some reports). how can I make sure that it doesn't timeout regardless of the time it takes? I think there are many timeout settings in WCF config, I am not sure which one is relevant for me. for ASMX webservices, there was an option to specify infinite timeout setting, is there a similar one for WCF?. also do I need to alter any IIS settings for this (WCF servcie is hosted in IIS), like recycling of worker processes, idle timeouts etc? | 0 |
8,530,517 | 12/16/2011 06:20:00 | 1,101,358 | 12/16/2011 06:16:35 | 1 | 0 | Interested in doing gui programming and IDE programming | I was wondering if anyone knows what the category for learning how to make IDE and code completion and if there are any good books or resources for creating it? thanks | gui | ide | completion | null | null | 12/17/2011 07:09:09 | not constructive | Interested in doing gui programming and IDE programming
===
I was wondering if anyone knows what the category for learning how to make IDE and code completion and if there are any good books or resources for creating it? thanks | 4 |
2,905,838 | 05/25/2010 14:57:56 | 72,937 | 03/02/2009 19:48:50 | 93 | 8 | How to prevent the user from leaving the page | I am currently building a registration site where if the user leaves, I want to pop up a CSS box asking him if he is sure or not. I can accomplish this feat using confirm boxes, but the client says that they are too ugly. I've tried using unload and beforeunload, but both cannot stop the page from being redirected. Using those to events, I return false, so maybe there's a way to cancel other than returning false?
Another solution that I've had was redirecting them to another page that has my popup, but the problem with that is that if they do want to leave the page, and it wasn't a mistake, they lose the page they were originally trying to go to. If I was a user, that would irritate me.
The last solution was real popup window. The only thing I don't like about that is that the main winow will have their destination page while the pop will have my page. In my opinion it looks disjoint. On top of that, I'd be worried about popup blockers. | javascript | javascript-events | null | null | null | 02/28/2012 14:22:24 | not constructive | How to prevent the user from leaving the page
===
I am currently building a registration site where if the user leaves, I want to pop up a CSS box asking him if he is sure or not. I can accomplish this feat using confirm boxes, but the client says that they are too ugly. I've tried using unload and beforeunload, but both cannot stop the page from being redirected. Using those to events, I return false, so maybe there's a way to cancel other than returning false?
Another solution that I've had was redirecting them to another page that has my popup, but the problem with that is that if they do want to leave the page, and it wasn't a mistake, they lose the page they were originally trying to go to. If I was a user, that would irritate me.
The last solution was real popup window. The only thing I don't like about that is that the main winow will have their destination page while the pop will have my page. In my opinion it looks disjoint. On top of that, I'd be worried about popup blockers. | 4 |
6,556,564 | 07/02/2011 10:52:10 | 825,692 | 07/02/2011 01:48:15 | 1 | 0 | How could i Print a block of text in PHP | I have a HTML file which contains a table. Using the "file_get_content()" i am reading the file then. I want to print the table only. How could i do this | php5 | null | null | null | null | null | open | How could i Print a block of text in PHP
===
I have a HTML file which contains a table. Using the "file_get_content()" i am reading the file then. I want to print the table only. How could i do this | 0 |
9,734,151 | 03/16/2012 08:42:12 | 1,036,032 | 11/08/2011 16:38:12 | 115 | 0 | How to be able to identify a constructor using JavaParser? | I am using Java Parser to get information about the method in a source file. I based my implementation as described in [this answer][1] . However the details of constructors are not being given. I think it has to do with how the Java parser works as the normal methods have a return type and the constructor doesn't.
Does anyone know how to be able to also get information of constructors using the Java parser?
[1]: http://stackoverflow.com/questions/7360311/how-to-get-surrounding-method-in-java-source-file-for-a-given-line-number | java | parsing | constructor | null | null | null | open | How to be able to identify a constructor using JavaParser?
===
I am using Java Parser to get information about the method in a source file. I based my implementation as described in [this answer][1] . However the details of constructors are not being given. I think it has to do with how the Java parser works as the normal methods have a return type and the constructor doesn't.
Does anyone know how to be able to also get information of constructors using the Java parser?
[1]: http://stackoverflow.com/questions/7360311/how-to-get-surrounding-method-in-java-source-file-for-a-given-line-number | 0 |
7,366,071 | 09/09/2011 18:42:39 | 921,902 | 08/31/2011 15:18:18 | 6 | 0 | Why I cannot get the passed value(PHP) | I want to pass a value "isProvena" from one file to another.
I use a hidden form t pass the "isProvena" value like this:
if ($_POST['type'] == 'printhpa' || $_POST['type'] == 'printphip' || $_POST['type'] == 'printphys' || $_POST['type'] == 'printprovenahpa')
{
echo "<form action='/content/822' method=post>";
echo "<input type=hidden name=filename value='$filename'>";
echo "<input type=hidden name=content value='";
if ($_POST['type'] == 'printhpa') echo 751;
else if ($_POST['type'] == 'printprovenahpa') echo "<input type=hidden name=isProvena value='1'>";
else if ($_POST['type'] == 'printphip') echo 630;
else if ($_POST['type'] == 'printphys') echo 741;
echo "'>";
echo "<input type=submit value='Start Job'></form>";
}
And I try to get the "isProvena" in another file like this:
$isProvena = false;
extract($_REQUEST, EXTR_IF_EXISTS);
$isProvena = (boolean)$isProvena;
if($isProvena){
echo 'yes';
}else{
echo 'no';
}
Why It always shows no? Anything wrong with it? | php | null | null | null | null | 11/11/2011 09:54:37 | too localized | Why I cannot get the passed value(PHP)
===
I want to pass a value "isProvena" from one file to another.
I use a hidden form t pass the "isProvena" value like this:
if ($_POST['type'] == 'printhpa' || $_POST['type'] == 'printphip' || $_POST['type'] == 'printphys' || $_POST['type'] == 'printprovenahpa')
{
echo "<form action='/content/822' method=post>";
echo "<input type=hidden name=filename value='$filename'>";
echo "<input type=hidden name=content value='";
if ($_POST['type'] == 'printhpa') echo 751;
else if ($_POST['type'] == 'printprovenahpa') echo "<input type=hidden name=isProvena value='1'>";
else if ($_POST['type'] == 'printphip') echo 630;
else if ($_POST['type'] == 'printphys') echo 741;
echo "'>";
echo "<input type=submit value='Start Job'></form>";
}
And I try to get the "isProvena" in another file like this:
$isProvena = false;
extract($_REQUEST, EXTR_IF_EXISTS);
$isProvena = (boolean)$isProvena;
if($isProvena){
echo 'yes';
}else{
echo 'no';
}
Why It always shows no? Anything wrong with it? | 3 |
10,342,623 | 04/26/2012 23:04:25 | 1,277,725 | 03/19/2012 03:00:58 | 3 | 1 | Which programming pattern / framework for intranet | I need an advice on which pattern / framerwork worth for me , I mainly currently work on web forms, for intranet websites on the company I work, I use asp.net 3.5/4 and ADO.NET to get the job done, and ocasionally I use CMSs such as Joomla and WordPress,
I am good at C#, VB, and html, as the new technolofies are comming up, such as linq, entity framework, MVC, etc, I dont know what is best for me and worth learning, for development. | asp.net | asp.net-mvc | asp.net-mvc-3 | entity-framework | webforms | 04/27/2012 07:33:11 | not constructive | Which programming pattern / framework for intranet
===
I need an advice on which pattern / framerwork worth for me , I mainly currently work on web forms, for intranet websites on the company I work, I use asp.net 3.5/4 and ADO.NET to get the job done, and ocasionally I use CMSs such as Joomla and WordPress,
I am good at C#, VB, and html, as the new technolofies are comming up, such as linq, entity framework, MVC, etc, I dont know what is best for me and worth learning, for development. | 4 |
11,071,640 | 06/17/2012 13:30:23 | 1,421,836 | 05/28/2012 13:41:59 | 20 | 0 | Image function that allows images to be cropped and resized in PHP without using so much memory | I've used this code for a while now for a few sites I've built which is great for galleries but it uses up a lot of memory and I keep getting memory allocation errors within the error log. Is there anything that can be changed to make this script better?
<?php
// Smart Image Resizer 1.4.1
// Resizes images, intelligently sharpens, crops based on width:height ratios, color fills
// transparent GIFs and PNGs, and caches variations for optimal performance
// Created by: Joe Lencioni (http://shiftingpixel.com)
// Date: August 6, 2008
// Based on: http://veryraw.com/history/2005/03/image-resizing-with-php/
/////////////////////
// LICENSE
/////////////////////
// I love to hear when my work is being used, so if you decide to use this, feel encouraged
// to send me an email. Smart Image Resizer is released under a Creative Commons
// Attribution-Share Alike 3.0 United States license
// (http://creativecommons.org/licenses/by-sa/3.0/us/). All I ask is that you include a link
// back to Shifting Pixel (either this page or shiftingpixel.com), but don’t worry about
// including a big link on each page if you don’t want to–one will do just nicely. Feel
// free to contact me to discuss any specifics (joe@shiftingpixel.com).
/////////////////////
// REQUIREMENTS
/////////////////////
// PHP and GD
/////////////////////
// PARAMETERS
/////////////////////
// Parameters need to be passed in through the URL's query string:
// image absolute path of local image starting with "/" (e.g. /images/toast.jpg)
// width maximum width of final image in pixels (e.g. 700)
// height maximum height of final image in pixels (e.g. 700)
// color (optional) background hex color for filling transparent PNGs (e.g. 900 or 16a942)
// cropratio (optional) ratio of width to height to crop final image (e.g. 1:1 or 3:2)
// nocache (optional) does not read image from the cache
// quality (optional, 0-100, default: 90) quality of output image
/////////////////////
// EXAMPLES
/////////////////////
// Resizing a JPEG:
// <img src="/image.php/image-name.jpg?width=100&height=100&image=/path/to/image.jpg" alt="Don't forget your alt text" />
// Resizing and cropping a JPEG into a square:
// <img src="/image.php/image-name.jpg?width=100&height=100&cropratio=1:1&image=/path/to/image.jpg" alt="Don't forget your alt text" />
// Matting a PNG with #990000:
// <img src="/image.php/image-name.png?color=900&image=/path/to/image.png" alt="Don't forget your alt text" />
/////////////////////
// CODE STARTS HERE
/////////////////////
if (!isset($_GET['image']))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}
define('MEMORY_TO_ALLOCATE', '100M');
define('DEFAULT_QUALITY', 90);
define('CURRENT_DIR', dirname(__FILE__));
define('CACHE_DIR_NAME', '/imagecache/');
define('CACHE_DIR', CURRENT_DIR . CACHE_DIR_NAME);
define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']);
// Images must be local files, so for convenience we strip the domain if it's there
$image = preg_replace('/^(s?f|ht)tps?:\/\/[^\/]+/i', '', (string) $_GET['image']);
// For security, directories cannot contain ':', images cannot contain '..' or '<', and
// images must start with '/'
if ($image{0} != '/' || strpos(dirname($image), ':') || preg_match('/(\.\.|<|>)/', $image))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: malformed image path. Image paths must begin with \'/\'';
exit();
}
// If the image doesn't exist, or we haven't been told what it is, there's nothing
// that we can do
if (!$image)
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}
// Strip the possible trailing slash off the document root
$docRoot = preg_replace('/\/$/', '', DOCUMENT_ROOT);
if (!file_exists($docRoot . $image))
{
header('HTTP/1.1 404 Not Found');
echo 'Error: image does not exist: ' . $docRoot . $image;
exit();
}
// Get the size and MIME type of the requested image
$size = GetImageSize($docRoot . $image);
$mime = $size['mime'];
// Make sure that the requested file is actually an image
if (substr($mime, 0, 6) != 'image/')
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: requested file is not an accepted type: ' . $docRoot . $image;
exit();
}
$width = $size[0];
$height = $size[1];
$maxWidth = (isset($_GET['width'])) ? (int) $_GET['width'] : 0;
$maxHeight = (isset($_GET['height'])) ? (int) $_GET['height'] : 0;
if (isset($_GET['color']))
$color = preg_replace('/[^0-9a-fA-F]/', '', (string) $_GET['color']);
else
$color = FALSE;
// If either a max width or max height are not specified, we default to something
// large so the unspecified dimension isn't a constraint on our resized image.
// If neither are specified but the color is, we aren't going to be resizing at
// all, just coloring.
if (!$maxWidth && $maxHeight)
{
$maxWidth = 99999999999999;
}
elseif ($maxWidth && !$maxHeight)
{
$maxHeight = 99999999999999;
}
elseif ($color && !$maxWidth && !$maxHeight)
{
$maxWidth = $width;
$maxHeight = $height;
}
// If we don't have a max width or max height, OR the image is smaller than both
// we do not want to resize it, so we simply output the original image and exit
if ((!$maxWidth && !$maxHeight) || (!$color && $maxWidth >= $width && $maxHeight >= $height))
{
$data = file_get_contents($docRoot . '/' . $image);
$lastModifiedString = gmdate('D, d M Y H:i:s', filemtime($docRoot . '/' . $image)) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
exit();
}
// Ratio cropping
$offsetX = 0;
$offsetY = 0;
if (isset($_GET['cropratio']))
{
$cropRatio = explode(':', (string) $_GET['cropratio']);
if (count($cropRatio) == 2)
{
$ratioComputed = $width / $height;
$cropRatioComputed = (float) $cropRatio[0] / (float) $cropRatio[1];
if ($ratioComputed < $cropRatioComputed)
{ // Image is too tall so we will crop the top and bottom
$origHeight = $height;
$height = $width / $cropRatioComputed;
$offsetY = ($origHeight - $height) / 2;
}
else if ($ratioComputed > $cropRatioComputed)
{ // Image is too wide so we will crop off the left and right sides
$origWidth = $width;
$width = $height * $cropRatioComputed;
$offsetX = ($origWidth - $width) / 2;
}
}
}
// Setting up the ratios needed for resizing. We will compare these below to determine how to
// resize the image (based on height or based on width)
$xRatio = $maxWidth / $width;
$yRatio = $maxHeight / $height;
if ($xRatio * $height < $maxHeight)
{ // Resize the image based on width
$tnHeight = ceil($xRatio * $height);
$tnWidth = $maxWidth;
}
else // Resize the image based on height
{
$tnWidth = ceil($yRatio * $width);
$tnHeight = $maxHeight;
}
// Determine the quality of the output image
$quality = (isset($_GET['quality'])) ? (int) $_GET['quality'] : DEFAULT_QUALITY;
// Before we actually do any crazy resizing of the image, we want to make sure that we
// haven't already done this one at these dimensions. To the cache!
// Note, cache must be world-readable
// We store our cached image filenames as a hash of the dimensions and the original filename
$resizedImageSource = $tnWidth . 'x' . $tnHeight . 'x' . $quality;
if ($color)
$resizedImageSource .= 'x' . $color;
if (isset($_GET['cropratio']))
$resizedImageSource .= 'x' . (string) $_GET['cropratio'];
$resizedImageSource .= '-' . $image;
$resizedImage = md5($resizedImageSource);
$resized = CACHE_DIR . $resizedImage;
// Check the modified times of the cached file and the original file.
// If the original file is older than the cached file, then we simply serve up the cached file
if (!isset($_GET['nocache']) && file_exists($resized))
{
$imageModified = filemtime($docRoot . $image);
$thumbModified = filemtime($resized);
if($imageModified < $thumbModified) {
$data = file_get_contents($resized);
$lastModifiedString = gmdate('D, d M Y H:i:s', $thumbModified) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
exit();
}
}
// We don't want to run out of memory
ini_set('memory_limit', MEMORY_TO_ALLOCATE);
// Set up a blank canvas for our resized image (destination)
$dst = imagecreatetruecolor($tnWidth, $tnHeight);
// Set up the appropriate image handling functions based on the original image's mime type
switch ($size['mime'])
{
case 'image/gif':
// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
// This is maybe not the ideal solution, but IE6 can suck it
$creationFunction = 'ImageCreateFromGif';
$outputFunction = 'ImagePng';
$mime = 'image/png'; // We need to convert GIFs to PNGs
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
break;
case 'image/x-png':
case 'image/png':
$creationFunction = 'ImageCreateFromPng';
$outputFunction = 'ImagePng';
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // PNG needs a compression level of 0 (no compression) through 9
break;
default:
$creationFunction = 'ImageCreateFromJpeg';
$outputFunction = 'ImageJpeg';
$doSharpen = TRUE;
break;
}
// Read in the original image
$src = $creationFunction($docRoot . $image);
if (in_array($size['mime'], array('image/gif', 'image/png')))
{
if (!$color)
{
// If this is a GIF or a PNG, we need to set up transparency
imagealphablending($dst, false);
imagesavealpha($dst, true);
}
else
{
// Fill the background with the specified color for matting purposes
if ($color[0] == '#')
$color = substr($color, 1);
$background = FALSE;
if (strlen($color) == 6)
$background = imagecolorallocate($dst, hexdec($color[0].$color[1]), hexdec($color[2].$color[3]), hexdec($color[4].$color[5]));
else if (strlen($color) == 3)
$background = imagecolorallocate($dst, hexdec($color[0].$color[0]), hexdec($color[1].$color[1]), hexdec($color[2].$color[2]));
if ($background)
imagefill($dst, 0, 0, $background);
}
}
// Resample the original image into the resized canvas we set up earlier
ImageCopyResampled($dst, $src, 0, 0, $offsetX, $offsetY, $tnWidth, $tnHeight, $width, $height);
if ($doSharpen)
{
// Sharpen the image based on two things:
// (1) the difference between the original size and the final size
// (2) the final size
$sharpness = findSharp($width, $tnWidth);
$sharpenMatrix = array(
array(-1, -2, -1),
array(-2, $sharpness + 12, -2),
array(-1, -2, -1)
);
$divisor = $sharpness;
$offset = 0;
imageconvolution($dst, $sharpenMatrix, $divisor, $offset);
}
// Make sure the cache exists. If it doesn't, then create it
if (!file_exists(CACHE_DIR))
mkdir(CACHE_DIR, 0755);
// Make sure we can read and write the cache directory
if (!is_readable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not readable';
exit();
}
else if (!is_writable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not writable';
exit();
}
// Write the resized image to the cache
$outputFunction($dst, $resized, $quality);
// Put the data of the resized image into a variable
ob_start();
$outputFunction($dst, null, $quality);
$data = ob_get_contents();
ob_end_clean();
// Clean up the memory
ImageDestroy($src);
ImageDestroy($dst);
// See if the browser already has the image
$lastModifiedString = gmdate('D, d M Y H:i:s', filemtime($resized)) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
// Send the image to the browser with some delicious headers
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
function findSharp($orig, $final) // function from Ryan Rud (http://adryrun.com)
{
$final = $final * (750.0 / $orig);
$a = 52;
$b = -0.27810650887573124;
$c = .00047337278106508946;
$result = $a + $b * $final + $c * $final * $final;
return max(round($result), 0);
} // findSharp()
function doConditionalGet($etag, $lastModified)
{
header("Last-Modified: $lastModified");
header("ETag: \"{$etag}\"");
$if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) :
false;
$if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) :
false;
if (!$if_modified_since && !$if_none_match)
return;
if ($if_none_match && $if_none_match != $etag && $if_none_match != '"' . $etag . '"')
return; // etag is there but doesn't match
if ($if_modified_since && $if_modified_since != $lastModified)
return; // if-modified-since is there but doesn't match
// Nothing has changed since their last request - serve a 304 and exit
header('HTTP/1.1 304 Not Modified');
exit();
} // doConditionalGet()
// old pond
// a frog jumps
// the sound of water
// —Matsuo Basho
?> | php | image | function | resize | gd | 06/17/2012 23:53:26 | off topic | Image function that allows images to be cropped and resized in PHP without using so much memory
===
I've used this code for a while now for a few sites I've built which is great for galleries but it uses up a lot of memory and I keep getting memory allocation errors within the error log. Is there anything that can be changed to make this script better?
<?php
// Smart Image Resizer 1.4.1
// Resizes images, intelligently sharpens, crops based on width:height ratios, color fills
// transparent GIFs and PNGs, and caches variations for optimal performance
// Created by: Joe Lencioni (http://shiftingpixel.com)
// Date: August 6, 2008
// Based on: http://veryraw.com/history/2005/03/image-resizing-with-php/
/////////////////////
// LICENSE
/////////////////////
// I love to hear when my work is being used, so if you decide to use this, feel encouraged
// to send me an email. Smart Image Resizer is released under a Creative Commons
// Attribution-Share Alike 3.0 United States license
// (http://creativecommons.org/licenses/by-sa/3.0/us/). All I ask is that you include a link
// back to Shifting Pixel (either this page or shiftingpixel.com), but don’t worry about
// including a big link on each page if you don’t want to–one will do just nicely. Feel
// free to contact me to discuss any specifics (joe@shiftingpixel.com).
/////////////////////
// REQUIREMENTS
/////////////////////
// PHP and GD
/////////////////////
// PARAMETERS
/////////////////////
// Parameters need to be passed in through the URL's query string:
// image absolute path of local image starting with "/" (e.g. /images/toast.jpg)
// width maximum width of final image in pixels (e.g. 700)
// height maximum height of final image in pixels (e.g. 700)
// color (optional) background hex color for filling transparent PNGs (e.g. 900 or 16a942)
// cropratio (optional) ratio of width to height to crop final image (e.g. 1:1 or 3:2)
// nocache (optional) does not read image from the cache
// quality (optional, 0-100, default: 90) quality of output image
/////////////////////
// EXAMPLES
/////////////////////
// Resizing a JPEG:
// <img src="/image.php/image-name.jpg?width=100&height=100&image=/path/to/image.jpg" alt="Don't forget your alt text" />
// Resizing and cropping a JPEG into a square:
// <img src="/image.php/image-name.jpg?width=100&height=100&cropratio=1:1&image=/path/to/image.jpg" alt="Don't forget your alt text" />
// Matting a PNG with #990000:
// <img src="/image.php/image-name.png?color=900&image=/path/to/image.png" alt="Don't forget your alt text" />
/////////////////////
// CODE STARTS HERE
/////////////////////
if (!isset($_GET['image']))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}
define('MEMORY_TO_ALLOCATE', '100M');
define('DEFAULT_QUALITY', 90);
define('CURRENT_DIR', dirname(__FILE__));
define('CACHE_DIR_NAME', '/imagecache/');
define('CACHE_DIR', CURRENT_DIR . CACHE_DIR_NAME);
define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']);
// Images must be local files, so for convenience we strip the domain if it's there
$image = preg_replace('/^(s?f|ht)tps?:\/\/[^\/]+/i', '', (string) $_GET['image']);
// For security, directories cannot contain ':', images cannot contain '..' or '<', and
// images must start with '/'
if ($image{0} != '/' || strpos(dirname($image), ':') || preg_match('/(\.\.|<|>)/', $image))
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: malformed image path. Image paths must begin with \'/\'';
exit();
}
// If the image doesn't exist, or we haven't been told what it is, there's nothing
// that we can do
if (!$image)
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: no image was specified';
exit();
}
// Strip the possible trailing slash off the document root
$docRoot = preg_replace('/\/$/', '', DOCUMENT_ROOT);
if (!file_exists($docRoot . $image))
{
header('HTTP/1.1 404 Not Found');
echo 'Error: image does not exist: ' . $docRoot . $image;
exit();
}
// Get the size and MIME type of the requested image
$size = GetImageSize($docRoot . $image);
$mime = $size['mime'];
// Make sure that the requested file is actually an image
if (substr($mime, 0, 6) != 'image/')
{
header('HTTP/1.1 400 Bad Request');
echo 'Error: requested file is not an accepted type: ' . $docRoot . $image;
exit();
}
$width = $size[0];
$height = $size[1];
$maxWidth = (isset($_GET['width'])) ? (int) $_GET['width'] : 0;
$maxHeight = (isset($_GET['height'])) ? (int) $_GET['height'] : 0;
if (isset($_GET['color']))
$color = preg_replace('/[^0-9a-fA-F]/', '', (string) $_GET['color']);
else
$color = FALSE;
// If either a max width or max height are not specified, we default to something
// large so the unspecified dimension isn't a constraint on our resized image.
// If neither are specified but the color is, we aren't going to be resizing at
// all, just coloring.
if (!$maxWidth && $maxHeight)
{
$maxWidth = 99999999999999;
}
elseif ($maxWidth && !$maxHeight)
{
$maxHeight = 99999999999999;
}
elseif ($color && !$maxWidth && !$maxHeight)
{
$maxWidth = $width;
$maxHeight = $height;
}
// If we don't have a max width or max height, OR the image is smaller than both
// we do not want to resize it, so we simply output the original image and exit
if ((!$maxWidth && !$maxHeight) || (!$color && $maxWidth >= $width && $maxHeight >= $height))
{
$data = file_get_contents($docRoot . '/' . $image);
$lastModifiedString = gmdate('D, d M Y H:i:s', filemtime($docRoot . '/' . $image)) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
exit();
}
// Ratio cropping
$offsetX = 0;
$offsetY = 0;
if (isset($_GET['cropratio']))
{
$cropRatio = explode(':', (string) $_GET['cropratio']);
if (count($cropRatio) == 2)
{
$ratioComputed = $width / $height;
$cropRatioComputed = (float) $cropRatio[0] / (float) $cropRatio[1];
if ($ratioComputed < $cropRatioComputed)
{ // Image is too tall so we will crop the top and bottom
$origHeight = $height;
$height = $width / $cropRatioComputed;
$offsetY = ($origHeight - $height) / 2;
}
else if ($ratioComputed > $cropRatioComputed)
{ // Image is too wide so we will crop off the left and right sides
$origWidth = $width;
$width = $height * $cropRatioComputed;
$offsetX = ($origWidth - $width) / 2;
}
}
}
// Setting up the ratios needed for resizing. We will compare these below to determine how to
// resize the image (based on height or based on width)
$xRatio = $maxWidth / $width;
$yRatio = $maxHeight / $height;
if ($xRatio * $height < $maxHeight)
{ // Resize the image based on width
$tnHeight = ceil($xRatio * $height);
$tnWidth = $maxWidth;
}
else // Resize the image based on height
{
$tnWidth = ceil($yRatio * $width);
$tnHeight = $maxHeight;
}
// Determine the quality of the output image
$quality = (isset($_GET['quality'])) ? (int) $_GET['quality'] : DEFAULT_QUALITY;
// Before we actually do any crazy resizing of the image, we want to make sure that we
// haven't already done this one at these dimensions. To the cache!
// Note, cache must be world-readable
// We store our cached image filenames as a hash of the dimensions and the original filename
$resizedImageSource = $tnWidth . 'x' . $tnHeight . 'x' . $quality;
if ($color)
$resizedImageSource .= 'x' . $color;
if (isset($_GET['cropratio']))
$resizedImageSource .= 'x' . (string) $_GET['cropratio'];
$resizedImageSource .= '-' . $image;
$resizedImage = md5($resizedImageSource);
$resized = CACHE_DIR . $resizedImage;
// Check the modified times of the cached file and the original file.
// If the original file is older than the cached file, then we simply serve up the cached file
if (!isset($_GET['nocache']) && file_exists($resized))
{
$imageModified = filemtime($docRoot . $image);
$thumbModified = filemtime($resized);
if($imageModified < $thumbModified) {
$data = file_get_contents($resized);
$lastModifiedString = gmdate('D, d M Y H:i:s', $thumbModified) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
exit();
}
}
// We don't want to run out of memory
ini_set('memory_limit', MEMORY_TO_ALLOCATE);
// Set up a blank canvas for our resized image (destination)
$dst = imagecreatetruecolor($tnWidth, $tnHeight);
// Set up the appropriate image handling functions based on the original image's mime type
switch ($size['mime'])
{
case 'image/gif':
// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
// This is maybe not the ideal solution, but IE6 can suck it
$creationFunction = 'ImageCreateFromGif';
$outputFunction = 'ImagePng';
$mime = 'image/png'; // We need to convert GIFs to PNGs
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
break;
case 'image/x-png':
case 'image/png':
$creationFunction = 'ImageCreateFromPng';
$outputFunction = 'ImagePng';
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // PNG needs a compression level of 0 (no compression) through 9
break;
default:
$creationFunction = 'ImageCreateFromJpeg';
$outputFunction = 'ImageJpeg';
$doSharpen = TRUE;
break;
}
// Read in the original image
$src = $creationFunction($docRoot . $image);
if (in_array($size['mime'], array('image/gif', 'image/png')))
{
if (!$color)
{
// If this is a GIF or a PNG, we need to set up transparency
imagealphablending($dst, false);
imagesavealpha($dst, true);
}
else
{
// Fill the background with the specified color for matting purposes
if ($color[0] == '#')
$color = substr($color, 1);
$background = FALSE;
if (strlen($color) == 6)
$background = imagecolorallocate($dst, hexdec($color[0].$color[1]), hexdec($color[2].$color[3]), hexdec($color[4].$color[5]));
else if (strlen($color) == 3)
$background = imagecolorallocate($dst, hexdec($color[0].$color[0]), hexdec($color[1].$color[1]), hexdec($color[2].$color[2]));
if ($background)
imagefill($dst, 0, 0, $background);
}
}
// Resample the original image into the resized canvas we set up earlier
ImageCopyResampled($dst, $src, 0, 0, $offsetX, $offsetY, $tnWidth, $tnHeight, $width, $height);
if ($doSharpen)
{
// Sharpen the image based on two things:
// (1) the difference between the original size and the final size
// (2) the final size
$sharpness = findSharp($width, $tnWidth);
$sharpenMatrix = array(
array(-1, -2, -1),
array(-2, $sharpness + 12, -2),
array(-1, -2, -1)
);
$divisor = $sharpness;
$offset = 0;
imageconvolution($dst, $sharpenMatrix, $divisor, $offset);
}
// Make sure the cache exists. If it doesn't, then create it
if (!file_exists(CACHE_DIR))
mkdir(CACHE_DIR, 0755);
// Make sure we can read and write the cache directory
if (!is_readable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not readable';
exit();
}
else if (!is_writable(CACHE_DIR))
{
header('HTTP/1.1 500 Internal Server Error');
echo 'Error: the cache directory is not writable';
exit();
}
// Write the resized image to the cache
$outputFunction($dst, $resized, $quality);
// Put the data of the resized image into a variable
ob_start();
$outputFunction($dst, null, $quality);
$data = ob_get_contents();
ob_end_clean();
// Clean up the memory
ImageDestroy($src);
ImageDestroy($dst);
// See if the browser already has the image
$lastModifiedString = gmdate('D, d M Y H:i:s', filemtime($resized)) . ' GMT';
$etag = md5($data);
doConditionalGet($etag, $lastModifiedString);
// Send the image to the browser with some delicious headers
header("Content-type: $mime");
header('Content-Length: ' . strlen($data));
echo $data;
function findSharp($orig, $final) // function from Ryan Rud (http://adryrun.com)
{
$final = $final * (750.0 / $orig);
$a = 52;
$b = -0.27810650887573124;
$c = .00047337278106508946;
$result = $a + $b * $final + $c * $final * $final;
return max(round($result), 0);
} // findSharp()
function doConditionalGet($etag, $lastModified)
{
header("Last-Modified: $lastModified");
header("ETag: \"{$etag}\"");
$if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) :
false;
$if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) :
false;
if (!$if_modified_since && !$if_none_match)
return;
if ($if_none_match && $if_none_match != $etag && $if_none_match != '"' . $etag . '"')
return; // etag is there but doesn't match
if ($if_modified_since && $if_modified_since != $lastModified)
return; // if-modified-since is there but doesn't match
// Nothing has changed since their last request - serve a 304 and exit
header('HTTP/1.1 304 Not Modified');
exit();
} // doConditionalGet()
// old pond
// a frog jumps
// the sound of water
// —Matsuo Basho
?> | 2 |
6,960,321 | 08/05/2011 17:32:36 | 659,490 | 03/14/2011 20:19:27 | 22 | 2 | How to change the footer for a section in iWorks Pages? | I have a document with about 80 pages in iWorks Pages and I want to remove the pagenumbers in the footer within the last two sections with the glossary and my sources (pages 69-80).
How can I do that?
I have already unchecked the option to reuse the last footer and header. But I still can't edit the footer...
![enter image description here][1]
[1]: http://i.stack.imgur.com/7oaTU.png | apple | iwork | null | null | null | 08/06/2011 14:44:09 | off topic | How to change the footer for a section in iWorks Pages?
===
I have a document with about 80 pages in iWorks Pages and I want to remove the pagenumbers in the footer within the last two sections with the glossary and my sources (pages 69-80).
How can I do that?
I have already unchecked the option to reuse the last footer and header. But I still can't edit the footer...
![enter image description here][1]
[1]: http://i.stack.imgur.com/7oaTU.png | 2 |
3,240,377 | 07/13/2010 18:48:17 | 390,824 | 07/13/2010 18:48:17 | 1 | 0 | Format Removable media with c# programming | I want to format (FAT32) removable drive with c# programming. In the internet I found a way, but the problem is that it opens the generic windows format program. But I want to do it with C# only and no built in windows support.
My method is:
// FAT32 Format Button click event
[DllImport("shell32.dll")]
static extern uint SHFormatDrive(IntPtr hwnd, uint drive, uint fmtID, uint options); | c# | vs2008sp1 | null | null | null | null | open | Format Removable media with c# programming
===
I want to format (FAT32) removable drive with c# programming. In the internet I found a way, but the problem is that it opens the generic windows format program. But I want to do it with C# only and no built in windows support.
My method is:
// FAT32 Format Button click event
[DllImport("shell32.dll")]
static extern uint SHFormatDrive(IntPtr hwnd, uint drive, uint fmtID, uint options); | 0 |
6,928,429 | 08/03/2011 14:51:13 | 250,849 | 01/14/2010 15:56:27 | 273 | 22 | How to strike any letter using Unicode in Java | In my Java application I want to output striked letters (like html tag <strike> do). Is there any way to do this using Unicode (combine ) | java | unicode | null | null | null | null | open | How to strike any letter using Unicode in Java
===
In my Java application I want to output striked letters (like html tag <strike> do). Is there any way to do this using Unicode (combine ) | 0 |
3,910,869 | 10/12/2010 00:17:30 | 183,717 | 10/03/2009 20:08:39 | 569 | 0 | Using SendKey in NSL | All,
If anyone has experience working on NSL (Novell SecureLogin), I am trying to use the command SendKey "\|123" to send the F12 command, but there is no subsequent action taking place and nor any error. I tried googling out, but could not find much help. I have tried SendKey "{F12}" and SendKey ("{F12}") as well. Can anyone please let me know the appropriate command used to issue F12 key command. | novell | null | null | null | null | null | open | Using SendKey in NSL
===
All,
If anyone has experience working on NSL (Novell SecureLogin), I am trying to use the command SendKey "\|123" to send the F12 command, but there is no subsequent action taking place and nor any error. I tried googling out, but could not find much help. I have tried SendKey "{F12}" and SendKey ("{F12}") as well. Can anyone please let me know the appropriate command used to issue F12 key command. | 0 |
8,625,781 | 12/24/2011 16:52:52 | 1,114,734 | 12/24/2011 16:44:04 | 1 | 0 | How to insert value in aspx webpage textbox from windows form c# | My name is Ishaq.
I am new in this website.
I have listened that it is the best website for solving problems of programmers.
I want to insert text in the aspx webpage textbox programatically using c#.
But i dont know how to do it.
Can anyone please help me.
Thanks in advance. | c# | asp.net | winforms | null | null | 12/25/2011 03:59:12 | not a real question | How to insert value in aspx webpage textbox from windows form c#
===
My name is Ishaq.
I am new in this website.
I have listened that it is the best website for solving problems of programmers.
I want to insert text in the aspx webpage textbox programatically using c#.
But i dont know how to do it.
Can anyone please help me.
Thanks in advance. | 1 |
10,868,429 | 06/03/2012 06:41:12 | 1,026,160 | 11/02/2011 17:17:54 | 3 | 1 | SSO login dialog returns to fbDidNotLogin with no indication of error | I have recently created a new Facebook app ID as I'm adding Facebook SSO integration into my app. My app within Facebook is set to Native iOS and I've included the Bundle ID and a current published app's Apple ID (for testing).
I've implemented the SDK as per the instructions (I have two other iOS apps currently using the SDK without issue as well). All delegate methods and required plist entries are in place for the URL callbacks.
After attempting a login I'm shown the Facebook white screen (just a loading spinner) with blue bar but after 5 seconds it redirects back to my app and hits the fbDidNotLogin delegate method. That method doesn't include any sort of retrievable error (at least none that is documented or available to me).
So at this point I'm at a loss for what might be causing my login to fail. Is there any way to get a more detailed error? Or has anybody else run into this same problem? | iphone | ios | facebook | single-sign-on | null | null | open | SSO login dialog returns to fbDidNotLogin with no indication of error
===
I have recently created a new Facebook app ID as I'm adding Facebook SSO integration into my app. My app within Facebook is set to Native iOS and I've included the Bundle ID and a current published app's Apple ID (for testing).
I've implemented the SDK as per the instructions (I have two other iOS apps currently using the SDK without issue as well). All delegate methods and required plist entries are in place for the URL callbacks.
After attempting a login I'm shown the Facebook white screen (just a loading spinner) with blue bar but after 5 seconds it redirects back to my app and hits the fbDidNotLogin delegate method. That method doesn't include any sort of retrievable error (at least none that is documented or available to me).
So at this point I'm at a loss for what might be causing my login to fail. Is there any way to get a more detailed error? Or has anybody else run into this same problem? | 0 |
8,581,369 | 12/20/2011 20:15:35 | 1,108,596 | 12/20/2011 20:02:49 | 1 | 0 | Need help transforming a dataset from multiple rows to a single row | I have a database (MySQL) that holds cost records for some of our customers (each customer has a different cost for items). Any given cost record has an effective date range (ie, the cost is valid for a given time frame). Here's some sample data:
Customer ItemNumber EffectDate Counter Cost
ABC123 ITEM101 2011-12-01 0 $1.00
ABC123 ITEM101 2011-12-10 0 $1.20
ABC123 ITEM101 2011-12-10 1 $1.25
DEF456 ITEM101 2011-11-15 0 $1.10
DEF456 ITEM101 2011-12-01 0 $1.12
To make some sense of that data, the "Counter" variable is the number of times it's been changed (this is from an antiquated accounting platform), and the date is the "Beginning Date" of the cost. So, ITEM101 for customer ABC123 will have a cost of $1.00 on 12/1/2011 and 12/8/2011, but starting 12/10/2011, will be $1.25 (would be $1.20, but the Counter has gone up - ie the cost is $1.25 now). I hope that makes sense.
What I'm trying to do is to get the data to come out as follows:
Customer ItemNumber EffectiveBegin EffectiveEnd Cost
ABC123 ITEM101 2011-12-01 2011-12-09 $1.00
ABC123 ITEM101 2011-12-10 2099-12-31 $1.25
DEF456 ITEM101 2011-11-15 2011-11-30 $1.10
DEF456 ITEM101 2011-12-01 2099-12-31 $1.12
Where 12/31/2099 is just a placeholder date for "Current".
Any help would be HUGELY appreciated!! | mysql | sql | database | tsql | null | null | open | Need help transforming a dataset from multiple rows to a single row
===
I have a database (MySQL) that holds cost records for some of our customers (each customer has a different cost for items). Any given cost record has an effective date range (ie, the cost is valid for a given time frame). Here's some sample data:
Customer ItemNumber EffectDate Counter Cost
ABC123 ITEM101 2011-12-01 0 $1.00
ABC123 ITEM101 2011-12-10 0 $1.20
ABC123 ITEM101 2011-12-10 1 $1.25
DEF456 ITEM101 2011-11-15 0 $1.10
DEF456 ITEM101 2011-12-01 0 $1.12
To make some sense of that data, the "Counter" variable is the number of times it's been changed (this is from an antiquated accounting platform), and the date is the "Beginning Date" of the cost. So, ITEM101 for customer ABC123 will have a cost of $1.00 on 12/1/2011 and 12/8/2011, but starting 12/10/2011, will be $1.25 (would be $1.20, but the Counter has gone up - ie the cost is $1.25 now). I hope that makes sense.
What I'm trying to do is to get the data to come out as follows:
Customer ItemNumber EffectiveBegin EffectiveEnd Cost
ABC123 ITEM101 2011-12-01 2011-12-09 $1.00
ABC123 ITEM101 2011-12-10 2099-12-31 $1.25
DEF456 ITEM101 2011-11-15 2011-11-30 $1.10
DEF456 ITEM101 2011-12-01 2099-12-31 $1.12
Where 12/31/2099 is just a placeholder date for "Current".
Any help would be HUGELY appreciated!! | 0 |
7,185,538 | 08/25/2011 05:29:50 | 754,865 | 05/15/2011 21:36:26 | 32 | 4 | Conversation system | Am trying to build a conversation system for users on a web app am working on.
At the the moment am quite confused on how to setup the database tables.
for now i have a table with fields this
- C_id
- Message
- S_id
- R_id
- read
- date_time
| php | mysql | database-design | null | null | 08/25/2011 12:54:42 | not a real question | Conversation system
===
Am trying to build a conversation system for users on a web app am working on.
At the the moment am quite confused on how to setup the database tables.
for now i have a table with fields this
- C_id
- Message
- S_id
- R_id
- read
- date_time
| 1 |
5,580,761 | 04/07/2011 12:08:56 | 696,753 | 04/07/2011 12:08:56 | 1 | 0 | use of double pointer | When should a double pointer be used in C, can anyone explain with a example. what i know is double pointer is a pointer to a pointer, why is this required pointing to a pointer. | c | null | null | null | null | null | open | use of double pointer
===
When should a double pointer be used in C, can anyone explain with a example. what i know is double pointer is a pointer to a pointer, why is this required pointing to a pointer. | 0 |
8,482,156 | 12/12/2011 22:58:52 | 1,094,695 | 12/12/2011 22:48:54 | 1 | 0 | Unique IDs to multidimensional array elements in python | I have a multidimensional array with elements that can be completely random. For example,
[[[1,2],[2,1],[3,1],[4,2]][[2,1],[4,3],[3,4],[1,3]]].
I'd like to assign an ID to each unique element (as in [1,2], not the elements within those) so that I can recognize it later on when this array is much larger, but I can't seem to figure it out. I've been searching the internet for a while now with no luck, so if someone could give me a push in the right direction I'd really appreciate it. | python | multidimensional-array | unique-id | null | null | null | open | Unique IDs to multidimensional array elements in python
===
I have a multidimensional array with elements that can be completely random. For example,
[[[1,2],[2,1],[3,1],[4,2]][[2,1],[4,3],[3,4],[1,3]]].
I'd like to assign an ID to each unique element (as in [1,2], not the elements within those) so that I can recognize it later on when this array is much larger, but I can't seem to figure it out. I've been searching the internet for a while now with no luck, so if someone could give me a push in the right direction I'd really appreciate it. | 0 |
10,239,717 | 04/20/2012 03:08:30 | 1,337,528 | 04/17/2012 00:29:43 | 9 | 0 | Preloading pictures for refresh, cache | I have these two php variables: `$img1src` and `$img2src`, they both hold a URL of an image. I was wondering if I was able to preload these images, or cache them to be accessed quickly after refreshing the page and displaying them in a `<img src >`
Thanks in advance for the help, Aaron
edit: If you don't know how to do it do you know the language that would most likely be done in? | php | javascript | html | caching | null | null | open | Preloading pictures for refresh, cache
===
I have these two php variables: `$img1src` and `$img2src`, they both hold a URL of an image. I was wondering if I was able to preload these images, or cache them to be accessed quickly after refreshing the page and displaying them in a `<img src >`
Thanks in advance for the help, Aaron
edit: If you don't know how to do it do you know the language that would most likely be done in? | 0 |
460,602 | 01/20/2009 09:39:34 | 4,406 | 09/03/2008 14:38:45 | 379 | 25 | [Java] What is the best way to check if an object is from another(say fixed) list of objects? | Currently, I create a HashMap with Object Id as key and 1 as value. And the method asks for Object/Id and checks if there is a matching key.
Is that ok? Or, is(are) there better alternative(s)?
| java | hashmap | null | null | null | null | open | [Java] What is the best way to check if an object is from another(say fixed) list of objects?
===
Currently, I create a HashMap with Object Id as key and 1 as value. And the method asks for Object/Id and checks if there is a matching key.
Is that ok? Or, is(are) there better alternative(s)?
| 0 |
11,233,290 | 06/27/2012 19:05:36 | 955,097 | 09/20/2011 15:23:49 | 77 | 3 | CSS for ID not affecting img tag | I came across this issue last night where my CSS would not affect the img tag for the following HTML:
<div class='container'>
<div id="grid"><img src='test.jpg' /></div>
</div>
The CSS was as follows:
#grid img { position:relative; top:75px; border:5px solid white; }
Everything should have been working fine, but when I viewed source on the uploaded CSS document, I found out a special character was being entered at the end of the previous line:
#grid p { float:right; font-size:34px; }​
#grid_right img { position:relative; top:75px; border:5px solid white; }
Highlighting the area and clicking backspace in my IDE fixed the issue. Was about to post question on here, so I thought I'd add the knowledge to save someone else the trouble. | html | css | special-characters | img | null | 06/29/2012 03:12:12 | too localized | CSS for ID not affecting img tag
===
I came across this issue last night where my CSS would not affect the img tag for the following HTML:
<div class='container'>
<div id="grid"><img src='test.jpg' /></div>
</div>
The CSS was as follows:
#grid img { position:relative; top:75px; border:5px solid white; }
Everything should have been working fine, but when I viewed source on the uploaded CSS document, I found out a special character was being entered at the end of the previous line:
#grid p { float:right; font-size:34px; }​
#grid_right img { position:relative; top:75px; border:5px solid white; }
Highlighting the area and clicking backspace in my IDE fixed the issue. Was about to post question on here, so I thought I'd add the knowledge to save someone else the trouble. | 3 |
1,044,202 | 06/25/2009 14:16:46 | 128,860 | 06/25/2009 14:05:08 | 1 | 0 | Multi-way tree | How do you find the height of a multi-way tree? A binary tree looks something like this...
int height(node *root)
{
if (root == NULL)
return 0;
else
return max(height(root->left), height(root->right)) + 1;
}
I cant figure it for multi-way. | c++ | tree | null | null | null | null | open | Multi-way tree
===
How do you find the height of a multi-way tree? A binary tree looks something like this...
int height(node *root)
{
if (root == NULL)
return 0;
else
return max(height(root->left), height(root->right)) + 1;
}
I cant figure it for multi-way. | 0 |
5,037,282 | 02/18/2011 03:16:26 | 622,471 | 02/18/2011 02:27:45 | 1 | 0 | operating system | how to install curl or more programming in ubuntu | ubuntu | null | null | null | null | 02/18/2011 03:18:45 | not a real question | operating system
===
how to install curl or more programming in ubuntu | 1 |
10,983,118 | 06/11/2012 15:27:29 | 1,449,244 | 06/11/2012 14:59:10 | 1 | 0 | MVC 3 Razor-Partial Validation of Model | I am currently working on a project in MVC 3 where I am leveraging Entity Framework to persist one data model over two Views which each contain one HTML Form (similar to wizard-based design).
Yet after the user fills out the appropriate fields on the first View and submits the form, client-side validation for the entire model is triggered, and validation errors are shown for fields that will not even be available for input until the second View instantiates.
I have currently implemented a workaround where I simply turn off client-side validation for the first View entirely, but I am certainly not keen on the idea of populating my model with data that has not been validated at all. This is bad. M'kay.
Is there any way to partially validate the fields on the first View and not trigger valdiation for the whole data model? | asp.net-mvc-3 | razor | form-validation | entity-framework-mapping | null | null | open | MVC 3 Razor-Partial Validation of Model
===
I am currently working on a project in MVC 3 where I am leveraging Entity Framework to persist one data model over two Views which each contain one HTML Form (similar to wizard-based design).
Yet after the user fills out the appropriate fields on the first View and submits the form, client-side validation for the entire model is triggered, and validation errors are shown for fields that will not even be available for input until the second View instantiates.
I have currently implemented a workaround where I simply turn off client-side validation for the first View entirely, but I am certainly not keen on the idea of populating my model with data that has not been validated at all. This is bad. M'kay.
Is there any way to partially validate the fields on the first View and not trigger valdiation for the whole data model? | 0 |
10,999,342 | 06/12/2012 15:01:07 | 1,124,911 | 01/01/2012 07:03:18 | 1 | 0 | Convert xml to pdf using Perl | I want to convert an excel xml file to PDF using Perl. I see PDF API2 allows working on PDF in perl, but how should I convert xml to PDF | xml | perl | null | null | null | 06/14/2012 11:57:17 | not a real question | Convert xml to pdf using Perl
===
I want to convert an excel xml file to PDF using Perl. I see PDF API2 allows working on PDF in perl, but how should I convert xml to PDF | 1 |
6,285,750 | 06/08/2011 21:56:28 | 780,393 | 06/02/2011 01:31:46 | 1 | 0 | Is there any combine name of analog and digital Device.?? | Or Is there any device which is used for analog and digital communication. | electronics | digital | analog | null | null | 06/10/2011 21:46:56 | off topic | Is there any combine name of analog and digital Device.??
===
Or Is there any device which is used for analog and digital communication. | 2 |
6,925,963 | 08/03/2011 11:49:28 | 476,024 | 10/14/2010 16:35:57 | 822 | 5 | How can i implement a listener for the gps? | I have an iPad app and wish to call a function every 0.1 miles I travel from a certain x start position . How can i implement this listener ? | iphone | objective-c | ios | ipad | null | null | open | How can i implement a listener for the gps?
===
I have an iPad app and wish to call a function every 0.1 miles I travel from a certain x start position . How can i implement this listener ? | 0 |
4,948,896 | 02/09/2011 18:26:51 | 29,726 | 10/20/2008 18:37:55 | 343 | 8 | Accessing user control properties defined in code behind in markup | I have a public property defined in code behind of a user control. I want to toggle visibility of controls in the markup based on the property's value. However, using the
following syntax:
<td style="display:<%#(Container.PageControlMode == PageControlMode. PageMode.Wizard) ? "none" : "inline" %;">
I have the following property in my code behind:
public PageMode PageControlMode { get; set; }
Does not work and generate errors. What is a good way around it? | asp.net | null | null | null | null | null | open | Accessing user control properties defined in code behind in markup
===
I have a public property defined in code behind of a user control. I want to toggle visibility of controls in the markup based on the property's value. However, using the
following syntax:
<td style="display:<%#(Container.PageControlMode == PageControlMode. PageMode.Wizard) ? "none" : "inline" %;">
I have the following property in my code behind:
public PageMode PageControlMode { get; set; }
Does not work and generate errors. What is a good way around it? | 0 |
6,381,443 | 06/17/2011 04:45:25 | 802,690 | 06/17/2011 04:45:25 | 1 | 0 | lines overlap in latex | The Figure 6 and Figure 7 demonstrates the throughput for to be decreased or dropped.
Mobile IP and ABNM. The graph suggests the throughput
The above lines overlap. I am not sure what is the reason. Please help(am writing a academic paper). | latex | null | null | null | null | 06/17/2011 07:58:57 | off topic | lines overlap in latex
===
The Figure 6 and Figure 7 demonstrates the throughput for to be decreased or dropped.
Mobile IP and ABNM. The graph suggests the throughput
The above lines overlap. I am not sure what is the reason. Please help(am writing a academic paper). | 2 |
9,480,935 | 02/28/2012 11:19:02 | 1,129,995 | 01/04/2012 13:21:46 | 159 | 9 | robocopy scheduler and command line | I have a .bat file that copies from z drive to c drive as follow :
robocopy z:\file\ c:\file\ /E /R:2 /W:1 /PURGE
robocopy z:\file\ c:\file\ /E /R:2 /W:1 /PURGE
I have been searching all over the server to see what runs this batch file but cannot find any scheduled task or service that runs this batch file.
Did some research online and found out if you have mot or mon in command line that monitors source file..but as you can see the above command is not using it.
So how is this running then without any scheduling? | command-line | schedule | robocopy | null | null | 02/29/2012 19:09:32 | off topic | robocopy scheduler and command line
===
I have a .bat file that copies from z drive to c drive as follow :
robocopy z:\file\ c:\file\ /E /R:2 /W:1 /PURGE
robocopy z:\file\ c:\file\ /E /R:2 /W:1 /PURGE
I have been searching all over the server to see what runs this batch file but cannot find any scheduled task or service that runs this batch file.
Did some research online and found out if you have mot or mon in command line that monitors source file..but as you can see the above command is not using it.
So how is this running then without any scheduling? | 2 |
10,938,161 | 06/07/2012 18:59:07 | 712,302 | 04/17/2011 16:42:44 | 747 | 12 | Can a class expose a number without instantiating it? |
A class can expose types without instantiating it. For example:
class bar {
typedef int GET_TYPE;
};
template<class T>
void foo() {
typename T::GET_TYPE t;
// do something with t
}
foo<bar>();
Can a integer number be exposed in a similar way? In the sense that template parameters can be either types or built-in types.
| c++ | null | null | null | null | null | open | Can a class expose a number without instantiating it?
===
A class can expose types without instantiating it. For example:
class bar {
typedef int GET_TYPE;
};
template<class T>
void foo() {
typename T::GET_TYPE t;
// do something with t
}
foo<bar>();
Can a integer number be exposed in a similar way? In the sense that template parameters can be either types or built-in types.
| 0 |
3,853,963 | 10/04/2010 09:20:20 | 97,581 | 04/29/2009 09:07:28 | 26 | 3 | Clean HTML documentation template for Enterprise Architect | I use Enterprise Architect from Sparx Systems for reverse-engineering URL class diagrams from my source code, and want to take this a step further by using the software to generate HTML API documentation of my code.
However I find the markup generated by Enterprise Architect to be full of Javascript, and I think I may have even spotted some VB Script in there. Want I want is a clean HTML-only template that I can use to produce simple markup that will work fine in all browsers.
I have tried to manually create this template using the template editor in Enterprise Architect 8, but find this cumbersome.
Does anyone know of an existing template I can use, or an easier way to generate a template without using the built in template editor? | uml | enterprise-architect | sparx | null | null | null | open | Clean HTML documentation template for Enterprise Architect
===
I use Enterprise Architect from Sparx Systems for reverse-engineering URL class diagrams from my source code, and want to take this a step further by using the software to generate HTML API documentation of my code.
However I find the markup generated by Enterprise Architect to be full of Javascript, and I think I may have even spotted some VB Script in there. Want I want is a clean HTML-only template that I can use to produce simple markup that will work fine in all browsers.
I have tried to manually create this template using the template editor in Enterprise Architect 8, but find this cumbersome.
Does anyone know of an existing template I can use, or an easier way to generate a template without using the built in template editor? | 0 |
10,817,282 | 05/30/2012 13:27:16 | 1,207,146 | 02/13/2012 15:46:40 | 179 | 23 | How to style the default dragIndicator when dragging? | Using RF 4.1 I am trying to style the default `dragIndicator` (the one used when none is defined). When I use a custom `dragIndicator`, I can style it using the class `rf-ind-drag`, but the default `dragIndicator` only has the class `ui-draggable`.
The problem with `ui-draggable` is, that it is already set before dragging, so my component has the dragging style before I start dragging it.
How can I style the default `dragIndicator` or make the custom one look like the component that I am dragging (I drag tree nodes)? | java | jsf | richfaces | null | null | null | open | How to style the default dragIndicator when dragging?
===
Using RF 4.1 I am trying to style the default `dragIndicator` (the one used when none is defined). When I use a custom `dragIndicator`, I can style it using the class `rf-ind-drag`, but the default `dragIndicator` only has the class `ui-draggable`.
The problem with `ui-draggable` is, that it is already set before dragging, so my component has the dragging style before I start dragging it.
How can I style the default `dragIndicator` or make the custom one look like the component that I am dragging (I drag tree nodes)? | 0 |
3,758,347 | 09/21/2010 08:01:36 | 387,454 | 07/09/2010 06:45:48 | 277 | 34 | Grails: No signature of method findAll() is applicable for argument types: String, ArrayList | I'm new to grails and receive the following error:
`No signature of method: Something.findAll() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [from Something AS s WHERE s.some_number LIKE ?, [%asdf%]]"`
The error occurs when I run `test-app`. It occurs in the following place:
SomethingVO[] findBySomeNumber(String searchString) {
searchString = "%"+searchString+"%"
return Something.findAll("from Something AS s WHERE s.some_number LIKE ?",[searchString]).collect {
new SomethingVO(it);
}
}
The class `Something` is a domain object:
package some.project.domain
class Something{
static belongsTo = [product:Product, productVersion:ProductVersion]
Long id
String name
String someNumber
static constraints = {
product (nullable:true)
productVersion (nullable:true)
}
}
Where is the mistake?
(I use Grails 1.2.4)
| grails | groovy | gorm | findall | null | null | open | Grails: No signature of method findAll() is applicable for argument types: String, ArrayList
===
I'm new to grails and receive the following error:
`No signature of method: Something.findAll() is applicable for argument types: (java.lang.String, java.util.ArrayList) values: [from Something AS s WHERE s.some_number LIKE ?, [%asdf%]]"`
The error occurs when I run `test-app`. It occurs in the following place:
SomethingVO[] findBySomeNumber(String searchString) {
searchString = "%"+searchString+"%"
return Something.findAll("from Something AS s WHERE s.some_number LIKE ?",[searchString]).collect {
new SomethingVO(it);
}
}
The class `Something` is a domain object:
package some.project.domain
class Something{
static belongsTo = [product:Product, productVersion:ProductVersion]
Long id
String name
String someNumber
static constraints = {
product (nullable:true)
productVersion (nullable:true)
}
}
Where is the mistake?
(I use Grails 1.2.4)
| 0 |
2,881,368 | 05/21/2010 10:46:21 | 213,000 | 11/17/2009 15:52:42 | 22 | 2 | How to override a related sets "add" method? | I am working on a django project and i want to send a signal when something get's added to some models related set, e.g. we have an owner wo has a set of collectables and each time the method owner.collectable_set.add(something) is getting called i want signal like "collectable_added" or something. signals are clear to me, but in which manager(?) the "add" method sits that i want to override is unclear to me. | django | related | set | null | null | null | open | How to override a related sets "add" method?
===
I am working on a django project and i want to send a signal when something get's added to some models related set, e.g. we have an owner wo has a set of collectables and each time the method owner.collectable_set.add(something) is getting called i want signal like "collectable_added" or something. signals are clear to me, but in which manager(?) the "add" method sits that i want to override is unclear to me. | 0 |
9,586,220 | 03/06/2012 15:04:07 | 1,046,219 | 11/14/2011 19:22:50 | 8 | 0 | Program giving wrong answer when written but gives right answer when copied | I was doing selection sort. The program that I wrote was generating wrong result but when I copied it from a site. The codes are exactly the same except the one copied from the website has more number of spaces. I am providing both the codes. Please help
The code written by me:
#include<stdio.h>
main()
{
int position, array[100], n, c, d, swap;
printf ("Enter the number of elements:\n");
scanf ("%d", &n);
printf ("Enter the %d integer\n",n);
for (c=0 ; c < n ; c++)
scanf ("%d", &array[c]);
for (c = 0 ; c < (n-1); c++)
{
position=c;
for (d = c+1; d < n; d++)
{
if (array[position] > array[d]);
position = d;
}
if (position !=c);
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf ("Sorted list in the ascending order:\n");
for (c=0 ; c < n ; c++)
printf ("%d\n", array[c]);
getch();
}
The code given in the website
#include<stdio.h>
main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d", &array[c]);
for ( c = 0 ; c < ( n - 1 ) ; c++ )
{
position = c;
for ( d = c + 1 ; d < n ; d++ )
{
if ( array[position] > array[d] )
position = d;
}
if ( position != c )
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf("Sorted list in ascending order:\n");
for ( c = 0 ; c < n ; c++ )
printf("%d\n", array[c]);
getch();
}#include<stdio.h>
main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d", &array[c]);
for ( c = 0 ; c < ( n - 1 ) ; c++ )
{
position = c;
for ( d = c + 1 ; d < n ; d++ )
{
if ( array[position] > array[d] )
position = d;
}
if ( position != c )
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf("Sorted list in ascending order:\n");
for ( c = 0 ; c < n ; c++ )
printf("%d\n", array[c]);
getch();
}
| c | null | null | null | null | 04/06/2012 17:21:40 | not a real question | Program giving wrong answer when written but gives right answer when copied
===
I was doing selection sort. The program that I wrote was generating wrong result but when I copied it from a site. The codes are exactly the same except the one copied from the website has more number of spaces. I am providing both the codes. Please help
The code written by me:
#include<stdio.h>
main()
{
int position, array[100], n, c, d, swap;
printf ("Enter the number of elements:\n");
scanf ("%d", &n);
printf ("Enter the %d integer\n",n);
for (c=0 ; c < n ; c++)
scanf ("%d", &array[c]);
for (c = 0 ; c < (n-1); c++)
{
position=c;
for (d = c+1; d < n; d++)
{
if (array[position] > array[d]);
position = d;
}
if (position !=c);
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf ("Sorted list in the ascending order:\n");
for (c=0 ; c < n ; c++)
printf ("%d\n", array[c]);
getch();
}
The code given in the website
#include<stdio.h>
main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d", &array[c]);
for ( c = 0 ; c < ( n - 1 ) ; c++ )
{
position = c;
for ( d = c + 1 ; d < n ; d++ )
{
if ( array[position] > array[d] )
position = d;
}
if ( position != c )
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf("Sorted list in ascending order:\n");
for ( c = 0 ; c < n ; c++ )
printf("%d\n", array[c]);
getch();
}#include<stdio.h>
main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d", &array[c]);
for ( c = 0 ; c < ( n - 1 ) ; c++ )
{
position = c;
for ( d = c + 1 ; d < n ; d++ )
{
if ( array[position] > array[d] )
position = d;
}
if ( position != c )
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf("Sorted list in ascending order:\n");
for ( c = 0 ; c < n ; c++ )
printf("%d\n", array[c]);
getch();
}
| 1 |
8,817,642 | 01/11/2012 10:19:55 | 622,875 | 02/18/2011 09:30:41 | 839 | 60 | How to use POCO in MVC application | I have read about POCO (Plain old CLR (or C#) object) [here][1] ,and confused about usage of it.
If i can go with Code First approach then weather i need to create .edmx file?
Without that how can i use poco with code first approach?
Please correct me if i understood something wrong in this case!
Thanks.
[1]: http://blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx | asp.net-mvc-3 | c#-4.0 | entity-framework-4 | null | null | null | open | How to use POCO in MVC application
===
I have read about POCO (Plain old CLR (or C#) object) [here][1] ,and confused about usage of it.
If i can go with Code First approach then weather i need to create .edmx file?
Without that how can i use poco with code first approach?
Please correct me if i understood something wrong in this case!
Thanks.
[1]: http://blogs.msdn.com/b/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx | 0 |
4,978,571 | 02/12/2011 14:25:38 | 594,297 | 01/28/2011 19:21:20 | 1 | 1 | Turn off Joomla System Session at the front end | I have a popular joomla site(4000/day) at shared server. I have performance problems. I want to disable joomla system session at frontend, so I take this row to the index.php:
$mainframe =& JFactory::getApplication('site',array('session'=>false));
It works well for guests, but have a side effect. It is really strange, but when I logged in as registered user and turn on the debug mode, I experience that joomla module caching isn't work.
How can I solve it? | caching | joomla | null | null | null | null | open | Turn off Joomla System Session at the front end
===
I have a popular joomla site(4000/day) at shared server. I have performance problems. I want to disable joomla system session at frontend, so I take this row to the index.php:
$mainframe =& JFactory::getApplication('site',array('session'=>false));
It works well for guests, but have a side effect. It is really strange, but when I logged in as registered user and turn on the debug mode, I experience that joomla module caching isn't work.
How can I solve it? | 0 |
5,140,100 | 02/28/2011 09:23:24 | 246,776 | 01/08/2010 22:16:08 | 1,952 | 55 | Registering multiple versions of packages with `ghc-pkg`? | I'm trying to install `GHC` and `Cabal` on FreeBSD 8.1.
I've installed GHC 7.0.1 (because it's current stable release) and now trying to install `Cabal` (to install `cabal-install`), but it fails with this error message.
%./Setup configure
Configuring Cabal-1.8.0.4...
Setup: At least the following dependencies are missing:
base >=4 && <3 && >=1 && <5, filepath >=1 && <1.2
%
Definitely I'm having too higher version of library.
%ghc-pkg list
/usr/local/lib/ghc-7.0.1/package.conf.d
Cabal-1.10.0.0
array-0.3.0.2
base-4.3.0.0
bin-package-db-0.0.0.0
bytestring-0.9.1.8
containers-0.4.0.0
directory-1.1.0.0
extensible-exceptions-0.1.1.2
ffi-1.0
filepath-1.2.0.0
ghc-7.0.1
ghc-binary-0.5.0.2
ghc-prim-0.2.0.0
haskell2010-1.0.0.0
haskell98-1.1.0.0
hpc-0.5.0.6
integer-gmp-0.2.0.2
old-locale-1.0.0.2
old-time-1.0.0.6
pretty-1.0.1.2
process-1.0.1.4
random-1.0.0.3
rts-1.0
template-haskell-2.5.0.0
time-1.2.0.3
unix-2.4.1.0
/home/eonil/.ghc/x86_64-freebsd-7.0.1/package.conf.d
network-2.2.1.5
parsec-2.1.0.1
%
Should I downgrade to GHC 6.x? Or can I install lower version of the packages? (or side-by-side install)
| haskell | version | ghc | cabal | cabal-install | null | open | Registering multiple versions of packages with `ghc-pkg`?
===
I'm trying to install `GHC` and `Cabal` on FreeBSD 8.1.
I've installed GHC 7.0.1 (because it's current stable release) and now trying to install `Cabal` (to install `cabal-install`), but it fails with this error message.
%./Setup configure
Configuring Cabal-1.8.0.4...
Setup: At least the following dependencies are missing:
base >=4 && <3 && >=1 && <5, filepath >=1 && <1.2
%
Definitely I'm having too higher version of library.
%ghc-pkg list
/usr/local/lib/ghc-7.0.1/package.conf.d
Cabal-1.10.0.0
array-0.3.0.2
base-4.3.0.0
bin-package-db-0.0.0.0
bytestring-0.9.1.8
containers-0.4.0.0
directory-1.1.0.0
extensible-exceptions-0.1.1.2
ffi-1.0
filepath-1.2.0.0
ghc-7.0.1
ghc-binary-0.5.0.2
ghc-prim-0.2.0.0
haskell2010-1.0.0.0
haskell98-1.1.0.0
hpc-0.5.0.6
integer-gmp-0.2.0.2
old-locale-1.0.0.2
old-time-1.0.0.6
pretty-1.0.1.2
process-1.0.1.4
random-1.0.0.3
rts-1.0
template-haskell-2.5.0.0
time-1.2.0.3
unix-2.4.1.0
/home/eonil/.ghc/x86_64-freebsd-7.0.1/package.conf.d
network-2.2.1.5
parsec-2.1.0.1
%
Should I downgrade to GHC 6.x? Or can I install lower version of the packages? (or side-by-side install)
| 0 |
8,587,760 | 12/21/2011 09:41:58 | 584,518 | 01/21/2011 13:46:43 | 3,762 | 220 | Unicode conversion issues | Here is a beginner question on Unicode. I'm using Embarcadero C++ Builder 2009, where they supposedly changed the default strings to use Unicode.
- I type various symbols in my source editor, that aren't part of the standard "7-bit ASCII".
- My program is using the String type of C++ Builder to fetch user input.
- I am also adding input manually by setting a value to a wchar_t.
It would seem that there are conflicts in how the symbols are interpreted. Sometimes I get a symbol with for example the code 0x00C7 ('Ç'), but sometimes the same symbol is coded as 0xFFC7, for example in the source code editor. To my understanding, the former is proper Unicode, the latter is "something else". Can someone confirm this?
I wonder where this "something else" encoding is coming from, and how to get rid of it?
| c++ | unicode | embarcadero | null | null | null | open | Unicode conversion issues
===
Here is a beginner question on Unicode. I'm using Embarcadero C++ Builder 2009, where they supposedly changed the default strings to use Unicode.
- I type various symbols in my source editor, that aren't part of the standard "7-bit ASCII".
- My program is using the String type of C++ Builder to fetch user input.
- I am also adding input manually by setting a value to a wchar_t.
It would seem that there are conflicts in how the symbols are interpreted. Sometimes I get a symbol with for example the code 0x00C7 ('Ç'), but sometimes the same symbol is coded as 0xFFC7, for example in the source code editor. To my understanding, the former is proper Unicode, the latter is "something else". Can someone confirm this?
I wonder where this "something else" encoding is coming from, and how to get rid of it?
| 0 |
8,046,321 | 11/08/2011 05:27:03 | 1,034,961 | 11/08/2011 04:52:45 | 1 | 0 | listBox.ItemContainerGenerator.ContainerFromItem() returns null to the NEW item added in the listbox | This is my first post here so I hope you could help me with my problem regarding WPF.
I have a listbox that is bind with an ObservableCollection:
public ObservableCollection<DeviceSetting> DeviceSettings
{
get { return _deviceSettings; }
set { _deviceSettings = value; }
}
<ListBox ItemTemplate="{StaticResource IPItemTemplate}" Name="listBoxAddresses" SelectionMode="Extended" ItemsSource="{Binding Path=TestSetting.DeviceSettings, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
ItemContainerStyle="{StaticResource ContainerStyle}" />
The situation here is, I would like to know if a new item has been added to the list so what I did was create a CollectionChanged event:
TestSetting.DeviceSettings.CollectionChanged += mListBox_CollectionChanged;
private void mListBox_CollectionChanged(object sender,NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
for (int i = 0; i < TestSetting.DeviceSettings.Count; i++){
ListBoxItem myListBoxItem = (ListBoxItem)(listBoxAddresses.ItemContainerGenerator.ContainerFromItem(listBoxAddresses.Items[i]));
if (!TestSetting.DeviceSettings[i].IsNetwork && DeviceDiscovery.IsSelected)
myListBoxItem.IsEnabled = false;
else if (TestSetting.DeviceSettings[i].IsNetwork && !DeviceDiscovery.IsSelected)
myListBoxItem.IsEnabled = false;
else
myListBoxItem.IsEnabled = true;
}
}
But a problem occurs at this statement:
ListBoxItem myListBoxItem = (ListBoxItem)(listBoxAddresses.ItemContainerGenerator.ContainerFromItem(listBoxAddresses.Items[i]));
Everytime I added a new item, the statement above always returns null so the new item that was added was not checked if would be enabled or not. Is there a way for this statement to return the correct ListBoxItem that I need?
| wpf | null | null | null | null | null | open | listBox.ItemContainerGenerator.ContainerFromItem() returns null to the NEW item added in the listbox
===
This is my first post here so I hope you could help me with my problem regarding WPF.
I have a listbox that is bind with an ObservableCollection:
public ObservableCollection<DeviceSetting> DeviceSettings
{
get { return _deviceSettings; }
set { _deviceSettings = value; }
}
<ListBox ItemTemplate="{StaticResource IPItemTemplate}" Name="listBoxAddresses" SelectionMode="Extended" ItemsSource="{Binding Path=TestSetting.DeviceSettings, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
ItemContainerStyle="{StaticResource ContainerStyle}" />
The situation here is, I would like to know if a new item has been added to the list so what I did was create a CollectionChanged event:
TestSetting.DeviceSettings.CollectionChanged += mListBox_CollectionChanged;
private void mListBox_CollectionChanged(object sender,NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
for (int i = 0; i < TestSetting.DeviceSettings.Count; i++){
ListBoxItem myListBoxItem = (ListBoxItem)(listBoxAddresses.ItemContainerGenerator.ContainerFromItem(listBoxAddresses.Items[i]));
if (!TestSetting.DeviceSettings[i].IsNetwork && DeviceDiscovery.IsSelected)
myListBoxItem.IsEnabled = false;
else if (TestSetting.DeviceSettings[i].IsNetwork && !DeviceDiscovery.IsSelected)
myListBoxItem.IsEnabled = false;
else
myListBoxItem.IsEnabled = true;
}
}
But a problem occurs at this statement:
ListBoxItem myListBoxItem = (ListBoxItem)(listBoxAddresses.ItemContainerGenerator.ContainerFromItem(listBoxAddresses.Items[i]));
Everytime I added a new item, the statement above always returns null so the new item that was added was not checked if would be enabled or not. Is there a way for this statement to return the correct ListBoxItem that I need?
| 0 |
3,848,953 | 10/03/2010 07:25:29 | 256,007 | 01/21/2010 17:10:22 | 395 | 40 | LED Quix Buzzer Circuit With Logic Gates | I want to Make Simple a Quiz Buzzer Circuit With LED. e.g. I need LED instead of Buzzer. I don't need any reset Switch.
I want to maximize the Use of Logic Gates in this Circuit.
and Obviously no Capacitors are Allowed.and obviously no microcontroller.
I am trying to do this for 2 days. But Cannot Make it Out.
I think The Basic Idea should be this:
<img src="http://www.freeimagehosting.net/uploads/92da05b218.png" />
I've done a Lot of things on the top of this but non of them seemed to work. | logic | boolean-logic | electronics | circuit | null | 10/13/2010 05:48:15 | off topic | LED Quix Buzzer Circuit With Logic Gates
===
I want to Make Simple a Quiz Buzzer Circuit With LED. e.g. I need LED instead of Buzzer. I don't need any reset Switch.
I want to maximize the Use of Logic Gates in this Circuit.
and Obviously no Capacitors are Allowed.and obviously no microcontroller.
I am trying to do this for 2 days. But Cannot Make it Out.
I think The Basic Idea should be this:
<img src="http://www.freeimagehosting.net/uploads/92da05b218.png" />
I've done a Lot of things on the top of this but non of them seemed to work. | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.