XML Compressor
This little tool removes comments, linebreaks, tabs and unneeded spaces from your xml, html, xhtml, js or css, reducing it's filesize
Comment removal
How to remove comments beside variables or function!
How often have you been bitten by a regex? In my work has a lots!
Three days ago, i spent 40 minutes crafting in compressing, do html+css+js to a single file to improve performance of loading from browser.
Here's requirement.
And here's how the story usually goes, this's done by Vu Le.
And here's how it works.
How often have you been bitten by a regex? In my work has a lots!
Three days ago, i spent 40 minutes crafting in compressing, do html+css+js to a single file to improve performance of loading from browser.
Here's requirement.
var a="http://ccnhup.com";
// url "" var c='//root//app//test'
// uri with ' ' var d="http://domain.com";
// //domain var e='//root//app//test'
// // var f=background-image:url(http://domain) // url(://) var g=background-image:url(//domain) // url(//) var h=(rpc://domain)
// (rpc://) var i="(", j="("
// variables with )) // (( ")" ")" var l=background-image:url(((//domain))) // url(//) var b=function(
// // function ) var k=1
// k = 1 as eq /// //
And here's how the story usually goes, this's done by Vu Le.
var a = "[^(http:)(file:)(rpc:)'\"]//[^\n]*\n|[^(http:)(file:)(rpc:)'\"]//[^\n]*$";Thanks Vu Le for contribution.
And here's how it works.
var a="http://ccnhup.com";
var c='//root//app//test'
var d="http://domain.com";
var e='//root//app//test'
var f=background-image:url(http://domain) var g=background-image:url(//domain)
var h=(rpc://domain)
var i="(", j="("
var l=background-image:url(((//domain))) var b=function(
var k=1
Pass data from popup to parent on multi browsers
Today I’m going to support a small issue for my co-worker working with browser popup.
How to pass data from popup to parent window on IE or Chrome or others for example?
What is similar of some browsers supporting? Let me show you somethings that I have summarized:
For example:
http://domain.a.com/parent.html
http://domain.b.com/popup.html
How to pass data from popup to parent window on IE or Chrome or others for example?
What is similar of some browsers supporting? Let me show you somethings that I have summarized:
Browser | Method should be used | Return by |
---|---|---|
IE 6, 7, 8,9,Edge | window.showModalDialog | window.returnValue |
Chrome, Opera, Firefox, Safari | window.open | window.opener.passDataToParent |
Example how to get a message from popup
I create 2 pages parent.html and popup.html, on the parent page I will have a method use to open the popup page.On parent.html
<script language="javascript">
function passDataToParent(txt) {
//data will be received from popup page
}
function callOpenPopup() {
// popup page will be opened at here!
}
</script>
On popup.html
<script language="javascript">
function callPassData() {
var d = "data for passing";
// pass data to parent at here
}
</script>
<input value="call popup" type="button" onclick=" callPassData() " />
And with
IE 6,7,8,9 and Edge we should use with this method
//Parent.html uses to open popup window.showModalDialog(); //Data passes from popup.html to parent.html var value = new Object(); value.data = d; window.returnValue = value;
Chrome, Opera, Firefox, Safari we should use with this method
//Parent.html uses to open popup window.open(); //Data passes from popup.html to parent.html window.opener.passDataToParent(d);
Cross domain should pay attention
We could not to be able to pass data from another popup domain to another parent domain.For example:
http://domain.a.com/parent.html
http://domain.b.com/popup.html
Conclusion
Working with multi-browsers is amazing for any developers I think, because we will have chance to get more differences between them, sometime we also get mad because we do not have any way to resolve a huge issues between them, meanwhile Google also has no clearly defined problem. The version of the browsers are also thing we have to concern.Download
Click here!Bubble Sort
After a series bad days, I decided to take back the spirit begins with a request from my teacher, here's a small demo of sorting algorithm
ActionScrip 3 code demo:
ActionScrip 3 code demo:
var temp: int = 0,
i: int = 0,
j: int = 0,
array: Array = [];
function BubbleSort(n: int) {
for (i = 0; i < n - 1; i++) {
for (j = i + 1; j < n; j++) {
if (array[i] > array[j]) {
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
}
References
- https://en.wikipedia.org/wiki/Bubble_sort
- http://rosettacode.org/wiki/Sorting_algorithms/Bubble_sort
- http://code.tutsplus.com/tutorials/quick-tip-implementing-the-bubble-sort-in-as3--active-10728
- https://www.hackerearth.com/notes/sorting-code-monk/
- https://www.quora.com/What-is-the-fastest-sorting-algorithm
Main idea
Download
Source here: https://drive.google.com/open?id=0B8jxLPprSFg1TWVENmZ4SEE3SjQOnline music tool makes for fun
If you wanna have amazing tool support for online music, drop me a text we can share experience!
Music references:
1. home edward sharpe and the magnetic zeros: https://www.youtube.com/watch?v=L64c5vT3NBw
2. Someone like you: https://www.youtube.com/watch?v=hLQl3WQQoQ0
3. Dance of the little swans(cygnets): https://www.youtube.com/watch?v=i4ANvfEqIho
4. One way ticket: https://www.youtube.com/watch?v=7DYA1raD-YY
5.박혜경 Lemon tree: https://www.youtube.com/watch?v=c7KXtINADRo
6. Lemon tree: https://www.youtube.com/watch?v=bCDIt50hRDs
7. Hello Vietnam(Pham quynh Anh): https://www.youtube.com/watch?v=0nbY7Mg_vMI
8.So happy together(cover by lizziepmusic): https://www.youtube.com/watch?v=WTRkMDOj_J0
Ocean Paradise Game
Show off to you my world fish, ocean paradise game :D
My fish game is just one of several my prototype game built on flash two years ago. Several calculation methods as perspective, direction, gravity of the game is applied Vector2D, a library is very useful to me. Whoever created great achievements must also have started to learn, and I am also proud that I have studied and inherit the research achievements of predecessors :D :D
This project couldn't continue because it has not received adequate investment.
Author relations:
- Graphic design: Thanh Nhan, Hoai Anh
- Music: Khanh Duong Phan
- R&D: Hung Le
Reference:
- http://www.zambetti.com/projects/vector2d/
- Download Vector2D.as3
Tag: Vector2D.as, Vector2D, algorithm, mathematics
This project couldn't continue because it has not received adequate investment.
Author relations:
- Graphic design: Thanh Nhan, Hoai Anh
- Music: Khanh Duong Phan
- R&D: Hung Le
Reference:
- http://www.zambetti.com/projects/vector2d/
- Download Vector2D.as3
Tag: Vector2D.as, Vector2D, algorithm, mathematics
Why FlashDevelop Version number plugin doesn't work?
FlashDevelop Version number is a library working hide on FlashDevelop tool, it's automatically create and increase version file which is we can show it off to define between last version also current version.
For example of my product when I click right on app:
I spent just a few hours to debug why the FlashDevelop version number plugin doesn't work?
The main reason was because of the dissimilarity of subversion in directory management and its new library, it can not be read by new management subversion folder.
You can see through the images described below:
New version is working for directory now:
I copied SharpSvn.dll which is supporting for Subversion 1.8.9 into Plugins folder(replace the last dll file) and it works!
Here is all zip libraries already: download here
Download and extract to your FlashDevelop installed
ex: C:\Program Files (x86)\FlashDevelop\Plugins
If it still doesn't work, contact me for a help ;)
For example of my product when I click right on app:
I spent just a few hours to debug why the FlashDevelop version number plugin doesn't work?
The main reason was because of the dissimilarity of subversion in directory management and its new library, it can not be read by new management subversion folder.
You can see through the images described below:
New version is working for directory now:
I copied SharpSvn.dll which is supporting for Subversion 1.8.9 into Plugins folder(replace the last dll file) and it works!
Here is all zip libraries already: download here
Download and extract to your FlashDevelop installed
ex: C:\Program Files (x86)\FlashDevelop\Plugins
If it still doesn't work, contact me for a help ;)
Reference
http://www.flashdevelop.org/community/viewtopic.php?f=4&t=6150
Subscribe to:
Posts (
Atom)