Caano Geel

Nomads
  • Content Count

    1,812
  • Joined

  • Last visited

Everything posted by Caano Geel

  1. At about 55mph/88kmh my old car's doors would start to rattle and when you hit 60mph/96kmh it would shake so violently that you couldn't physically hold on to the steering wheel and keep it on the straight and narrow ... and to add insult to injury and irony, i got banned for speeding in the end!
  2. cool, well at the very least, c socket programming is the best way to learn the stuff, -- given that most libraries/language implementations and real production code is based directly on it or builds from it, you'll be gaining, good luck.. PS always double check that the size of your char arrays, you don't people exploding your buffffer
  3. Hey G, what do want to know exactly. You dont really need to do any raw socket processing these days unless your after some measurement / performance and etc. there are plenty of libraries that provide you with wrappers to abstract away the lower-level stuff. Again, it is the same with C, unless you *must* use C, don't. Higher-level languages like python, and ruby are posix complaint and make it really easy to write even low-level socket processing. For example here, is a complete low-level socket transceiver (server and client) in python (tutorial i got this from http://www.amk.ca/python/howto/sockets/) -------------------------------- code: import os, socket class mysocket: '''demonstration class only - coded for clarity, not efficiency''' def __init__(self, sock=None): if sock is None: self.sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM) else: self.sock = sock def connect(host, port): self.sock.connect((host, port)) def mysend(msg): totalsent = 0 while totalsent < MSGLEN: sent = self.sock.send(msg[totalsent:]) if sent == 0: raise RuntimeError, "socket connection broken" totalsent = totalsent + sent def myreceive(): msg = '' while len(msg) < MSGLEN: chunk = self.sock.recv(MSGLEN-len(msg)) if chunk == '': raise RuntimeError, "socket connection broken" msg = msg + chunk return msg ----------------------------------------------- The same code in C (tutorial http://www.cs.rpi.edu/courses/sysprog/sockets/sock.html) The server: ---------- code: /* a server in the unix domain. The pathname of the socket address is passed as an argument */ #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <stdio.h> void error(char *); int main(int argc, char *argv[]) { int sockfd, newsockfd, servlen, clilen, n; struct sockaddr_un cli_addr, serv_addr; char buf[80]; if ((sockfd = socket(AF_UNIX,SOCK_STREAM,0)) < 0) error("creating socket"); bzero((char *) &serv_addr, sizeof(serv_addr)); serv_addr.sun_family = AF_UNIX; strcpy(serv_addr.sun_path, argv[1]); servlen=strlen(serv_addr.sun_path) + sizeof(serv_addr.sun_family); if(bind(sockfd,(struct sockaddr *)&serv_addr,servlen)<0) error("binding socket"); listen(sockfd,5); clilen = sizeof(cli_addr); newsockfd = accept( sockfd,(struct sockaddr *)&cli_addr,&clilen); if (newsockfd < 0) error("accepting"); n=read(newsockfd,buf,80); printf("A connection has been establishedn"); write(1,buf,n); write(newsockfd,"I got your messagen",19); } void error(char *msg) { perror(msg); exit(0); } -------------------- The client ------------- code: /* a client in the unix domain */ #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <stdio.h> void error(char *); void main(int argc, char *argv[]) { int sockfd, servlen,n; struct sockaddr_un serv_addr; char buffer[82]; bzero((char *)&serv_addr,sizeof(serv_addr)); serv_addr.sun_family = AF_UNIX; strcpy(serv_addr.sun_path, argv[1]); servlen = strlen(serv_addr.sun_path) + sizeof(serv_addr.sun_family); if ((sockfd = socket(AF_UNIX, SOCK_STREAM,0)) < 0) error("Creating socket"); if (connect(sockfd, (struct sockaddr *) &serv_addr, servlen) < 0) error("Connecting"); printf("Please enter your message: "); bzero(buffer,82); fgets(buffer,80,stdin); write(sockfd,buffer,strlen(buffer)); n=read(sockfd,buffer,80); printf("The return message wasn"); write(1,buffer,n); } void error(char *msg) { perror(msg); exit(0); } ------------------------------------- As you can see the python version is much smaller, and easier to understand. Anyhow, if you must, there are plenty of C tutorials online and for an in depth understanding, the daddy of all such books are: W. Richard Stevens, Unix Network Programming series. The have in depth discussions of protocols and performance, i/o and all the weird little variable that make you scream whhaattttt!
  4. ^ and i will judge whether the 20 lashes he gives you expunges the 'Dufarnimo' out of you
  5. Originally posted by Legend of Zu: ^^^ This was useless dream! you didn't end up with any of the ladies of the night! with me in his dream, sadly, the poor man had no chance . ng sorry dude.
  6. emperor, sadly i'm not intelligent enough to be a physicist, but that was the 3rd law. but i'm with you on the deathcult. Obviously all this violence is a direct result of the melanin distribution and the relative uv-absorption rates of differing pheomelanin and eumelanin percentiles.
  7. its official then, the australian labour party is back in action ..but will they actually be labour?
  8. Originally posted by Cara: Val, is lamb shank what they're calling it now? Woof. Heheheh, raggu dhan cadkass bay u laab laabanayeen, woof . now ng sir, just because your were captivated by my natural good looks, don't let yourself be lulled into the comfort of the overly relaxed mannerism that are carefully disguised to pacify the natural threats raised in the unlucky many when confronted with the afore mentioned fantastic looks. now do go on with your dream
  9. ^it wasnt so much as going chicken, as going kangaroo and hoppin' it. The place was just too creepy! its all far too clean organised and the people are far too pretty... how are u meant to appreciate anything in a place like that.. ps. val your def. on fire
  10. Caano Geel

    Tacsi

    bob, wallaal, samir iyo iimaan allah ha idin wada siiyo, allah-na ha u naxriisto.
  11. Well he's def. not the guy in the photo. The photo is from a reportage on childbrides in afghanistan- nytimes or bbc i can't remember, so if the photo is faked stock, there aint much there to the story
  12. kix kix kix kix kix kix, honestly, i feel sorry for the sister
  13. Serenity, in answer to your question, yes and no, but your mainly gaining by doing so. p.s. how's the jet set life going?
  14. ^ talk about a kettle calling ....
  15. I propose to device a `fair' payment scheme towards the upgrade, whereby everyone contributes relative to the number of posts they have made and the size of those posts(eg lots of pics).
  16. G, is that you in one your previous jobs?
  17. caamir, i understand agree with on the contextualisation of information, and of course they are biased, after all, they have interests to serve. - thanks
  18. caamir, from what i've seen the NY times represents the closest thing to liberal/inclusive thought in popular US media, also the article or commentary isn't about islam, but the SA regime - its questions their application - a mechanism which by an large as fatah-al-somali said, is setup to maintain a families power and status.
  19. goodie jihadwatch, one of my favourite comedy sites
  20. Ghanima yes, your right about the stagnant culture - but that religious interpretation is used as a justification is the real sadness here. Thierry walaal, what would or wouldn't be within the boundaries of islam in the setting of academic research. actually that is a trick question, but fundamental to any academic activity is academic honesty, which usually means the space to able to challenge the orthadox, not chartng paths around the ridges of well defined acceptability. Northerner saaxiib, i think you have the wrong end of the stick there, sadly there are homeless and prostitutes also in SA. further, the rights of men, women and children are central to any human enterprise - really what is the latest and most advanced in anything without the people it is meant to serve or are meant to create it. So before a society can talk about anything, it must address the condition of its populace. This (along with amaco) is why i sense cynicism in the act. wrt the benefits, yes a campus will be built, and likely that researchers will be bought in, but what will be the reason that keeps them and their knowledge in the country in the long term. ngonge I agree the king is walking a very tight rope, but he also realises that there are limits - since educating his kingdom will surely create the populace that questions their position, entitlements and privileges. So any self interested party will surely be trying find the formula for 'some, but not enough' - hence the hot air. $10 billion is a lot of money, but in the hands of foreign researchers in walled off institutions and labs it is a colossal waste. Places like MIT work not because they are overrun with cash, but because they provide mechanism which integrate both people and their developments into their local environment, create the markets and have a direct impact. Technology and pharmaceutical industries are such example - Sharmarkee yes any input to education is a good thing, but surely the money and resources would be better spent by distributing it between the existing institutions a developing a better schools and universities with educate and grow nurture talent that will be better places to address local requirements - that's how everyone has done it. because if there institutions are up to standards, they will naturally create and attract the talent
  21. So what is the kings message here, wrt, liberal secular colleges, education and development if he's banning the thought police form his new super campus and men and women may interact freely. Is he saying that Islam is not compatible with education and development or that saudi-islam is not compatible with the above - hence the requirement for some tweaking. Its interesting since which ever way his argument goes, he's undermining the justification of his rule and a large part of his countries social fibre. ----------- Saudi King Tries to Grow Modern Ideas in the Desert, By THANASSIS CAMBANIS, for the NY Times, October 26, 2007 The construction site for the King Abdullah University of Science and Technology, Saudi Arabia’s effort to build its own M.I.T. JIDDA, Saudi Arabia, Oct. 25 — On a marshy peninsula 50 miles from this Red Sea port, King Abdullah of Saudi Arabia is staking $12.5 billion on a gargantuan bid to catch up with the West in science and technology. Between an oil refinery and the sea, the monarch is building from scratch a graduate research institution that will have one of the 10 largest endowments in the world, worth more than $10 billion. Its planners say men and women will study side by side in an enclave walled off from the rest of Saudi society, the country’s notorious religious police will be barred and all religious and ethnic groups will be welcome in a push for academic freedom and international collaboration sure to test the kingdom’s cultural and religious limits. This undertaking is directly at odds with the kingdom’s religious establishment, which severely limits women’s rights and rejects coeducation and robust liberal inquiry as unthinkable. For the new institution, the king has cut his own education ministry out the loop, hiring the state-owned oil giant Saudi Aramco to build the campus, create its curriculum and attract foreigners. Supporters of what is to be called the King Abdullah University of Science and Technology, or Kaust, wonder whether the king is simply building another gated island to be dominated by foreigners, like the compounds for oil industry workers that have existed here for decades, or creating an institution that will have a real impact on Saudi society and the rest of the Arab world. “There are two Saudi Arabias,” said Jamal Khashoggi, the editor of Al Watan, a newspaper. “The question is which Saudi Arabia will take over.” The king has broken taboos, declaring that the Arabs have fallen critically behind much of the modern world in intellectual achievement and that his country depends too much on oil and not enough on creating wealth through innovation. “There is a deep knowledge gap separating the Arab and Islamic nations from the process and progress of contemporary global civilization,” said Abdallah S. Jumah, the chief executive of Saudi Aramco. “We are no longer keeping pace with the advances of our era.” Traditional Saudi practice is on display at the biggest public universities, where the Islamic authorities vet the curriculum, medical researchers tread carefully around controversial subjects like evolution, and female and male students enter classrooms through separate doors and follow lectures while separated by partitions. Old-fashioned values even seeped into the carefully staged groundbreaking ceremony on Sunday for King Abdullah’s new university, at which organizers distributed an issue of the magazine The Economist with a special advertisement for the university wrapped around the cover. State censors had physically torn from each copy an article about Saudi legal reform titled “Law of God Versus Law of Man,” leaving a jagged edge. Despite the obstacles, the king intends to make the university a showcase for modernization. The festive groundbreaking and accompanying symposium about the future of the modern university were devised partly as a recruiting tool for international academics. “Getting the faculty will be the biggest challenge,” said Ahmed F. Ghoniem, a professor at the Massachusetts Institute of Technology who is consulting for the new university. “That will make it or break it.” Professor Ghoniem has advised the new university to lure international academics with laboratory facilities and grants they cannot find at home, but he also believes that established professors will be reluctant to leave their universities for a small enclave in the desert. “You have to create an environment where you can connect to the outside world,” said Professor Ghoniem, who is from Egypt. “You cannot work in isolation.” He admitted that even though he admired the idea of the new university, he would be unlikely to abandon his post at M.I.T. to move to Saudi Arabia. Festivities at the construction site on Sunday for 1,500 dignitaries included a laser light show and a mockup of the planned campus that filled an entire room. The king laid a crystal cornerstone into a stainless steel shaft on wheels. Cranes tore out mangroves and pounded the swampland with 20-ton blocks into a surface firm enough to build the campus on. Inside a tent, the king, his honor guard wearing flowing robes and curved daggers, and an array of Aramco officials in suits took to a shiny stage lighted with green and blue neon tubing, like an MTV awards show. Mist from dry ice shrouded the stage, music blared in surround sound, and holographic projections served as a backdrop to some of the speeches. From a laconic monarch known for his austerity, the pomp, along with a rare speech by the king himself, was intended to send a strong signal, according to the team charged with building and staffing the new campus within two years. The king is lavishing the institution not only with money, but also with his full political endorsement, intended to stave off internal challenges from conservatives and to win over foreign scholars who doubt that academic freedom can thrive here. The new project is giving hope to Saudi scholars who until the king’s push to reform education in the last few years have endured stagnant research budgets and continue to face extensive government red tape. “Because Aramco is founding the university, I believe it will have freedom,” said Abdulmalik A. Aljinaidi, dean of the research and consultation institute at King Abdulaziz University, Jidda’s biggest, with more than 40,000 students. “For Kaust to succeed, it will have to be free of all the restrictions and bureaucracy we face as a public university.” Even in the most advanced genetics labs at King Abdulaziz, the women wear full face coverings, and female students can meet with male advisers only in carefully controlled public “free zones” like the library. Scientists there tread carefully when they do research in genetics, stem cells or evolution, for fear of offending Islamic social mores. Even in Jidda, the kingdom’s most liberal city, a status rooted in its history as a trading outpost, change comes slowly. This month the governor allowed families to celebrate the post-Ramadan Id al-Fitr holiday in public, effectively allowing men and women to socialize publicly on the same streets for the first time. The religious police were accused of beating a man to death because he was suspected of selling alcohol. Conservatives have fended off efforts by women to secure the right to drive or to run for office, although women have made considerable gains in access to segregated education and workplaces. Against this backdrop, said Mr. Khashoggi, the newspaper editor, the king has conceived of the new university as a liberalizing counterweight, whose success depends on how much it engages the rest of Saudi society. “Nobody wants to live in a ghetto, even a nice one,” Mr. Khashoggi said. “As a Saudi, I say, let’s open up.” Upon completion, the energy-efficient campus will house 20,000 faculty and staff members, students and their families. Social rules will be more relaxed, as they are in the compounds where foreign oil workers live; women will be allowed to drive, for example. But the kingdom’s laws will still apply: Israelis, barred by law from visiting Saudi Arabia, will not be able to collaborate with the university. And one staple of campus life worldwide will be missing: alcohol. The university president will be a foreigner, and the faculty members and graduate students at first will be overwhelmingly foreign as well. Generous scholarships will finance the 2,000 graduate students; planners expect the Saudi share of the student body to increase over the years as scholarships aimed at promising current undergraduates help groom them for graduate studies at the new university. The university’s entire model is built around partnerships with other international universities, and faculty members are expected to have permanent bases at other research institutions abroad. The university will also rely on a new free-market model. The faculty members will not have tenure, and almost all of them will have joint appointments. While the university will initially be awash in money, its faculty and graduate students will still have to compete with top international institutions for the limited pool of private money that underwrites most graduate research. Suhair el-Qurashi, dean of the private all-female Dar Al Hekma College, often attacked as “bad” and “liberal,” said a vigorous example of free-thinking at the university would embolden the many Saudis who back the king’s quest to reform long-stagnant higher education. “The king knows he will face some backlash and bad publicity,” Ms. Qurashi said. “I think the system is moving in the right direction.”
  22. NGONGE u dirty 'ol so and so .. go on then, fill us in on the latest development in the troll corner