======Part 1====== =====Entries===== ====Entry 1: September 4, 2012==== Today for Data Comm we managed to get asterisk up and running properly. We connected a softphone on my laptop to a softphone running on Andrews laptop, all through asterisk's service. We edited files that we weren't supposed to, since we couldn't find the options in the gui web interface. I'm hoping that for Thursday we can get asterisk to connect to the cisco phone, and maybe get to work on integrating it with google voice. Maybe if we get really lucky we can even start figuring out how to text non local numbers using the google voice service. At first I had a lot of trouble understanding asterisk, but now I think I am getting the feel for it. I think it will be less confusing as progression is made. ====Entry 2: September 15, 2012==== Yesterday in Data Structures we got into the 'real' data structures part. We started learning about linked lists, and got as far as insertion and must now code a deletion. I thought the way the a link list works is very cool. It can basically dynamically allocate, and uses struct pointers, and uses the struct to create more instances of the struct (as many as the program wants). We're basically teaching the program how to give itself more memory within certain constraints. If you screw up and are not careful about these constraints, you can lose track of where the nodes are located - so while the program is running, it is taking up memory that it can't even get back to: a memory leak. The whole deal with this was very intuitive and I appreciated how it worked. I probably could not reproduce it on the spot perfectly, but looking at the example from class I can understand how it is doing what it is doing. I will probably create the deletion part of it in a couple days, I don't anticipate it being too difficult. ====Entry 3: September 28, 2012==== Yesterday I coded the increment function. I even made it work with bignum, and work for any given base (upto base 16). At first I did some weird thing where I incremented every value in the number, not sure why I did that. Once I got rid of that, the solution became much much easier to implement. To test this, I would copy my code into my bignum location (where it belonged, in this case I believe it was in ops). I would then make a backup of the .o file that was already there. Then, I would run make from the bignum directory, and then cd to testing, do a make clean and then do a make. Then I can run the respective test program. It is very neat. I may write a decrement function later today or tomorrow. ====Entry 4: September 30, 2012==== While working on asterisk last week we started running into a lot of dead ends. However, now that we know a lot about how it works, I believe the best course of action will now be to start fresh and keep very careful track of everything and undo unnecessary changes instead if letting them pile up. I really think we could get it up and running with Google voice in a day with a fresh start. We know how to add custom ringtones, know how to create extensions and how to compile from source and how the .conf files work (some of them). All we need to do is get a clean Linux district on the machine and follow a guide that actually specifies the asterisk version to be used. It should work out pleasantly that way. =====Keywords===== {{page>asmpart1&nofooter}} {{page>datapart1&nofooter}} {{page>datacommpart1&nofooter}} {{page>discretepart1&nofooter}} =====Experiment 1===== ====Question==== Can I send a linked list to a void function, have the function perform something to change the list, and then have the changes reflect in the main program without actually having to return a pointer and setting the list equal to the function call? ====Resources==== To test this I am going to use knowledge gained through the data structures class. And a little discrete. ====Hypothesis==== Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment. State your rationale. ====Experiment==== Since linked lists use a pointer to work... I am going to have to use double pointers to make this while thing work out okay. I also tried this using just the single pointers and the values would not stay globally throughout the program. Double pointers will have to be used, and I will probably get a headache. I am thinking I will have to define the start of the linked list as a double pointer. While I am filing it and stuff, I will have it dereferenced down only one level. When I pass it to a function to sort, I will pass the double pointer. So I will technically be passing by address. Within the function, I dereference it down one level and make the changes. These changes should carry through globally because it was passed by address. ====Data==== /home/smalik2/repo/experiments ====Analysis==== I believe my hypothesis was correct. Although I technically passed a single pointer by reference - its effectively the same thing. I had a huge problem that was resolved when I figured out there was a malloc on a temp variable - and not on the start pointer. So the list would get lost and become a memory leak. ====Conclusions==== I'm much more comfortable with pointers now. On top of that, I'm gaining familiarity with double pointers which will let me make more concise code.