This Post show how to upload data or audio files on server getting from URL and how to download that file in PC using URL.
First put URL in string like below:
$url = 'http://s.cdnpk.eu/pk-mp3/love-dose/s165352040.mp3'; To Download file in PC its a simple short-cut.using download attribute of <a> tag in HTML.
echo "<a href='".$url."' download='myfile.wav'>Download</a>";
Object oriented programming OOP is a programming
technique which is used by many programming languages and in this you have to
use classes which are a user define data type and you create functions and
attributes according to your use and then to use them you have to create an
object or instance of that class so that you are able to access the attribute
and operation of that class.
Advantages:
The object oriented programming have a main advantage of
code reusability that you have to create a class for one time and then just
have to create its instance where ever you want to use it.
The main concepts of object oriented programming are
given below:
·Inheritance
·Encapsulation
·Overloading
·Polymorphism
·Abstraction
As we already discuss all of these topics in over
previous posts but for now take a little review of all of them. Inheritance as the name suggests
inheriting something from other. In this we have a supper and sub class
hierarchy and sup classes are inherited form super classes and was able to use
the functionality and attributes of super class. Many type of inheritance is
there:
·Single level inheritance
·Multi-level inheritance
·Multiple inheritances
·Hybrid inheritance
For more there are other two very important concepts in
inheritance which is following:
·Generalization
·Specialization
Encapsulation
mean data hiding in classes we have to define the scope of every object and
function by default they are all private. We have normally three scope resolution
operator.
·Public
·Private
·Protected
·Sealed
·Sealed internal
Overloading
provides us the y to define same thing with different meaning there are two
type of overloading:
·Function overloading
·Operator overloading
In function
overloading we have many functions with same name but different data type
and in operator overloading we
re-write the functionality of different operators like =, <, >, ||, $$
etc.
Polymorphism
means many ways. In this we have many ways to class a function it cover the
topic of function overriding.
The polymorphic classes contain two types of functions
·Virtual function
·Override functions
OOP
languages:
There are many object oriented programming languages in
which some are pure object oriented and some have both procedural and also
object oriented way.
Java and C# are pure object oriented languages
C++, PHP, JavaScript are not pure object oriented but
have functionality of it.
Constructor:
The constructor is default functionality in all object
oriented languages which come with the classes whenever we create object of the
class the default constructor call and execute its code first without calling
it.
In C++, Java and C# constructor have the same name as
class name and have no data type but in PHP we have to define constructor like
this:
Function __construct( ) {
}
Example
class in PHP:
<?php
class person{
function
__construct(){
echo
"<h1>Person Information</h1>";
}
private
function get_ID($id){
echo
"<h3>Person ID No is :- ".$id.'</h3>';
}
private function
get_name($name){
echo
"<h3>Person name is :- ".$name.'</h3>';
}
private
function get_mob($mob){//have private scope
Add or Remove Input fields Dynamically Using JQuery - HTML
add/remove multiple input fields in html forms
if you are looking to add and remove duplicate input fields, here’s another jQuery example below to do the task for you. This jQuery snippet adds duplicate input fields dynamically and stops when it reaches maximum. Code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function() { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //Fields wrapper var add_button = $(".add_field_button"); //Add button ID var x = 1; //initlal text box count $(add_button).click(function(e){ //on add input button click e.preventDefault(); if(x < max_fields){ //max input box allowed x++; //text box increment $(wrapper).append('<div><input type="file" name="mytext[]"/><a href="#" class="remove_field">X</a></div>'); //add input box } }); $(wrapper).on("click",".remove_field", function(e){ //user click on remove text e.preventDefault(); $(this).parent('div').remove(); x--; }) }); </script> <div class="input_fields_wrap"> <button class="add_field_button">Add More Fields</button> <div><input type="file" name="mytext[]"></div> </div>
As i'm currently working on biometric gait recognition project so to complete that project i have to background subtraction to extract foreground from video.
i'm using CASIA data set videos for my experiments.
So background subtraction is the first thing to do in my project so when we have extracted human structure from video we easily perform our algorithms on it to identify its gait.
Matlab code for background subtraction using frame difference:
clc; % clear command window
clear all; % clear work space
% Reading video from computer directory
videoObject = VideoReader('001-bg-01-090.avi');
% Determine how many frames there are.
numberOfFrames = videoObject.NumberOfFrames;
% Loop through all frames
for frame = 1 : numberOfFrames
% Extract the frame from the movie structure.
img1 = read(videoObject, frame);
img2 = read(videoObject, frame+10);
% In above we take two frame to subtract them from each other
% Subtract frames from each other img3 = imsubtract(img1,img2);
Graduates coming out from Universities are usually very passionate to start a software house of their own. Once they step into the real world, pictures from the dream word start getting blurred and things start looking much more complex then what they envisioned in their dreams.
An initial thought of putting down few computers together in a nice office, giving a good name to this small setup and taking up the seat of CEO of this house, now looks like nothing more than an exercise of interior decoration. People standing outside on the road, will start rushing into this new facility to get their software ordered and we will start making big deals and will have dollars flowing all around is another aspiration that now looks like a big exaggeration.
So what?
What am I supposed to do?
You need projects to start work. Where to get from? Local market? International market? Or should you start developing a new product? How should you decide?
Project or Product?
Project:
A project is a customer specific order for developing software as per his/her specific needs. For a project to get started you need to have a customer paying for it and signing a deal with you.
Product:
Product is usually a new idea or a modification of existing product, targeting customers all around in some specific business domain and does not need any binding, deal or agreement before hand.
Should I go for Projects or should I innovate a product? That’s a challenging question and in fact draws a baseline of your business motive and is a strategic decision. How to decide? What are the factors to base my decision upon?
Here we go with some important considerations for a new entrepreneur:
Capital:
How much can you invest and for how long can you invest without worrying for ROI (Return on investment).
Let’s say I have 1 million and can invest for 2 years without running into financial crises. Will not need to withdraw single penny from my business, have other sources of income to sustain myself and so on. That looks like a relatively good condition for an innovation, but only if I can innovate something.
What should I innovate?
Should I go for a flying train? No, we are only talking about a software innovation. So what should I? Should I develop a product for NASA for tracking satellites? That would impose a big risk, what if NASA refuses to buy the product or is not interested at all. Should I go for an income tax calculator? I need too much of domain knowledge for that, would I be able to get the services of a Tax consultant to guide me on that? Tax laws are different in different countries so my solution would be country specific, most probably for Pakistani citizens. Are Pakistani citizens literate enough to go for computer based software solutions for tax calculation? Do we have any existing solutions in the market for tax calculation? Does FBR provide any such facility, if so then why would someone like to buy mine? Can I provide more user friendly and precise interface for that matter?
After doing all the needed R&D and putting down the answers for above why’s and what’s, let’s say results are positive. What next? Would it be feasible? What comes under feasibility? To calculate feasibility I will consider following ingredients:
Scope: What should precisely be the scope of this product? All kinds of taxes? Or some specific taxes like income tax, wealth tax etc.
Interfaces: What different interfaces should I provide?
Simple desktop utility?
Web based online calculator?
A web service for any third party vendor?
Resources: What different resources would I need? How much of human resource utilization would it take to complete this product end to end? Then office infrastructure, electricity and power backups, Internet connections and towards the end I will need marketing resources to get the product out the door.
Cost: Cost would be determined based on the scope that I define the interfaces that I choose and accordingly resources that are needed.
Feasibility comes to a point where I can say “Yes” or “NO”. Does it fall within my budget and within the defined period of investment?
If finally I get a big “YES” I will go for it and setup a small facility, hire resources and start development of the product, will do my hard and will patiently wait for the outcome. My software house is up and running.
Now let’s talk about track 2, I don’t have much capital and I’m not willing to take risk associated with my innovation. I need earlier commitments from my clients before starting the development cycle. These conditions dictate me to go for Project oriented setup.
How to start such a setup?
There are two ways to do it; either I should have some references in the market from where I could get a project OR I should go for online options, where I could try bidding for online applications and utilities from sites like “rent-a-coder” etc.
If I could be hunting my own references in the local market, I need to be aware of pros and cons associated with this approach. Being a Pakistani national I know my local market is not very much software literate and/or computer literate so opportunities in the local market for a beginner would not be very encouraging.
Secondly the paying capacity of local market is not too good so I might not get rewarded for the effort which I will put in.
Third and more important issue, our local businessmen always considered “software automation” more of a luxury than a need so they don’t opt for it that easily but now situation is changing; people are getting acquainted with the “goods” of automation specifically the efficiency it brings in.
So keeping in mind these factors associated with the local market I will see if it meets what I need from it. If that’s sounds feasibly a fine start, I can try that out and meanwhile I would also keep building my profile for freelance sites to get myself into that business as well. Sites like “rentacoder.com” give us good opportunities to establish our self online. It might not usually be big order but usually going for a bunch of small orders will get you a good start if you are really putting your hard for it.
So summarizing the discussion whether you are going product oriented or project oriented, you need to plan well and estimate the risks associated with it. Otherwise going by the wind will not get you anywhere.
An interface is a reference type in Java, it is similar to class, it is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.
Along with abstract methods an interface may also contain constants, default methods, static methods, and nested types. Method bodies exist only for default methods and static methods.
Writing an interface is similar to writing a class. But a class describes the attributes and behaviours of an object. And an interface contains behaviours that a class implements.
Unless the class that implements the interface is abstract, all the methods of the interface need to be defined in the class.
An interface is similar to a class in the following ways:
An interface can contain any number of methods.
An interface is written in a file with a .java extension, with the name of the interface matching the name of the file.
The byte code of an interface appears in a .class file.
Interfaces appear in packages, and their corresponding bytecode file must be in a directory structure that matches the package name.
However, an interface is different from a class in several ways, including:
You cannot instantiate an interface.
An interface does not contain any constructors.
All of the methods in an interface are abstract.
An interface cannot contain instance fields. The only fields that can appear in an interface must be declared both static and final.
An interface is not extended by a class; it is implemented by a class.
An interface can extend multiple interfaces.
Declaring Interfaces:
The interface keyword is used to declare an interface.
Some time we have a lot of data like 600000 records and we want to show them but not all at a time so we use paging to divide them on separate pages in this post i will define how to use paging in PHP.
First we have to create a Database.
Database Name:Paging Table:
CREATE TABLE `record` (
`Id` int(9) NOT NULL,
`Name` varchar(100) NOT NULL,
`Mobno` int(18) NOT NULL,
`Address` varchar(100) NOT NULL
) ;
And We put Dummy data on 100 records in it .
Now Retrieve that data.i use limit property in my query like SELECT id,name,mobno,address from record limit 0,6
it will limit data in only 6 rows.
Now by using String Query's i create a hyper links containing page no and then on page load get them and use in limit value . Formula: ( page_no - 1 ) * 6