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.
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.
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.
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.
CPU Registers
A CPU register is effectively how the CPU manipulates given data.
The CPU can use load commands to bring data from memory, into a register. The register is the fastest part of a computer - it's where the CPU can do work with the greatest speed. Once some data is loaded into a register, the CPU can then manipulate that data. Add, subtract, all of these things happen in the register. Once the instruction is done, another command can be used to push that data back into memory and then the register is available for use once again.
For the z80 CPU simulator, the registers will be represented by text files. A combination of scripts and C programs will be used to load data from a memory file into a register, then perform the desired operation, and then move the result in whatever way was intended. It will end up being a ton of different scripts and programs, because there are many different combinations - as there are multiple registers, and we need a way to move values between registers, move values from registers to memory, from memory to registers, etc.
CPU Registers
A CPU register is effectively how the CPU manipulates given data.
The CPU can use load commands to bring data from memory, into a register. The register is the fastest part of a computer - it's where the CPU can do work with the greatest speed. Once some data is loaded into a register, the CPU can then manipulate that data. Add, subtract, all of these things happen in the register. Once the instruction is done, another command can be used to push that data back into memory and then the register is available for use once again.
For the z80 CPU simulator, the registers will be represented by text files. A combination of scripts and C programs will be used to load data from a memory file into a register, then perform the desired operation, and then move the result in whatever way was intended. It will end up being a ton of different scripts and programs, because there are many different combinations - as there are multiple registers, and we need a way to move values between registers, move values from registers to memory, from memory to registers, etc.
pointer arithmetic (esp. in relation to arrays)
Pointer arithmetic is basically when you use math on pointers to accomplish a task. Generally this task is looped, where the math is incrementing or decrementing… and generally this is used for 'pointer arrays' (as opposed to 'bracket arrays').
When you want to make an array, and fill it with 20 zero's. You will create a pointer. You will then create a loop that will fill in a zero to the array, where the pointer is having a counter of some form (usually) being added to it. That part where the pointer is having stuff added to it, that's pointer arithmetic.
Pointer arithmetic is arguably faster, but it really does depend on surrounding code and the CPU and the compiler etc.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
A collection of data that is organized so it can easily be modified, updated, or deleted.
A cool website to test sql: http://www.w3schools.com/sql/sql_tryit.asp
This website has it's own sql database up and lets you run commands on it to see what different commands will do.
SELECT CompanyName, ContactName FROM customers
This sql command would display all data values that are under the 'CompanyName' and the ones from 'ContactName' from the customers list.
So all the people that are identified as customers in the database - they have different forms of data for each customer. Such as CompanyName, and ContactName. There are others as well. This command would pull just the two that I listed. It seems a lot like a real life implementation of linked lists..
SIP - Session Initiation Protocol
SIP is a signalling protocol. I would guess that that means it is a certain method of having machines communicate. It is typically used for voice and video communication. SIP can be used for two-party (unicast) and multiparty (multicast).
You can modify IPs and ports, invite more people, and add/delete media streams.
SIP can take care of 5 things:
At first I had no idea what SIP was all about and had difficulty understanding it. Now I have a pretty good understanding, I think. I'll probably ask about it next class to make sure I am right, but I feel like SIP is basically just a 'code' of how machines communicate. Just like how humans use English, or Spanish, or Arabic. Computers can use SIP.
On further research, the analogy is fairly sound, but needs a little bit more to it. SIP is basically a specific format that machines can use to communicate. It's a set of certain things that need to be done while communicating. It's not like a language…. it's more like the RULES behind a language.
asterisk
A programming language to communicate and execute the basic functions of telephony services.
Example of a configuration file written using asterisks language. Given an example, it is pretty easy to figure out what certain things mean. The 600 numbers are the numbers to call, and then it will Dial and use the given protocol to try to connect to the defined name. The 20 is how long it will ring for.
exten => s,1,Answer() exten => s,n,Wait(2) exten => s,n,SendDTMF(1) exten => s,n,Dial(SIP/Saad&SIP/Andrew&SIP/LairPhone&SIP/Dataking&SIP/sipura&SIP/PA168,20) exten => s,n,VoiceMail(601@vm,u) exten => 601,1,Dial(SIP/Saad,20) exten => 601,n,VoiceMail(601@vm,u) exten => 602,1,Dial(SIP/Andrew,20) exten => 602,n,VoiceMail(602@vm,u) exten => 603,1,Dial(SIP/LairPhone,20) exten => 603,n,VoiceMail(603@vm,u) exten => 604,1,Dial(SIP/PA168,20) exten => 604,n,VoiceMail(604@vm,u) exten => 605,1,Dial(SIP/Dataking,20) exten => 605,n,VoiceMail(605@vm,u) exten => 606,1,Dial(SIP/sipura,20) exten => 606,n,VoiceMail(606@vm,u)
exclusive disjunction/nonequivalence
Exclusive disjunction means that only one can be true, but not both. It's basically an XOR.
Affirmation/Validity/Tautology
Everything is always evaluated as true
P | Q | X ---------------- 0 | 0 | 1 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1 ----------------
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?
To test this I am going to use knowledge gained through the data structures class. And a little discrete.
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.
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.
/home/smalik2/repo/experiments
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.
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.