Archive

Posts Tagged ‘duration’

Need To Calculate Play Time Duration For .flv Video Fil 2

November 11th, 2011 Comments off

Hi,

I need to calculate the play time duration for .flv video files stored in a web folder and update a table field with the calculated time duration.

Attached is the existing php file which does that but it calculates the time from AVI file types. This has to be changed to calculate the time from .flv video files instead of AVI file types.

Need To Calculate Play Time Duration For .flv Video Files

November 10th, 2011 Comments off

Hi,

I need to calculate the play time duration for .flv video files stored in a web folder and update a table field with the calculated time duration.

Attached is the existing php file which does that but it calculates the time from AVI file types. This has to be changed to calculate the time from .flv video files instead of AVI file types.

Mysql Trigger

August 22nd, 2011 Comments off

I have a field in my database that occassionally gets populated with the following string:

O:8:”mgm_post”:8:{s:11:”purchasable”;s:1:”N”;s:13:”purchase_cost”;s:1:”0″;s:15:”purchase_expiry”;s:0:”";s:17:”purchase_duration”;s:1:”0″;s:7:”product”;a:0:{}s:23:”access_membership_types”;a:0:{}s:12:”access_delay”;a:0:{}s:15:”access_duration”;s:1:”0″;}

I need to switch this string to a similar but altogether different string, this one:

O:8:”mgm_post”:8:{s:11:”purchasable”;s:1:”N”;s:13:”purchase_cost”;s:1:”4″;s:15:”purchase_expiry”;s:0:”";s:17:”purchase_duration”;s:1:”0″;s:7:”product”;a:0:{}s:23:”access_membership_types”;a:1:{i:0;s:6:”member”;}s:12:”access_delay”;a:4:{s:5:”guest”;s:1:”0″;s:5:”trial”;s:1:”0″;s:4:”free”;s:1:”0″;s:6:”member”;s:1:”0″;}s:15:”access_duration”;s:1:”0″;}

I dont claim to be very good at SQL but this is what i have come up with:

CREATE TRIGGER setMetaValue BEFORE INSERT ON wp_postmeta
FOR EACH ROW
BEGIN
IF NEW.meta_value = ‘O:8:”mgm_post”:8:{s:11:”purchasable”;s:1:”N”;s:13:”purchase_cost”;s:1:”0″;s:15:”purchase_expiry”;s:0:”";s:17:”purchase_duration”;s:1:”0″;s:7:”product”;a:0:{}s:23:”access_membership_types”;a:0:{}s:12:”access_delay”;a:0:{}s:15:”access_duration”;s:1:”0″;}’ THEN

SET NEW.meta_value = ‘O:8:”mgm_post”:8:{s:11:”purchasable”;s:1:”N”;s:13:”purchase_cost”;s:1:”4″;s:15:”purchase_expiry”;s:0:”";s:17:”purchase_duration”;s:1:”0″;s:7:”product”;a:0:{}s:23:”access_membership_types”;a:1:{i:0;s:6:”member”;}s:12:”access_delay”;a:4:{s:5:”guest”;s:1:”0″;s:5:”trial”;s:1:”0″;s:4:”free”;s:1:”0″;s:6:”member”;s:1:”0″;}s:15:”access_duration”;s:1:”0″;}’;

END IF;
END $$

DELIMITER ;

However i get error warnings of syntax errors, could this be because of the characters in the string?
If this is true (even if its not) Can anyone help with a fix?

Regards

Categories: MySQL Tags: , , , , , ,

Sql Solution Needed

November 18th, 2009 Comments off

I need a quick mysql solution for the following (please review table structures, see attached file):

There are several records in table “cdr” (around 100 new rows in every minute).

In every 5 minutes I need to determine the costs per call.
See the first row in cdr:
9256749931 | 10.0.0.1 | 12010320313 | 33.33.33.33

it means 9256749931 called 12010320313, caller’s source ip was 10.0.0.1, the destination gateway was 33.33.33.33

Here are the steps to make it working:

select dst_username and dst_domain from the cdr table, and then look for the grp_id in gw table by IP.

Select the grp_id from the gw table and search for lcr based on the grp_id and the first 7 chars of the dst_username(remember, dst_username was selected form cdrs), the first 7 chars will be the prefix in lcr table.

Then select that prefix and search for destinations in the rates table (so lcr.prefix=rates.destination to search for).

select durationRate,durationRateIn,increment and minduration from the rates, and then do the following:

there are increment and minduration, so values should be rounded.
if the duration in cdrs table contains 13, then that should rounded to the next 6, so 13 will become 18 (remember, 6 seconds increments).
If the duration in cdrs are below 6, then it should be rounded to 6.

If the increment and min_duration is 1 and 1 in rates table, then it shouldn’t be rounded to the next 6.

so there will be duration_6 and minduration_6 columns, so you will need to update that an don’t touch the original duration.
you will need to update price_in, and price_out column in the cdrs table:

price_in will be rates.durationRateIn*cdrs.duration[rounded to next 6 if there is increment 6 in the rates table for the prefix] / 10000

price_out will be rates.durationRate*cdrs.duration[rounded to next 6 if there is increment 6 in the rates table for the prefix] / 10000

note: my comments are between [ and ]

if you done with a row in cdrs table, then update processed=1 in the specific row in cdrs table, make sure that won’t be processed again.

I’ll need a script for this, it will run from command line by a cronjob (every 5 mins), so you should add new indexes if needed, there can be 100mill rows in the cdrs table, so table scans should be avoided.

I’ll need the solution within 2 hours from now, payment will be SL escrow after selecting the right provider for this project.

If you have any questions, please don’t hesitate to ask.

Thanks and happy bidding :)

Pay Per Call

September 1st, 2009 Comments off

We are working with very well branded companies to generate high quality leads both online and offline. We are looking for publishers that can advertise this pay per call offer online, newspapers, direct mail, or any source you believe will generate high quality leads.

Here is the minimum you can make:

$0.35 if duration is 12 sec
$4.00 if duration is 6 min
$8.00 if duration is 9 min

This is cost for just 1 of our advertisers we would like to promote, we need all the help we can get. Payment will be NET 30.

If you do not agree to any of these terms please do not bother contacting us to negotiate payment frequency or price. After working with us for a period of atleast 3 months we will negotiate the amount you generate and give you increases periodically.

Excel Macros

August 27th, 2009 Comments off

Introduction

The requirement is for a set of Microsoft Excel Macros to import data from proxy server log files into a Microsoft Excel Workbook and to produce reports and charts based on the imported data.

The Macros may be written in VBA and the result will be a single .XLS workbook containing the macros which would be triggered by either a hot key or a macro button.

The project will be in two stages. First developing the
Macro(s) to import the raw log file data into an Excel Workbook and secondly developing the Macro(s) to process this imported data to produce a number of charts based on the log file data.

Background

The company’s internal proxy servers produces log files which detail fetch request made by user PCs within the company network to servers on the internet via the proxy server. These proxy log files contain many lines, one for each fetch request. The log files are in plain text and each line contains the following fields prefaced by the identifier then the data and separated by a space. Records are separated by a newline character.

1 id= Proxy Server ID

Categories: Programming, Visual Basic Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Tapi Monitor

June 30th, 2009 Comments off

My project is almost complete. Our software works with an IP PBX. We need to add a module for call duration control. The needed module should be delivered in VS2005 .NET C# or VB.

The requested features are as follows:

- Monitor all TAPI lines for outgoing call duration.
- Specify a parameter for the maximum call duration allowed per extension.
- Extension maximum duration will be passed from our other software modules upon successful connected calls. An event is needed for that purpose.
- Disconnect the call when the threshold is reached.
- An event to register to upon threshold breach with complete event arguments for the involved disconnected call properties.
- Robust error management

The programmer must have previous experience in TAPI for .NET and some IP PBX knowledge.

The time frame is short and quality work is needed.

Please use the board for any inquiries.

Thanks

Bear