Trying to convert this tax-like IRS function http://stackoverflow.com/questions/1817920/calculating-revenue-share-at-different-tiers to SQL. The assumption is the table would be one column (price) and the tiers will be added dynamically.
My first attempt has some case statements that didn't work out well. I have since scrapped it :) Thanks for the help!
I am using ruby on rails 2.3.5 .
I have user instance. On run time depending on certain conditions I want to add an after_save callback just for this instance.
The other issue is that this after_save should take a block or a proc as parameter.
What I want is something like this. This is psuedo code.
user = User.first
proc = Proc.new do
puts 'this is foo'
end
user.after_save proc
Is it possible to automaticly download xml files from one server to another server on a daily basis with PHP?
The goal is to create a webapplication in CakePHP which makes use of an xml report that comes from a online accountingserver.
So it can be done using a cronjob? But is cron supported with PHP?
Where can i configure that cronjob?
What kind of code should i write to get the file from the accountingserver in the first place?
If I am going to use the code:
extract(
array(
'key.name' => 'value',
'somekey' => 'somevalue'
)
)
Is there some way for me to retrieve the first value? E.g. ${'key.name'} or similar.
I know I can retrieve the second value with $somekey but I am curious if its possible with . in the name.
I have gone through Head First Java and some other sites but I couldn't find complete stuff related to Threads and additional concurrency packages at one place.
Please suggest a book/website which covers complete Threads with more details like
Synchronize and locking of objects
More detailed about volatile
Visibility issues in Threads
java.util.concurrent package
java.util.concurrent.atomic package
hi people, I wanna make change in css class every 3 loops. In the first three I want to use the CSS class A, in the next three I want to use the CSS class B, in the next three I want to use the CSS class A again and so on.
can anyone help? Thanks
hi,
I'm using a Repeater object in Flex. Would be possible to stop the repeater after 50 iterations.. even if my dataProvider is bigger ?
I want to display only the first 50 items. I'm using MXML to implement the repeater.
thanks
there are 2 multiple select list on my page , one is there with a seperate remove button . selecting an item there in the selected list is removing the item from the first select list also.how will i specify which list to remove item from in this code
$().ready(function() {
$('#remove').click(function() {
return !$('#FeatureList option:selected').remove();
});
});
I'm still new to Android, so, I'm still not so familiar with its libraries and APIs.
My first major project is a download manager which supports segmented downloading. I could already download files, but, I still have no idea on how or where to start for segmented downloading.
I have already browsed a lot of threads, but I really couldn't find any article or thread about segmented downloading in Android.
Can anyone please help me?
I have two tables and I want to get all records from one table that are different from the records in second table.
Eg.: if we have four records in the first table like A,B,C,D and three records in the second table thats A,B,C then the answer of query should be D.
I have tried "EXCEPT" operator but it doesn't work fine. Kindly help me in writing correct query for the given problem.
Hi,
having a FileStream that I read with a StreamReader (it is a very large file), how can I set the Seek position of the FileStream to the first occurrence of a certain substring so that I can start reading this large file from a given point?
Thanks
I am using jquery to find a first element having a class "error" applied to it using the below code
$('#mainDiv input.error:eq(0)')
But the above one working only for input elements only.
How to make this one to work for both input and select elements?
I know this is kind of a dumb question, but does anyone have an elegant (or non-elegant) LINQ approach to transform a 2D array (object[,]) into a 1D array (object[]) comprised of the first dimension of the 2D array?
I have two insert statements.Second one will be executed only after successful execution of First one.What I wd like to do is-
$sqlone="Insert into .....";
$sqltwo="Insert into.....";
If(mysql_query($sqlone))
{
If(mysql_query($sqltwo))
{
show message Data inserted in both tables.
}
}
I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for / and one for \ .Help me to get the logic behind slashes.
Hi,
I'm using ruby to sort an array where each element in the array is another array.
I have this:
Data = Data.SortBy { |Info| info[3] }
example data in this column:
3.1
2
5.65
-1
0.4
-9.43
-10.87
-2.3
It should sort this into:
5.65
3.1
2
0.4
-1
-2.3
-9.43
-10.87
But it comes out like this:
5.65
3.1
2
0.4
-1
-10.87
-2.3
-9.43
It's only comparing the first char of the float... not the whole number?
Hello, I have a tab bar with two views. In the first view the iPhone status bar is hidden using [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]. When the second view is loaded, and the status bar is made visible again using [[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES] it overlaps the view. How do I make the status bar visible again without overlapping the second view?
Thanks
Hello,
i have grid with user data.with first column has check box.. i have a button at the top of the gird..if i click button I need to selct top 5 users from the list?
can anybody tell me how to do this using jquery?
thanks
First of all I am using ASP.NET with C# for Facebook
Application Developement
My Qestion is :::
How to use Notification.SendRequest.. or
i want to send Request that is A gift from my application to friend then what is the process..
and how to do it.
Hey all, this is my first post. I recently upgraded a wordpress site, all things load but on the top of the page and bottom of the page I get this error.
Warning: session_start() [function.session-start]: open(/tmp/sess_6v2kul3t823ah9074g3cl2lrt6, O_RDWR) failed: Permission denied (13) in /home/admin_m3/incommunion.org/wp-content/plugins/wordpress-automatic-upgrade/wordpress-automatic-upgrade.php on line 121
How can I remove it from the page? I believe the server automatically upgraded the version of Wordpress.
Any idea?
Newbie A
<div id="example-value"> or <div id="example_value">?
This site and Twitter use the first style. Facebook and Vimeo - the second.
Which one do you use and why?
i need to get a query where the elements are displayed in case the first letter is E (the word is electronics).. i have tried with the following :
mysql_query("select * from nested_category where name like '[A-F]%'");