Off Topic > Off Topic
Programming Megathread
<< < (98/241) > >>
Foxscotch:

why does this work and not ruin everything


--- Quote from: Ono-Sendai on February 11, 2016, 03:05:37 PM ---nwjs and electron give you a webkit context and you can basically create a local webapp using nodejs. its a pretty easy way to write cross platform gui applications.

--- End quote ---
wow. that's really cool
electron's website is a lot more clear (at least to me) about what it does
--- Quote from: Ono-Sendai on February 11, 2016, 03:05:37 PM ---require.js/AMD and common.js etc are module import systems which make it easy to split your code across multiple files. you should write javascript in a way where everything is a small module that does one specific purpose. theres no other way to build 'large' javascript applications that are also maintainable. there are programs where you can concatenate all your dependencies together and minify them to reduce network usage

--- End quote ---
I completely understand why you'd use it in node.js, I just don't get the point in using something like that on a webpage. I can see how it would help managing dependencies to other files during development, but only until you concatenate them. it seems like it'd hurt performance being used on a production page

edit: can someone tell me why npm downloads packages that you already have installed globally...
like, if you already have the right version in the global node_modules folder, why not just copy that to the local one, instead of downloading a new one?????
Ono-Sendai:

--- Quote from: Foxscotch on February 12, 2016, 10:33:57 PM ---
why does this work and not ruin everything
--- End quote ---
you push the reference of the x array onto the back of the array itself. in the inspector when you see the contents of x[2] it resolves that reference and displays that same array. it lets you do this forever.

--- Quote from: Foxscotch on February 12, 2016, 10:33:57 PM ---I completely understand why you'd use it in node.js, I just don't get the point in using something like that on a webpage. I can see how it would help managing dependencies to other files during development, but only until you concatenate them. it seems like it'd hurt performance being used on a production page
--- End quote ---
it doesnt really hurt performance when all the dependencies are concatenated into one file before minification. theres a very slight performance overhead but not much. it would be very hard to write complex web applications like facebook etc without javascript module systems because it would get very hard to maintain. also there are such things as source maps which allow you to untangle the concactenated files during debugging. these are VERY useful.

--- Quote from: Foxscotch on February 12, 2016, 10:33:57 PM ---edit: can someone tell me why npm downloads packages that you already have installed globally...
like, if you already have the right version in the global node_modules folder, why not just copy that to the local one, instead of downloading a new one?????

--- End quote ---
good question. if the versions matched between the current one and the globally installed one then that would make sense. ive always found package managers to be kind of stuffty. why dont more of them grab more than one package at the same time?
Tudoreleu:
bump.cs

ive been thinking of trying something a bit greater than the stuff our teacher gives us; maybe a program to display all the possible structural formulas of a hydrocarbon, given its molecular formula, or a rough recreation of minesweeper in c++
devildogelite:
I started working on a project in C# and using my arduino that has been pretty fun to do. I've been wanting to interface real world devices with the computer and this was one of the first things I could do to teach me some stuff. I've never dealt with serial communications, then also all the fun of C# dealing with classes and what not.

I use the C# application to get the information of the computer devices then it passes that along to the arduino over a serial connection on USB. I wanna make the C# application minimize down to the dock but have some info about the system and some settings to mess around with.

The arduino displays all of this using a little display made up of 4 8x8 LED matrixes next to eachother for  a grand total of 32x8 resolution. It scrolls the device name across and then the numbers are displayed in the center of the display. It's not super useful but I love these little displays, I wanna do something with the pile of 7 segment LED displays I have but don't have a clue yet.

Right now I have it so I can hit a button to send the info to the arduino to display stuff. It displays whatever is separated by a line break and then adds it to a linked list it works it's way through. I'm trying to make it so that when the arduino goes through the whole list it sends back a message saying it needs more info and then the C# application automatically sends it over.

That's the part that I'm getting really screwed up with, at first I thought I was gonna need to multithread to listen for stuff, then I found out the serialport has an event for when new info comes back over however I'm confused on how to call the temperature stuff again without making everything static.
BluetoothBoy:

--- Quote from: devildogelite on February 25, 2016, 04:06:07 AM ---I started working on a project in C# and using my arduino that has been pretty fun to do. I've been wanting to interface real world devices with the computer and this was one of the first things I could do to teach me some stuff. I've never dealt with serial communications, then also all the fun of C# dealing with classes and what not.

I use the C# application to get the information of the computer devices then it passes that along to the arduino over a serial connection on USB. I wanna make the C# application minimize down to the dock but have some info about the system and some settings to mess around with.

The arduino displays all of this using a little display made up of 4 8x8 LED matrixes next to eachother for  a grand total of 32x8 resolution. It scrolls the device name across and then the numbers are displayed in the center of the display. It's not super useful but I love these little displays, I wanna do something with the pile of 7 segment LED displays I have but don't have a clue yet.

Right now I have it so I can hit a button to send the info to the arduino to display stuff. It displays whatever is separated by a line break and then adds it to a linked list it works it's way through. I'm trying to make it so that when the arduino goes through the whole list it sends back a message saying it needs more info and then the C# application automatically sends it over.

That's the part that I'm getting really screwed up with, at first I thought I was gonna need to multithread to listen for stuff, then I found out the serialport has an event for when new info comes back over however I'm confused on how to call the temperature stuff again without making everything static.

--- End quote ---
Gonna plug a thing my friend made/is making that works with Arduino. http://alicorn.io
Navigation
Message Index
Next page
Previous page

Go to full version