|
Barnyard Protein posted:as much as possible of the app will be in java with spring mvc, but i would like to have some ~dynamic web interfaces~. i'm starting to think that having content update without a page reload isn't worth loving around with javascript and jquery just write a java applet
|
# ? Aug 8, 2015 03:10 |
|
|
# ? May 10, 2024 01:56 |
|
on a related note today I got a job. I'm a node.js developer now
|
# ? Aug 8, 2015 03:11 |
|
Symbolic Butt posted:on a related note today I got a job. I'm a node.js developer now rip
|
# ? Aug 8, 2015 03:12 |
|
Barnyard Protein posted:i'm starting to think that having content update without a page reload isn't worth loving around with javascript and jquery the student becomes the master.
|
# ? Aug 8, 2015 03:51 |
|
Barnyard Protein posted:as much as possible of the app will be in java with spring mvc, but i would like to have some ~dynamic web interfaces~. i'm starting to think that having content update without a page reload isn't worth loving around with javascript and jquery vaadin
|
# ? Aug 8, 2015 04:05 |
|
Symbolic Butt posted:on a related note today I got a job. I'm a node.js developer now similarly, i've been promoted from guy who reports bugs to guy who bugs get reported to
|
# ? Aug 8, 2015 04:08 |
|
Luigi Thirty posted:similarly, i've been promoted from guy who reports bugs to guy who bugs get reported to i asked on slack today who our security person was and was insta promoted to vice president of operational security (no raise)
|
# ? Aug 8, 2015 04:11 |
|
Barnyard Protein posted:re: web dev sinon?
|
# ? Aug 8, 2015 04:42 |
|
the talent deficit posted:i asked on slack today who our security person was and was insta promoted to vice president of operational security (no raise) I wish I knew who our security guy was because I've seen some things
|
# ? Aug 8, 2015 05:32 |
|
Luigi Thirty posted:I wish I knew who our security guy was because I've seen some things ...things you people wouldn't believe. aws credentials in commits on github. i watched ansible roles copy ssl certs to publically accessible s3 buckets. all those passwords will be lost to hackers like bitcoins on mtgox. time to resign
|
# ? Aug 8, 2015 06:03 |
|
basically that yes
|
# ? Aug 8, 2015 06:10 |
|
the talent deficit posted:...things you people wouldn't believe. aws credentials in commits on github. this happened in my senior year of college. this guy in our group had never used git before and he ended up committing files that had our credentials in it. Amazon called him within 24 hours and told him not to do that poo poo again.
|
# ? Aug 8, 2015 06:31 |
|
Luigi Thirty posted:similarly, i've been promoted from guy who reports bugs to guy who bugs get reported to congratulations, another entry for #P"Documents:YOSPOS;Success Stories.TEXT.NEWEST"
|
# ? Aug 8, 2015 10:02 |
|
the talent deficit posted:...things you people wouldn't believe. aws credentials in commits on github. i watched ansible roles copy ssl certs to publically accessible s3 buckets. all those passwords will be lost to hackers like bitcoins on mtgox. time to resign
|
# ? Aug 8, 2015 10:47 |
|
terrible programmer status: i need some help with intellij. i have my module, CPU. however when there's a CPU module and a root module* when both root and cpu modules exist, then i get the compilation error: quote:Error:scalac: Output path C:\Users\gonadic io\IdeaProjects\CPU\target\scala-2.11\test-classes is shared between: Module 'CPU' tests, Module 'root' tests and if i delete the module root, then it gets recreated on intellij start up. should i only be using root? i don't really know what's going on *: like so e: i guess just keeping the root module and getting rid of the cpu one fixes it. i don't really know the difference between modules and projects, or why you'd want multiple modules in a project, but whatever #worksforme gonadic io fucked around with this message at 14:55 on Aug 8, 2015 |
# ? Aug 8, 2015 13:06 |
|
so I have a KSP plugin that talks to my Arduino with a two-line LCD screen. my Arduino understands three commands over serial: write a string to line 1, write a string to line 2, and clear the screen. problem is, since the way it processes commands is by shoving incoming ASCII data into a buffer and waiting for a CRLF sequence, if a second command comes in while we're still processing the first command (I want to write altitude to the top line and velocity on the bottom line), the buffer is corrupted and the program will crash. what's the name for this beyond "bad at systems programming"
|
# ? Aug 8, 2015 23:14 |
|
wait, is your buffer just like 8 characters long or something? are we talking about the serial buffer on the arduino or the transmission buffer on the thing that's talking to the arduino
|
# ? Aug 8, 2015 23:28 |
|
i have an ISR that takes each character that comes in over the wire and puts them in a 64-byte buffer, then executes the command when it sees a CRLF sequence or discards it if the buffer is full with no CRLF. this may not be ideal. each of the three commands consists of a three-character mnemonic followed by the string if required.
Luigi Thirty fucked around with this message at 23:53 on Aug 8, 2015 |
# ? Aug 8, 2015 23:50 |
|
you need some kind of protocol that handles new incoming commands such that they don't corrupt commands being processed. at a basic level, this could take form of adding a new command that asks/answers "are you busy, can i send a new command?"
|
# ? Aug 9, 2015 00:05 |
|
Luigi Thirty posted:i have an ISR that takes each character that comes in over the wire and puts them in a 64-byte buffer, then executes the command when it sees a CRLF sequence or discards it if the buffer is full with no CRLF. this may not be ideal. each of the three commands consists of a three-character mnemonic followed by the string if required. why use a three char mnemonic? you could shove the command and the string length in a single byte
|
# ? Aug 9, 2015 00:06 |
|
send commands until the buffer is full, if a command comes in while the buffer is full just delete the entire buffer and start again, stuff in the buffer wasn't important anyway
|
# ? Aug 9, 2015 00:07 |
|
Luigi Thirty posted:i have an ISR that takes each character that comes in over the wire and puts them in a 64-byte buffer, then executes the command when it sees a CRLF sequence or discards it if the buffer is full with no CRLF. this may not be ideal. each of the three commands consists of a three-character mnemonic followed by the string if required. use a ring buffer with a read and write pointer and hope (or ensure) that the pointers never cross each other
|
# ? Aug 9, 2015 00:07 |
|
you could also implement a command queue. if a command is being processed, new incoming commands get added to the queue. when the lcd is ready to process a new command it pops it off the queue and begins work. this will stop working if you send commands too fast and fill up your queue. the "busy" logic will have to take place somewhere: explicitly through a command that determines if the lcd is free, implicitly through some convention (e.g. only send x commands/sec), etc.
|
# ? Aug 9, 2015 00:08 |
|
eschaton posted:why use a three char mnemonic? you could shove the command and the string length in a single byte so that when i'm debugging it i can just open up a serial console and type commands in.
|
# ? Aug 9, 2015 00:45 |
|
also maybe rate limit the plugin. exactly how often are you trying to refresh this that you're running into this issue
|
# ? Aug 9, 2015 02:08 |
|
once per second, so that's not the issue okay, i implemented a command queue and it works great, for a while. the problem is that it's leaking memory! after a number of commands which are processed successfully, when I echo the command back after it's popped from the queue, the command text is just garbage or strings from RAM and it crashes. i know the command length being written into the queue is correct (strlen(command_buffer) is always correct, but when the command is popped it's an empty string or garbage), so it's being mangled while it's queued somehow. uhhh can someone tell me if anything's obviously wrong here? code:
my ISR is just code:
Luigi Thirty fucked around with this message at 04:36 on Aug 9, 2015 |
# ? Aug 9, 2015 04:33 |
|
Luigi Thirty posted:so I have a KSP plugin that talks to my Arduino with a two-line LCD screen. my Arduino understands three commands over serial: write a string to line 1, write a string to line 2, and clear the screen. why are you doing this with an isr instead of the normal arduino serial library and peek()?
|
# ? Aug 9, 2015 04:44 |
|
isn't strcpy deprecated because of buffer overruns? idk if the problem is that but sounds like a good thing to look up
|
# ? Aug 9, 2015 04:51 |
|
Luigi Thirty posted:uhhh can someone tell me if anything's obviously wrong here? Are you calling malloc in an ISR?
|
# ? Aug 9, 2015 05:23 |
|
its too late for me to try to be confident in my ability to check linked-list code. it looks right, but idk. i have some general embedded advice though. find a unit testing framework that you like, and write as much as code as possible such that it will compile/execute/test on your workstation with gcc or clang or whatever. once you have your queue implementation solid, incorporate it with your firmware. the most aggravating thing (to me) about embedded development is how one broken piece can cause the whole system to malfunction to a point where its difficult to tell what the root cause is. every component that you can guarantee as working will save you a lot of work down the road
|
# ? Aug 9, 2015 06:25 |
|
oh also, i'll mention something way outside what the likely root-cause is, or something you care to gently caress around with it but could possibly affect the correct operation of your project. the real world is analog, your serial communication isn't guaranteed to reach its destination uncorrupted! its hooked up to your computer right, so there are probably some electrically noisy things around. the computer itself shouldn't be a concern, but if there are switching power supplies, powerful motors, &c. near then you may get the occasional corrupted byte on the serial line. your code as it stands assumes that it receives the data that you send it. what if instead of an '\n', the part receives '\n' with a random bit flipped? well, in this case you could enable the UART module's parity bit checking and you could detect a single bit error. what if two bits get flipped? now you need a more complicated solution. the error code correction/detection field is very rich with solutions to this kinds of problems, a basic solution would be to take the CRC of the packet on the sender and send it along in the packet. the receiver would check the CRC and decide what to do if it doesn't match. Jerry Bindle fucked around with this message at 06:50 on Aug 9, 2015 |
# ? Aug 9, 2015 06:42 |
|
echoing error checking as a possible culprit also did you intend to implement a stack? a FIFO queue is probably what ur after
|
# ? Aug 9, 2015 11:06 |
|
Luigi Thirty posted:
you're overwriting the null byte that strlen looks for with the first line, so the second strlen is in general a random number but i guess you're getting lucky for a while that all your buffers are in zeroed memory just save the strlen in a int beforehand, use that twice
|
# ? Aug 9, 2015 11:41 |
|
are you doing dynamic memory allocation on an arduino lol
|
# ? Aug 9, 2015 15:04 |
|
Bloody posted:are you doing dynamic memory allocation on an arduino it has 2kB of RAM
|
# ? Aug 9, 2015 15:11 |
|
this is web developer c okay i don't know what i'm doing
|
# ? Aug 9, 2015 15:52 |
|
you need to initialize your variables. initialize root to null in your constructor. also realize that your isempty check will break because calls to delete will not set the pointer to null, only deallocate the memory it points to. you need to do code:
also: 1. do not do malloc in an isr. things in isrs should be as quick as possible. this isn't an issue in this case because it's a trivial example but please just do not do it. let that isr just put data in a buffer, and set a flag when it gets a \n so code running in normal context can process the buffer. 2. this command buffer doesn't need to be dynamically allocated, unless i guess you really want to figure out how to do cpp dynamic allocation, which is an ok goal. 3. seriously, if you're only sending this data once per second, needing a command buffer at all is a sign that something else in your code is seriously screwed up. since you're writing this directly in c++ rather than arduino's intermediate, write a really light stub for a hal and isrs and compile it with your system compiler so you can use gdb or valgrind. or hell just download atmel studio, atmel's VS skin http://www.atmel.com/tools/atmelstudio.aspx for free, buy a jtagice (not free but v useful) and do things the big boy way.
|
# ? Aug 9, 2015 16:00 |
|
on that note of doing c++ directly to arduino, how the gently caress do you do that? ive tried before with atmel studio but poo poo didn't work
|
# ? Aug 9, 2015 16:02 |
|
Awia posted:on that note of doing c++ directly to arduino, how the gently caress do you do that? ive tried before with atmel studio but poo poo didn't work what didn't work about it? atmel studio is pretty good about that, just make sure you've selected a c++ project. you might have to stub out some syscalls like __cxa_guard_aquire and such, but it's pretty easy to google the errors you get.
|
# ? Aug 9, 2015 16:06 |
|
|
# ? May 10, 2024 01:56 |
|
i tried to move a .ino from arduino to atmel, so got the c++ intermediate it creates and everything, moved it to atmel, included all the arduino libraries and poo poo and it just shat errors all over me. ill give it another go later and see what they were
|
# ? Aug 9, 2015 16:09 |