PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,066,092 | 08/15/2011 14:26:02 | 846,351 | 07/15/2011 11:20:02 | 25 | 0 | WPF.RoutedEvents,Commands,Dependecy Properties tutorial? | I am looking for a good tutorial preferably video that teaches SLOWLY and throughtly what are:
RoutedEvents,Commands,Dependecy Properties
and how to use them in order to create large scale WPF project.
I have tried to watch a few tutrials and read the MSDNand got very confused. | c# | wpf | mvvm | null | null | 08/15/2011 15:30:41 | not constructive | WPF.RoutedEvents,Commands,Dependecy Properties tutorial?
===
I am looking for a good tutorial preferably video that teaches SLOWLY and throughtly what are:
RoutedEvents,Commands,Dependecy Properties
and how to use them in order to create large scale WPF project.
I have tried to watch a few tutrials and read the MSDNand got very confused. | 4 |
3,766,939 | 09/22/2010 06:51:52 | 454,740 | 09/22/2010 06:51:52 | 1 | 0 | Object Oriented Language |
HI
I am new to C#.I know al the object oriened language concepts theoritically.
But i dont know where and when to use (abstraction , Interface ,Polymorphism ,
overriding,overloading, Encapsulation) concepts.
I want to know what are advantages..like what is use of overloading.
Method with same name but diiferent parameters.., we can use methods
with different name why to use overloading
| c# | oop | null | null | null | 09/22/2010 06:58:29 | not a real question | Object Oriented Language
===
HI
I am new to C#.I know al the object oriened language concepts theoritically.
But i dont know where and when to use (abstraction , Interface ,Polymorphism ,
overriding,overloading, Encapsulation) concepts.
I want to know what are advantages..like what is use of overloading.
Method with same name but diiferent parameters.., we can use methods
with different name why to use overloading
| 1 |
10,023,558 | 04/05/2012 06:19:17 | 1,314,472 | 04/05/2012 06:00:54 | 1 | 0 | Creating a lottery game of some sort | i am creating a lottery type game where players are able to click a button, and they can then get a random amount of coins (a high amount being rare and low amount being common.)
So far all i could think of is an array, is there a more efficient way of doing this?
private static final int[] REWARDS = {10, 25, 50, 100, 250, 500, 1000};
| java | null | null | null | null | 04/05/2012 12:08:56 | too localized | Creating a lottery game of some sort
===
i am creating a lottery type game where players are able to click a button, and they can then get a random amount of coins (a high amount being rare and low amount being common.)
So far all i could think of is an array, is there a more efficient way of doing this?
private static final int[] REWARDS = {10, 25, 50, 100, 250, 500, 1000};
| 3 |
8,606,563 | 12/22/2011 16:07:06 | 812,206 | 06/23/2011 12:39:32 | 12 | 0 | PHP date() reliability | I am building a package that heavily relies on the current week number of the year as well as the forthcoming 4 or 5 week numbers. I know that sounds kind of confusing but lets say this week amounts to the 51st one of the year. The next 4 week numbers would be:
1. 52
2. 1
3. 2
4. 3
My Question:
How reliable is PHP's date() function? The library isn't very well documented and the comments underneath make me a little nervous about using it. I am using the following to get the current week number:
echo $weekNumber = date("W");
Is that a reliable way of working with dates? Any recommendations? I am not very good with dates and times and the sheer size of the various functions available in PHP's native library has left me very confused (time(),strtotime(),date() etc)
I need guidance oh wise ones.
Thanks :) | php | php5 | datetime | date | time | null | open | PHP date() reliability
===
I am building a package that heavily relies on the current week number of the year as well as the forthcoming 4 or 5 week numbers. I know that sounds kind of confusing but lets say this week amounts to the 51st one of the year. The next 4 week numbers would be:
1. 52
2. 1
3. 2
4. 3
My Question:
How reliable is PHP's date() function? The library isn't very well documented and the comments underneath make me a little nervous about using it. I am using the following to get the current week number:
echo $weekNumber = date("W");
Is that a reliable way of working with dates? Any recommendations? I am not very good with dates and times and the sheer size of the various functions available in PHP's native library has left me very confused (time(),strtotime(),date() etc)
I need guidance oh wise ones.
Thanks :) | 0 |
10,433,427 | 05/03/2012 14:25:13 | 1,372,696 | 05/03/2012 14:07:03 | 1 | 0 | Gwt - TextBox KeyUpEvent Synchronization | I have textbox used for filtering data from Flextable.
When Internet explorer debugging is enabled in IE9 it works totally fine. But in IE8,when user types at the fast pace in textbox, i see Javascript exceptions. Because there is a clash in keyupevent rendering.
How can i queue each of the keyUpevent,when the user types in?
Here is my code:
TextBox nameFilter = new TextBox();
nameFilter.addKeyUpHandler( new KeyUpHandler()
{
public void onKeyUp( KeyUpEvent event )
{
int count = 0;
userInput = ( (TextBox)event.getSource() ).getText();
/*
Timer t = new Timer()
{
@Override
public void run()
{
System.out.println( "SearchText : " + searchText );
}
};
t.schedule( 1000 );
*/
if ( inProgress )
{
inProgress = false;
searchText = userInput;
}
else
{
searchText = userInput;
}
Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand()
{
public void execute()
{
if ( ( searchText != null ) && ( searchText.length() > 0 ) )
{
startSearch();
}
else
{
presenter.loadGroups();
chooseFilteredMap = false;
}
}
} );
}
} );
private void startSearch()
{
inProgress = true;
chooseFilteredMap = true;
AdminGroupDTO dto = new AdminGroupDTO();
List<AdminGroupDTO.GroupInfo> groupInfoList = new ArrayList<AdminGroupDTO.GroupInfo>();
Set<GroupFilterDTO> keys = filterDTOGroupInfoMap.keySet();
for ( GroupFilterDTO groupFilterDTO : keys )
{
if ( groupFilterDTO.soundLike( searchText) )
{
if(!inProgress)
startSearch();
groupInfoList.add( filterDTOGroupInfoMap.get( groupFilterDTO ) );
}
}
dto.setGroupInfoList( groupInfoList );
setData( dto );
inProgress = false;
}
private void setDataUsingFilteredResultSet( AdminGroupDTO groupDTO, int rowNum, int count )
{
// Window.alert( "Inside setDataUsingFilteredResultSet method" );
filteredResultSet.clear();
for ( AdminGroupDTO.GroupInfo groupInfo : groupDTO.getGroupInfoList() )
{
filteredResultSet.put( count, groupInfo );
if ( rowNum < visibleRange )
{
rowNum = table.insertRow( table.getRowCount() );
createRowWidgets( rowNum, groupInfo );
}
count++;
}
if ( table.getRowCount() == filteredResultSet.size() )
{
if(!inProgress)
startSearch();
showMoreButton.setVisible( false );
showMoreButton.setEnabled( false );
}
else
{
if(!inProgress)
startSearch();
showMoreButton.setVisible( true );
showMoreButton.setEnabled( true );
}
}
| gwt2 | null | null | null | null | null | open | Gwt - TextBox KeyUpEvent Synchronization
===
I have textbox used for filtering data from Flextable.
When Internet explorer debugging is enabled in IE9 it works totally fine. But in IE8,when user types at the fast pace in textbox, i see Javascript exceptions. Because there is a clash in keyupevent rendering.
How can i queue each of the keyUpevent,when the user types in?
Here is my code:
TextBox nameFilter = new TextBox();
nameFilter.addKeyUpHandler( new KeyUpHandler()
{
public void onKeyUp( KeyUpEvent event )
{
int count = 0;
userInput = ( (TextBox)event.getSource() ).getText();
/*
Timer t = new Timer()
{
@Override
public void run()
{
System.out.println( "SearchText : " + searchText );
}
};
t.schedule( 1000 );
*/
if ( inProgress )
{
inProgress = false;
searchText = userInput;
}
else
{
searchText = userInput;
}
Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand()
{
public void execute()
{
if ( ( searchText != null ) && ( searchText.length() > 0 ) )
{
startSearch();
}
else
{
presenter.loadGroups();
chooseFilteredMap = false;
}
}
} );
}
} );
private void startSearch()
{
inProgress = true;
chooseFilteredMap = true;
AdminGroupDTO dto = new AdminGroupDTO();
List<AdminGroupDTO.GroupInfo> groupInfoList = new ArrayList<AdminGroupDTO.GroupInfo>();
Set<GroupFilterDTO> keys = filterDTOGroupInfoMap.keySet();
for ( GroupFilterDTO groupFilterDTO : keys )
{
if ( groupFilterDTO.soundLike( searchText) )
{
if(!inProgress)
startSearch();
groupInfoList.add( filterDTOGroupInfoMap.get( groupFilterDTO ) );
}
}
dto.setGroupInfoList( groupInfoList );
setData( dto );
inProgress = false;
}
private void setDataUsingFilteredResultSet( AdminGroupDTO groupDTO, int rowNum, int count )
{
// Window.alert( "Inside setDataUsingFilteredResultSet method" );
filteredResultSet.clear();
for ( AdminGroupDTO.GroupInfo groupInfo : groupDTO.getGroupInfoList() )
{
filteredResultSet.put( count, groupInfo );
if ( rowNum < visibleRange )
{
rowNum = table.insertRow( table.getRowCount() );
createRowWidgets( rowNum, groupInfo );
}
count++;
}
if ( table.getRowCount() == filteredResultSet.size() )
{
if(!inProgress)
startSearch();
showMoreButton.setVisible( false );
showMoreButton.setEnabled( false );
}
else
{
if(!inProgress)
startSearch();
showMoreButton.setVisible( true );
showMoreButton.setEnabled( true );
}
}
| 0 |
4,509,798 | 12/22/2010 13:49:47 | 182,513 | 10/01/2009 13:35:06 | 135 | 5 | Finding nearest point in an efficient way | I've got a point in 2d plane for example (x0,y0) and a set of n points (x1,y1)...(xn,yn) and I want to find nearest point to (x0,y0) in a way better than trying all points. Any solutions?
I should also say that my points are sorted in this way:
bool less(point a,point b){
if(a.x!=b.x)
return a.x<b.x;
else
return a.y<b.y;
}
| c++ | algorithm | geometry | null | null | null | open | Finding nearest point in an efficient way
===
I've got a point in 2d plane for example (x0,y0) and a set of n points (x1,y1)...(xn,yn) and I want to find nearest point to (x0,y0) in a way better than trying all points. Any solutions?
I should also say that my points are sorted in this way:
bool less(point a,point b){
if(a.x!=b.x)
return a.x<b.x;
else
return a.y<b.y;
}
| 0 |
7,199,458 | 08/26/2011 02:35:06 | 127,320 | 06/23/2009 03:11:55 | 11,936 | 684 | Online web banner creator suggestions | Looking for a free online animated web banner creator. I found one after search but the banner templates didn't suit for my needs.
Regards. | css | null | null | null | null | 08/26/2011 03:07:34 | off topic | Online web banner creator suggestions
===
Looking for a free online animated web banner creator. I found one after search but the banner templates didn't suit for my needs.
Regards. | 2 |
5,841,505 | 04/30/2011 11:44:05 | 723,374 | 04/25/2011 07:16:45 | 19 | 0 | Help me convince a teacher that he needs to stop teaching IE filters! | ## The Issue ##
Just to give you some background, I'm currently enrolled as a student at the University of Mary Hardin-Baylor. Currently the web design classes there is somewhat... sub-par. My DHTML teacher worked on websites in the Netscape/IE clash and most of the stuff he teaches is deprecated, non-semantic HTML, or inline code. He is still a huge supporter of IE and is still avid about students learning IE filters. He seems to see no need to support multiple browsers. I'd really like to see the web design section of the school grow and as long as the teachers are still teaching deprecated code, it probably won't. I'm planning on sending him an e-mail trying to convince him to drop the IE filters section of the course next semester and replace it with something that students will actually be able to use cross-browser.
## The Request ##
I need help building my argument.
- I need to build a list of reasons on
why filters are deprecated and
shouldn't be used(I believe they
aren't even supported in IE9
anymore).
- It might also be advantageous to give
reasons why cross-browser support
should be achieved.
- I need some reputable sources that I
can quote. This excludes sites like
wikipedia.
Also, on a side note, one of the reasons I'm asking this here is because I don't have any type of real world coding experience. If I had support from someone else who worked in the same era of the web, it could do wonders for the legitimacy of my argument. I don't want this to sound like I'm just bashing his methods, or even worse... just trying to get out of work.
<p>Thank you in advance for any help you post! I know this is a huge request. I appreciate any time your willing to give.</p> | javascript | css | internet-explorer | deprecated | college | 04/30/2011 13:24:29 | off topic | Help me convince a teacher that he needs to stop teaching IE filters!
===
## The Issue ##
Just to give you some background, I'm currently enrolled as a student at the University of Mary Hardin-Baylor. Currently the web design classes there is somewhat... sub-par. My DHTML teacher worked on websites in the Netscape/IE clash and most of the stuff he teaches is deprecated, non-semantic HTML, or inline code. He is still a huge supporter of IE and is still avid about students learning IE filters. He seems to see no need to support multiple browsers. I'd really like to see the web design section of the school grow and as long as the teachers are still teaching deprecated code, it probably won't. I'm planning on sending him an e-mail trying to convince him to drop the IE filters section of the course next semester and replace it with something that students will actually be able to use cross-browser.
## The Request ##
I need help building my argument.
- I need to build a list of reasons on
why filters are deprecated and
shouldn't be used(I believe they
aren't even supported in IE9
anymore).
- It might also be advantageous to give
reasons why cross-browser support
should be achieved.
- I need some reputable sources that I
can quote. This excludes sites like
wikipedia.
Also, on a side note, one of the reasons I'm asking this here is because I don't have any type of real world coding experience. If I had support from someone else who worked in the same era of the web, it could do wonders for the legitimacy of my argument. I don't want this to sound like I'm just bashing his methods, or even worse... just trying to get out of work.
<p>Thank you in advance for any help you post! I know this is a huge request. I appreciate any time your willing to give.</p> | 2 |
10,996,362 | 06/12/2012 12:09:08 | 406,762 | 07/30/2010 13:35:07 | 686 | 5 | Anyone know where I can get high quality powerpoint presentation themes? | Trying to look for themes on Google but results are all pretty bad, anyone have any sites they use for high quality themes? | powerpoint | null | null | null | null | 06/13/2012 02:23:44 | off topic | Anyone know where I can get high quality powerpoint presentation themes?
===
Trying to look for themes on Google but results are all pretty bad, anyone have any sites they use for high quality themes? | 2 |
7,925,765 | 10/28/2011 06:14:06 | 786,954 | 05/04/2011 05:59:14 | 228 | 0 | divide 24 hours with a particular number | I am making an iphone app in which I am implementing the concept of alarm. Let user select the frequency 7, so that 24 hrs divided by 7. How to divide 24hours with a particular number so that I get proper time interval.
Thanks alot. | iphone | null | null | null | null | 10/28/2011 11:32:48 | too localized | divide 24 hours with a particular number
===
I am making an iphone app in which I am implementing the concept of alarm. Let user select the frequency 7, so that 24 hrs divided by 7. How to divide 24hours with a particular number so that I get proper time interval.
Thanks alot. | 3 |
4,676,568 | 01/13/2011 03:42:17 | 331,896 | 05/03/2010 23:46:11 | 153 | 1 | Call WCF Service Through Javascript, AJAX, or JQuery | I created a number of standard WCF Services (Service Contract and Host (svc) are in separate assemblies). I fired up a Web Site in IIS to host the Services (i.e., address is http://services:1000/wcfservices.svc).
Then in my Web Site project I added the reference. I am able to call the services normally. I am needed to call some of the services client side. Not sure if I should be looking at articles calling WCF services through AJAX, JQuery, or JSON enabled WCF Services. Can anyone provide any thoughts or experience with configuring as such?
Some of the changes I made was adding the following to the Operation Contract:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "SetFoo")]
void SetFoo(string Id);
Then this above the implementation of the interface:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
Then in the service webconfig I have this (parens are angle brackets):
(serviceHostingEnvironment aspNetCompatibilityEnabled="true")
(baseAddressPrefixFilters)
(add prefix="http://services:1000/wcfservices.svc/"/)
(/baseAddressPrefixFilters)
(/serviceHostingEnvironment)
(serviceHostingEnvironment multipleSiteBindingsEnabled="false" /)
Then in the client side I attempted this:
(asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server")
(compositeScript)
(Scripts)
(asp:ScriptReference Path="http://Flixsit:1000/FlixsitWebServices.svc" /)
(/Scripts)
(/CompositeScript)
(/asp:ScriptManagerProxy)
I am attempting to call the service like this in javascript:
wcfservices.SetFoo(string Id);
Nothing is working. If it is idea or a better solution to call JSON enable, JQuery, etc....I am willing to make any changes.
Thanks for any suggestions/tips provided.... | asp.net | ajax | wcf | null | null | null | open | Call WCF Service Through Javascript, AJAX, or JQuery
===
I created a number of standard WCF Services (Service Contract and Host (svc) are in separate assemblies). I fired up a Web Site in IIS to host the Services (i.e., address is http://services:1000/wcfservices.svc).
Then in my Web Site project I added the reference. I am able to call the services normally. I am needed to call some of the services client side. Not sure if I should be looking at articles calling WCF services through AJAX, JQuery, or JSON enabled WCF Services. Can anyone provide any thoughts or experience with configuring as such?
Some of the changes I made was adding the following to the Operation Contract:
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "SetFoo")]
void SetFoo(string Id);
Then this above the implementation of the interface:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
Then in the service webconfig I have this (parens are angle brackets):
(serviceHostingEnvironment aspNetCompatibilityEnabled="true")
(baseAddressPrefixFilters)
(add prefix="http://services:1000/wcfservices.svc/"/)
(/baseAddressPrefixFilters)
(/serviceHostingEnvironment)
(serviceHostingEnvironment multipleSiteBindingsEnabled="false" /)
Then in the client side I attempted this:
(asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server")
(compositeScript)
(Scripts)
(asp:ScriptReference Path="http://Flixsit:1000/FlixsitWebServices.svc" /)
(/Scripts)
(/CompositeScript)
(/asp:ScriptManagerProxy)
I am attempting to call the service like this in javascript:
wcfservices.SetFoo(string Id);
Nothing is working. If it is idea or a better solution to call JSON enable, JQuery, etc....I am willing to make any changes.
Thanks for any suggestions/tips provided.... | 0 |
9,666,425 | 03/12/2012 11:46:02 | 1,080,997 | 12/05/2011 06:10:15 | 54 | 1 | How to disable a button after clicking it in OpenERP | This might be a simple question.but,does any one know how to disable a button after clicking it in OpenERP?
Please help!!!!!
Thanks for all your help.... | python | openerp | null | null | null | null | open | How to disable a button after clicking it in OpenERP
===
This might be a simple question.but,does any one know how to disable a button after clicking it in OpenERP?
Please help!!!!!
Thanks for all your help.... | 0 |
8,205,437 | 11/20/2011 22:52:23 | 682,308 | 03/29/2011 15:00:33 | 283 | 6 | Arch Linux - How to pass arguments to daemon in rc.conf | If I add a daemon to rc.conf, how can I then pass arguments to it?
Eg
`DAEMONS = (sshd mongodb ...)`
How can I pass `--replSet` to the `mongodb` daemon? | daemon | rc | archlinux | null | null | 12/02/2011 17:24:35 | off topic | Arch Linux - How to pass arguments to daemon in rc.conf
===
If I add a daemon to rc.conf, how can I then pass arguments to it?
Eg
`DAEMONS = (sshd mongodb ...)`
How can I pass `--replSet` to the `mongodb` daemon? | 2 |
2,376,407 | 03/04/2010 01:52:49 | 285,909 | 03/04/2010 01:52:49 | 1 | 0 | How do i edit Values in Visual Studio 2008? | hello im making a application and i need to know how to change the values of address's for example : Memory Address : 0xB7CE50 Value : 100000
Is there a wiki page or a function for this? if so what is it? | visual-studio-2008 | value | memory | address | null | null | open | How do i edit Values in Visual Studio 2008?
===
hello im making a application and i need to know how to change the values of address's for example : Memory Address : 0xB7CE50 Value : 100000
Is there a wiki page or a function for this? if so what is it? | 0 |
11,263,294 | 06/29/2012 14:05:57 | 1,351,546 | 04/23/2012 14:15:31 | 35 | 1 | integer division in mySql | I have a mySql table which has a product_id field (big integer)
> 1102330008
1102330025
1102330070
1103010009
1103010010
1103020006
...
I want to select rows which have product_id like
> 110301 * * * *
I used this query:
SELECT * FROM `product` WHERE (product_id/10000)=110301
but it does not return any values with this message:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0005 sec )
Please Help! | mysql | select | null | null | null | null | open | integer division in mySql
===
I have a mySql table which has a product_id field (big integer)
> 1102330008
1102330025
1102330070
1103010009
1103010010
1103020006
...
I want to select rows which have product_id like
> 110301 * * * *
I used this query:
SELECT * FROM `product` WHERE (product_id/10000)=110301
but it does not return any values with this message:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0005 sec )
Please Help! | 0 |
4,067,093 | 11/01/2010 06:48:17 | 218,455 | 11/25/2009 09:57:19 | 5 | 0 | Mustache: read variables from parent section in child section | Is it possible in Mustache to read variable from parent section while in child section?
for instance my example below, I want the **{{order_store.id}}** to read variable from it's parent **$order_store[(array index of current child loop)]['id']**
the template.mustache
{{#order_store}}<table>
<caption>
Store Name: {{name}}
Product Ordered: {{products}}
Product Weights: {{products_weight}}
</caption>
<tbody>
{{#shipping_method}}<tr>
<td>
<input type="radio" name="shipping[{{order_store.id}}]" id="shipping-{{id}}" value="{{id}}" />
<label for="shipping-{{id}}">{{name}}</label>
</td>
<td>{{description}}</td>
<td>{{price}}</td>
</tr>{{/shipping_method}}
</tbody>
</table>{{/order_store}}
sample data (in PHP);
$order_store => array(
array(
'id' => 1,
'name' => 'Kyriena Cookies',
'shipping_method' => array(
array(
'id' => 1,
'name' => 'Poslaju',
'description' => 'Poslaju courier'
),
array(
'id' => 2,
'name' => 'SkyNET',
'description' => 'Skynet courier'
),
),
)); | php | mustache | null | null | null | null | open | Mustache: read variables from parent section in child section
===
Is it possible in Mustache to read variable from parent section while in child section?
for instance my example below, I want the **{{order_store.id}}** to read variable from it's parent **$order_store[(array index of current child loop)]['id']**
the template.mustache
{{#order_store}}<table>
<caption>
Store Name: {{name}}
Product Ordered: {{products}}
Product Weights: {{products_weight}}
</caption>
<tbody>
{{#shipping_method}}<tr>
<td>
<input type="radio" name="shipping[{{order_store.id}}]" id="shipping-{{id}}" value="{{id}}" />
<label for="shipping-{{id}}">{{name}}</label>
</td>
<td>{{description}}</td>
<td>{{price}}</td>
</tr>{{/shipping_method}}
</tbody>
</table>{{/order_store}}
sample data (in PHP);
$order_store => array(
array(
'id' => 1,
'name' => 'Kyriena Cookies',
'shipping_method' => array(
array(
'id' => 1,
'name' => 'Poslaju',
'description' => 'Poslaju courier'
),
array(
'id' => 2,
'name' => 'SkyNET',
'description' => 'Skynet courier'
),
),
)); | 0 |
7,738,818 | 10/12/2011 10:43:03 | 891,216 | 08/12/2011 06:16:59 | 19 | 0 | Dynamically setting the sum formulla in excel | I want to sum two cells values.like i want sum of A1 and A2 in C1 then the formulla will be =sum(A1,A2). but in this formulla row number fixed(i.e. 1 and 2). but I want that row number should be decided dynamically in excel.
suppose i have integer values in cell range A1 to A100.Now i want sum of any two values beween A1 to A100. I am putting row number in B1 and B2 and writting this formulla in C1
=SUM(A&B1,A&B2)
so in above formulla Column A is fixed and i want to pick row number from other cell.
for example if i enter the 5 in B1 and 10 in B2 the formulla should sum the A5 and A10 values.similarly i can enter any value between 1- 100 in column B1 and B2.
I want to do it directly in excel not in macro. | excel | excel-2003 | null | null | null | null | open | Dynamically setting the sum formulla in excel
===
I want to sum two cells values.like i want sum of A1 and A2 in C1 then the formulla will be =sum(A1,A2). but in this formulla row number fixed(i.e. 1 and 2). but I want that row number should be decided dynamically in excel.
suppose i have integer values in cell range A1 to A100.Now i want sum of any two values beween A1 to A100. I am putting row number in B1 and B2 and writting this formulla in C1
=SUM(A&B1,A&B2)
so in above formulla Column A is fixed and i want to pick row number from other cell.
for example if i enter the 5 in B1 and 10 in B2 the formulla should sum the A5 and A10 values.similarly i can enter any value between 1- 100 in column B1 and B2.
I want to do it directly in excel not in macro. | 0 |
9,277,270 | 02/14/2012 12:59:48 | 1,209,099 | 02/14/2012 12:48:33 | 1 | 0 | Using a dash in a xpath does not work in python | I'm curreny using py-dom-xpath (http://code.google.com/p/py-dom-xpath/downloads/list) with python 2.7.2 under Debian 4.1.1-21. Everything works pretty well, instead of one XML element.
Whenever I try to check a XML document for a xpath like //AAA/BBB/CCC-DDD the path is not found. It's the only node with a dash "-" in it. I already tried to escape the dash, but that didn't work.
I also tried //*[name()='CCC-DDD'] and the "starts-with" and "contains" statement. the element is definately in the XML and the spelling is also correct.
I tried an online xpath validation site (http://chris.photobooks.com/xml/default.htm), and it works flawless there, even with the dash.
Any help is appreciated. | python | xml | xpath | null | null | null | open | Using a dash in a xpath does not work in python
===
I'm curreny using py-dom-xpath (http://code.google.com/p/py-dom-xpath/downloads/list) with python 2.7.2 under Debian 4.1.1-21. Everything works pretty well, instead of one XML element.
Whenever I try to check a XML document for a xpath like //AAA/BBB/CCC-DDD the path is not found. It's the only node with a dash "-" in it. I already tried to escape the dash, but that didn't work.
I also tried //*[name()='CCC-DDD'] and the "starts-with" and "contains" statement. the element is definately in the XML and the spelling is also correct.
I tried an online xpath validation site (http://chris.photobooks.com/xml/default.htm), and it works flawless there, even with the dash.
Any help is appreciated. | 0 |
9,444,801 | 02/25/2012 14:23:13 | 1,232,587 | 02/25/2012 14:08:41 | 1 | 0 | netbeans/metro ws - how do I make a child property required/minOccurs=1 | I have built a web service in Netbeans using Metro and javax.xml.bind annotations.
It all works. I can make web service parameters mandatory using
@WebMethod(operationName = "doIt")
@WebResult(name = "result" )
public Result doIt(
@WebParam(name = "param1") @XmlElement(name = "param1",required=true ) String param1) {
...
}
But if param1 is a simple object, how do I make specific properties required ?
I've tried annotations in the param1 class... eg.
In main Web Service
@WebMethod(operationName = "doIt")
@WebResult(name = "result" )
public Result doIt(
Param param1) {
...
}
then in Param class :
@XmlAccessorType(XmlAccessType.PROPERTY)
public class Param {
@XmlElement(name = "mustHave",required=true )
private String mustHave;
private String optional;
}
But I just get vague exceptions from Metro:
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: javax.servlet.ServletException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: Unable to create JAXBContext
| web-services | xml-schema | java-metro-framework | null | null | null | open | netbeans/metro ws - how do I make a child property required/minOccurs=1
===
I have built a web service in Netbeans using Metro and javax.xml.bind annotations.
It all works. I can make web service parameters mandatory using
@WebMethod(operationName = "doIt")
@WebResult(name = "result" )
public Result doIt(
@WebParam(name = "param1") @XmlElement(name = "param1",required=true ) String param1) {
...
}
But if param1 is a simple object, how do I make specific properties required ?
I've tried annotations in the param1 class... eg.
In main Web Service
@WebMethod(operationName = "doIt")
@WebResult(name = "result" )
public Result doIt(
Param param1) {
...
}
then in Param class :
@XmlAccessorType(XmlAccessType.PROPERTY)
public class Param {
@XmlElement(name = "mustHave",required=true )
private String mustHave;
private String optional;
}
But I just get vague exceptions from Metro:
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: javax.servlet.ServletException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: Unable to create JAXBContext
| 0 |
2,729,651 | 04/28/2010 13:08:19 | 198,119 | 10/28/2009 13:50:50 | 24 | 3 | Dependency Property Set Priority: CodeBehind vs. XAML | When I initialize a control property from code, the binding to the same property defined on XAML don't work. Why?
For Example, I set control properties on startup with this statements:
myControl.SetValue(UIElement.VisibilityProperty, DefaultProp.Visibility);
myControl.SetValue(UIElement.IsEnabledProperty, DefaultProp.IsEnabled);
and on xaml I bind the property of myControl in this way:
IsEnabled="{Binding Path=IsKeyControlEnabled}"
now, when the property "IsKeyControlEnabled" changes to false, myControl remains enabled (because it's initialize with true value).
How can I do? | wpf | xaml | dependency-properties | binding | null | null | open | Dependency Property Set Priority: CodeBehind vs. XAML
===
When I initialize a control property from code, the binding to the same property defined on XAML don't work. Why?
For Example, I set control properties on startup with this statements:
myControl.SetValue(UIElement.VisibilityProperty, DefaultProp.Visibility);
myControl.SetValue(UIElement.IsEnabledProperty, DefaultProp.IsEnabled);
and on xaml I bind the property of myControl in this way:
IsEnabled="{Binding Path=IsKeyControlEnabled}"
now, when the property "IsKeyControlEnabled" changes to false, myControl remains enabled (because it's initialize with true value).
How can I do? | 0 |
3,078,590 | 06/20/2010 08:08:48 | 30,674 | 10/23/2008 06:54:58 | 5,425 | 141 | How do I update my own Mecurial Fork with the lastest code in the main code base? | I've got a fork of some codeplex project. I wish to update my fork with the latest code in the official code (is that the trunk?).
How can I do this?
I'm also using [TortoiseHG][1] on Win7 x64.
Thanks :)
[1]: http://tortoisehg.org/ | mercurial | mercurial-hg | null | null | null | null | open | How do I update my own Mecurial Fork with the lastest code in the main code base?
===
I've got a fork of some codeplex project. I wish to update my fork with the latest code in the official code (is that the trunk?).
How can I do this?
I'm also using [TortoiseHG][1] on Win7 x64.
Thanks :)
[1]: http://tortoisehg.org/ | 0 |
1,700,086 | 11/09/2009 09:59:58 | 203,372 | 11/05/2009 11:18:08 | 8 | 1 | need help about how to add Menu page | i'm download DrillDownApp example project from iPhoneSDKArticles
i have a problem when i'm try to add menu page
before load MainWindow.
i'm new to iphone development, need some advise please , thanks all | iphone | null | null | null | null | null | open | need help about how to add Menu page
===
i'm download DrillDownApp example project from iPhoneSDKArticles
i have a problem when i'm try to add menu page
before load MainWindow.
i'm new to iphone development, need some advise please , thanks all | 0 |
5,952,641 | 05/10/2011 15:36:56 | 471,842 | 10/11/2010 01:33:35 | 166 | 15 | decorating decorators: try to get my head around understanding it | I'm trying to understand decorating decorators, and wanted to try out the following:
Let's say I have to decorators and apply them to the function hello:
def wrap(f):
def wrapper():
return " ".join(f())
return wrapper
def upper(f):
def uppercase(*args, **kargs):
a,b = f(*args, **kargs)
return a.upper(), b.upper()
return uppercase
@wrap
@upper
def hello():
return "hello","world"
print hello()
Then I have to start adding other decorators for other functions,
but in general the wrap decorator will "wrap all of them"
def lower(f):
def lowercase(*args, **kargs):
a,b = f(*args, **kargs)
return a.lower(), b.lower()
return lowercase
@wrap
@lower
def byebye():
return "bye", "bye"
Now how do I write a decorator, with witch I can decorate my lower and upper decorators:
@wrap
def lower():
...
@wrap
def upper():
...
To achieve the same result as above by only doing:
@upper
def hello():
...
@lower
def byebye():
...
thx. | python | decorator | null | null | null | null | open | decorating decorators: try to get my head around understanding it
===
I'm trying to understand decorating decorators, and wanted to try out the following:
Let's say I have to decorators and apply them to the function hello:
def wrap(f):
def wrapper():
return " ".join(f())
return wrapper
def upper(f):
def uppercase(*args, **kargs):
a,b = f(*args, **kargs)
return a.upper(), b.upper()
return uppercase
@wrap
@upper
def hello():
return "hello","world"
print hello()
Then I have to start adding other decorators for other functions,
but in general the wrap decorator will "wrap all of them"
def lower(f):
def lowercase(*args, **kargs):
a,b = f(*args, **kargs)
return a.lower(), b.lower()
return lowercase
@wrap
@lower
def byebye():
return "bye", "bye"
Now how do I write a decorator, with witch I can decorate my lower and upper decorators:
@wrap
def lower():
...
@wrap
def upper():
...
To achieve the same result as above by only doing:
@upper
def hello():
...
@lower
def byebye():
...
thx. | 0 |
4,116,259 | 11/07/2010 02:32:10 | 197,036 | 10/27/2009 03:15:27 | 555 | 3 | any good software html verifier | How can I verify a html file is well formed? I want to find the problems such as lack of closing `</div>` vice versa. | html | css | null | null | null | null | open | any good software html verifier
===
How can I verify a html file is well formed? I want to find the problems such as lack of closing `</div>` vice versa. | 0 |
3,841,107 | 10/01/2010 16:22:20 | 464,059 | 10/01/2010 16:22:20 | 1 | 0 | Nested Set Filtering | I'm using nested set model for my menu tree, and I'm trying to get nodes with some filtering. I have several root nodes.
Example:
Menu1(on)
\-Submenu1(on)
\-Submenu2(on)
Menu2(off)
\-Submenu3(on)
\-Submenu4(on)
\-Submenu5(on)
Menu3(on)
I want to return all nodes "on" but not the ones that have parents "off".
The query, for the example above, should return only Menu1 (and children) and Menu3.
Menu1(on)
\-Submenu1(on)
\-Submenu2(on)
Menu2(on)
\-Submenu3(on)
\-Submenu4(off)
\-Submenu5(on)
Menu3(on)
For this example, the query should return all except Submenu4 and it's children.
Any ideas?
Thanks in advance.
| mysql | nested | set | null | null | null | open | Nested Set Filtering
===
I'm using nested set model for my menu tree, and I'm trying to get nodes with some filtering. I have several root nodes.
Example:
Menu1(on)
\-Submenu1(on)
\-Submenu2(on)
Menu2(off)
\-Submenu3(on)
\-Submenu4(on)
\-Submenu5(on)
Menu3(on)
I want to return all nodes "on" but not the ones that have parents "off".
The query, for the example above, should return only Menu1 (and children) and Menu3.
Menu1(on)
\-Submenu1(on)
\-Submenu2(on)
Menu2(on)
\-Submenu3(on)
\-Submenu4(off)
\-Submenu5(on)
Menu3(on)
For this example, the query should return all except Submenu4 and it's children.
Any ideas?
Thanks in advance.
| 0 |
3,605,096 | 08/30/2010 23:56:15 | 384,080 | 07/06/2010 00:37:49 | 98 | 2 | installing second instance of reporting service | getting confused here. I'm trying to install a second instance of reporting service sql server 2008 r2. Now does it mean I need to install a second instance of sql server or can i use the existing sql server instance to create anothe reportserver database? | sql | reporting-services | server | null | null | null | open | installing second instance of reporting service
===
getting confused here. I'm trying to install a second instance of reporting service sql server 2008 r2. Now does it mean I need to install a second instance of sql server or can i use the existing sql server instance to create anothe reportserver database? | 0 |
3,309,949 | 07/22/2010 14:29:14 | 399,200 | 07/22/2010 14:29:14 | 1 | 0 | Is HTML 5 + CSS 3 >= Microsoft Silverlight | It is said that the unreleased HTML 5 and CSS 3 can produce the effects and graphics which can be done in Microsoft Silverlight. It thats true then can i skip lering Silverlight and wait for HTML5 and CSS 3? | silverlight | html5 | microsoft | css3 | null | 07/22/2010 14:47:56 | not constructive | Is HTML 5 + CSS 3 >= Microsoft Silverlight
===
It is said that the unreleased HTML 5 and CSS 3 can produce the effects and graphics which can be done in Microsoft Silverlight. It thats true then can i skip lering Silverlight and wait for HTML5 and CSS 3? | 4 |
3,238,556 | 07/13/2010 15:10:43 | 138,627 | 07/15/2009 10:24:43 | 174 | 5 | How to price Consulting ? | I'm giving consulting to someone thta is hired worker in a company.
seveal times a day he wants to ask me abount proggraming things that he get stuck with.
How can I price this service ? | consulting | null | null | null | null | 07/13/2010 15:12:06 | off topic | How to price Consulting ?
===
I'm giving consulting to someone thta is hired worker in a company.
seveal times a day he wants to ask me abount proggraming things that he get stuck with.
How can I price this service ? | 2 |
7,192,366 | 08/25/2011 14:42:16 | 628,736 | 02/22/2011 17:07:19 | 1 | 0 | Need help with regex replace in php | i have a string which includes links of this pattern:
<a href="http://randomurl.com/random_string;url=http://anotherrandomurl.com/">xxxx</a>
i want to remove "http://xxx.xxx.xxx/random_string;url=" and keep the rest of the string, leaving at the end
<a href="http://anotherrandomurl.com/">xxxx</a>
Can anyone help please ? | php | regex | preg-replace | null | null | 08/25/2011 15:47:36 | too localized | Need help with regex replace in php
===
i have a string which includes links of this pattern:
<a href="http://randomurl.com/random_string;url=http://anotherrandomurl.com/">xxxx</a>
i want to remove "http://xxx.xxx.xxx/random_string;url=" and keep the rest of the string, leaving at the end
<a href="http://anotherrandomurl.com/">xxxx</a>
Can anyone help please ? | 3 |
6,950,900 | 08/05/2011 02:56:38 | 152,308 | 08/07/2009 07:07:58 | 329 | 2 | Update query with multiple values | I'm developing query interface in python. Is it possible to update query with multiple values just using SQL language? | python | mysql | sql | oracle | postgresql | 08/07/2011 09:54:31 | not a real question | Update query with multiple values
===
I'm developing query interface in python. Is it possible to update query with multiple values just using SQL language? | 1 |
11,035,577 | 06/14/2012 14:44:51 | 1,366,714 | 04/30/2012 21:19:09 | 1 | 0 | HTML caching versus Javascript and CSS | Please explain HTML caching to me. Does it behave differently than how external files like JS and CSS get cached, or is it the same? Is the actual HTML just as prone to cache?
And if the HTML is prone to cahce, can you *force* the HTML to not cache on command -- from the server -- like when a major update is done to the site content? Or is there never any guarantee a user will get the latest HTML? (Since they may have aggressive caching settings in their browser?)
(Seems to me I can force the latest external JS or CSS by naming the external files a new name, which will ensure that the new files will get downloaded since new files can't be cached. But! This is only good if the HTML itself is fresh and using the new names? How can I make sure that the HTML itself is fresh -- again, after a major update? I want the HTML to cache 90% of the time, but on occasion want to force new HTML. Can I?)
Thanks,
JJB
| html5 | caching | css3 | proxy | gzip | 06/14/2012 16:20:00 | not a real question | HTML caching versus Javascript and CSS
===
Please explain HTML caching to me. Does it behave differently than how external files like JS and CSS get cached, or is it the same? Is the actual HTML just as prone to cache?
And if the HTML is prone to cahce, can you *force* the HTML to not cache on command -- from the server -- like when a major update is done to the site content? Or is there never any guarantee a user will get the latest HTML? (Since they may have aggressive caching settings in their browser?)
(Seems to me I can force the latest external JS or CSS by naming the external files a new name, which will ensure that the new files will get downloaded since new files can't be cached. But! This is only good if the HTML itself is fresh and using the new names? How can I make sure that the HTML itself is fresh -- again, after a major update? I want the HTML to cache 90% of the time, but on occasion want to force new HTML. Can I?)
Thanks,
JJB
| 1 |
3,050,727 | 06/16/2010 04:29:25 | 367,888 | 06/16/2010 04:29:25 | 1 | 0 | how can pass the image in database in php | please send the answer | php | null | null | null | null | 06/17/2010 05:30:27 | not a real question | how can pass the image in database in php
===
please send the answer | 1 |
7,171,023 | 08/24/2011 05:53:25 | 753,502 | 05/14/2011 10:23:55 | 23 | 0 | Repository Pattern with Entity Framework 4.1 and Parent/Child Relationships | I still have some confusion with the Repository Pattern. The primary reason why I want to use this pattern is to avoid calling EF 4.1 specific data access operations from the domain. I'd rather call generic CRUD operations from a IRepository interface. This will make testing easier and if I ever have to change the data access framework in the future, I will be able to do so without refactoring a lot of code.
Here is an example of my situation:
I have 3 tables in the database: Group, Person, and GroupPersonMap. GroupPersonMap is a link table and just consists of the Group and Person primary keys. I created a EF model of the 3 tables with VS 2010 designer. EF was smart enough to assume GroupPersonMap is a link table so it doesn't show it in the designer. I want to use my existing domain objects so I turn off code generation for the model.
My existing classes that matches my EF model are as follows:
public class Group
{
public int GroupId { get; set; }
public string Name { get; set; }
public virtual ICollection<Person> People { get; set; }
}
public class Person
{
public int PersonId {get; set; }
public string FirstName { get; set; }
public virtual ICollection<Group> Groups { get; set; }
}
I have a generic repository interface like so:
public interface IRepository<T> where T: class
{
IQueryable<T> GetAll();
T Add(T entity);
T Update(T entity);
void Delete(T entity);
void Save()
}
and a generic EF repository:
public class EF4Repository<T> : IRepository<T> where T: class
{
public DbContext Context { get; private set; }
private DbSet<T> _dbSet;
public EF4Repository(string connectionString)
{
Context = new DbContext(connectionString);
_dbSet = Context.Set<T>();
}
public IQueryable<T> GetAll()
{
get { // code }
}
public T Insert(T entity)
{
// code
}
public T Update(T entity)
{
// code
}
public void Delete(T entity)
{
// code
}
}
Now suppose I just want to map an existing Group to an existing Person. I would have to do something like the following:
EFRepository<Group> groupRepository = new EFRepository<Group>("name=connString");
EFRepository<Person> personRepository = new EFRepository<Person>("name=connString");
var group = groupRepository.GetAll().Where(g => g.GroupId == 5).First();
var person = personRepository.GetAll().Where(p => p.PersonId == 2).First();
group.People.Add(person);
groupRepository.Update(group);
But this doesn't work because EF thinks Person is new, and will try to insert it into the database. If a primary key constraint existed on PersonId, then I would get a constraint error. I must use EF's `Attach` method to tell EF's `DbContext` that the Person object already exists in the database so just create the link between Group and Person in the `GroupPersonMap` table.
So now I must add an `Attach` method to my IRepository so I can attach entities to the DbContext.
public interface IRepository<T> where T: class
{
// existing methods
T Attach(T entity);
}
No more constraint error, but the Group entity is being modified or UPDATE'd in the database for no reason. I must set the Group's state to Unchanged so EF doesn't persist the object to the database.
Now I must add some sort of Update overload to my IRepository to not update the root entity, or Group, in this case:
public interface IRepository<T> where T: class
{
// existing methods
T Update(T entity, bool updateRootEntity);
}
The EF4 implentation of the Update method would look something like this:
T Update(T entity, bool updateRootEntity)
{
if (updateRootEntity)
Context.Entry(entity).State = System.Data.EntityState.Modified;
else
Context.Entry(entity).State = System.Data.EntityState.Unchanged;
Context.SaveChanges();
}
My question is am I approaching this the right way? My Repository is starting to seem EF4 centric which I was trying to avoid. | c# | entity-framework-4.1 | repository-pattern | null | null | null | open | Repository Pattern with Entity Framework 4.1 and Parent/Child Relationships
===
I still have some confusion with the Repository Pattern. The primary reason why I want to use this pattern is to avoid calling EF 4.1 specific data access operations from the domain. I'd rather call generic CRUD operations from a IRepository interface. This will make testing easier and if I ever have to change the data access framework in the future, I will be able to do so without refactoring a lot of code.
Here is an example of my situation:
I have 3 tables in the database: Group, Person, and GroupPersonMap. GroupPersonMap is a link table and just consists of the Group and Person primary keys. I created a EF model of the 3 tables with VS 2010 designer. EF was smart enough to assume GroupPersonMap is a link table so it doesn't show it in the designer. I want to use my existing domain objects so I turn off code generation for the model.
My existing classes that matches my EF model are as follows:
public class Group
{
public int GroupId { get; set; }
public string Name { get; set; }
public virtual ICollection<Person> People { get; set; }
}
public class Person
{
public int PersonId {get; set; }
public string FirstName { get; set; }
public virtual ICollection<Group> Groups { get; set; }
}
I have a generic repository interface like so:
public interface IRepository<T> where T: class
{
IQueryable<T> GetAll();
T Add(T entity);
T Update(T entity);
void Delete(T entity);
void Save()
}
and a generic EF repository:
public class EF4Repository<T> : IRepository<T> where T: class
{
public DbContext Context { get; private set; }
private DbSet<T> _dbSet;
public EF4Repository(string connectionString)
{
Context = new DbContext(connectionString);
_dbSet = Context.Set<T>();
}
public IQueryable<T> GetAll()
{
get { // code }
}
public T Insert(T entity)
{
// code
}
public T Update(T entity)
{
// code
}
public void Delete(T entity)
{
// code
}
}
Now suppose I just want to map an existing Group to an existing Person. I would have to do something like the following:
EFRepository<Group> groupRepository = new EFRepository<Group>("name=connString");
EFRepository<Person> personRepository = new EFRepository<Person>("name=connString");
var group = groupRepository.GetAll().Where(g => g.GroupId == 5).First();
var person = personRepository.GetAll().Where(p => p.PersonId == 2).First();
group.People.Add(person);
groupRepository.Update(group);
But this doesn't work because EF thinks Person is new, and will try to insert it into the database. If a primary key constraint existed on PersonId, then I would get a constraint error. I must use EF's `Attach` method to tell EF's `DbContext` that the Person object already exists in the database so just create the link between Group and Person in the `GroupPersonMap` table.
So now I must add an `Attach` method to my IRepository so I can attach entities to the DbContext.
public interface IRepository<T> where T: class
{
// existing methods
T Attach(T entity);
}
No more constraint error, but the Group entity is being modified or UPDATE'd in the database for no reason. I must set the Group's state to Unchanged so EF doesn't persist the object to the database.
Now I must add some sort of Update overload to my IRepository to not update the root entity, or Group, in this case:
public interface IRepository<T> where T: class
{
// existing methods
T Update(T entity, bool updateRootEntity);
}
The EF4 implentation of the Update method would look something like this:
T Update(T entity, bool updateRootEntity)
{
if (updateRootEntity)
Context.Entry(entity).State = System.Data.EntityState.Modified;
else
Context.Entry(entity).State = System.Data.EntityState.Unchanged;
Context.SaveChanges();
}
My question is am I approaching this the right way? My Repository is starting to seem EF4 centric which I was trying to avoid. | 0 |
8,738,160 | 01/05/2012 05:40:50 | 690,164 | 04/03/2011 19:38:25 | 349 | 21 | Eclipse Jobs API for a stand-alone Swing project | I am looking into the [Eclipse Jobs API][1] and was wondering if anyone has used it in a stand-alone Swing project (aka not Eclipse RCP)? Also is there any another competing framework like the Jobs API?
[1]: http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html | java | eclipse | swing | null | null | null | open | Eclipse Jobs API for a stand-alone Swing project
===
I am looking into the [Eclipse Jobs API][1] and was wondering if anyone has used it in a stand-alone Swing project (aka not Eclipse RCP)? Also is there any another competing framework like the Jobs API?
[1]: http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html | 0 |
92,082 | 09/18/2008 12:30:04 | 7,241 | 09/15/2008 13:24:02 | 1 | 1 | Add column to existing table in MSSQL | How do you add a column, with a default value, to an existing table in MSSQL 2000/2005? | sql | database | mssql | db | null | null | open | Add column to existing table in MSSQL
===
How do you add a column, with a default value, to an existing table in MSSQL 2000/2005? | 0 |
6,890,037 | 07/31/2011 14:32:40 | 479,491 | 10/18/2010 15:59:09 | 516 | 55 | Python FizzBuzz in one line | Is is possible to write FizzBuzz problem in one line in python.
P.S.: This is not a simple FizzBuzz, i know the answer for that. But i want a one liner. I searched for that in SO. but couldn't find anything, so asking the question. | python | pythonic | oneliner | null | null | 07/31/2011 16:11:32 | not constructive | Python FizzBuzz in one line
===
Is is possible to write FizzBuzz problem in one line in python.
P.S.: This is not a simple FizzBuzz, i know the answer for that. But i want a one liner. I searched for that in SO. but couldn't find anything, so asking the question. | 4 |
8,505,647 | 12/14/2011 13:56:02 | 488,433 | 10/27/2010 06:53:55 | 6,448 | 314 | How to capture the live image from camera on Android Emulator? | Based on [this article,][1] I'm trying do capture the image from camera on Android Emulator. I followed the instructions as per they said. But I didn't get the positive result.
I'm getting `Player` as `null` while I'm running `WebcamBroadcaster.java`.
Is anyone achieve this before? If yes, Just let me how to do.
Or
Is there any other way to capture the live image from camera on Android Emulator?
[1]: http://www.tomgibara.com/android/camera-source | android | android-emulator | android-camera | null | null | null | open | How to capture the live image from camera on Android Emulator?
===
Based on [this article,][1] I'm trying do capture the image from camera on Android Emulator. I followed the instructions as per they said. But I didn't get the positive result.
I'm getting `Player` as `null` while I'm running `WebcamBroadcaster.java`.
Is anyone achieve this before? If yes, Just let me how to do.
Or
Is there any other way to capture the live image from camera on Android Emulator?
[1]: http://www.tomgibara.com/android/camera-source | 0 |
8,505,785 | 12/14/2011 14:05:05 | 1,092,118 | 12/11/2011 10:22:02 | -1 | 0 | Android-Send/Receive byte[] via TCP Socket | I would like to send/receive sqlite database files (*.db) in byte[] over TCP socket connection? | java | android | null | null | null | 12/14/2011 14:08:27 | not a real question | Android-Send/Receive byte[] via TCP Socket
===
I would like to send/receive sqlite database files (*.db) in byte[] over TCP socket connection? | 1 |
39,647 | 09/02/2008 14:22:06 | 4,252 | 09/02/2008 14:22:06 | 1 | 0 | What's the best Delphi book for a newbie? | I'm a web developer (PHP, Perl, some ASP.NET) with some desktop app experience (VB.NET, Python, Adobe AIR), but I'd like to learn Delphi so I can write small, Win32 apps that I'll know will work on any Windows or Linux+WINE machine. Right now I'm using Turbo Delphi (2006, freebie), but really need some kind of "Dummies book" to get started. Can anyone recommend a good Delphi book, web site, or tutorial? | winapi | delphi | null | null | null | 12/25/2011 00:15:00 | not constructive | What's the best Delphi book for a newbie?
===
I'm a web developer (PHP, Perl, some ASP.NET) with some desktop app experience (VB.NET, Python, Adobe AIR), but I'd like to learn Delphi so I can write small, Win32 apps that I'll know will work on any Windows or Linux+WINE machine. Right now I'm using Turbo Delphi (2006, freebie), but really need some kind of "Dummies book" to get started. Can anyone recommend a good Delphi book, web site, or tutorial? | 4 |
11,260,965 | 06/29/2012 11:27:28 | 754,522 | 05/15/2011 14:07:31 | 13 | 1 | mysql: increment maximum field value on insert | I have a table with a field called 'sort' which contains sorting number. When I add a new row, I would like the sort field to be filled with the maximum existing value + 1. I tried this:
insert into highlights set sort=max(sort)+1
but I get a 1111 error "Invalid use of group function"
If I try with a subquery,
insert into highlights set sort=(select max(sort) from highlights)+1
I get a 1093 error since apparently I cannot subquery the same table I am inserting into.
Any ideas? Thanks! | mysql | null | null | null | null | null | open | mysql: increment maximum field value on insert
===
I have a table with a field called 'sort' which contains sorting number. When I add a new row, I would like the sort field to be filled with the maximum existing value + 1. I tried this:
insert into highlights set sort=max(sort)+1
but I get a 1111 error "Invalid use of group function"
If I try with a subquery,
insert into highlights set sort=(select max(sort) from highlights)+1
I get a 1093 error since apparently I cannot subquery the same table I am inserting into.
Any ideas? Thanks! | 0 |
6,190,974 | 05/31/2011 17:02:00 | 163,109 | 08/25/2009 21:53:43 | 274 | 14 | Access 2007 open recordset type mismatch | I have an Access ADP file. I upgraded the back-end database to point to a SQL 2005 server instead of a SQL 2000 server and changed the database connection information appropriately. The file runs perfectly fine on my own system, running Windows 7 (64-bit) and Access 2007. On the target systems running Windows XP and Access 2007, the primary functionality of the database blows up almost immediately with a "Run-time error '13': Type Mismatch" error.
At first I thought I was suffering from the same problem as described [in this question over here][1], where the default definition of a connection is DAO but the database is using an ADO object. However, in reviewing the code, every instance of a connection is specifically declared as "ADODB.Connection".
The code in question that causes the error is this:
Public Sub Tools()
dim db as ADODB.Connection
dim sql as String
sql = "Select SSPatch from tblPlastech"
set db = CurrentProject.Connection ' THIS LINE CAUSES THE TYPE MISMATCH ERROR
dim rst as ADODB.RecordSet
set rst = New ADODB.RecordSet
rst.open sql, db, adOpenKeyset, adLockOptimistic
gsSSpath = rst!sspath
QUOTES = Chr(34)
rst.Close
set rst = Nothing
db.Close
set db = Nothing
End Sub
Can anyone shed a bit of light on the issue? Right now I'm stumped.
[1]: http://stackoverflow.com/questions/6034959/open-recordset-in-access-2003-2007 | ms-access | ms-access-2007 | null | null | null | null | open | Access 2007 open recordset type mismatch
===
I have an Access ADP file. I upgraded the back-end database to point to a SQL 2005 server instead of a SQL 2000 server and changed the database connection information appropriately. The file runs perfectly fine on my own system, running Windows 7 (64-bit) and Access 2007. On the target systems running Windows XP and Access 2007, the primary functionality of the database blows up almost immediately with a "Run-time error '13': Type Mismatch" error.
At first I thought I was suffering from the same problem as described [in this question over here][1], where the default definition of a connection is DAO but the database is using an ADO object. However, in reviewing the code, every instance of a connection is specifically declared as "ADODB.Connection".
The code in question that causes the error is this:
Public Sub Tools()
dim db as ADODB.Connection
dim sql as String
sql = "Select SSPatch from tblPlastech"
set db = CurrentProject.Connection ' THIS LINE CAUSES THE TYPE MISMATCH ERROR
dim rst as ADODB.RecordSet
set rst = New ADODB.RecordSet
rst.open sql, db, adOpenKeyset, adLockOptimistic
gsSSpath = rst!sspath
QUOTES = Chr(34)
rst.Close
set rst = Nothing
db.Close
set db = Nothing
End Sub
Can anyone shed a bit of light on the issue? Right now I'm stumped.
[1]: http://stackoverflow.com/questions/6034959/open-recordset-in-access-2003-2007 | 0 |
6,832,507 | 07/26/2011 15:25:10 | 133,212 | 07/04/2009 21:14:53 | 192 | 18 | Why the Click event doesn't get raised when adding a custom button to RadGrid ItemCommand? | I have a RadGrid control which is created dynamically on page_init and added to a placeholder which is inside an updatePanel on the page.
I'd need to add a new Button to the CommandItem section of the RadGrid. The button has to support full postback.
RadGrid has an event called RadGrid_ItemCreated() and that's where I've added my new button and it appears on my RadGrid:
protected virtual void RdGridItemCreated(object sender, GridItemEventArgs e)
{
var itemType = e.Item.ItemType;
switch (itemType)
{
// other cases...
case GridItemType.CommandItem:
{
var gridCommandItem = e.Item as GridCommandItem;
if (gridCommandItem == null) return;
if (this.EnablePdfExport)
{
var pdfButton = CreateExportToPdfButton();
PageUtil.RegisterPostBackControl(pdfButton);
// this is the cell which contains the export buttons.
((Table)gridCommandItem.Cells[0].Controls[0]).Rows[0].Cells[1].Controls.Add(pdfButton);
}
break;
}
}
}
The button has a Click event and a method has been added to it as an event handler:
private Button CreateExportToPdfButton()
{
var result = new Button();
result.ID = "btnExportToPdf";
result.Click += ExportToPdfButtonClick;
result.CssClass = "rgExpPDF";
result.CommandName = "ExportToPdf";
result.Attributes.Add("title", "Export to Pdf");
return result;
}
To register the postback event for this control I've used the RegisterPostBackControl() method of the ScriptManager.
public static void RegisterPostBackControl(Control control)
{
var currentPage = (Page) HttpContext.Current.CurrentHandler;
var currentScriptManager = ScriptManager.GetCurrent(currentPage);
if (currentScriptManager != null)
{
currentScriptManager.RegisterPostBackControl(control);
}
}
When I click the button on the RadGrid, it posts back to the server but the problem is that its Click event is never raised:
private void ExportToPdfButtonClick(object sender, EventArgs e)
{
// process
}
I don't understand why; any thoughts/help?
Many thanks, | button | updatepanel | postback | radgrid | null | null | open | Why the Click event doesn't get raised when adding a custom button to RadGrid ItemCommand?
===
I have a RadGrid control which is created dynamically on page_init and added to a placeholder which is inside an updatePanel on the page.
I'd need to add a new Button to the CommandItem section of the RadGrid. The button has to support full postback.
RadGrid has an event called RadGrid_ItemCreated() and that's where I've added my new button and it appears on my RadGrid:
protected virtual void RdGridItemCreated(object sender, GridItemEventArgs e)
{
var itemType = e.Item.ItemType;
switch (itemType)
{
// other cases...
case GridItemType.CommandItem:
{
var gridCommandItem = e.Item as GridCommandItem;
if (gridCommandItem == null) return;
if (this.EnablePdfExport)
{
var pdfButton = CreateExportToPdfButton();
PageUtil.RegisterPostBackControl(pdfButton);
// this is the cell which contains the export buttons.
((Table)gridCommandItem.Cells[0].Controls[0]).Rows[0].Cells[1].Controls.Add(pdfButton);
}
break;
}
}
}
The button has a Click event and a method has been added to it as an event handler:
private Button CreateExportToPdfButton()
{
var result = new Button();
result.ID = "btnExportToPdf";
result.Click += ExportToPdfButtonClick;
result.CssClass = "rgExpPDF";
result.CommandName = "ExportToPdf";
result.Attributes.Add("title", "Export to Pdf");
return result;
}
To register the postback event for this control I've used the RegisterPostBackControl() method of the ScriptManager.
public static void RegisterPostBackControl(Control control)
{
var currentPage = (Page) HttpContext.Current.CurrentHandler;
var currentScriptManager = ScriptManager.GetCurrent(currentPage);
if (currentScriptManager != null)
{
currentScriptManager.RegisterPostBackControl(control);
}
}
When I click the button on the RadGrid, it posts back to the server but the problem is that its Click event is never raised:
private void ExportToPdfButtonClick(object sender, EventArgs e)
{
// process
}
I don't understand why; any thoughts/help?
Many thanks, | 0 |
68,372 | 09/16/2008 00:55:59 | 3,499 | 08/28/2008 19:39:37 | 301 | 27 | What are some of your favorite little known command-line tricks using Bash? | We all know how to use <CTRL>-R to reverse search through history, but did you know you can use <CTRL>-S to forward search if you set `stty stop ""`? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by default.
What are some of your favorite obscure tricks, keyboard shortcuts and shopt configuration using bash?
| bash | null | null | null | null | 05/27/2011 21:59:18 | not a real question | What are some of your favorite little known command-line tricks using Bash?
===
We all know how to use <CTRL>-R to reverse search through history, but did you know you can use <CTRL>-S to forward search if you set `stty stop ""`? Also, have you ever tried running bind -p to see all of your keyboard shortcuts listed? There are over 455 on Mac OS X by default.
What are some of your favorite obscure tricks, keyboard shortcuts and shopt configuration using bash?
| 1 |
11,391,892 | 07/09/2012 08:58:40 | 1,394,519 | 05/14/2012 19:19:57 | 1 | 0 | Insert object into javascript | I have a string in Java and a HTML file.This file i want to load in an Android Web view.
How can I inject a Java object into HTML file and then load that file in Web view ?
| java | javascript | null | null | null | 07/09/2012 09:04:48 | not a real question | Insert object into javascript
===
I have a string in Java and a HTML file.This file i want to load in an Android Web view.
How can I inject a Java object into HTML file and then load that file in Web view ?
| 1 |
10,568,916 | 05/13/2012 02:38:38 | 1,112,255 | 12/22/2011 18:15:15 | 33 | 0 | Accessing Instance Variables from Another Class | If you want to get straight to the problem, skip this paragraph. As practice, I am trying to write a Java program that simulates an economy, and to that end wrote a company class. The idea was to have, say, a dozen of them, wrap their earnings into a normalvariate function, and that would be the economy.
I wrote a separate class to graph the companies' outputs using JFreeChart. However, I can't access the ArrayList that I write the amount of money for each year to from the graphing class. I understand the best way to do this is probably with getters, but it didn't seem to work, so if that is your advice, could you please provide an example? Thanks!
The company:
public class ServiceProvider implements Company {
//Variables
public ArrayList getRecords(){
return records;
}
public ServiceProvider(){
money = 10000;
yearID = 0;
goodYears = 0;badYears = 0;
records = new ArrayList();
id++;
}
public void year() {
yearID++;
if(!getBankrupt()){
spend();
}
writeRecords();
}
public void spend() {
...
}
public void printRecords() {
for(int i=0;i<records.size();i++){
String[] tmp = (String[]) records.get(i);
for(String a:tmp){
System.out.print(a+" ");
}
System.out.print("\n");
}
}
public void writeRecords(){
String[] toWrite = new String[2];
toWrite[0] = String.valueOf(yearID);
toWrite[1] = String.valueOf(money);
records.add(toWrite);
}
public void writeRecords(String toWrite){
String temp = "\n"+yearID+" "+toWrite;
records.add(temp);
}
public boolean getBankrupt(){
boolean result = (money < 0) ? true : false;
return result;
}
}
What I am trying to access it from:
public class grapher extends JFrame {
ArrayList records = s.getRecords();
public grapher(){
super("ServiceProvider");
final XYDataset dataset = getCompanyData();
}
private XYDataset getCompanyData(){
XYSeries series;
for(int i=0;i<s.getRecords().length;i++){ //S cannot be resolved, it's instantiated in the main class.
}
}
}
The main class:
public class start {
public static void main(String[] args) {
ServiceProvider s = new ServiceProvider();
for(int i=0;i<10;i++){
s.year();
}
s.printRecords();
}
}
P.S. Don't tell me what a mess Records are. I know. | java | permissions | instance | null | null | null | open | Accessing Instance Variables from Another Class
===
If you want to get straight to the problem, skip this paragraph. As practice, I am trying to write a Java program that simulates an economy, and to that end wrote a company class. The idea was to have, say, a dozen of them, wrap their earnings into a normalvariate function, and that would be the economy.
I wrote a separate class to graph the companies' outputs using JFreeChart. However, I can't access the ArrayList that I write the amount of money for each year to from the graphing class. I understand the best way to do this is probably with getters, but it didn't seem to work, so if that is your advice, could you please provide an example? Thanks!
The company:
public class ServiceProvider implements Company {
//Variables
public ArrayList getRecords(){
return records;
}
public ServiceProvider(){
money = 10000;
yearID = 0;
goodYears = 0;badYears = 0;
records = new ArrayList();
id++;
}
public void year() {
yearID++;
if(!getBankrupt()){
spend();
}
writeRecords();
}
public void spend() {
...
}
public void printRecords() {
for(int i=0;i<records.size();i++){
String[] tmp = (String[]) records.get(i);
for(String a:tmp){
System.out.print(a+" ");
}
System.out.print("\n");
}
}
public void writeRecords(){
String[] toWrite = new String[2];
toWrite[0] = String.valueOf(yearID);
toWrite[1] = String.valueOf(money);
records.add(toWrite);
}
public void writeRecords(String toWrite){
String temp = "\n"+yearID+" "+toWrite;
records.add(temp);
}
public boolean getBankrupt(){
boolean result = (money < 0) ? true : false;
return result;
}
}
What I am trying to access it from:
public class grapher extends JFrame {
ArrayList records = s.getRecords();
public grapher(){
super("ServiceProvider");
final XYDataset dataset = getCompanyData();
}
private XYDataset getCompanyData(){
XYSeries series;
for(int i=0;i<s.getRecords().length;i++){ //S cannot be resolved, it's instantiated in the main class.
}
}
}
The main class:
public class start {
public static void main(String[] args) {
ServiceProvider s = new ServiceProvider();
for(int i=0;i<10;i++){
s.year();
}
s.printRecords();
}
}
P.S. Don't tell me what a mess Records are. I know. | 0 |
11,382,253 | 07/08/2012 09:58:02 | 1,281,943 | 03/20/2012 20:49:38 | 21 | 5 | Objective C wrappers | I know that mixing c/c++ with objective-c is possible when using Xcode.
I think that objective c is not very popular language, though it's learning curve is not very slow for programmers with C/C++ background.
Monotouch is a Csharp wrapper for several iOS frameworks. I suppose that the monotouch source code was not generated by a tool but was written by hand. Any information about that ?
Object pascal has also a cocoa wrapper which is written in php and that parses the objective c header and generates pascal code.
Openframworks is a multiplatforme C++ library with some wrappers for a limited part of the cocoa framework.
I think that a pure C/C++ wrapper to cocoa a la monotouch will remove the objective c obstacle toward iOS programming.
Do you know about any open source or commercial tool that bridges objective c to c++ ?
Any experience with swig http://www.swig.org/ for wrapping objective c ?
When I code for the iOS plateforme I often write and use C++ code except when using the UIKit because of my c++ background. For example I use std strings instead of NNstring. The same for lists, maps, dictionary STL.
It would be great to have a pure C++ bridge for cocoa available on the shelf. Do you agree ?
| c++ | objective-c | null | null | null | 07/08/2012 10:28:24 | not a real question | Objective C wrappers
===
I know that mixing c/c++ with objective-c is possible when using Xcode.
I think that objective c is not very popular language, though it's learning curve is not very slow for programmers with C/C++ background.
Monotouch is a Csharp wrapper for several iOS frameworks. I suppose that the monotouch source code was not generated by a tool but was written by hand. Any information about that ?
Object pascal has also a cocoa wrapper which is written in php and that parses the objective c header and generates pascal code.
Openframworks is a multiplatforme C++ library with some wrappers for a limited part of the cocoa framework.
I think that a pure C/C++ wrapper to cocoa a la monotouch will remove the objective c obstacle toward iOS programming.
Do you know about any open source or commercial tool that bridges objective c to c++ ?
Any experience with swig http://www.swig.org/ for wrapping objective c ?
When I code for the iOS plateforme I often write and use C++ code except when using the UIKit because of my c++ background. For example I use std strings instead of NNstring. The same for lists, maps, dictionary STL.
It would be great to have a pure C++ bridge for cocoa available on the shelf. Do you agree ?
| 1 |
1,287,934 | 08/17/2009 13:22:34 | 20,003 | 09/21/2008 17:08:29 | 1,927 | 137 | not reimplementing GUI controls on new 'platform' | We're doing some serious games interface work. Games allow unique new interfaces, but we also want to avoid having to reimplement traditional 2D controls, we want to leverage the years of refinement to windows controls.
How would we go about hosting and rendering .NET controls in a '3D' context? 3D in the sense of, eventually they will have to go through the game engine/opengl, but this could easily just be by painting the control to a texture and putting a textured quad on the interface. | gui | .net | 3d | opengl | null | null | open | not reimplementing GUI controls on new 'platform'
===
We're doing some serious games interface work. Games allow unique new interfaces, but we also want to avoid having to reimplement traditional 2D controls, we want to leverage the years of refinement to windows controls.
How would we go about hosting and rendering .NET controls in a '3D' context? 3D in the sense of, eventually they will have to go through the game engine/opengl, but this could easily just be by painting the control to a texture and putting a textured quad on the interface. | 0 |
11,616,220 | 07/23/2012 16:02:58 | 1,187,135 | 02/03/2012 09:15:24 | 191 | 9 | What is wrong with this wordwrap? | I can't wordwrap this for some reason.. its just displaying a long line. Is there something else I am missing or do I need to do something with css or html?
<?php $text = ucfirst($row->description); echo wordwrap($text, 200, '<br/>'); ?>
| php | word-wrap | null | null | null | 07/23/2012 20:50:31 | not a real question | What is wrong with this wordwrap?
===
I can't wordwrap this for some reason.. its just displaying a long line. Is there something else I am missing or do I need to do something with css or html?
<?php $text = ucfirst($row->description); echo wordwrap($text, 200, '<br/>'); ?>
| 1 |
7,149,410 | 08/22/2011 15:00:38 | 755,830 | 05/16/2011 14:43:21 | 118 | 0 | UINavigationController push view in a UIPopOverController | I have a UINavigationController in a UIPopovercontroller, and I want to push it to another uiviewcontroller.
I tried it, but the popovercontroller loses its size; meaning it goes back to the default size and position.
I tried the following:
CGSize popoversize = CGSizeMake(750,550);
popOverController.popoverContentSize = popoversize;
but that doesn't seem to change anything.
Anyone have a solution? | uinavigationcontroller | push | uipopovercontroller | null | null | null | open | UINavigationController push view in a UIPopOverController
===
I have a UINavigationController in a UIPopovercontroller, and I want to push it to another uiviewcontroller.
I tried it, but the popovercontroller loses its size; meaning it goes back to the default size and position.
I tried the following:
CGSize popoversize = CGSizeMake(750,550);
popOverController.popoverContentSize = popoversize;
but that doesn't seem to change anything.
Anyone have a solution? | 0 |
10,702,772 | 05/22/2012 13:14:01 | 873,635 | 08/01/2011 23:51:08 | 66 | 5 | File not found with VirtualHost and mod_rewrite | I'm bulding a RESTful api based on [Tonic](http://peej.github.com/tonic/).
On my developer machine and our stage server we use virtual hosts.
Tonic uses a .htaccess file to translate the incomming calls to it's dispatcher.php file. This works fine on servers without VirtualHosts enabled.
However if i enable VirtualHosts i get a file not found even thought the path and name to the file is correct.
Here is the VirtualHost setup on my developer machine.
<VirtualHost *:80>
ServerAdmin admin@xxxxxxxxxxxx
ServerAlias *.dev.xxxxx
VirtualDocumentRoot /home/xxxxxxxx/workspace/%1
<Directory /home/xxxxxxxx/workspace/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
And Tonic's .htacces:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !dispatch\.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* dispatch.php [L,QSA]
</IfModule>
This gives:
Not Found
The requested URL /home/xxxxxxxx/workspace/project/rest/dispatch.php was
not found on this server.
Apache/2.2.22 (Ubuntu) Server at xxxxxxx Port 80
| apache | mod-rewrite | mod-vhost-alias | null | null | null | open | File not found with VirtualHost and mod_rewrite
===
I'm bulding a RESTful api based on [Tonic](http://peej.github.com/tonic/).
On my developer machine and our stage server we use virtual hosts.
Tonic uses a .htaccess file to translate the incomming calls to it's dispatcher.php file. This works fine on servers without VirtualHosts enabled.
However if i enable VirtualHosts i get a file not found even thought the path and name to the file is correct.
Here is the VirtualHost setup on my developer machine.
<VirtualHost *:80>
ServerAdmin admin@xxxxxxxxxxxx
ServerAlias *.dev.xxxxx
VirtualDocumentRoot /home/xxxxxxxx/workspace/%1
<Directory /home/xxxxxxxx/workspace/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
And Tonic's .htacces:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !dispatch\.php$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* dispatch.php [L,QSA]
</IfModule>
This gives:
Not Found
The requested URL /home/xxxxxxxx/workspace/project/rest/dispatch.php was
not found on this server.
Apache/2.2.22 (Ubuntu) Server at xxxxxxx Port 80
| 0 |
8,791,338 | 01/09/2012 16:03:24 | 48,067 | 12/20/2008 23:47:47 | 1,184 | 27 | measurement converter for selecting unit | I'm seeing quite a few measurement conversion relating gems, but I haven't been able to find one that will select the best/closest unit.
For example
If I give the gem the measurement of
<pre>
9 inches + 6 inches
</pre>
I'm trying to get the result
<pre>
1 foot, 3 inches
</pre>
The conversion tools I've seen, I'd have to tell the convertor to try to convert to feet, and then decide which is the most appropriate measurement.
| ruby | units-of-measurement | null | null | null | null | open | measurement converter for selecting unit
===
I'm seeing quite a few measurement conversion relating gems, but I haven't been able to find one that will select the best/closest unit.
For example
If I give the gem the measurement of
<pre>
9 inches + 6 inches
</pre>
I'm trying to get the result
<pre>
1 foot, 3 inches
</pre>
The conversion tools I've seen, I'd have to tell the convertor to try to convert to feet, and then decide which is the most appropriate measurement.
| 0 |
4,615,416 | 01/06/2011 13:34:25 | 414,844 | 08/09/2010 08:29:03 | 37 | 4 | Meaning of Types, Class, Interface ? | Find many authors interchangably use the term Type and Class. Certain textbooks covering object based model covers the term Interface also.
Could someone please explain these in simple terms based on Object Oriented Programming in general and C++/Java/object-oriented-database in particular. | java | c++ | object | oop | object-oriented-database | null | open | Meaning of Types, Class, Interface ?
===
Find many authors interchangably use the term Type and Class. Certain textbooks covering object based model covers the term Interface also.
Could someone please explain these in simple terms based on Object Oriented Programming in general and C++/Java/object-oriented-database in particular. | 0 |
8,735,533 | 01/04/2012 23:20:56 | 869,635 | 07/29/2011 15:23:19 | 135 | 4 | Copying text from a WPF control | My question is more in general. Is it possible to copy from a wpf control? It might be possible with one label. But lets say a grid has 10 different labels. Is it possible to select all of them and copy the text?
Is this possible on any other control like a data grid? | .net | wpf | wpfdatagrid | wpf-usercontrols | null | null | open | Copying text from a WPF control
===
My question is more in general. Is it possible to copy from a wpf control? It might be possible with one label. But lets say a grid has 10 different labels. Is it possible to select all of them and copy the text?
Is this possible on any other control like a data grid? | 0 |
2,800,628 | 05/10/2010 06:04:34 | 315,427 | 04/13/2010 11:57:31 | 235 | 15 | Firefox extension dev: observing preferences, avoid multiple notifications | Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function.
When I subscribe to preference service and add observer, the `observe` callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. It's a great redundancy!
What I want is `observe` to be called just once for group of preferences. Say
extensions.myextension.interval1
extensions.myextension.site
extensions.myextension.retry
so if one or all of those preferences are changed, I receive only 1 notification about it. In other words, no matter how many preferences changed in branch, I want the `observe` callback to called once. | firefox | extension | preferences | null | null | null | open | Firefox extension dev: observing preferences, avoid multiple notifications
===
Let's say my Firefox extension has multiple preferences, but some of them are grouped, like check interval, fail retry interval, destination url. Those are used in just single function.
When I subscribe to preference service and add observer, the `observe` callback will be called for each changed preference, so if by chance user changed all of the settings in group, then I will have to do the same routine for the same subsystem as many times as I have items in that preferences group. It's a great redundancy!
What I want is `observe` to be called just once for group of preferences. Say
extensions.myextension.interval1
extensions.myextension.site
extensions.myextension.retry
so if one or all of those preferences are changed, I receive only 1 notification about it. In other words, no matter how many preferences changed in branch, I want the `observe` callback to called once. | 0 |
7,023,017 | 08/11/2011 08:36:41 | 889,526 | 08/11/2011 08:36:41 | 1 | 0 | Can anyone reccomend a series of good training videos for JAVA | For someone who is completely new to JAVA.
Please no old school / ugly video tutorials, something intuitive and easy to learn. | java | oracle | null | null | null | 08/11/2011 08:53:37 | not constructive | Can anyone reccomend a series of good training videos for JAVA
===
For someone who is completely new to JAVA.
Please no old school / ugly video tutorials, something intuitive and easy to learn. | 4 |
10,336,261 | 04/26/2012 15:11:24 | 758,103 | 05/17/2011 20:07:23 | 1 | 0 | Making personal data in MySQL Database hacker safe? | a heads up on my knowledge: I'm used to building relatively basic PHP apps with MySQL, besides that I don't have huge programming experience.
I'm just starting to build a fairly simple web application where data is stored in a database using php and mysql in one part of the country, and retrieved in another part. The data will contain personal information that must, under no circumstances, be accessed by a third party. And there may be cases where a third party will actively try to access that information. Let's assume its the names of witnesses. This is a system done on a low-budget in a development country without any sort of witness protection.
One of the measures I want to take is to anonymise the data before ever putting it in the database, I'm assuming that's the safest and most low-cost. Besides that, what measures can I take to reduce the chance of hackers getting access to these people's data?
If I use intense encryption on the data before storing it, the people entering it and the ones retrieving it will need to have the encryption key, right? That's an issue since many people will be entering/retrieving data, creating vulnerabilities. If the key is stored on the server, e.g. in the code, it won't be much of a protection, right? Or can the code be made to be fairly hacker-safe?
I read in some forum an old post, where someone suggests:
> Webserver<==>Application server ( in DMZ)<==>database server (behind 2nd Firewall) with an application that precludes & prevents SQL injection & similar defenses.
>In such a scenario, no hacker can get close to the database itself.
Is that true? Would three physical servers be needed for that?
Best,
D | php | mysql | database | security | hacking | 04/26/2012 15:23:57 | not constructive | Making personal data in MySQL Database hacker safe?
===
a heads up on my knowledge: I'm used to building relatively basic PHP apps with MySQL, besides that I don't have huge programming experience.
I'm just starting to build a fairly simple web application where data is stored in a database using php and mysql in one part of the country, and retrieved in another part. The data will contain personal information that must, under no circumstances, be accessed by a third party. And there may be cases where a third party will actively try to access that information. Let's assume its the names of witnesses. This is a system done on a low-budget in a development country without any sort of witness protection.
One of the measures I want to take is to anonymise the data before ever putting it in the database, I'm assuming that's the safest and most low-cost. Besides that, what measures can I take to reduce the chance of hackers getting access to these people's data?
If I use intense encryption on the data before storing it, the people entering it and the ones retrieving it will need to have the encryption key, right? That's an issue since many people will be entering/retrieving data, creating vulnerabilities. If the key is stored on the server, e.g. in the code, it won't be much of a protection, right? Or can the code be made to be fairly hacker-safe?
I read in some forum an old post, where someone suggests:
> Webserver<==>Application server ( in DMZ)<==>database server (behind 2nd Firewall) with an application that precludes & prevents SQL injection & similar defenses.
>In such a scenario, no hacker can get close to the database itself.
Is that true? Would three physical servers be needed for that?
Best,
D | 4 |
7,920,011 | 10/27/2011 17:37:48 | 186,742 | 10/08/2009 20:54:08 | 215 | 9 | parse string with potentially 2 occurrences of the same string | I'm working on parsing an address string and have found that sometimes the street name contains a word that is also a valid city name. I want to be sure that any second occurrence of city name is always matched to the last group in the regex and the first group in the regex is treated as optional.
Here is some sample input:
123 SUNNYSIDE AVENUE BROOKLYN
59 MAIDEN LANE MANHATTAN
59 MAIDEN LANE MANHATTAN 10038
39-076 46 STREET SUNNYSIDE
39-076 46 STREET SUNNYSIDE 11104
Ideally the regex groups returned for these would be as follows:
(123 )(SUNNYSIDE)( AVENUE )(BROOKLYN)
(59 MAIDEN LANE )(null)(null)(MANHATTAN)
(59 MAIDEN LANE )(null)(null)(MANHATTAN)
(39-076 46 STREET )(null)(null)(SUNNYSIDE)
(39-076 46 STREET )(null)(null)(SUNNYSIDE)
For the cities, I have a list (dumbed down for this example) in a regex group like this:
(MANHATTAN|BROOKLYN|SUNNYSIDE)
My starting regex was this:
(.*?)(?:\W*)(MANHATTAN|BROOKLYN|SUNNYSIDE)(?:.*)
But of course that outputs:
(123)(SUNNYSIDE)
I'm trying to expand it to support the cases mentioned above, but everything I've tried thus far to match 1 or 2 cities will always match the first city it finds as the last group and ignore the remainder.
There are a lot of special issues with address parsing, but right now I'm focused on solving just this one particular case. Thanks for any help! | java | regex | null | null | null | null | open | parse string with potentially 2 occurrences of the same string
===
I'm working on parsing an address string and have found that sometimes the street name contains a word that is also a valid city name. I want to be sure that any second occurrence of city name is always matched to the last group in the regex and the first group in the regex is treated as optional.
Here is some sample input:
123 SUNNYSIDE AVENUE BROOKLYN
59 MAIDEN LANE MANHATTAN
59 MAIDEN LANE MANHATTAN 10038
39-076 46 STREET SUNNYSIDE
39-076 46 STREET SUNNYSIDE 11104
Ideally the regex groups returned for these would be as follows:
(123 )(SUNNYSIDE)( AVENUE )(BROOKLYN)
(59 MAIDEN LANE )(null)(null)(MANHATTAN)
(59 MAIDEN LANE )(null)(null)(MANHATTAN)
(39-076 46 STREET )(null)(null)(SUNNYSIDE)
(39-076 46 STREET )(null)(null)(SUNNYSIDE)
For the cities, I have a list (dumbed down for this example) in a regex group like this:
(MANHATTAN|BROOKLYN|SUNNYSIDE)
My starting regex was this:
(.*?)(?:\W*)(MANHATTAN|BROOKLYN|SUNNYSIDE)(?:.*)
But of course that outputs:
(123)(SUNNYSIDE)
I'm trying to expand it to support the cases mentioned above, but everything I've tried thus far to match 1 or 2 cities will always match the first city it finds as the last group and ignore the remainder.
There are a lot of special issues with address parsing, but right now I'm focused on solving just this one particular case. Thanks for any help! | 0 |
9,660,152 | 03/11/2012 23:56:54 | 1,214,518 | 02/16/2012 18:15:02 | 58 | 0 | How to create a JFrame Array? | I would like to create an Array where each index will contain a JFrame. The number of slots depends on the user so I cannot simply do JFrame[] array = new JFrame[x]; as I do not know what x will be.
Is there an alternative way of creating a JFrame array. I've looked into vectors but couldn't get them working. | arrays | vector | jframe | null | null | null | open | How to create a JFrame Array?
===
I would like to create an Array where each index will contain a JFrame. The number of slots depends on the user so I cannot simply do JFrame[] array = new JFrame[x]; as I do not know what x will be.
Is there an alternative way of creating a JFrame array. I've looked into vectors but couldn't get them working. | 0 |
10,536,784 | 05/10/2012 14:59:48 | 188,516 | 10/12/2009 15:39:45 | 361 | 1 | Select an approach to localize large .NET applications | I know that Question of Localizing .NET applications asked here many times.
But I am doubt about effectiveness of the approach to use Resources and 3-d party resource editing tools to localizing large .NET applications.
I am thinking about staying with one of the below approaches:
1. Set Localizable=True for all solution forms, and use 3-d party resource editor, for ex: Zeta Resource Editor, to edit and manage resources.
Disadvantages:
- Our solution has ~100 forms, and for 30 extra languages there will be 30*100 = 3000 new resx files!
- A lot of efforts to interact with translators: I need to send them excel files with plain text after each product and manually update project resources after each language changes.
- Part (most?) of the language files will be always outdated, because translators might do their works after product release, and we can't include their changes without recompiling the project.
2. Use custom Dictionary based class (like GNU GetText), that will load an old-fashioned ini file with translations.
Disadvantage: need to do an extra job, like writing a helper tool to edit ini files for translators.
Advantage: new language versions might be published after product release as a separate ini files.
Unfortunately I can't compare performance of the both ways.
**Which approach is better? Please share your experience!** | .net | winforms | localization | gettext | null | null | open | Select an approach to localize large .NET applications
===
I know that Question of Localizing .NET applications asked here many times.
But I am doubt about effectiveness of the approach to use Resources and 3-d party resource editing tools to localizing large .NET applications.
I am thinking about staying with one of the below approaches:
1. Set Localizable=True for all solution forms, and use 3-d party resource editor, for ex: Zeta Resource Editor, to edit and manage resources.
Disadvantages:
- Our solution has ~100 forms, and for 30 extra languages there will be 30*100 = 3000 new resx files!
- A lot of efforts to interact with translators: I need to send them excel files with plain text after each product and manually update project resources after each language changes.
- Part (most?) of the language files will be always outdated, because translators might do their works after product release, and we can't include their changes without recompiling the project.
2. Use custom Dictionary based class (like GNU GetText), that will load an old-fashioned ini file with translations.
Disadvantage: need to do an extra job, like writing a helper tool to edit ini files for translators.
Advantage: new language versions might be published after product release as a separate ini files.
Unfortunately I can't compare performance of the both ways.
**Which approach is better? Please share your experience!** | 0 |
6,354,210 | 06/15/2011 07:04:38 | 84,262 | 03/29/2009 13:57:59 | 616 | 9 | Using autofac to inject properties into asp.net pages: Overriding PropertyInjectionModule behaviour to inject values/settings. | Is it possible to inject values/settings into ASP.NET Pages via autofac's PropertyInjectionModule? I get the impression that default handler behavior is to search for properties and find any types that match services in the container.
eg for a page:
public class MyPage: System.Web.UI.Page {
public IDataProvider DataProvider { get; set; }
public bool SomeSetting {get; set; }
public bool AnotherSetting { get; set; }
public string MySettings { get; set; }
// stuff
}
I thought maybe you could specify properties:
builder.RegisterType<MyPage>()
.WithProperty("SomeSetting", true)
.WithProperty("AnotherSetting", false)
.WithProperty("MySettings", "do-re-mi");
but it doesn't seem to work.
I realise I could setup an IMyPageConfig interface and provide settings that way but these are optional properties that may or may not need to be set. | asp.net | page | autofac | null | null | null | open | Using autofac to inject properties into asp.net pages: Overriding PropertyInjectionModule behaviour to inject values/settings.
===
Is it possible to inject values/settings into ASP.NET Pages via autofac's PropertyInjectionModule? I get the impression that default handler behavior is to search for properties and find any types that match services in the container.
eg for a page:
public class MyPage: System.Web.UI.Page {
public IDataProvider DataProvider { get; set; }
public bool SomeSetting {get; set; }
public bool AnotherSetting { get; set; }
public string MySettings { get; set; }
// stuff
}
I thought maybe you could specify properties:
builder.RegisterType<MyPage>()
.WithProperty("SomeSetting", true)
.WithProperty("AnotherSetting", false)
.WithProperty("MySettings", "do-re-mi");
but it doesn't seem to work.
I realise I could setup an IMyPageConfig interface and provide settings that way but these are optional properties that may or may not need to be set. | 0 |
8,442,100 | 12/09/2011 06:58:24 | 1,034,600 | 11/07/2011 22:10:55 | 96 | 8 | MVC Redirect Theory | This question is more theoretical than it is procedural.
**The Setup:** My model is handling a DB transaction. If the transaction fails the model returns false and the controller reloads the form with some error information, otherwise it returns the ID of the last transaction and then the controller does a redirect to the appropriate page, passing along the newly created ID.
**The Question:** Should the model return the "false" on error, or, if the transaction is successful is it acceptable to handle the redirect inside the model?
I imagine this has potential for a chicken & egg situation, but I'd at least like to get some input on the matter. I've been on a kick lately of Testing, Standardizing code, good practices. | mvc | theory | null | null | null | 12/09/2011 15:34:44 | off topic | MVC Redirect Theory
===
This question is more theoretical than it is procedural.
**The Setup:** My model is handling a DB transaction. If the transaction fails the model returns false and the controller reloads the form with some error information, otherwise it returns the ID of the last transaction and then the controller does a redirect to the appropriate page, passing along the newly created ID.
**The Question:** Should the model return the "false" on error, or, if the transaction is successful is it acceptable to handle the redirect inside the model?
I imagine this has potential for a chicken & egg situation, but I'd at least like to get some input on the matter. I've been on a kick lately of Testing, Standardizing code, good practices. | 2 |
10,628,742 | 05/17/2012 01:15:53 | 1,395,400 | 05/15/2012 06:38:51 | 1 | 0 | phone to ACR122 over npp. how to send and receive long text like 100bytes or 50kbytes | I'm using a project named "ismb-npp-java".
It seems the project works perfect and I really appreciate it
but when I tried to send data larger than 41 bytes,
the reader java source failed to receive the payload.
Does anyone know what's going on?
The situation is about sending data from phone to acr122 over npp.
I can send 41 bytes data. But never 42 bytes and what's larger.
* Below is the output when it fails to receive :
[DEBUG] {sending [50 bytes]} 0xFF 0x00 0x00 0x00 0x2D 0xD4 0x8C 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0xFE 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0xFE 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 0x46 0x66 0x6D 0x01 0x01 0x10 0x00
[DEBUG] {receiving [35 bytes]} 0xD5 0x8D 0x25 0x1E 0xD4 0x00 0x43 0xC2 0x44 0x63 0x35 0xDA 0xC8 0x38 0xE5 0x08 0x00 0x00 0x00 0x32 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x86
[DEBUG] {receiving [24 bytes]} 0xD5 0x87 0x00 0x05 0x21 0x06 0x0F 0x63 0x6F 0x6D 0x2E 0x61 0x6E 0x64 0x72 0x6F 0x69 0x64 0x2E 0x6E 0x70 0x70 0x90 0x00
[DEBUG] {sending [9 bytes]} 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x85 0x81
[DEBUG] {receiving [5 bytes]} 0xD5 0x8F 0x00 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x8A
[DEBUG] {receiving [6 bytes]} 0xD5 0x8B 0x01 0x22 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x86
[DEBUG] {receiving [5 bytes]} 0xD5 0x87 0x29 0x90 0x00
Finished
| nfc | null | null | null | null | 05/22/2012 14:20:32 | too localized | phone to ACR122 over npp. how to send and receive long text like 100bytes or 50kbytes
===
I'm using a project named "ismb-npp-java".
It seems the project works perfect and I really appreciate it
but when I tried to send data larger than 41 bytes,
the reader java source failed to receive the payload.
Does anyone know what's going on?
The situation is about sending data from phone to acr122 over npp.
I can send 41 bytes data. But never 42 bytes and what's larger.
* Below is the output when it fails to receive :
[DEBUG] {sending [50 bytes]} 0xFF 0x00 0x00 0x00 0x2D 0xD4 0x8C 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0xFE 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0xFE 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x06 0x46 0x66 0x6D 0x01 0x01 0x10 0x00
[DEBUG] {receiving [35 bytes]} 0xD5 0x8D 0x25 0x1E 0xD4 0x00 0x43 0xC2 0x44 0x63 0x35 0xDA 0xC8 0x38 0xE5 0x08 0x00 0x00 0x00 0x32 0x46 0x66 0x6D 0x01 0x01 0x10 0x03 0x02 0x00 0x01 0x04 0x01 0x96 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x86
[DEBUG] {receiving [24 bytes]} 0xD5 0x87 0x00 0x05 0x21 0x06 0x0F 0x63 0x6F 0x6D 0x2E 0x61 0x6E 0x64 0x72 0x6F 0x69 0x64 0x2E 0x6E 0x70 0x70 0x90 0x00
[DEBUG] {sending [9 bytes]} 0xFF 0x00 0x00 0x00 0x04 0xD4 0x8E 0x85 0x81
[DEBUG] {receiving [5 bytes]} 0xD5 0x8F 0x00 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x8A
[DEBUG] {receiving [6 bytes]} 0xD5 0x8B 0x01 0x22 0x90 0x00
[DEBUG] {sending [7 bytes]} 0xFF 0x00 0x00 0x00 0x02 0xD4 0x86
[DEBUG] {receiving [5 bytes]} 0xD5 0x87 0x29 0x90 0x00
Finished
| 3 |
8,407,389 | 12/06/2011 21:52:13 | 165,673 | 08/30/2009 18:28:44 | 2,487 | 38 | Form submission of input elements not included in the form | I have an web page where form input elements are in different places and cannot be physically contained within the same form. What's the best approach to include these input values in the form submission?
Note that I want to perform an actual post submission, not an AJAX submission. | javascript | html | forms | null | null | null | open | Form submission of input elements not included in the form
===
I have an web page where form input elements are in different places and cannot be physically contained within the same form. What's the best approach to include these input values in the form submission?
Note that I want to perform an actual post submission, not an AJAX submission. | 0 |
8,824,796 | 01/11/2012 18:40:38 | 542,319 | 12/14/2010 17:48:26 | 11 | 0 | t-sql conditional date processing | I have a stored procedure which returns data used in a report. There are numerous paramters the user can specify, two of which are a start and end date. I can use a "WHERE create_date BETWEEN @arg_start AND @arg_end" statement to filter on the dates.
What I dont know how to do is to handle the situation where the user doesnt supply any dates. CASE doesnt support anything like "WHERE create_date = CASE @arg_start WHEN NULL THEN create_date ELSE BETWEEN @arg_start AND @arg_end".
Ive done a lot of research on google, msdn, and here and I havent find out to handle conditional null datetime processing. Although I know its bad form, I can pass programatically pass in a magic date, such as 1/1/1900, to test instead of a null, but that doesnt really help in conditional date processing.
Thanks very much for your help. | tsql | datetime | null | null | null | null | open | t-sql conditional date processing
===
I have a stored procedure which returns data used in a report. There are numerous paramters the user can specify, two of which are a start and end date. I can use a "WHERE create_date BETWEEN @arg_start AND @arg_end" statement to filter on the dates.
What I dont know how to do is to handle the situation where the user doesnt supply any dates. CASE doesnt support anything like "WHERE create_date = CASE @arg_start WHEN NULL THEN create_date ELSE BETWEEN @arg_start AND @arg_end".
Ive done a lot of research on google, msdn, and here and I havent find out to handle conditional null datetime processing. Although I know its bad form, I can pass programatically pass in a magic date, such as 1/1/1900, to test instead of a null, but that doesnt really help in conditional date processing.
Thanks very much for your help. | 0 |
5,027,730 | 02/17/2011 10:30:46 | 621,177 | 02/17/2011 10:30:46 | 1 | 0 | Bulk/batch image resizer for Mac | I need a good bulk image resizer for Mac, cos I'm tired of doing the thumbnails for my photo site by hand. I tried this one: http://ddd.ee/NIT_bulk_resize_and_watermark/ it's good and does the job but it's $19, is there a free alternative? | image | osx | resize | photo | watermark | 04/29/2011 09:35:26 | off topic | Bulk/batch image resizer for Mac
===
I need a good bulk image resizer for Mac, cos I'm tired of doing the thumbnails for my photo site by hand. I tried this one: http://ddd.ee/NIT_bulk_resize_and_watermark/ it's good and does the job but it's $19, is there a free alternative? | 2 |
8,002,399 | 11/03/2011 21:54:50 | 873,566 | 08/01/2011 22:13:12 | 22 | 0 | credits system online banking PHP | I would like to create a system that does the following
- Allows users to add "credits" which they use real money to get
- Allows users to transfer these "credits" into their real bank accounts
- Allows users to spend these "credits" on my website to buy goods.
I have been looking for a good tutorial to code such a system in PHP, but I have not been able to find one. Does anyone know any good tutorials?
One of my concerns is that I would need to do locking on the database field that stores the credit balance (to prevent conflicts when people transfer the credits to their bank account or spend the credits while adding credits at the same time).
Basically, do you know any good tutorials that addresses how to design and implement such a simple system in PHP and Mysql?
I have searched stackoverflow and could not find a good Q/A addressing this topic.
thank you | php | mysql | null | null | null | 11/03/2011 22:25:26 | not a real question | credits system online banking PHP
===
I would like to create a system that does the following
- Allows users to add "credits" which they use real money to get
- Allows users to transfer these "credits" into their real bank accounts
- Allows users to spend these "credits" on my website to buy goods.
I have been looking for a good tutorial to code such a system in PHP, but I have not been able to find one. Does anyone know any good tutorials?
One of my concerns is that I would need to do locking on the database field that stores the credit balance (to prevent conflicts when people transfer the credits to their bank account or spend the credits while adding credits at the same time).
Basically, do you know any good tutorials that addresses how to design and implement such a simple system in PHP and Mysql?
I have searched stackoverflow and could not find a good Q/A addressing this topic.
thank you | 1 |
10,563,444 | 05/12/2012 11:49:14 | 1,283,286 | 03/21/2012 11:57:46 | 26 | 1 | Simple php programm doesn't work | <html>
<head>
<title>Roll Em!</title>
</head>
<body>
<h1>Roll Em!</h1>
<?php
$roll = rand(1,6);
print "You rolled a $roll";
print "<br>";
?>
</body>
</html>
It is quite simple programm, but for some reason doent work!
And it gives output like this
Roll Em!
"; ?> | php | html | null | null | null | 05/15/2012 03:13:51 | too localized | Simple php programm doesn't work
===
<html>
<head>
<title>Roll Em!</title>
</head>
<body>
<h1>Roll Em!</h1>
<?php
$roll = rand(1,6);
print "You rolled a $roll";
print "<br>";
?>
</body>
</html>
It is quite simple programm, but for some reason doent work!
And it gives output like this
Roll Em!
"; ?> | 3 |
8,750,693 | 01/05/2012 22:20:29 | 749,047 | 05/11/2011 15:56:25 | 99 | 2 | How to integrate color picker dialog into existing Android project? | What's the correct way to integrate one of those 2 color picker projects into an existing android project?
http://code.google.com/p/android-color-picker/
http://code.google.com/p/color-picker-view/
As IDE i'm using Eclipse, all i get at the moment is a "NoClassDefFoundError" when trying to open the color picker dialog of the first project in my app. How to setup the project correctly? | android | colors | dialog | picker | null | 01/08/2012 05:50:32 | not constructive | How to integrate color picker dialog into existing Android project?
===
What's the correct way to integrate one of those 2 color picker projects into an existing android project?
http://code.google.com/p/android-color-picker/
http://code.google.com/p/color-picker-view/
As IDE i'm using Eclipse, all i get at the moment is a "NoClassDefFoundError" when trying to open the color picker dialog of the first project in my app. How to setup the project correctly? | 4 |
5,081,552 | 02/22/2011 17:23:41 | 450,741 | 09/17/2010 15:36:05 | 77 | 0 | bring JInternalFrame to the front | I have a `JDesktopPane` which contains a number of `JInternalFrame`s. I'd like to be able to bring any `JInternalFrame` to the front, overlaying any other active frames. I found a number of code samples to do this, but none seem to work - the frame does NOT go on top of other active `JInternalFrame`s. E.g.
<pre>
public static void moveToFront(final JInternalFrame fr) {
if (fr != null) {
processOnSwingEventThread(new Runnable() {
public void run() {
fr.moveToFront();
fr.setVisible(true);
try {
fr.setSelected(true);
if (fr.isIcon()) {
fr.setIcon(false);
}
fr.setSelected(true);
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
fr.requestFocus();
fr.toFront();
}
});
}
}
</pre> | java | swing | null | null | null | null | open | bring JInternalFrame to the front
===
I have a `JDesktopPane` which contains a number of `JInternalFrame`s. I'd like to be able to bring any `JInternalFrame` to the front, overlaying any other active frames. I found a number of code samples to do this, but none seem to work - the frame does NOT go on top of other active `JInternalFrame`s. E.g.
<pre>
public static void moveToFront(final JInternalFrame fr) {
if (fr != null) {
processOnSwingEventThread(new Runnable() {
public void run() {
fr.moveToFront();
fr.setVisible(true);
try {
fr.setSelected(true);
if (fr.isIcon()) {
fr.setIcon(false);
}
fr.setSelected(true);
} catch (PropertyVetoException ex) {
ex.printStackTrace();
}
fr.requestFocus();
fr.toFront();
}
});
}
}
</pre> | 0 |
7,562,584 | 09/26/2011 23:38:03 | 964,103 | 09/25/2011 22:04:53 | 23 | 0 | Javascript apply methods from one object to another | I have been at this for hours and just can't get it quite right. I have an object with methods that works fine. I need to save it as a string using JSON.stringify and then bring it back as an object and still use the same methods.
function Workflow(){
this.setTitle = function(newtitle){this.title = newtitle; return this;};
this.getTitle = function(){return this.title;};
}
function testIn(){
var workflow = new Workflow().setTitle('Workflow Test');
Logger.log(workflow);//{title=Workflow Test}
Logger.log(workflow.getTitle()); //Workflow Test
var stringy = JSON.stringify(workflow);
var newWorkflow = Utilities.jsonParse(stringy);
Logger.log(newWorkflow); //{title=Workflow Test}
//Looks like the same properties as above
Logger.log(newWorkflow.getTitle());//Error can't find getTitle
}
I think I should prototype the new object but nothing seems to work.
Please help I have very little hair left. | javascript | null | null | null | null | null | open | Javascript apply methods from one object to another
===
I have been at this for hours and just can't get it quite right. I have an object with methods that works fine. I need to save it as a string using JSON.stringify and then bring it back as an object and still use the same methods.
function Workflow(){
this.setTitle = function(newtitle){this.title = newtitle; return this;};
this.getTitle = function(){return this.title;};
}
function testIn(){
var workflow = new Workflow().setTitle('Workflow Test');
Logger.log(workflow);//{title=Workflow Test}
Logger.log(workflow.getTitle()); //Workflow Test
var stringy = JSON.stringify(workflow);
var newWorkflow = Utilities.jsonParse(stringy);
Logger.log(newWorkflow); //{title=Workflow Test}
//Looks like the same properties as above
Logger.log(newWorkflow.getTitle());//Error can't find getTitle
}
I think I should prototype the new object but nothing seems to work.
Please help I have very little hair left. | 0 |
4,148,486 | 11/10/2010 19:55:24 | 55,640 | 01/15/2009 22:09:50 | 972 | 59 | Solution to problem done in PL/SQL what would it look like in SQL? | Friends,
Hope you can help. I've written a solution to problem using PL/SQL and SQL and I can't help thinking that it could be done 100% in SQL but am I am struggling to get started.
Here is the structure of the two tables (If it helps, the scripts to create them are at the end of the question)
Table t1 (primary key is both columns displayed)
ID TYPE
1 A
1 B
1 C
2 A
2 B
3 B
The Type column is a Foreign Key to table T2 which contains the following data:
Table t2 (primary key is Type)
Type Desc
A xx
B xx
C xx
So given the the data in T1 the result I need will be:
For ID 1 because it has all the types in the foreign key table I would return the literal "All"
For ID 2 because it has two types I would like to return "A & B" (note the separator)
And finally for ID 3 because it has one type I would like to return just "B"
As promised here are the scripts to create all the objects mentioned.
Thanks in advance
create table t2(type varchar2(1),
description varchar2(100)
)
/
insert into t2
values ('A', 'xx')
/
insert into t2
values ('B', 'xx')
/
insert into t2
values ('C', 'xx')
/
alter table t2 add constraint t2_pk primary key (type)
/
create table t1 (id number(10),
type varchar2(1)
)
/
alter table t1 add constraint t1_pk primary key(id, type)
/
alter table t1 add constraint t1_fk foreign key (type)
references t2(type)
/
insert into t1
values (1, 'A')
/
insert into t1
values (1, 'B')
/
insert into t1
values (1, 'C')
/
insert into t1
values (2, 'A')
/
insert into t1
values (2, 'B')
/
insert into t1
values (3, 'B')
/
| sql | oracle | oracle10g | null | null | null | open | Solution to problem done in PL/SQL what would it look like in SQL?
===
Friends,
Hope you can help. I've written a solution to problem using PL/SQL and SQL and I can't help thinking that it could be done 100% in SQL but am I am struggling to get started.
Here is the structure of the two tables (If it helps, the scripts to create them are at the end of the question)
Table t1 (primary key is both columns displayed)
ID TYPE
1 A
1 B
1 C
2 A
2 B
3 B
The Type column is a Foreign Key to table T2 which contains the following data:
Table t2 (primary key is Type)
Type Desc
A xx
B xx
C xx
So given the the data in T1 the result I need will be:
For ID 1 because it has all the types in the foreign key table I would return the literal "All"
For ID 2 because it has two types I would like to return "A & B" (note the separator)
And finally for ID 3 because it has one type I would like to return just "B"
As promised here are the scripts to create all the objects mentioned.
Thanks in advance
create table t2(type varchar2(1),
description varchar2(100)
)
/
insert into t2
values ('A', 'xx')
/
insert into t2
values ('B', 'xx')
/
insert into t2
values ('C', 'xx')
/
alter table t2 add constraint t2_pk primary key (type)
/
create table t1 (id number(10),
type varchar2(1)
)
/
alter table t1 add constraint t1_pk primary key(id, type)
/
alter table t1 add constraint t1_fk foreign key (type)
references t2(type)
/
insert into t1
values (1, 'A')
/
insert into t1
values (1, 'B')
/
insert into t1
values (1, 'C')
/
insert into t1
values (2, 'A')
/
insert into t1
values (2, 'B')
/
insert into t1
values (3, 'B')
/
| 0 |
5,566,720 | 04/06/2011 12:57:18 | 653,807 | 03/10/2011 15:26:18 | 19 | 0 | Fear of DataBinding | I am newBie while I know the concept of dataadapters, dataset,tables and controls I have a initial fear of databinding. Is there a very simple code explaining it very deeply to understand the concept as well?
My Fears are that:
1- When I want to have a gridview and this should be binded to my dataset so eg user opens a combo in column and there are updated information on a field of a table in my dataset.
2- When I want to apply the changes from my database to my dataset
3- When After refreshing the dataset the controls should be filled with new information now! | c# | .net | vb.net | null | null | 04/06/2011 14:28:02 | not a real question | Fear of DataBinding
===
I am newBie while I know the concept of dataadapters, dataset,tables and controls I have a initial fear of databinding. Is there a very simple code explaining it very deeply to understand the concept as well?
My Fears are that:
1- When I want to have a gridview and this should be binded to my dataset so eg user opens a combo in column and there are updated information on a field of a table in my dataset.
2- When I want to apply the changes from my database to my dataset
3- When After refreshing the dataset the controls should be filled with new information now! | 1 |
6,888,453 | 07/31/2011 08:53:34 | 527,749 | 12/02/2010 09:38:30 | 579 | 28 | "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK." | There are a lot of responses dealing with iPhone development, but this is in relation to **mac app store** development.
I am running Lion, with a new install of Xcode. When I try to submit or validate, I get
> "This bundle is invalid. Apple is not currently accepting applications
> built with this version of the SDK."
I have tried setting the SDK to 10.7, 10.6 and 'latest' but always get the same problem. | xcode | cocoa | application | app-store | null | 07/31/2011 09:20:55 | off topic | "This bundle is invalid. Apple is not currently accepting applications built with this version of the SDK."
===
There are a lot of responses dealing with iPhone development, but this is in relation to **mac app store** development.
I am running Lion, with a new install of Xcode. When I try to submit or validate, I get
> "This bundle is invalid. Apple is not currently accepting applications
> built with this version of the SDK."
I have tried setting the SDK to 10.7, 10.6 and 'latest' but always get the same problem. | 2 |
4,417,915 | 12/11/2010 17:18:58 | 372,613 | 06/21/2010 21:46:24 | 30 | 2 | problem with painting one widged inside another one (parent) | I am trying to make some simple game under Qt 4.6. The idea is to have two widgets , one is main window widget and represent the space and secondone is starship widget inside space (parent).
Simplified code looks like this ::
/*this is ship and child widget*/
class MyRect : public QWidget {
Q_OBJECT
public:
MyRect(QWidget* parent)
: QWidget(parent)
{
itsParent = parent;
itsx = 120;
itsy = 250;
itsw = 110;
itsh = 35;
body = new QRect(itsx, itsy, itsw, itsh);
}
~MyRect() {}
protected:
void paintEvent(QPaintEvent *event);
private:
int itsx;
int itsy;
int itsw;
int itsh;
QRect* body;
QWidget* itsParent;
};
void MyRect::paintEvent(QPaintEvent *event)
{
QPen pen(Qt::black, 2, Qt::SolidLine);
QColor hourColor(0, 255, 0);
QPainter painter(itsParent);
painter.setBrush(hourColor);
painter.setPen(pen);
painter.drawRect(*body);
}
/*this is space and main window widget*/
class space : public QMainWindow
{
Q_OBJECT
public:
space(QWidget *parent = 0);
~space();
protected:
private:
MyRect* ship;
};
space::space(QWidget *parent)
: QMainWindow(parent)
{
ship = new MyRect(this);
}
When I compile , the screen is blank and rectangle MyRect::body is not drawn.
I checked Qt online documentacion and do some google research but have not luck.
Any explanation about this is welcome.I want to draw from one widget to another (parent). | c++ | visual-studio-2008 | qt4.6 | null | null | null | open | problem with painting one widged inside another one (parent)
===
I am trying to make some simple game under Qt 4.6. The idea is to have two widgets , one is main window widget and represent the space and secondone is starship widget inside space (parent).
Simplified code looks like this ::
/*this is ship and child widget*/
class MyRect : public QWidget {
Q_OBJECT
public:
MyRect(QWidget* parent)
: QWidget(parent)
{
itsParent = parent;
itsx = 120;
itsy = 250;
itsw = 110;
itsh = 35;
body = new QRect(itsx, itsy, itsw, itsh);
}
~MyRect() {}
protected:
void paintEvent(QPaintEvent *event);
private:
int itsx;
int itsy;
int itsw;
int itsh;
QRect* body;
QWidget* itsParent;
};
void MyRect::paintEvent(QPaintEvent *event)
{
QPen pen(Qt::black, 2, Qt::SolidLine);
QColor hourColor(0, 255, 0);
QPainter painter(itsParent);
painter.setBrush(hourColor);
painter.setPen(pen);
painter.drawRect(*body);
}
/*this is space and main window widget*/
class space : public QMainWindow
{
Q_OBJECT
public:
space(QWidget *parent = 0);
~space();
protected:
private:
MyRect* ship;
};
space::space(QWidget *parent)
: QMainWindow(parent)
{
ship = new MyRect(this);
}
When I compile , the screen is blank and rectangle MyRect::body is not drawn.
I checked Qt online documentacion and do some google research but have not luck.
Any explanation about this is welcome.I want to draw from one widget to another (parent). | 0 |
11,108,838 | 06/19/2012 20:25:17 | 869,233 | 07/29/2011 11:02:05 | 295 | 28 | Which one is correct approach for assembly reference in csproj file? | In my one of the MSI Installer I am updating the assembly and project reference relative path pro-grammatically.My all reference assemblies inside my application folder.
I try to implement both the path relative and absolute path. Both are working fine.
Relative Path
<Reference Include="log4net">
<HintPath>..\..\..\..\log4net.dll</HintPath>
</Reference>
Absolute path
<Reference Include="log4net">
<HintPath>C:\Program files\Myapplication\log4net.dll</HintPath>
</Reference>
I have only seen absolute path reference when I take the reference of assembly from the below Path or GAC files.
C:\Program Files (x86)\Reference Assemblies
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll</HintPath>
</Reference>
Which one is correct approach for updating path into `.Csproj` file? | c#-4.0 | csproj | null | null | null | null | open | Which one is correct approach for assembly reference in csproj file?
===
In my one of the MSI Installer I am updating the assembly and project reference relative path pro-grammatically.My all reference assemblies inside my application folder.
I try to implement both the path relative and absolute path. Both are working fine.
Relative Path
<Reference Include="log4net">
<HintPath>..\..\..\..\log4net.dll</HintPath>
</Reference>
Absolute path
<Reference Include="log4net">
<HintPath>C:\Program files\Myapplication\log4net.dll</HintPath>
</Reference>
I have only seen absolute path reference when I take the reference of assembly from the below Path or GAC files.
C:\Program Files (x86)\Reference Assemblies
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll</HintPath>
</Reference>
Which one is correct approach for updating path into `.Csproj` file? | 0 |
7,192,305 | 08/25/2011 14:38:22 | 476,218 | 10/14/2010 19:39:25 | 73 | 3 | Firewall Programs With CMD Capabilities | I am making a Java Desktop Application which is going to have a Firewall. My program is going to support Windows 7, Vista and XP.
What are some existing Firewall programs with command line capabilities? I want to be able to call the secondary Firewall program through the command line so that I can control it with my own GUI. I also want the program's Terms Of Service to allow for commercial distribution or for it to be published under the GNU General public license agreement. | java | windows | cmd | firewall | null | 08/26/2011 18:37:35 | off topic | Firewall Programs With CMD Capabilities
===
I am making a Java Desktop Application which is going to have a Firewall. My program is going to support Windows 7, Vista and XP.
What are some existing Firewall programs with command line capabilities? I want to be able to call the secondary Firewall program through the command line so that I can control it with my own GUI. I also want the program's Terms Of Service to allow for commercial distribution or for it to be published under the GNU General public license agreement. | 2 |
6,761,055 | 07/20/2011 11:18:58 | 656,585 | 03/12/2011 12:33:00 | 68 | 11 | LaTeX book recommendation? | [EN]
Can anyone recommend a good LaTeX book for beginners, preferably in German?
[DE]
Kann mir bitte jemand ein gutes LaTeX-Einsteiger-Buch empfehlen, vorzugsweise in deutscher Sprache?
| latex | null | null | null | null | 07/20/2011 11:29:46 | not constructive | LaTeX book recommendation?
===
[EN]
Can anyone recommend a good LaTeX book for beginners, preferably in German?
[DE]
Kann mir bitte jemand ein gutes LaTeX-Einsteiger-Buch empfehlen, vorzugsweise in deutscher Sprache?
| 4 |
10,206,678 | 04/18/2012 09:35:17 | 758,133 | 05/17/2011 20:31:02 | 4,842 | 454 | FastMM dumps, leaks pools and plumbing - how can I register pools for RegisterExpectedMemoryLeak? | Delphi has a good memory manager that works fine during an app. run - I have no issue with its run-time performance at all.
It can be asked to give a termination dump of 'leaks'. The problem is that I have many apps with massive 'leaks' by design. My apps can only be considered really leaky if the total leaked memory rises with app runtime. It is not practical to avoid leaks in many multithreaded apps without getting into the mess of terminating running and blocked threads on multiple cores - not going down that road to hell!
Nevertheless, it would be silly not to take advantage of any debugging tool available that does not cause more problems than it solves. The FastMM supplies a 'RegisterExpectedMemoryLeak' call that seems to take two magic numbers. Can I get the magic numbers for the objects in an object pool? Can any 'magic numbers' be provided by the app just before shutdown?
| delphi | fastmm | null | null | null | 04/30/2012 19:56:08 | not a real question | FastMM dumps, leaks pools and plumbing - how can I register pools for RegisterExpectedMemoryLeak?
===
Delphi has a good memory manager that works fine during an app. run - I have no issue with its run-time performance at all.
It can be asked to give a termination dump of 'leaks'. The problem is that I have many apps with massive 'leaks' by design. My apps can only be considered really leaky if the total leaked memory rises with app runtime. It is not practical to avoid leaks in many multithreaded apps without getting into the mess of terminating running and blocked threads on multiple cores - not going down that road to hell!
Nevertheless, it would be silly not to take advantage of any debugging tool available that does not cause more problems than it solves. The FastMM supplies a 'RegisterExpectedMemoryLeak' call that seems to take two magic numbers. Can I get the magic numbers for the objects in an object pool? Can any 'magic numbers' be provided by the app just before shutdown?
| 1 |
8,830,768 | 01/12/2012 05:58:28 | 173,634 | 09/15/2009 10:21:27 | 1,589 | 2 | Turning on test mode in OmniAuth does not redirect requests when using Cucumber | I am trying to test my [OmniAuth][1] login process by providing a faked authentication hash when a request is made to `/auth/facebook`, as described [here][2] and [here][3]. The problem is, when I turn test mode on, the request returns as an error, which is the same behaviour as when test mode is not turned on.
user_management.feature
Feature: User management
@omniauth_test
Scenario: Login
Given a user exists
And that user is signed in
web_steps.rb
...
And /^that user is signed in$/ do
visit "/auth/facebook"
end
...
omniauth.rb
Before('@omniauth_test') do
OmniAuth.config.test_mode = true
p "OmniAuth.config.test_mode is #{OmniAuth.config.test_mode}"
# the symbol passed to mock_auth is the same as the name of the provider set up in the initializer
OmniAuth.config.mock_auth[:facebook] = {
"provider"=>"facebook",
"uid"=>"uid",
"user_info"=>{"email"=>"test@xxxx.com", "first_name"=>"Test", "last_name"=>"User", "name"=>"Test User"}
}
end
After('@omniauth_test') do
OmniAuth.config.test_mode = false
end
Outcome
Feature: User management
@omniauth_test
Scenario: Login # features/user_management.feature:3
"OmniAuth.config.test_mode is true"
Given a user exists # features/step_definitions/pickle_steps.rb:4
And that user is signed in # features/step_definitions/web_steps.rb:40
No route matches [GET] "/auth/facebook" (ActionController::RoutingError)
./features/step_definitions/web_steps.rb:41:in `/^that user is signed in$/'
features/testing.feature:5:in `And that user is signed in'
[1]: https://github.com/intridea/omniauth
[2]: https://github.com/intridea/omniauth/wiki/Integration-Testing
[3]: http://pivotallabs.com/users/mgehard/blog/articles/1595-testing-omniauth-based-login-via-cucumber | testing | cucumber | omniauth | null | null | null | open | Turning on test mode in OmniAuth does not redirect requests when using Cucumber
===
I am trying to test my [OmniAuth][1] login process by providing a faked authentication hash when a request is made to `/auth/facebook`, as described [here][2] and [here][3]. The problem is, when I turn test mode on, the request returns as an error, which is the same behaviour as when test mode is not turned on.
user_management.feature
Feature: User management
@omniauth_test
Scenario: Login
Given a user exists
And that user is signed in
web_steps.rb
...
And /^that user is signed in$/ do
visit "/auth/facebook"
end
...
omniauth.rb
Before('@omniauth_test') do
OmniAuth.config.test_mode = true
p "OmniAuth.config.test_mode is #{OmniAuth.config.test_mode}"
# the symbol passed to mock_auth is the same as the name of the provider set up in the initializer
OmniAuth.config.mock_auth[:facebook] = {
"provider"=>"facebook",
"uid"=>"uid",
"user_info"=>{"email"=>"test@xxxx.com", "first_name"=>"Test", "last_name"=>"User", "name"=>"Test User"}
}
end
After('@omniauth_test') do
OmniAuth.config.test_mode = false
end
Outcome
Feature: User management
@omniauth_test
Scenario: Login # features/user_management.feature:3
"OmniAuth.config.test_mode is true"
Given a user exists # features/step_definitions/pickle_steps.rb:4
And that user is signed in # features/step_definitions/web_steps.rb:40
No route matches [GET] "/auth/facebook" (ActionController::RoutingError)
./features/step_definitions/web_steps.rb:41:in `/^that user is signed in$/'
features/testing.feature:5:in `And that user is signed in'
[1]: https://github.com/intridea/omniauth
[2]: https://github.com/intridea/omniauth/wiki/Integration-Testing
[3]: http://pivotallabs.com/users/mgehard/blog/articles/1595-testing-omniauth-based-login-via-cucumber | 0 |
2,995,010 | 06/08/2010 05:45:26 | 133,405 | 07/05/2009 17:43:52 | 39 | 8 | Need to play flash videos on iphone | I am building this iphone app for a client and they have a large set of flash video files that they need to play/stream to the iphone. I understand that the iphone doesnt natively support flv playback but isnt there anything I can do to get around this problem?
In case it helps, they are using the akamai flash player on their website to play these video files.
Thanks in advance. | iphone | flvplayback | akamai | flv | null | null | open | Need to play flash videos on iphone
===
I am building this iphone app for a client and they have a large set of flash video files that they need to play/stream to the iphone. I understand that the iphone doesnt natively support flv playback but isnt there anything I can do to get around this problem?
In case it helps, they are using the akamai flash player on their website to play these video files.
Thanks in advance. | 0 |
4,540,160 | 12/27/2010 16:35:12 | 6,153 | 09/12/2008 17:19:08 | 284 | 11 | is there a way to programatically determine the EJB entity class and id column from the table name? | is there a way to programatically determine the EJB entity class and id column from the table name?
I have the table name, what I want is a way to get the entity class name and the name of the id column from the table name.
Is this possible?
Each entity class does have annotations describing the table name as well as which field is the identity column.
Thanks | java | ejb | ejbql | null | null | null | open | is there a way to programatically determine the EJB entity class and id column from the table name?
===
is there a way to programatically determine the EJB entity class and id column from the table name?
I have the table name, what I want is a way to get the entity class name and the name of the id column from the table name.
Is this possible?
Each entity class does have annotations describing the table name as well as which field is the identity column.
Thanks | 0 |
8,974,456 | 01/23/2012 15:54:24 | 1,165,167 | 01/23/2012 14:45:03 | 1 | 0 | Migrating facebook App Profile Page to a new Page | Facebook deprecates Application Profile Page and they are saying "Before you go through the migration process, please ensure you have downloaded all photos, posts, Insights, and any other material that you want to keep. Once you hit the migrate button, the App Profile Page will be deleted."
My questions is:
How to download the posts (and all related comments and likes) from an Application wall and after that "upload" them back to the new Page wall?
I know about the https://graph.facebook.com/some_id/comments and other feeds like this but how do you restore the data that we downloaded in this case? | facebook | facebook-graph-api | migration | facebook-page | null | 01/24/2012 18:29:52 | off topic | Migrating facebook App Profile Page to a new Page
===
Facebook deprecates Application Profile Page and they are saying "Before you go through the migration process, please ensure you have downloaded all photos, posts, Insights, and any other material that you want to keep. Once you hit the migrate button, the App Profile Page will be deleted."
My questions is:
How to download the posts (and all related comments and likes) from an Application wall and after that "upload" them back to the new Page wall?
I know about the https://graph.facebook.com/some_id/comments and other feeds like this but how do you restore the data that we downloaded in this case? | 2 |
5,772,406 | 04/24/2011 18:33:18 | 722,838 | 04/24/2011 18:33:18 | 1 | 0 | save image to server specific folder | Iam devloping a medical Center application using C# and sql server 2008
the problem is i have to store patients images on folder to the server not on the database
and then read it from the specific folder say "C:\\MCImages"
I do not want to use shared folder to store and retrieve because security issue
any way i was thinking of ftp and socket (network layer)
any help i will be gratful
thanks alot
Amir Ahmed | c# | null | null | null | null | 04/25/2011 20:10:42 | not a real question | save image to server specific folder
===
Iam devloping a medical Center application using C# and sql server 2008
the problem is i have to store patients images on folder to the server not on the database
and then read it from the specific folder say "C:\\MCImages"
I do not want to use shared folder to store and retrieve because security issue
any way i was thinking of ftp and socket (network layer)
any help i will be gratful
thanks alot
Amir Ahmed | 1 |
10,210,473 | 04/18/2012 13:31:55 | 192,919 | 10/20/2009 08:10:37 | 362 | 15 | Add imageview to layout on specific coordinates | I am dynamically adding ImageViews to layout. Here is the code, which is doing what I want:
setContentView(R.layout.main);
RelativeLayout main = (RelativeLayout) findViewById(R.id.main_view);
ImageView smokeImage = new ImageView(this);
Drawable smoke = getResources().getDrawable(R.drawable.smoke);
smokeImage.setBackgroundDrawable(smoke);
main.addView(smokeImage, 800, 800);
How to add ImageView to specific coordinates? For example. I want it to appear on x=25px and y=43px . Are there any special functions? | java | android | layout | null | null | null | open | Add imageview to layout on specific coordinates
===
I am dynamically adding ImageViews to layout. Here is the code, which is doing what I want:
setContentView(R.layout.main);
RelativeLayout main = (RelativeLayout) findViewById(R.id.main_view);
ImageView smokeImage = new ImageView(this);
Drawable smoke = getResources().getDrawable(R.drawable.smoke);
smokeImage.setBackgroundDrawable(smoke);
main.addView(smokeImage, 800, 800);
How to add ImageView to specific coordinates? For example. I want it to appear on x=25px and y=43px . Are there any special functions? | 0 |
8,302,119 | 11/28/2011 20:48:56 | 1,030,771 | 11/05/2011 04:58:12 | 65 | 0 | Significance testing in R, determining if the proportion in one column is significantly different from the other column within the single variable | I'm sure this is an easy command in R, but for some reason, I'm having trouble finding a solution.
I'm trying to run a bunch of crosstabs (using the table() command) in R, and each tab has two columns (treatment and no treatment). I would like to know if the difference between the columns are significantly different for each other for all rows (the rows are a handful of answer choices from a survey). I'm not interested in overall significance, only within the crosstab comparing treatment vs. no treatment.
This type of analysis is very easy in SPSS (link below to illustrate what I'm talking about), but I can't seem to get it working in R. Do you know I can do this?
http://help.vovici.net/robohelp/robohelp/server/general/projects_fhpro/survey_workbench_MX/Significance_testing.htm
Thanks! | r | crosstab | significance | null | null | null | open | Significance testing in R, determining if the proportion in one column is significantly different from the other column within the single variable
===
I'm sure this is an easy command in R, but for some reason, I'm having trouble finding a solution.
I'm trying to run a bunch of crosstabs (using the table() command) in R, and each tab has two columns (treatment and no treatment). I would like to know if the difference between the columns are significantly different for each other for all rows (the rows are a handful of answer choices from a survey). I'm not interested in overall significance, only within the crosstab comparing treatment vs. no treatment.
This type of analysis is very easy in SPSS (link below to illustrate what I'm talking about), but I can't seem to get it working in R. Do you know I can do this?
http://help.vovici.net/robohelp/robohelp/server/general/projects_fhpro/survey_workbench_MX/Significance_testing.htm
Thanks! | 0 |
11,381,375 | 07/08/2012 07:17:53 | 1,509,675 | 07/08/2012 06:54:38 | 1 | 0 | asp.net mvc---Telerik MVC | 1.Create a new asp.net mvc 3 application
----------
2.Use nuget install telerik
----------
3._Layout.cshtml
----------
@(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group =>
group.Add("telerik.examples.css").Add("telerik.common.css")
.Add("telerik.rtl.css").Combined(true).Compress(true)))
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group =>
group.Add("telerik.examples.js").Compress(true))
.OnDocumentReady(@<text>prettyPrint(); </text>))
4.Index.cshtml
----------
@using Telerik.Web.Mvc
@using Telerik.Web.Mvc.UI
@{
if (!Telerik.Web.Mvc.SiteMapManager.SiteMaps.ContainsKey("sample"))
{
Telerik.Web.Mvc.SiteMapManager.SiteMaps.Register<Telerik.Web.Mvc.XmlSiteMap> ("sample", sitmap =>sitmap.LoadFrom("~/sample.sitemap"));
}
}
@(
Html.Telerik().Menu()
.Name("Menu")
.BindTo("sample"))
5.Create a sample.sitemap file to the root directory
----------
6.Run the application
----------
7.Errer:
----------
Object reference not set to an instance of an object
-----> Html.Telerik().Menu()
----------
8.Why wrong?
----------
| asp.net | mvc | telerik | null | null | 07/10/2012 01:58:44 | not a real question | asp.net mvc---Telerik MVC
===
1.Create a new asp.net mvc 3 application
----------
2.Use nuget install telerik
----------
3._Layout.cshtml
----------
@(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group =>
group.Add("telerik.examples.css").Add("telerik.common.css")
.Add("telerik.rtl.css").Combined(true).Compress(true)))
@(Html.Telerik().ScriptRegistrar().DefaultGroup(group =>
group.Add("telerik.examples.js").Compress(true))
.OnDocumentReady(@<text>prettyPrint(); </text>))
4.Index.cshtml
----------
@using Telerik.Web.Mvc
@using Telerik.Web.Mvc.UI
@{
if (!Telerik.Web.Mvc.SiteMapManager.SiteMaps.ContainsKey("sample"))
{
Telerik.Web.Mvc.SiteMapManager.SiteMaps.Register<Telerik.Web.Mvc.XmlSiteMap> ("sample", sitmap =>sitmap.LoadFrom("~/sample.sitemap"));
}
}
@(
Html.Telerik().Menu()
.Name("Menu")
.BindTo("sample"))
5.Create a sample.sitemap file to the root directory
----------
6.Run the application
----------
7.Errer:
----------
Object reference not set to an instance of an object
-----> Html.Telerik().Menu()
----------
8.Why wrong?
----------
| 1 |
9,044,203 | 01/28/2012 09:29:11 | 530,439 | 12/04/2010 13:21:01 | 299 | 0 | How to make a jar file run on startup & and when you log out (Ubunto)? | I have no idea where to start looking. I've been reading about daemons and didn't understand the concept.
More details :
- I've been writing a crawler which never stops and crawlers over RSS in the internet.
- The crawler has been written in java - therefore its a jar right now.
- I'm an administrator on a machine that has Ubunto 11.04 .
- There is some chances for the machine to crash , so I'd like the crawler to run every time you startup the machine.
- Furthermore, I'd like it to keep running even when i logged out. I'm not sure this is possible, but most of the time I'm logged out, and I still want to it crawl.
Any ideas? Can someone point me in the right direction? | ubuntu | jar | web-crawler | crawler | ubuntu-11.04 | 01/29/2012 14:05:21 | off topic | How to make a jar file run on startup & and when you log out (Ubunto)?
===
I have no idea where to start looking. I've been reading about daemons and didn't understand the concept.
More details :
- I've been writing a crawler which never stops and crawlers over RSS in the internet.
- The crawler has been written in java - therefore its a jar right now.
- I'm an administrator on a machine that has Ubunto 11.04 .
- There is some chances for the machine to crash , so I'd like the crawler to run every time you startup the machine.
- Furthermore, I'd like it to keep running even when i logged out. I'm not sure this is possible, but most of the time I'm logged out, and I still want to it crawl.
Any ideas? Can someone point me in the right direction? | 2 |
10,716,194 | 05/23/2012 08:28:28 | 1,412,058 | 05/23/2012 08:08:29 | 1 | 0 | PHP Shorthand If/Else | I want two things to happen when this is true. It's working fine, but i'm not sure is this good programming.
$a =1;
($a == 1) ? (($b= 'val1') && ($c= 'val2')) : null;
echo $b . '<br/>';
echo $c;
I could simply write with if else but this way, it's smart. please help me... | php | shorthand | null | null | null | 05/23/2012 08:36:47 | not a real question | PHP Shorthand If/Else
===
I want two things to happen when this is true. It's working fine, but i'm not sure is this good programming.
$a =1;
($a == 1) ? (($b= 'val1') && ($c= 'val2')) : null;
echo $b . '<br/>';
echo $c;
I could simply write with if else but this way, it's smart. please help me... | 1 |
4,834,472 | 01/29/2011 01:18:43 | 164,148 | 08/27/2009 11:33:59 | 926 | 26 | How to know which option user clicked in select -box before hitting enter? | // Description: I try to understand what happens when user clicks something in JS.
// Since users may use select boxes differently, with clicking or arrow-keys,
// I want some way to know how they use it.
// EQ.
// What happens when user click a select_box? How can I know what user clicked?
input.addEventListener('click', function(e)
{
if (e. //How to specify where it clicked? )
{
// EQ bizarre clicking selection
// if clicked choice 0, turn to (0+2)mod(choices.len) i.e. 2
// if clicked choice 2, turn to 1
// if clicked choice 1, turn to 0
}
}
// Some box
<div id="topic_box">
<select name="topic" id="topic" size=3>
<option value="0" selected="selected">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
| javascript | usercontrols | null | null | null | null | open | How to know which option user clicked in select -box before hitting enter?
===
// Description: I try to understand what happens when user clicks something in JS.
// Since users may use select boxes differently, with clicking or arrow-keys,
// I want some way to know how they use it.
// EQ.
// What happens when user click a select_box? How can I know what user clicked?
input.addEventListener('click', function(e)
{
if (e. //How to specify where it clicked? )
{
// EQ bizarre clicking selection
// if clicked choice 0, turn to (0+2)mod(choices.len) i.e. 2
// if clicked choice 2, turn to 1
// if clicked choice 1, turn to 0
}
}
// Some box
<div id="topic_box">
<select name="topic" id="topic" size=3>
<option value="0" selected="selected">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
| 0 |
5,510,367 | 04/01/2011 07:29:38 | 1,145,225 | 04/01/2011 07:15:08 | 1 | 0 | can't run vim-ruby-debugger(rails3). any choices to run? | 1. :Rdebugger - running, but server doesn't start automatically
2. :Rdebugger 'script/rails server' -- E77: Too many file names
3. tryed just to run :Rserver - failed. I don't have 'rails server -d' working at all- after start rails stops without any errors. In common everything works(from console).
Env - Mac Os X 10.6.6, macvim 7.3, zsh, rvm, ruby 1.8.7(as default)
| vim | macvim | null | null | null | null | open | can't run vim-ruby-debugger(rails3). any choices to run?
===
1. :Rdebugger - running, but server doesn't start automatically
2. :Rdebugger 'script/rails server' -- E77: Too many file names
3. tryed just to run :Rserver - failed. I don't have 'rails server -d' working at all- after start rails stops without any errors. In common everything works(from console).
Env - Mac Os X 10.6.6, macvim 7.3, zsh, rvm, ruby 1.8.7(as default)
| 0 |
996,151 | 06/15/2009 13:36:21 | 64,334 | 02/09/2009 21:08:32 | 559 | 21 | How can I learn to REALLY design software?! | First off, my focus is web development (ASP.net webforms up to now), using C#. But, I am interested in learning design principles that will carry into any technology or language.
I have been ready for a long time to step up, and learn how to design software the right way. Up to this point, the software I write has been designing the database schema first, using an ORM for data access (usually Linq To SQL), stepping though requirements building a screen (web page) at a time, responding to control events, and when I notice that I am duplicating logic, I will pull that logic out into a utility class or something like that.
I know that this isn't the best way to design software. I think a couple of things have/are holding me back:
- Recently, when earning my BS degree in Computer Information Systems, my teachers focused on teaching the basics of frameworks (.net) and hardly ever touched on design patterns.
- I have never had a mentor. StackOverflow IS my mentor. I am the only developer where I work.
I am currently reading [Pro ASP.NET MVC Framework][1]. The 3rd chapter talks a lot about some design patters, test driven development, and domain driven design. I am very interested in these practices and want to start designing my applications first with an object model that reflects the problem domain and THEN letting the rest fall into place.
BUT HOW?! Seriously, I'm not helpless here, but I need to know what to read and study. I am beginning a Masters in Software Engineering program in the fall, but if history is any indicator, I can't rely on a college education to actually teach me anything useful (regardless of how perfect my grades are).
So, to make a long question short, who/how/what would you do/read/study/stalk if you were me?
[1]: http://www.apress.com/book/view/1430210079
| software-engineering | software-design | oop | domain-driven-design | null | 03/15/2011 04:19:01 | not constructive | How can I learn to REALLY design software?!
===
First off, my focus is web development (ASP.net webforms up to now), using C#. But, I am interested in learning design principles that will carry into any technology or language.
I have been ready for a long time to step up, and learn how to design software the right way. Up to this point, the software I write has been designing the database schema first, using an ORM for data access (usually Linq To SQL), stepping though requirements building a screen (web page) at a time, responding to control events, and when I notice that I am duplicating logic, I will pull that logic out into a utility class or something like that.
I know that this isn't the best way to design software. I think a couple of things have/are holding me back:
- Recently, when earning my BS degree in Computer Information Systems, my teachers focused on teaching the basics of frameworks (.net) and hardly ever touched on design patterns.
- I have never had a mentor. StackOverflow IS my mentor. I am the only developer where I work.
I am currently reading [Pro ASP.NET MVC Framework][1]. The 3rd chapter talks a lot about some design patters, test driven development, and domain driven design. I am very interested in these practices and want to start designing my applications first with an object model that reflects the problem domain and THEN letting the rest fall into place.
BUT HOW?! Seriously, I'm not helpless here, but I need to know what to read and study. I am beginning a Masters in Software Engineering program in the fall, but if history is any indicator, I can't rely on a college education to actually teach me anything useful (regardless of how perfect my grades are).
So, to make a long question short, who/how/what would you do/read/study/stalk if you were me?
[1]: http://www.apress.com/book/view/1430210079
| 4 |
10,166,532 | 04/15/2012 22:02:04 | 121,993 | 06/12/2009 13:11:22 | 8,451 | 223 | Overriding single YUI dialog button style | I'm trying to override the style of a button used in a single YUI dialog. I've created a css file that has
#mydialog.yui-button {
// style customization
}
Where mydialog is the id of the dialog. This does not work. Can someone explain what I am doing wrong? | css | yui | null | null | null | null | open | Overriding single YUI dialog button style
===
I'm trying to override the style of a button used in a single YUI dialog. I've created a css file that has
#mydialog.yui-button {
// style customization
}
Where mydialog is the id of the dialog. This does not work. Can someone explain what I am doing wrong? | 0 |
7,086,545 | 08/16/2011 23:57:48 | 897,704 | 08/16/2011 23:57:48 | 1 | 0 | Problems with PhotoSmash plugin for Wordpress | I added all pictures as I wanted and they appear on the screen. But there is a text when all pictures end saying "Galleries:" and there is nothing there. I want a gallery to show up there but I am not being able to. Can someone help me? I tried to remove the word "Galleries:" but I also was unable to.
I also tried NextGen gallery instead but I can't upload the photos. Don't know why. | wordpress | plugins | null | null | null | 07/30/2012 03:29:59 | off topic | Problems with PhotoSmash plugin for Wordpress
===
I added all pictures as I wanted and they appear on the screen. But there is a text when all pictures end saying "Galleries:" and there is nothing there. I want a gallery to show up there but I am not being able to. Can someone help me? I tried to remove the word "Galleries:" but I also was unable to.
I also tried NextGen gallery instead but I can't upload the photos. Don't know why. | 2 |
9,750,023 | 03/17/2012 12:34:06 | 1,275,717 | 03/17/2012 12:29:43 | 1 | 0 | how to fetch data in mobile application | i want to make android application which will fetch data from my website
website location is: localhost:1186/WebSite4
how to fetch data from website...
which are the classes are required to do that | ora-01704 | null | null | null | null | 05/08/2012 12:18:52 | not a real question | how to fetch data in mobile application
===
i want to make android application which will fetch data from my website
website location is: localhost:1186/WebSite4
how to fetch data from website...
which are the classes are required to do that | 1 |
10,055,235 | 04/07/2012 14:20:14 | 687,581 | 04/01/2011 12:39:09 | 314 | 7 | .htaccess for rewriting a personal system | I can't get my head around exactly what I want to do using mod_rewrite.
I want to be able to type in a url such as:
`http://site.com/project/project-title/people/alex-coady`
or
`http://site.com/project/project-title/tasks/task-list-title`
which will then be processed at `handle.php` with the variables available such that:
`$_GET['project'] would equal 'project-title'`
`$_GET['people'] would equal 'alex-coady'` (first example)
`$_GET['tasks'] would equal 'task-list-title'` (second example)
To reiterate: All requests will be managed by `handle.php`, but if any additional variables are tacked onto the URL, first the keyword `people`, `tasks`, `projects` (and any others I manually add) would be checked and the value immediately after them would be added in the form suggested above.
ie. `http://site.com/handle.php?project=project-title&people=alex-coady&tasks=` (first example)
Thank you.
| php | .htaccess | mod-rewrite | null | null | null | open | .htaccess for rewriting a personal system
===
I can't get my head around exactly what I want to do using mod_rewrite.
I want to be able to type in a url such as:
`http://site.com/project/project-title/people/alex-coady`
or
`http://site.com/project/project-title/tasks/task-list-title`
which will then be processed at `handle.php` with the variables available such that:
`$_GET['project'] would equal 'project-title'`
`$_GET['people'] would equal 'alex-coady'` (first example)
`$_GET['tasks'] would equal 'task-list-title'` (second example)
To reiterate: All requests will be managed by `handle.php`, but if any additional variables are tacked onto the URL, first the keyword `people`, `tasks`, `projects` (and any others I manually add) would be checked and the value immediately after them would be added in the form suggested above.
ie. `http://site.com/handle.php?project=project-title&people=alex-coady&tasks=` (first example)
Thank you.
| 0 |
9,451,805 | 02/26/2012 09:01:06 | 808,203 | 06/21/2011 10:08:03 | 97 | 4 | Insert an integer(not its ascii) in Character Array? | Its a pretty old question. I want to insert an integer in a character array.
Eg: int a=10;
char c[100]; I want to insert '10' in the array. Not the ascii equivalent of '10'.
Programming Language: JAVA or C. | java | c | ascii | null | null | 02/26/2012 18:21:17 | not a real question | Insert an integer(not its ascii) in Character Array?
===
Its a pretty old question. I want to insert an integer in a character array.
Eg: int a=10;
char c[100]; I want to insert '10' in the array. Not the ascii equivalent of '10'.
Programming Language: JAVA or C. | 1 |
11,255,367 | 06/29/2012 02:35:45 | 1,490,121 | 06/29/2012 02:19:29 | 1 | 0 | SQL Select statement - The thing i am querying for has a single quotation mark | Hi everyone I am new to StackOverflow and SQL. I am not sure how to phrase the title so google was not very helpful.
I am doing a simple SELECT query:
SELECT * FROM Department WHERE DepartmentName = "Controller's Office"
I would like to return all results that has DepartmentName of "Controller's Office". The name itself has a single quotation that must not be removed(because boss said so). Using single quotation marks does not work. and returns an error:
Invalid column name 'Controller's Office'.
How can i do the query so that it works? If you are doing anything complicated please explain because i am new thanks! | sql | null | null | null | null | null | open | SQL Select statement - The thing i am querying for has a single quotation mark
===
Hi everyone I am new to StackOverflow and SQL. I am not sure how to phrase the title so google was not very helpful.
I am doing a simple SELECT query:
SELECT * FROM Department WHERE DepartmentName = "Controller's Office"
I would like to return all results that has DepartmentName of "Controller's Office". The name itself has a single quotation that must not be removed(because boss said so). Using single quotation marks does not work. and returns an error:
Invalid column name 'Controller's Office'.
How can i do the query so that it works? If you are doing anything complicated please explain because i am new thanks! | 0 |
10,974,357 | 06/11/2012 03:56:13 | 1,222,424 | 02/21/2012 02:38:43 | 128 | 6 | Android 2.1 - Object Detection on OpenCV 2.0 and image's quality of different devices. | Now, I'm working on a project about object detection using opencv on Android 2.1. <br/>
And I have many problems: <br/>
1. I cannot use the lastest version of opencv on Android 2.1 project, And now I use Opencv 2.0 written on C-language. I see many function like haarcascade or image process is missed or haved many bug:( </br>
2. Each android device give me a different image's quality. So, it make a detection module give wrong result. For example: HTC Desire give me a darken image, Sony Arc give me a image have more blue or yellow value etc... How can I process these image to same quality for training and detecting.<br/>
3. When I run haartraining command (on opencv 2.0), with npos = 20, nneg = 10, It never is successful, even if I run it more than 24 hours. <br/>
Today is deadline of my project. <br/>
http://opencv.willowgarage.com/documentation/object_detection.html <br/>
Thanks so much for your supports. | android | c | opencv | null | null | null | open | Android 2.1 - Object Detection on OpenCV 2.0 and image's quality of different devices.
===
Now, I'm working on a project about object detection using opencv on Android 2.1. <br/>
And I have many problems: <br/>
1. I cannot use the lastest version of opencv on Android 2.1 project, And now I use Opencv 2.0 written on C-language. I see many function like haarcascade or image process is missed or haved many bug:( </br>
2. Each android device give me a different image's quality. So, it make a detection module give wrong result. For example: HTC Desire give me a darken image, Sony Arc give me a image have more blue or yellow value etc... How can I process these image to same quality for training and detecting.<br/>
3. When I run haartraining command (on opencv 2.0), with npos = 20, nneg = 10, It never is successful, even if I run it more than 24 hours. <br/>
Today is deadline of my project. <br/>
http://opencv.willowgarage.com/documentation/object_detection.html <br/>
Thanks so much for your supports. | 0 |
7,988,289 | 11/02/2011 22:51:10 | 1,026,645 | 11/02/2011 22:29:38 | 1 | 0 | Programmatically set screen density on Android | I'm writing a game which I want to run on medium and high densities (320x480 and 480x800). In order to run the app on both densities, I had to set support-screens param like this.-
<supports-screens android:anyDensity="true" />
My problem is, in some 2nd generation devices (i.e. HTC Desire), the game runs on hd density, but the performance is a little poor, so I'm trying to 'force' medium density for those devices.
I've managed to get the current density like this.-
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
and DisplayMetrics class seems to have a 'setTo' method, but not sure if it fits my need, nor how exactly should I use it. Is there any way to achieve this?
Thanks!
| android | display | density | null | null | null | open | Programmatically set screen density on Android
===
I'm writing a game which I want to run on medium and high densities (320x480 and 480x800). In order to run the app on both densities, I had to set support-screens param like this.-
<supports-screens android:anyDensity="true" />
My problem is, in some 2nd generation devices (i.e. HTC Desire), the game runs on hd density, but the performance is a little poor, so I'm trying to 'force' medium density for those devices.
I've managed to get the current density like this.-
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
and DisplayMetrics class seems to have a 'setTo' method, but not sure if it fits my need, nor how exactly should I use it. Is there any way to achieve this?
Thanks!
| 0 |
10,498,936 | 05/08/2012 12:48:15 | 771,111 | 05/26/2011 10:21:41 | 16 | 0 | How to practice css and jquery skill? | I have just learned CSS, Javascript and Jquery. I just want to practice those skills in some projects. So that i thought it would be better for me if i do some template designing with this skills. Is there any tutorial site..where step by step guide is available?
Or, how i can sharpen my skills using this skills? | javascript | jquery | css | templates | null | 05/08/2012 12:51:56 | off topic | How to practice css and jquery skill?
===
I have just learned CSS, Javascript and Jquery. I just want to practice those skills in some projects. So that i thought it would be better for me if i do some template designing with this skills. Is there any tutorial site..where step by step guide is available?
Or, how i can sharpen my skills using this skills? | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.