Thursday, October 8, 2009

Granting And Revoking Permissions by anil nain


Granting And Revoking Permissions by anil nain
Permission on the objects created by the use
The objects created by one user are not accessible by another user unless the owner of those objects gives such permission to other user. These permissions cab be given by using the Grant statement. One user can grant permission to another user if he is the owner of the object of has the permission to grant access to other users.
Granting Permissions Using Grant Statement
The Grant statement provides various types of access to database objects such as tables, views and sequence. Granting And Revoking Permissions by anil nain
Syntax
GRANT {object privileges}
ON objectname
TO username
[WITH GRANT OPTION];
Object Privileges
Each object privilege that is granted authorizes the grantee to perform some operation on the object. The user can granto all the privileges or grant only specific object privileges.
The list object privileges is as follows:
· ALTER : allows the grantee to change the table definition with the ALTER
TABLE command
· DELETE : allows the grantee to remove the records from the table eith the DELETE
Command.
· INDEX : allows the grantee to create an index on the table with the CREATE INDEX
Command.
· INSERT : allows the grantee to add records to the table with the INSERT command.
· SELECT : allows the grantee to query to the table with the INSERT command.
· UPDATE : allows the grantee to modify to the records in the tables with the UPDATE
Command.
With Grant Option
The WITH GRANT OPTION allows the grantee to grant object privileges to other users.
Example 1
Grant all privileges on the table product_master to the user Pradeep
GRANT ALL
ON product_master
TO pradeep;
Example 2
Grant Select and Update privileges on table client_master to Mita.
GRANT SELECT, UPDATE
ON client_master
TO mita;
Example 3
Grant all privileges on the table client_master to the user Ivan with the grant option.
GRANT ALL
ON client_master
TO ivan
WITH GRANT OPTION;
Granting And Revoking Permissions by anil nain

Thursday, September 17, 2009

Sorting process by anil nain from sonepat haryana


Sorting: Sorting is the process of arranging a set of similar information into an increasing or decreasing order. Sorting is one of the most intellectually pleasing category because the process is so well defined. We can use function qsort( ) for sorting but it will sort array in memory not linked lists. Finally qsort( ) is very effective in general case but not the best for all situations.

Selection Sort : A selection sort selects the element with the lowest value and exchanges it with first element. Then from the remaining n-1 elements, the element with smallest value is found and exchanged with the second element, and so forth. The exchanges continue to the last two elements. For example, if selection sort method is used on the array dcab, each pass would like this:

Initial d c a b
Pass 1 a c d b
Pass 2 a b d c
Pass 3 a b c d
n / 6 log n
Average Number of Exchanges = .


Bubble Sort : The most well known and infamous sort is Bubble Sort. Its popularity is derived from its catchy name and simplicity. However, for general purpose sorting, it is one of the worst sort sorts ever convinced.
The Bubble Sort is an exchange sort. It involves repeated comparisons and, if necessary exchange of adjacent elements. The elements are just like bubbles in a tank of water – each seeks its own level. For example, if bubble sort method is used on the array dcab, each pass is shown here:

Initial d c a b
Pass 1 a d b c
Pass 2 a b d c
Pass 3 a b c d

In analyzing any sort, it is useful to have an idea about comparisons and exchanges performed for best, average, worst case. With Bubble Sort, the no. of comparisons are always same because two for loops repeat the specified no. of times whether the list is initially ordered or not.
1 / 2(n2-n)
Average Number of Exchanges =

Where n is no. of elements to be sorted. The formula is derived from the fact that outer for loop executes n-1 times while inner one n/2 times. Multiplied together results in the preceding formula. For Bubble Sort :
Case No. of Exchanges. Remarks
Best Zero Already Sorted List
Average 1/2(n2-n) -
Worst 1/2(n2-n) -
Sorting process by anil nain from sonepat haryana

Tuesday, September 15, 2009

Binary Search by anil nain


Binary Search: If data to be searched in sorted array, In such cases we use a vastly superior method to find a match named Binary Search which uses the divide and conquer approach. To employ this method, test the middle element. If it is larger than key(element to be searched), test the middle element of the first half; otherwise test the middle element of lower half. Repeat this procedure until a match is found or there is no more elements to test.

For Example, to find number 4 in Array :
1 2 3 4 5 6 7 8 9

A binary search first tests the middle element, which is 5. Since 5 is greater than 4, the search continues in first half, or
1 2 3 4 5

The middle element is now 3. This is less than 4, so first half is discarded, and search continues with
4 5
This time the match is found.

No. of Comparisons (Worst Case) = log2 n
No. of Comparisons (Best Case) = 0
No. of Comparisons for Average Case are somewhat lower as compared to Worst Case.
by anil nain 9416077273


Friday, September 4, 2009

Grouping Data From Tables In SQL FROM anil nain 9416077273

Grouping Data From Tables In SQL
The concept of grouping
From sale_order_details table, we well create a set containing several sets of rows groups together based on a condition.
Table name: sales_order_details
S Order No.
Product Qty Ordered
Qty. Ordered
Qty. Disp
019001
P00001
10
10
019001
P03453
3
3
019001
P06734
3
3
046865
P06734
4
4
046865
P03453
10
10
046865
P03453
2
2
073965
P00001
1
1
073965
P06734
1
1
Example
Select product_no, total qty_ordered for each product;
SELECT Product_no, sum(qty_ordered) “Total Qty Ordered”
FROM slaes_order _details
GROUP BY product_no;
The following is the output displayed:
Product No. Total Qty. Ordered
------------------ ---------------------------
P00001 13
P03453 15
P06734 8

A condition cab be imposed on the group by clause, using the having clause as done in the following example:
1. Select product_no, total qty_ordered for products ’P00001’ OR ‘P03454’,
Select product_no, sum(qty_ordered)”Total Qty Ordered”
FROM sales_order_details
GROUP BY product_no
HAVING product_no=’P00001’ OR ‘P03454’,
The following output displayed:
Product No. Total Qty Ordered
---------------- -------------------------
P00001 13
P03453 15

Wednesday, August 26, 2009

Oracle Functions BY ANIL NAIN 9416077273

ANIL NAIN 9416077273
Functions are used to manipulate data items and return a result. Functions follow the format of: funtion_name (argument, argumnent2,…) An argument is a user-supplied variable or constant. The structure of functions is such that it accepts zero or more arguments.
Example
AVG Syntax AVG ([DISTINCT ALL]n)
Purpose Returns average value of n, ignoring null values.
Example SELECT AVG (sell_price ) “ Average”
FROM product_master,
Output Average
--------------
2012.3654
Note
In the above SELECT statement AVG function is used to calculate the average selling price of all products. The selected column is renamed as ‘Average’ in the output.
MIN Syntax MIN ([ISTINCT/ ALL] expr)
Purpose Returns minimum value of expr.
Example SELECT MIN(s_order_date) “Minimum Date”
FROM sales_order;
Output Minimum Date
----------------------
26- Jan-93
COUNT (expr) Syntax COUNT ([DISTINCT/ALL] expr)
Purpose Returns the number of rows where expr is not null.
Example SELECT COUNT (order_no) “No of Orders”
FROM sales_order
Output No of Orders
-------------------
5
COUNT(*) Syntax COUNT (*)
Purpose Returns the number of rows in the table, including duplicates and those with nulls.
Example SELECT COUNT(*) “Total” FROM client master;
Output Total
---------
15
MAX Syntax MAX ([DISTINCT/ALL]expr)
Purpose Returns maximum value of expr.
Example SELECT MAX (qty._ordered) “ Maximum”
FROM sale_order_details.
Output Maximum
---------------
5000.00
SUM Syntax SUM ([DISTINCT/ALL]n)
Purpose Returns sum of values of n.
Example SELECT SUM (qty_ordered)”Total Qty”
FROM sales_order_details
WHERE product_mo=’P00001’,
Output Total Qty
---------------
29025.00
ABS Syntax ABS (n)
Purpose Returns the absolute value of n.
Example SELECT ABX(-15) “Absolute” FROM dual;
Otuput Absolute
----------
15
POWER Syntax ABS(n)
Purpose Returns m raised to nth power, n must be an integer, else an error is returned.
Example SELECT POSWER (3,2) “Raised” FROM dual;
Otuput Raised
------------
9
ROUND Syntax ROUND (n[,m])
Purpose Returns n rounded to m places right of the decimal point.If m is omitted, to 0 places m can be negative to round off digits left of the decimal point m must be an integer.
Example SELECT ROUND (15, 19, 1)”Round” FROM dual;
Output Round
-----------
15.2
SQRT Syntax SQRT (n)
Purpose Returns square root of n; if n<0, name="’TURNER’" sel_price="sell_price+">

Saturday, August 15, 2009

UGC NET (NATIONAL ELIGIBILITY TEST) FOR JRF AND ELIGIBILITY FOR LECTURSHIP QUESTION PAPER by anil nain 9416077273

15X5=75

1. FIFO page replacement is used with for initial empty pages trams and eight pages. How many pages faults will occur for the references string 0172337103?
2. What do you mean by authoring tool give its application also. What are various types of authoring tools?
3. Define phrase structure grammar of type 0,1,2,3 with an example of each.
4. what are three major multiplexing technique(tamp) and show that
If A=>B then ~B=> ~A.
5. What are advantages of combining segmentation of paging together?
6. Differentiates between software engineering and software reveres engineering.
7. Explain rapid app. Development model with its various RAD.
8. What is index fast full scan in oracle. Why does it not grant that the output will in shorted order of the index.
9. Explain how the concept of object identify in object oriented mode define the concept of tuple.
10. Write on 9085 assembly language program that finds the 2’s complement of again 8 bit integer.
11. With reference to the worst case behavior determine the complexity of binary search.
12. Determine the product 1234*758 using divide and conquer technique.
13. Discuses XML architecture.
14. Distinguish between Moore and mealytinity sate machining.
15. State in algorithm for converting a transitive graph into a regular expression with explanations.

5x12=60
16. Half man tree.
17. Encoding and decoding of L2 codes.
18. Main goals of JPEG compression images.
19. Fourier transforms.
20. Neural Network sun throughputs fuzzy system sum output.
21. f(x)=1/1+ex
22. Switch function x1+x2x3.
23. LCM Divisible.

One essay type question with internal options 40 marks
24. Describe the back propagation algorithm assure a feed forward neural network topology with single hidden lodger.
25. UNIX files protection. What is fiber obstruction providing by xp? How it differ from threads obstruction

UGC NET (NATIONAL ELIGIBILITY TEST) FOR JRF AND ELIGIBILITY FOR LECTURSHIP QUESTION PAPER by anil nain 9416077273

MODEL TESTPAPER
Section (1) contains 5 Question each carry 5 marks.
Section (11) contains 15 Question each carry 5 marks.
Section (111) contains 5 Question each carry 12 marks.
Section (1V) contains 1 Question each carry 40 marks.

Wednesday, May 20, 2009

What are the Options after PhD?

What are the Options after PhD?
anil nain 9416077273 sonepat haryana MCA
Clearly, one of the main job opportunities after PhD is a faculty position in some University, College, or an Institute. This option, world over, is one of the most preferred options for people with PhD. One of the reasons for this is that in today's world, the best quality people require freedom in their work and have a strong desire to ``make a mark''. Both of these are well supported by research activities a faculty undertakes as part of his job - he has the freedom to select the problems he works on, and through his research he creates new knowledge which is published under his authorship. This is a very strong motivating factor and very good people across the world sacrifice other benefits for academic freedom and possibilities to create and innovate.
In faculty positions it should be mentioned that for Computer Science, as there is a shortage of qualified faculty in most good institutions, there are always openings in places like IITs/NITs/RECs/Central Universities, etc. In addition, now some private universities as well as institutions set up by overseas universities coming up which also are looking for qualified faculty (and these places are paying much more than Govt. scales - up to 3 times more!)
However, teaching is by no means the only option for a PhD. India today is fast becoming a center for global R&D. Due to the quality of its manpower, and the lower cost, many organizations have started setting up R&D centers in India. And these centers are looking for PhDs (and not finding them, as there are not enough getting produced!) Some example of these are IBM India Research Center in New Delhi, GE Research in Bangalore, Mentor Graphics in Hyderabad, Cadence, etc.
Besides these research centers, most of the big Indian IT companies have started high end technology development and consulting, and R&D centers or cells, in which they need PhDs. Almost all the IT majors - TCS, Infosys, Wipro, etc. employ a large number of PhDs (upward of about 50 each) and are always looking for more people to enhance their R&D activities. This activity will increase in these companies as these companies become larger. A few years back, we had done an informal survey on salaries with these companies and we were told that most of them will offer at least twice as much starting salary for a PhD as for a BE. Starting salaries for many of these positions are of the order of Rs 50,000 PM or more.
Besides these opportunities in India, people with PhDs are global citizens and move around quite a bit. Immediately after PhD, there are opportunities for post-doctoral work in US and Europe. While working as a researcher/faculty, there are opportunities for visiting faculty appointments or visiting researchers in US, Europe, Singapore, etc., where a faculty member from India can spend a year or two in overseas universities or research labs. Many faculty members from India avail of this from time to time.

What are the Options after PhD?

What are the Options after PhD?
anil nain 9416077273 sonepat haryana MCA
Clearly, one of the main job opportunities after PhD is a faculty position in some University, College, or an Institute. This option, world over, is one of the most preferred options for people with PhD. One of the reasons for this is that in today's world, the best quality people require freedom in their work and have a strong desire to ``make a mark''. Both of these are well supported by research activities a faculty undertakes as part of his job - he has the freedom to select the problems he works on, and through his research he creates new knowledge which is published under his authorship. This is a very strong motivating factor and very good people across the world sacrifice other benefits for academic freedom and possibilities to create and innovate.
In faculty positions it should be mentioned that for Computer Science, as there is a shortage of qualified faculty in most good institutions, there are always openings in places like IITs/NITs/RECs/Central Universities, etc. In addition, now some private universities as well as institutions set up by overseas universities coming up which also are looking for qualified faculty (and these places are paying much more than Govt. scales - up to 3 times more!)
However, teaching is by no means the only option for a PhD. India today is fast becoming a center for global R&D. Due to the quality of its manpower, and the lower cost, many organizations have started setting up R&D centers in India. And these centers are looking for PhDs (and not finding them, as there are not enough getting produced!) Some example of these are IBM India Research Center in New Delhi, GE Research in Bangalore, Mentor Graphics in Hyderabad, Cadence, etc.
Besides these research centers, most of the big Indian IT companies have started high end technology development and consulting, and R&D centers or cells, in which they need PhDs. Almost all the IT majors - TCS, Infosys, Wipro, etc. employ a large number of PhDs (upward of about 50 each) and are always looking for more people to enhance their R&D activities. This activity will increase in these companies as these companies become larger. A few years back, we had done an informal survey on salaries with these companies and we were told that most of them will offer at least twice as much starting salary for a PhD as for a BE. Starting salaries for many of these positions are of the order of Rs 50,000 PM or more.
Besides these opportunities in India, people with PhDs are global citizens and move around quite a bit. Immediately after PhD, there are opportunities for post-doctoral work in US and Europe. While working as a researcher/faculty, there are opportunities for visiting faculty appointments or visiting researchers in US, Europe, Singapore, etc., where a faculty member from India can spend a year or two in overseas universities or research labs. Many faculty members from India avail of this from time to time.

Monday, May 18, 2009

Doing a PhD in Computer Science

Doing a PhD in Computer Science
Anil Nain 9416077273 MCA
PhD is the highest degree offered anywhere in the world (barring the highly uncommon DSc). Its focus, unlike regular degrees, is not learning existing knowledge but creating new knowledge. No wonder, PhD is desired by anyone wishing to `make a mark' - the brightest seek it as it allows challenges that no other degree does; the innovative desire it as it allows the possibility to innovate and create new knowledge and technologies; the ambitious seek it as it is the top of the academic ladder; and the persistent seek it as this is the one degree where persistence and self discipline are brought to full use.
Despite the romance of doing a PhD, there seems to be some `fear' frequently in the youth about pursuing a PhD - prospective students are sometimes scared because they think it is ``too difficult and they will not be able to do it'', or because ``it takes too much time'', or perhaps just because ``PhD means that you have to be a teacher and I don't want to be a teacher''. All of these reasons/fears are actually false. This note discusses some of these issues in an attempt to clarify the situation for prospective candidates.
What is Involved in a PhD?
First let us clearly understand what is involved in doing a PhD. PhD is, as everyone knows, about doing research. And research is about formulating problems or questions whose answers the research or practitioner community wants to know, and whose answers are not known. Doing research is to provide some answer to these questions. So, the key aspects of doing a PhD are (a) formulating a question or a problem that is of interest and that can be solved, and (b) providing a useful/interesting solution to the stated problem. The results obtained are presented in national/international conferences, and/or submitted to scientific journals.
The problems that are addressed by a PhD scholar can range from very difficult open problems to evolutionary technology issues. In Computer Science, the problem area can range from highly theoretical/mathematical to modeling and experimentation or building new technologies. For example, there are a lot of open problems regarding the complexity of solving some problems algorithmically (for example, checking whether a number is a prime - a problem for which an efficient solution was proposed only recently by Prof. Agarwal of CSE/IITK). These problems typically involve complex theoretical and mathematical development. Similarly, there are many problems that require understanding the behavior of various systems. Approaching such problems frequently uses modeling and experimentation. Then there are problems of the type where something innovative and useful is done using computers and software. Working on such problems typically involves building systems and prototypes. In other words, a scholar doing a PhD in Computer Science has a wide range of areas to choose from, depending on his inclination, ability, and interests.
Generally, PhD programs world over proceed as follows: do some course work, pass some qualifying exam, and then write a thesis that has to be defended (sometimes, at the early stages of the thesis a `proposal' may have to be submitted.) In a place like CSE/IIT Kanpur, generally, a student who joins the PhD program after completing his/her B.Tech/BE will spend about 1 year doing the courses, about 1 to 2 years for formulating the problem, which also requires an in-depth study of the chosen area, and about 2 years or more for developing the solutions and writing the thesis. Once the thesis is written, it is examined by some experts and a thesis defense is scheduled. This process takes about 6 months, but the candidate can start his post PhD job once the thesis is submitted. Hence, doing a PhD takes about as much time as doing a BE, or the amount of time a doctor spends doing his residency and MD.
Doing a PhD is indeed hard. However, the difficulty is not because extreme intelligence is necessary. Brilliance, of course, helps - brilliant people can attack hard problems and produce solid results and leave a permanent mark on the field. However, students with good academic background and some amount of creativity can also do a PhD, and do quite well. Completing a PhD primarily requires a drive, motivation, and hard work. Hard and motivated work determines not only the quality of the final work, but also the amount of time needed to complete the PhD. In general, a PhD can be completed in 4 to 5 years - 4 years for the motivated and 5 for the not-so-motivated.

Saturday, January 3, 2009

ग्राविटी बल कोड फॉर एक्शन script

code by anil nain for flash action script anil nain is software enginearonSelfEvent(load){ var air_fy: Number = 10; var air_fx: Number = 10; var gravity: Number = 150; var intial_vy: Number = 20; var num_balls: Number = 3; var old_num: Number = 0; var ball_elastic: Number = 0.7; }onFrame(2){ for(db= (1); db<=old_num; db++){ this["ball_"+db].removeMovieClip(); } ball_mc._visible = false; for(ib =1;ib <=num_balls; ib++){ // duplicate ball_mc var add_ball: String = "ball_"+ib; ball_mc.duplicateMovieClip(add_ball,10+ib); var new_ball_mc: Object = this[add_ball]; new_ball_mc.txt_field.text = ib; var new_x2: Number = ((Stage.width - 200)/(num_balls))*ib; new_ball_mc._x = new_x2; new_ball_mc._y = 50; new_ball_mc._vy = intial_vy; new_ball_mc._ay = gravity; new_ball_mc.new_vy = intial_vy; new_ball_mc.new_ay = gravity; new_ball_mc.new_vx = 0; new_ball_mc.new_ax = 0; new_ball_mc._fy = air_fy; new_ball_mc._fx = air_fx; apply_color(new_ball_mc,ib); new_ball_mc._visible = true; } }onFrame(3){ stop(); }function apply_color(what_ball, num_b){ // the colors are hexidecimal numbers with '0x' added to let the script understand that it is a hexidecimal
color; // note: I have only setup 6 colors for 6 balls. You will need to add more numbers, use the color select in the
properties // panel to see the hexidecimal number of a color you like. if(num_b == 1){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0xff0000); } else if(num_b == 2){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0x00ff00); } else if(num_b == 3){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0xfff000); } else if(num_b == 4){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0x0000ff); } else if(num_b == 5){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0xff00ff); } else if(num_b == 6){ var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0x0000ff); } else { var ball_c: Object = new Color(what_ball.shape_mc); ball_c.setRGB(0x000fff); }}



spring slider


onSelfEvent(load){
var inital_n: Number = _root.ball_elastic; var min_n: Number = 0; var max_n: Number = 1; var inital_pos: Number = ((inital_n/(max_n - min_n)) * (slider.small_rect._width - slider.slider_bn._width)) +
slider.small_rect._x; slider.slider_bn._x = inital_pos; slider.txt_n.text = inital_n; // var intial_object: Object = _parent._parent.gravity; ref_var = intial_object; slider.slider_bn.onPress = function(){ record_pos(_parent._parent.gravity, max_n, min_n); // Here the horizontal movement of the slider_bn // dragging state is locked the width and position of the 1 // small_rect. The vertical move is zero, so we used the intial // position of the slider_bn this.startDrag(false, this._parent.small_rect._x, this._y, (this._parent.small_rect._x +
this._parent.small_rect._width - this.slider_bn._width), this._y); } slider.slider_bn.onRelease = function(){ recorder.removeMovieClip(); slider_bn.stopDrag(); } slider.slider_bn.onReleaseOutside = function(){ slider_bn.stopDrag(); }
}function record_pos(ref_var1,max_n,min_n){ createEmptyMovieClip("recorder",10); recorder.onEnterFrame = function(){ var current_ratio: Number = ((_parent.slider.slider_bn._x -
_parent.slider.small_rect._x)/(_parent.slider.small_rect._width - _parent.slider.slider_bn._width)) * (max_n -
min_n); _parent.slider.txt_n.text = (current_ratio); // apply to the var for that slider _root.ball_elastic = current_ratio; } }
numball slider
onSelfEvent(load){ var inital_n: Number = _root.num_balls; var min_n: Number = 0; var max_n: Number = 10; var inital_pos: Number = Math.ceil((inital_n/(max_n - min_n)) * (slider.small_rect._width -
slider.slider_bn._width)) + slider.small_rect._x; slider.slider_bn._x = inital_pos; slider.txt_n.text = inital_n; // var intial_object: Object = _parent._parent.gravity; ref_var = intial_object; slider.slider_bn.onPress = function(){ record_pos(_parent._parent.gravity, max_n, min_n); // Here the horizontal movement of the slider_bn // dragging state is locked the width and position of the 1 // small_rect. The vertical move is zero, so we used the intial // position of the slider_bn this.startDrag(false, this._parent.small_rect._x, this._y, (this._parent.small_rect._x +
this._parent.small_rect._width - this.slider_bn._width), this._y); } slider.slider_bn.onRelease = function(){ recorder.removeMovieClip(); slider_bn.stopDrag(); } slider.slider_bn.onReleaseOutside = function(){ slider_bn.stopDrag(); }
}function record_pos(ref_var1,max_n,min_n){ createEmptyMovieClip("recorder",10); recorder.onEnterFrame = function(){ var current_ratio: Number = ((_parent.slider.slider_bn._x -
_parent.slider.small_rect._x)/(_parent.slider.small_rect._width - _parent.slider.slider_bn._width)) * (max_n -
min_n); _parent.slider.txt_n.text = Math.ceil(current_ratio); // apply to the var for that slider _root.num_balls = Math.ceil(current_ratio); } }


air resistant
onSelfEvent(load){ var inital_n: Number = _root.air_fy; var min_n: Number = 0; var max_n: Number = 100; var inital_pos: Number = Math.ceil((inital_n/(max_n - min_n)) * (slider.small_rect._width -
slider.slider_bn._width)) + slider.small_rect._x; slider.slider_bn._x = inital_pos; slider.txt_n.text = inital_n; // var intial_object: Object = _parent._parent.gravity; ref_var = intial_object; slider.slider_bn.onPress = function(){ record_pos(_parent._parent.gravity, max_n, min_n); // Here the horizontal movement of the slider_bn // dragging state is locked the width and position of the 1 // small_rect. The vertical move is zero, so we used the intial // position of the slider_bn this.startDrag(false, this._parent.small_rect._x, this._y, (this._parent.small_rect._x +
this._parent.small_rect._width - this.slider_bn._width), this._y); } slider.slider_bn.onRelease = function(){ recorder.removeMovieClip(); slider_bn.stopDrag(); } slider.slider_bn.onReleaseOutside = function(){ slider_bn.stopDrag(); }
}function record_pos(ref_var1,max_n,min_n){ createEmptyMovieClip("recorder",10); recorder.onEnterFrame = function(){ var current_ratio: Number = ((_parent.slider.slider_bn._x -
_parent.slider.small_rect._x)/(_parent.slider.small_rect._width - _parent.slider.slider_bn._width)) * (max_n -
min_n); _parent.slider.txt_n.text = Math.ceil(current_ratio); // apply to the var for that slider _root.air_fy = current_ratio; } }
gravity
onSelfEvent(load){ var inital_n: Number = _root.gravity; var min_n: Number = 0; var max_n: Number = 300; var inital_pos: Number = Math.ceil((inital_n/(max_n - min_n)) * (slider.small_rect._width -
slider.slider_bn._width)) + slider.small_rect._x; slider.slider_bn._x = inital_pos; slider.txt_n.text = inital_n; // var intial_object: Object = _parent._parent.gravity; ref_var = intial_object; slider.slider_bn.onPress = function(){ record_pos(_parent._parent.gravity, max_n, min_n); // Here the horizontal movement of the slider_bn // dragging state is locked the width and position of the 1 // small_rect. The vertical move is zero, so we used the intial // position of the slider_bn this.startDrag(false, this._parent.small_rect._x, this._y, (this._parent.small_rect._x +
this._parent.small_rect._width - this.slider_bn._width), this._y); } slider.slider_bn.onRelease = function(){ recorder.removeMovieClip(); slider_bn.stopDrag(); } slider.slider_bn.onReleaseOutside = function(){ slider_bn.stopDrag(); }
}function record_pos(ref_var1,max_n,min_n){ createEmptyMovieClip("recorder",10); recorder.onEnterFrame = function(){ var current_ratio: Number = ((_parent.slider.slider_bn._x -
_parent.slider.small_rect._x)/(_parent.slider.small_rect._width - _parent.slider.slider_bn._width)) * (max_n -
min_n); _parent.slider.txt_n.text = Math.ceil(current_ratio); // apply to the var for that slider _root.gravity = current_ratio; } }
collection tester
onSelfEvent(load){ var inital_n: Number = _root.gravity; var min_n: Number = 0; var max_n: Number = 300; var inital_pos: Number = Math.ceil((inital_n/(max_n - min_n)) * (slider.small_rect._width -
slider.slider_bn._width)) + slider.small_rect._x; slider.slider_bn._x = inital_pos; slider.txt_n.text = inital_n; // var intial_object: Object = _parent._parent.gravity; ref_var = intial_object; slider.slider_bn.onPress = function(){ record_pos(_parent._parent.gravity, max_n, min_n); // Here the horizontal movement of the slider_bn // dragging state is locked the width and position of the 1 // small_rect. The vertical move is zero, so we used the intial // position of the slider_bn this.startDrag(false, this._parent.small_rect._x, this._y, (this._parent.small_rect._x +
this._parent.small_rect._width - this.slider_bn._width), this._y); } slider.slider_bn.onRelease = function(){ recorder.removeMovieClip(); slider_bn.stopDrag(); } slider.slider_bn.onReleaseOutside = function(){ slider_bn.stopDrag(); }
}function record_pos(ref_var1,max_n,min_n){ createEmptyMovieClip("recorder",10); recorder.onEnterFrame = function(){ var current_ratio: Number = ((_parent.slider.slider_bn._x -
_parent.slider.small_rect._x)/(_parent.slider.small_rect._width - _parent.slider.slider_bn._width)) * (max_n -
min_n); _parent.slider.txt_n.text = Math.ceil(current_ratio); // apply to the var for that slider _root.gravity = current_ratio; } }
ball mc
onSelfEvent(load){ var time_d1 : Object = new Date() var time_t1: Number = time_d1.getTime(); var pos_x1: Number = this._x; var pos_y1: Number = this._y; var dragging: Boolean = false; var collision: Boolean = false;} onSelfEvent(enterFrame){ if(dragging){ //sample the positions to determine the release velocities; // // first measure the changes in position and time past. var time_d2 : Object = new Date(); var time_t2: Number = time_d2.getTime(); var time_diff: Number = time_t2 - time_t1; var time_t1: Number = time_t2; // var pos_x2: Number = this._x; var pos_y2: Number = this._y; var diff_x: Number = pos_x2 - pos_x1; var diff_y: Number = pos_y2 - pos_y1; var pos_x1: Number = pos_x2; var pos_y1: Number = pos_y2; // var new_vx: Number = (diff_x * time_diff); var new_vy: Number = (diff_y * time_diff); } }
onSelfEvent(press){ this.startDrag(false,this._width/2,this._height/2,Stage.width-(this._width/2),Stage.height -(this._height/2));
var dragging: Boolean = true; this._vx = 0; this._vy = 0; this._ax = 0; this._ay = 0; }onSelfEvent(release, releaseOutside){ this.stopDrag(); var dragging: Boolean = false; this._vx = new_vx; this._vy = new_vy; this._ay = _root.gravity; this._fy = _root.air_fy; this._fx = _root.air_fx;}