Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Madhed

Member Since 13 Jun 2001
Offline Last Active Today, 03:44 AM

#5149830 Screenshot of your biggest success/ tech demo

Posted by Madhed on 27 April 2014 - 05:14 AM

I did some freelance programming on My Dolphin Show. Nothing next-gen though but a fun little game that's getting good reviews and has a few million installs.

Get it! it's free :D

 

https://play.google.com/store/apps/details?id=com.spilgames.mydolphinshow&hl=de

 

https://itunes.apple.com/de/app/my-dolphin-show/id632016921?mt=8

 

My-Dolphin-Show-MyDolphinShow.jpg




#5149685 Applications vs. Webapps

Posted by Madhed on 26 April 2014 - 12:24 PM

Yep that actually belongs in the con list. Dont know how it ended up there.
As for transpilers. Didn't really think of that. Good point.
Im not against pure JavaScript either. Just thought that might be a negative for people who are used to other languages.


#5149667 Applications vs. Webapps

Posted by Madhed on 26 April 2014 - 10:52 AM

A webapp is just an application that runs in the browser using web technology like html, javascript, xhr, etc.

 

Pros:

- user does not need to install the software

- user does not need to update the software

- cross platform

- sandboxed (browser separates app and os)

- rich design language (css)

 

Cons:

- requires internet access at all times (except if you do advanced stuff like html5 application cache)

- javascript

- can be slower than a native app

- browser differences can make development difficult

- sandboxed (if the app needs access to "unsafe" os functions you're SOL)




#5142643 Using MakeHuman..is it cheating?

Posted by Madhed on 27 March 2014 - 11:38 AM

IMO using such a tool as a starting point to make your own characters is perfectly fine.

Why should you reinvent the wheel?

 

When I'm coding I can use thousands of libraries that other people have written and use those with my own written code to put together a finished product.

Why should artists not do the same?




#5142145 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 05:26 PM

@JohnnyCode:

 

There are two ways to use setInterval.

 

1. Pass function as a reference: setInterval(function() { doSomething(); }, 10);

 

2. Pass an expression as a string: setInterval("doSomething();", 10);




#5142069 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 01:11 PM

// Creating a function in javascript

//1. directly named
function a() {};

//2. anonymously, assigned to variable
var b = function() {};

//3. via operator new (dont do this)
var c = new Function("arguments...", "body");

//4. anonymously, as a temporary variable (the temp is a reference to the function)
function() {};

OP creates a function when the script executes via method 4. The reference to the function is then passed to the internal setInterval function.

setInterval is internal to Chrome's V8 engine and repeatedly calls the function via reference. No additional functions are created.

 

If you can show me where my explanation is wrong, I welcome you to do so. If you continue attacking without reason I will assume that you are a troll.




#5142054 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:42 PM

@Alpha

 

In javascript functions without a return statement return the value undefined.




#5142053 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:40 PM


what is written to setInterval is  javascript code that gets executed every time the interval passes

 

What is "written" to setInterval is a reference to the function.

 


since it is not an r value, it gets also executed-entered

 

I don't know why you are talking about r-values as this is javascript and not c++.




#5142046 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:23 PM

The code is not creating a function every interval. It is passed once as an argument, that is all.

Furthermore your code is not correct. heavy() returns undefined. So you are actually calling setInterval(undefined, 1);

 

 

Apart from that typo, both snippets are identical except for the fact that in OP's code the function is anonymous whereas in yours it's stored in the variable heavy.




#5142029 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 11:01 AM


it seems to leak according to chrome dev tools 

 

Is this the whole code? How did you come to the conclusion that it leaks memory? That simple snippet should not leak any memory.

 

EDIT:

I just tried it myself. Even with a completely empty interval function the memory usage increases continually until chrome decides it's enough and frees a large block. This is completely normal behaviour and does not mean there is a memory leak. If you let the profiler run long enough you will see some kind of zig-zag pattern where memory usage increases up to a certain point and then suddenly drops. Older browsers used to have problems detecting circular references and thus never freeing some memory but in my experience this is mostly fixed now.

 

It is nevertheless a good practice to keep memory allocations low so the GC doesn't have to do as much work because it can slow down your application a lot.




#5141742 Help with Smooth Gradient on Skydome

Posted by Madhed on 24 March 2014 - 11:32 AM

It may be that there are no dark lines in your gradent, and you've just got a 6bit-per-channel LCD and are seeing the mach bands illusion.

 

I can definitely see the bands on my LCD. Do you mean on your screen everything appears smooth, Hodgman?

 

Display quality aside, this is a general problem that can appear because in some situations 8 bit per channel still is not enough. Look for photoshop tutorials on how to get perfectly smooth gradients. If you have the banding problem, the only fix is to add dithering.

 

http://blog.chipotoole.com/2011/03/how-to-eliminate-gradient-banding-in.html

 

EDIT: ...or choose another color transition. Going from full blue to completely black gives you only 256 separate steps with a fairly high contrast. Spread that out over more than 256 pixels and you will get noticeable bands.




#5137877 No Low Level Programming is better ?, Please explain this then ?

Posted by Madhed on 10 March 2014 - 12:54 PM

My head hurts...




#5136792 Choosing a Fast WebGL Sprite Renderer

Posted by Madhed on 06 March 2014 - 07:55 AM

Have a look at Pixi.js. It supports WebGL and falls back automatically to canvas. And it's pretty fast.

 

Here's a Benchmark: http://www.goodboydigital.com/pixijs/bunnymark/




#5136396 Providing a download link

Posted by Madhed on 04 March 2014 - 04:50 PM

You can use the php function readfile() to output file contents into the http response stream.

You would use this on a url that the user can only access when logged in.

You should also use header() to set the correct mime type and tell the browser to prompt the user to download the file (instead of opening it in the browser)

header("Content-type: application/octet-stream"); 
header("Content-disposition: attachment; filename=test.zip");  



#5135408 How to get good fast?

Posted by Madhed on 28 February 2014 - 11:05 AM

There really is no shortcut to becoming good at anything,

Set yourself realistic goals and keep a steady but achievable curriculum.

Surround yourself with persons who are better than you at whatever you want to learn.

Never become satisfied with your skillset and don't snub your nose at other people's ideas.

After all, how are you going to learn something new when all you accept are opinions you already hold.

Throw yourself out there and don't be afraid of failure.






PARTNERS