Sunday, 1 September 2013

Dynamic animation in flash and actionscript

Dynamic animation in flash and actionscript

longtime fan.
I wish to create a dynamic animation engine for my major creative project
in my current fine arts diploma. I have some programming experience in the
past but not specialized in the fields I'm currently researching.
I am wondering whether the idea I have is feasible and if so what
language/etc I would require to achieve it.
I realise this is a big question so I'll try to be as specific and
descriptive as possible
I am currently looking at using Flash and Actionscript 3.
The current simple description of operation is as follows:
User is presented with a drawing input whereby they can draw using just
black. Once they have finished their drawing they click a submit button
and the drawing becomes a frame in an ongoing animation.
However each frame that is submitted is analysed by the program and its
compared to all other frames currently in the animation. The program then
sorts the new frame (and possibly all or any appropriate other frames)
into the animation in an order where the pixel data is closest to the
frames either side of it.
The program could possibly do this resort in the background, or at
interval times or any way that works really.
The animations frame rate would also speed up partially over time as more
frames are added making the animation longer and faster (to a point
perhaps).
Perhaps:
framerate = totalFrames / n
or something along those lines
My current thoughts are:
I realise the most difficult aspect is the analysis, comparison and
re-sorting of frames in terms of their pixel location data. I feel it
could be possible through somekind of bitmap analysis.
As I am new to the question asking process if anything is unclear or bad
practice please pull me up and I will try to correct asap.
Thank you kindly.

Sharing URL On Facebook using Addthis

Sharing URL On Facebook using Addthis

we have a news website and using AddThis plugin to share news on Facebook
, sometimes when we try to share news on Facebook it doesn't detect the
page info (title ,desc , image ) and when we put the same URL on Facebook
debugger every thing running correctly and page info detected , and when
return to the web site and use the same URL we can share it normally .
the web site created using asp.net 4.0 + SQL server 2008 + iis 6 and the
website behind a firewall
thanks

Add "slow" to toggle function

Add "slow" to toggle function

I found this very well working toggle code. It´s nearly perfect, I just
want to add a slide function. I tried different things, but it did not
worked out for me:
.toggle("slow");
$("div").slideToggle("slow");
I hope someone can show me the right code and where to put it in this
function:
<script type="text/javascript">
function showme(id, linkid) {
var divid = document.getElementById(id);
var toggleLink = document.getElementById(linkid);
if (divid.style.display == 'block') {
toggleLink.innerHTML = 'Show Widget';
divid.style.display = 'none';
}
else {
toggleLink.innerHTML = 'Hide Widget';
divid.style.display = 'block';
}
}
</script>
<a id="toggler" onclick="showme('widget', this.id);" href="#">Show Widget</a>
<div id="widget" style="display:none;">
This is a widget
</div>
<a id="toggler" onclick="showme('widget', this.id);" href="#">Show Widget</a>
<div id="widget" style="display:none;">
This is a widget
</div>

Saturday, 31 August 2013

Unix: How to sort a dat file and keep original line numbers

Unix: How to sort a dat file and keep original line numbers

I have a large data file containing over a thousand entries. I would like
to sort them but maintain the original line numbers. For instance,
1:100
2:120
3:10
4:59
Where the first number is the line number, not saved in the data file,
separated by a colon from the real number. I would like to sort it and
keep the line numbers bound to their original lines, with an output of:
2:120
1:100
4:59
3:10
If possible, I would like to do this without creating another file, and
numbering them by hand is not an option for the data size I'm using.

Button click with jquery cancel form and redirect page

Button click with jquery cancel form and redirect page

http://jsfiddle.net/nqCFL/
I'm trying to check the value of an input and if it's empty, redirect the
page, if not empty, redirect to another page. It has no value as is and
does not represent what I'm actually trying to do, it';s just an
experiment. This experiment is supposed to help me with the goal is to
check the input and if it's empty, submit the form. If it's not empty,
cancel the form and redirect to another page. I'm experimenting with
Botcha and this is similar in idea. The problem is the page just
continually refreshes on button click and never redirects according to the
test I have above.
The experiment I have is:
<form action="" method="post">
<input type="text" placeholder="issue" class="issue-input" />
<button class="submit button" type="submit">Send</button>
</form>
$(".submit").click(function(){
if($(".issue-input").val().length == 0){
window.location.href = "http://www.google.com";
} else {
window.location.href = "http://www.yahoo.com";
};
});

how migrate to ember.js existing page with lot of js

how migrate to ember.js existing page with lot of js

I have start to make a full application using jquery ui and jsplumb. I
want ot make an application which use a lot of ajax and manage model on
client side. I have start to code it manaually. And I discover ember js
and angular. It fit perfectely to my need to have model on client side and
do ajax to save load data. I choose ember for different reason
(handlebars, no intrusive attribut, ...) I have read the documentation and
few tutorial. I see how we make a page and fill it with data from
controler/model. But where do we put code to make the view dynamic. I
mean, we have jqueryui and all things which add dragNDrop, effect,...
which manipulate DOM. I know that ember try to avoid that and prefer
template over dom manipulation but I have ever code that with jquery js
and do not see how to migrate that code to ember. To sum up: I need drag
and drop/ dom manipulation when click on button or when drop element. I
need to handle dbl click to load modal window (loaded in ajax) and del key
to delete content in dom. All this things are easy with jquery/jqueryUI
but do not see where to put that in ember.
My code is to big to be paste here.
Is it possible to load JS script to manage each view ? this js must only
be linked to the view content. To avoid id/class selector colision between
pages.

Why only one active partition in MBR

Why only one active partition in MBR

I was reading about bootstrapping of operating systems and read in detail
about usage of MBR. But wherever I referred, they mentioned that there can
be only one active partition among four primary partitions.And when the
code contained in the boot sector of that active partition is
executed,user is given a menu for selecting one of the operating
systems(in case of multiboot).
I do have following questions regrading my above description:
1. What are disadvantages of having more than one active partition in MBR?
2. And why only four primary partition?(Is it because of the limitation of
size of MBR)
3. What is the use of primary partitions other than active partition?