Wishing for Memory Functions in JavaScript

Share this:  

At work I am working on a web app that is very data intensive. A whole lot is done on the client side in JavaScript. There are certain instances in tests I have done where I have run out of memory.

I can adjust parameters down until the errors go away but:

  • Am I getting the absolute best usage of my memory or am I “leaving my change on the table?”
  • What if a user’s PC has less memory than me, are they going to get out of memory errors?
  • What if a user’s PC has a lot more memory than I do… then they really will not be able to leverage that extra memory to their advantage.

I wish there were two JavaScript functions available for programmers to use:

  • totalMemory()
  • availableMemory()

The functions could be called something else, that’s fine. But if there were these functions and if they returned the number of bytes relative to what was accessible to that current instance of the web browser, that would be so useful! As far as I know, JavaScript does not have any functions like this. I’ve looked 🙂

Am I missing something? Are there functions or object properties that I’ve missed? If you are a web developer working on some data intensive stuff on the client side don’t you wish you had these functions available?

One More Memory Related Thing
One more thing regarding JavaScript memory usage… There is a piece of info that I do know is out there somewhere… but I have not found yet… How much memory do JavaScript variables use?

I assume strings  may use 1 byte per character (or do they use 2 bytes to support unicode). I assume booleans take the least amount of memory (possibly 1 bit)? There are integers and floating point values… how many bytes do they use each? What is the overhead number of bytes for each variable and for each element in an array? Knowing this information could be helpful in deciding how to store information in memory the most efficient way.

UPDATE:
Microsoft says that their floating point variables in JavaScript use 8 bytes (search for the word “byte” on the page).
see: http://msdn.microsoft.com/en-us/library/ie/7wkd9z69(v=vs.94).aspx

UPDATE  2:
This looks like an interesting JS library: something where you pass in a variable or JSON string and it returns how many bytes it takes up.  I have to investigate this further when I have some time!
http://code.stephenmorley.org/javascript/finding-the-memory-usage-of-objects/

Crazy Ways of Designing 3D Printed Parts

Share this:  

So I got my female connection test piece working perfectly. My thought was Yes! I now have the measurements I need  to implement connections on the actual model!

Not so fast. I guess I just do not have the hang of this.  It seems to involve a lot of trial and error. Like I’ve said before, I am using Sketchup to design my parts.  This part of the project is driving me nuts. Its just the first part… getting the four base pieces to snap together.

I did not work on it last night because I was just too frustrated with it.

Working on Test Connector

Share this:  

Yesterday evening I started working again on the design of a female connection piece. The model I am working on (which I want to make copies of and give as gifts to family members) will use these connectors on the base. Instead of just trying to add them to the main model right away, I am creating a small connector which I can adjust the measurements of and print in a relatively short period of time and test to see if it fits the male part of the connector.

If it does not, I can make adjustments to the measurements and repeat the process. Printing this test piece takes much less time than printing the whole actual part of the model! Once I get it just right I will write down the final “correct” measurements and use them for all the base pieces of the model.

A couple months back I was working on this test connector. I was printing test prints in ABS plastic. I am putting ABS aside and printing my tests in PLA plastic. It takes about 24 minutes to print my female connector test print on my Makerbot Replicator 2 3D Printer.

3D Printing Journal Continued

Share this:  


I have started printing again after I got back from vacation. A lot of warping on a modest sized print in ABS plastic. It may be my imagination, but Makerbot’s Brown ABS filament seems to shrink and warp more than a color say like Red.

Oh, and I started getting temperature errors again 🙁 . I have not investigated this yet. It is just too depressing to look at right now.

PLA is still a non-starter on my Makerbot Replicator 2X printer.

There is a gift I want to  give to some of my relatives this Christmas. I am designing it and I want to print copies out and give as gifts. At the rate I am going, I am spending more time fixing the printer, having failed prints, etc. than I am designing this gift and printing its parts.

I decided rather impulsively to go to the nearby Microsoft Store and buy a Makerbot Replicator 2 printer (not 2x). It prints only in PLA. So far, I have found it to be much more reliable than the 2X. If I level the build plate properly it has a very high rate of successful prints. I am getting back to designing this gift in Sketchup again. Yay!

Note: The Makerbot Replicator 2 looks a lot like the 2X but… it cost less, does not print in ABS, has only one extruder not two, does not have an aluminum build plate, its build plate does not heat up (no need to for PLA), the extruder itself is different, there is no plexiglass on the sides and front, there is no plastic lid. So far… so good.

They have a demo printer at the Microsoft Store, it seems to be printing merrily away without filament cruft laying about. They sell a handful of PLA filament colors too. I will need to order some other colors from Makerbot that I need to print my gift out properly.

Getting the PLA prints to get unstuck from the build platform of my new 3D printer is harder than for ABS prints on my 2X. But I will trade successful prints for this problem any day!

I have notice that PLA can shrink… but a whole LOT less than ABS. I have a hunch that the really neat photos of say the green tractor on Makerbot’s site where printed on the Replicator 2 in PLA. I don’t know for sure, but I think I am right. I printed some tractor parts in ABS on my 2X (http://www.thingiverse.com/thing:31702)… there was a lot of warping. I printed the body of a UPS Truck in Brown ABS, there was a lot of warping and splitting (http://www.thingiverse.com/thing:31686).

Other Stuff
I got a new desk for my workshop at Office Depot to put my MacBook Pro on and hopefully it will be a future soldering station as well. My workshop is looking more and more “workshoppy” all the time! 🙂

Do I have too many proverbial balls in the air at one time? Probably!

I Began working on new Blogging Software

Share this:  

For all the benefits of using WordPress for my blog, there are many more draw-backs. Sometimes I wonder if I would have been better hand-coding my blog! Writing a post like this that only contains your basic text, its fine. You start wanting to embed pictures or perhaps videos and it behaves very badly. I lost a whole long post recently 🙁 .

So, over vacation I started filling out a notebook with designs for my own blogging software. I’ve been doing a lot of content management software at work so doing content management type stuff is fresh in my mind. My goal is to get off of WordPress and get off soon. I want to be able to put together posts efficiently. I want to spend my time writing and refining my posts, not struggling with the technical problems of the platform I am using.

The database I am using is mySQL. I was going to write the blog software in Coldfusion (since that is what I am most comfortable with). But I have decided to use PHP. All nice and open source! 🙂 I’m developing it in a web instance running on my iMac using MAMP.

Goal: That I have a local instance working with basic functionality by this Saturday.

Printing in PLA is Frustrating So Far

Share this:  

PLA Filament
I have a Makerbot Replicator 2X 3D Printer. It can print in both ABS and PLA plastic filaments.  So far, the only plastic I can get prints out of  fairly reliably is ABS.

I found some interesting info on the subject in Google Groups:

https://groups.google.com/forum/#!topic/makerbot/s1wZ6KoiIQY

I tried some things I saw here with some slight improvements. But it is still not worth my trouble.

I am giving up printing in PLA for now, I will probably try different things every now and then when my patience is running higher.

We will see.

3D Printing Update – Some of what’s Happened and What I’ve Learned

Share this:  

Oh heck! I have been neglecting my blog for long enough!

Due to the dearth of posts on 3D Printing you might suspect that I haven’t done any at all! Maybe I gave up? Not on your life! A Makerbot Replicator 2X is just too dang expensive to give up on!

When it came to the thermocouple, for a while my printer was in a bunch of pieces strewn all over my workbench. But, finally I got my printer back together and working.

I have gotten somewhat better and having successful prints… somewhat… I am better at leveling the build plate (very important leveling the build plate)! Kapton tape is very important for printing in ABS. But Kapton tape is a pain in the butt to apply nicely to the build plate (I should devote a whole post to this subject)!

I have designed a few things using Sketchup and you can download them to print on Thingiverse.com. My user name there is getOrvillized:

http://www.thingiverse.com/getOrvillized/designs

The things I have designed so far:

  • Garden Hose Spigot Handle
  • Makerbot 2X GoPro Camera Mount
  • GoPro Mounting Bracket
  • Furnace Pipe Connector
  • Hanging Basket

I am getting better at using Sketchup but I am by no means an expert… yet… 🙂

I’ve been working mostly with spools of ABS plastic. Mostly Makerbot brand. Some Octave brand as well (Octave seems to be a runnier plastic).

ABS printing… breathing the fumes makes me wheeze. Don’t breath the fumes.

PLA printing… smells like popcorn (since it is corn based that makes sense)… I still wouldn’t breath the fumes!

ABS loves to shrink and on taller prints the layers like to separate on the corners.

ABS (what legos are made of) is stronger and more flexible than PLA.

You could leave an ABS print in your back car window no problem, one in PLA plastic might get a little gooey sitting back there.

Basically, PLA melts at a lower temperature than ABS.

When printing in ABS you have to spend a large amount of time waiting for the build platform to heat up. When printing in PLA you do not have to heat the build plate so it starts to print much quicker.

To make your prints stick to the build platform during the printing, you use Kapton tape for ABS and Blue Painter’s Tape for PLA.

When printing in PLA, put the Blue Painter’s Tape over the Kapton tape. The Kapton tape is too expensive and too hard to work with to remove and install anew when switching back and forth between ABS and PLA. I found out this is what they do at the Bot Cave at Makerbot.

You should only change the Kapton tape when it gets too messed up (gouges and scratches) for prints to stick properly.

There was a 3D Printing Expo in Chicago. I took the day off and went to it. It was a big disappointment. Makerbot was not even represented there. The size of the whole exhibit floor was about the size of my back yard! I saw everything there was to see in about 20 minutes (that’s about a dollar a minute based on the ticket price).


Above is a sample brace for a child to wear to help them function.
This was at the Expo, and it is definitely a cool use of the
technology to provide custom solutions at a smaller cost.

I have recorded some of the prints I have recently done on YouTube.

Makerbot Replicator 2x Journal Entry 2

Share this:  

Well, yesterday was a busy day for me just immersing myself in the world of 3D printing. I want to keep this post short so I have more time to actually do more 3D printer stuff and maybe kick back on my remaining day off from work!

Let’s see:

  • I called Makerbot about my heater error.
  • They emailed me instructions for checking the thermocouple connections to the circuit board inside the printer.
  • I followed the instructions (I want to do a detailed post on this later).
  • It seemed to work… for a while…
  • I printed a 2nd Mr. Jaws for my nephews in Red ABS plastic. It printed nicely.
  • A little later the error message popped up again. Grrrrr!
  • I called Makerbot Support again and told them my woe.
  • They are sending me a new thermocouple cable free of charge. It will take a few days to get here (for fast shipping I would have to had to pay).
  • The thermocouple that is acting bad is for the right extruder.
  • In the mean time, I have not actually used the left extruder yet so I decided to start messing around with that!
  • While I had tech support on the phone I had a mess of questions I wanted answered in my notebook. I asked those questions (and two or three more) and built up my knowledge base quite a bit! There is still so much to learn! BTW, I did not feel rushed by the support person (I felt more rushed by myself)!
  • I hope to write other posts regarding the information I found out about on that call.
  • I picked another object out on Thingiverse to print in Natural ABS plastic (white). Its called Melting Ball in a Cage (thing:62856).
  • If you look at a picture of this thing it probably should have been called Ball in a Melting Cage!
  • It was printed in white PLA. I have white ABS. How hard could this be?
  • Even after leveling the build platform carefully I am having a hard time:
    • Even printing the raft.
    • Getting the plastic to consistently come out of the extruder!
  • The white ABS seems a bit runny.
  • The first thing I want to do today is try the print again with a lower temp on the extruder and see if that helps.

Wish me luck!

1 2 3 4 11