Jump to content

mrgrj

Active Members
  • Posts

    1422
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by mrgrj

  1. Merita citit
      • 1
      • Upvote
  2. Daca ti se pare greu, inseamna ca nu ai o baza. Incepi structurat si progresezi in timp, asa se face treaba. - inveti sa gandesti logic / structurat / algoritmic. - usor usor incepi sa implementezi ceva algoritmi basic (iti vor fi de ajutor) in pseudo cod. - iti alegi un limbaj cu care vrei sa mergi inainte, si ii dai bataie. (aici recomand Python pentru ca iti ofera deschidere catre orice: Networking & Scripts / Automation / Web / Software chiar si Machine Learning + Artificial Intelligence) Spor la invatat.
  3. Exista py2exe cu care poti face executabile. In fine, ceea ce vrei tu nu exist?. F?r? munc? nu vei ajunge nic?ieri. Vrei si usor si pentru "publicul larg". Încearc? la KFC.
  4. mrgrj

    Flare-on

    Foarte misto de citit asa, ca lectura de seara. Ca idee, daca sunteti pasionati de RE, incercati sa refaceti exact chall-urile, pe baza raspunsurilor / rezolvarilor din postul de mai sus.
  5. Ceva putin mai lizibil fata de cele 100 de for-uri ale "colegului": import random def function(x): for i in range(x): nr1 = 720000000 nr2 = 799999999 a = random.randint(nr1, nr2) b = '0' + str(a) print b function(10) # introduceti cate numere vreti (acum se genereaza 10 numere de telefon)
  6. @Ganav, ma refer la proiectele uzuale / clasice Evident ca in ceea ce priveste proiecte de anvergura, exista alte metodologii mult mai bune decat ceea ce am prezentat eu. Nu poti cere unui beginner sa invete despre smart pointers daca el habar nu are care e diferenta dintre calloc() si malloc()
  7. Today we are going to go through effective techniques to avoid errors in your C and C++ programming sessions. Errors in programming can affect the stability and functionality of the application, we are going to run through how to avoid that. Memory errors can be broadly classified into Heap Memory Errors and Stack Memory Errors. Some of the challenging memory errors are: Invalid Memory Access in heap and stack Memory leak Mismatched Allocation/Deallocation Missing Allocation Uninitialized Memory Access in heap and stack Cross Stack Access Invalid Memory Access This error occurs when a read or write instruction references unallocated or deallocated memory. char *pStr = (char*) malloc(25); free(pStr); strcpy(pStr, .parallel programming.); // Invalid write to deallocated memory in heap Memory leaks Memory leaks occur when memory is allocated but not released. If such leaks happen often enough and frequently enough, the leaks will eventually cause the application to run out of memory resulting in a premature termination (gracefully or as a crash). char *pStr = (char*) malloc(512); return; Mismatched Allocation/Deallocation This error occurs when a deallocation is attempted with a function that is not the logical counterpart of the allocation function used. char *s = (char*) malloc(5); delete s; To avoid mismatched allocation/deallocation, ensure that the right deallocator is called. In C++, new[] is used for memory allocation and delete[] for freeing up. In C, malloc(), calloc() and realloc() functions are used for allocating memory while the free() function is used for freeing up allocated memory. Similarly, there are APIs in Windows programming to allocate and free memory. Missing allocation This error occurs when freeing memory which has already been freed. This is also called “repeated free” or “double free”. Example: char* pStr = (char*) malloc(20); free(pStr); free(pStr); // results in an invalid deallocation Uninitialized Memory Access This type of memory error will occur when an uninitialized variable is read in your application. char *pStr = (char*) malloc(512); char c = pStr[0]; // the contents of pStr were not initialized void func() { int a; int b = a * 4; // uninitialized read of variable a } To avoid this type of memory error, always initialize variables before using them. Cross Stack Access This occurs when a thread accesses stack memory of a different thread. main() { int *p; ------- CreateThread(., thread #1, .); // Stack Owned CreateThread(., thread #2, .); ------- } Thread #1 { int q[1024]; p = q; q[0] = 1; } Thread #2 { *p = 2; // Stack Cross Accessed } One of the easiest ways to avoid this error is to avoid saving stack addresses to global variables. Using tools to find memory errors There are many memory error checkers available on the market; I used Intel Parallel Inspector to find memory errors. This is an easy and comprehensive tool to pinpoint memory errors in both sequential and multithreaded applications. Intel Parallel Inspector integrates into Visual Studio. Parallel Inspector uses dynamic instrumentation that requires no special builds or compilers. Not all memory checkers available in the market are capable of performing analysis of threaded applications. As shown below, Parallel Inspector finds all types of memory errors and displays source, module and source line number with state of error (fixed/not fixed). One important feature of this tool is that it allows end users to control the depth of analysis. The greater the depth of analysis, the longer the analysis takes and the more memory it uses. 2x-20x – analysis finds memory leaks 10x-40x – analysis identifies the existence of a problem 20x-80x – analysis provides root cause information to fix problems and enhanced dangling pointer check 40x-160x – provides the most comprehensive level of problem (including system libraries check) If a memory error is either not relevant or not going to be fixed, there is an option to suppress the error. Select suppressions from the configuration settings and choose the appropriate option.
  8. Jquery e o bibliotec?, nu o libr?rie. Poti pune un portofoliu aici ?
  9. Again ?! Man, I understand if you don't know English, but the ASCII is the same for everybody from anywhere. Whatever, this seems to be pointless. I'm out.
  10. [WTF] Scuze de OFF, dar poate ma intelegeti: bahahahahahahaha. [/WTF] //ON: I was just trying to be sarcastic. There're no such things as ASQII and ASKII. There's only ASCII. Please review your grammar in your future posts as you cannot teach something if you cannot use the same word three times in a row. Thanks. Bye
  11. What about ASQII and ASKII ? Could you please provide some tutorials for those too ?
  12. I was incredulous when I read this observation from Reginald Braithwaite: The author he's referring to is Imran, who is evidently turning away lots of programmers who can't write a simple program: Dan Kegel had a similar experience hiring entry-level programmers: Between Reginald, Dan, and Imran, I'm starting to get a little worried. I'm more than willing to cut freshly minted software developers slack at the beginning of their career. Everybody has to start somewhere. But I am disturbed and appalled that any so-called programmer would apply for a job without being able to write the simplest of programs. That's a slap in the face to anyone who writes software for a living. The vast divide between those who can program and those who cannot program is well known. I assumed anyone applying for a job as a programmer had already crossed this chasm. Apparently this is not a reasonable assumption to make. Apparently, FizzBuzz style screening is required to keep interviewers from wasting their time interviewing programmers who can't program. Lest you think the FizzBuzz test is too easy – and it is blindingly, intentionally easy – a commenter to Imran's post notes its efficacy: Maybe it's foolish to begin interviewing a programmer without looking at their code first. At Vertigo, we require a code sample before we even proceed to the phone interview stage. And our on-site interview includes a small coding exercise. Nothing difficult, mind you, just a basic exercise to go through the motions of building a small application in an hour or so. Although there have been one or two notable flame-outs, for the most part, this strategy has worked well for us. It lets us focus on actual software engineering in the interview without resorting to tedious puzzle questions. It's a shame you have to do so much pre-screening to have the luxury of interviewing programmers who can actually program. It'd be funny if it wasn't so damn depressing. I'm no fan of certification, but it does make me wonder if Steve McConnell was on to something with all his talk of creating a true profession of software engineering. Source
  13. Nu ma intereseaz? banii t?i sau metodele, dar argumentele sunt de cacat. ?i dac? postezi aici video-ul sau scrii mult vede toat? lumea. Asta doar asa, ca idee. Am si eu o idee prin care s? castigati mult mai mult: puneti mâna si înv?tati
  14. s.recv(1024) citeste cel mult 1024 bytes.
  15. Ai spus de 4 ori aceeasi chestie. Pe chat moderatorii au mâna liber? s? fac? ce vor. in plus, dac? intrerupi vreo discutie legat? de una din temele forumului poti lua ban f?r? drept de apel. Exist? si o regul? cum c? dac? te plângi în leg?tur? cu chatul primesti ban si pe forum. Asteapt?-te la orice si invata din greseli. Cât despre VPS... Poti g?si si la 5$ si la 50$. Totul depinde de ceea ce vrei sa faci si cum stii s? cauti. Baft?
  16. Cel mai bun tutorial pe care l-am citit so far. Give it a try: Spolier: So Everything Has A Class? class Customer(object): """A customer of ABC Bank with a checking account. Customers have the following properties: Attributes: name: A string representing the customer's name. balance: A float tracking the current balance of the customer's account. """ def __init__(self, name, balance=0.0): """Return a Customer object whose name is *name* and starting balance is *balance*.""" self.name = name self.balance = balance def withdraw(self, amount): """Return the balance remaining after withdrawing *amount* dollars.""" if amount > self.balance: raise RuntimeError('Amount greater than available balance.') self.balance -= amount return self.balance def deposit(self, amount): """Return the balance remaining after depositing *amount* dollars.""" self.balance += amount return self.balance
  17. Interesant da' nu prea. Totusi e bine de stiut. Poate e totusi cineva interesata. Facebook Launches M, Your New Personal Digital Assistant
  18. sunt inca la argv
  19. Poti face un script care sa ruleze comanda dir o data la x timp. Ceva de genul: @Echo OFF :START DIR /b /s | sort SLEEP 20 GOTO END // am crezut ca vrei in windows Linux like: watch -n 1 ls -ltr /ceva_director
  20. float InvSqrt(float x) { float xhalf = 0.5 f * x; int i = * (int * ) & x; // get bits for floating value i = 0x5f3759df - (i >> 1); // gives initial guess y0 x = * (float * ) & i; // convert bits back to float x = x * (1.5 f - xhalf * x * x); // Newton step, repeating increases accuracy return x; } float xhalf =[COLOR="#FF0000"] 0.5 f[/COLOR] * x; Nu stiu de ce, dar am impresia ca nu compileaza in forma asta Pentru cei care sunt la inceput, ar trebui sa fie: 0.5f //fara spatiu
  21. Although Java was modeled after C and C++ languages, it differs from C and C++ in many ways. Java does not i a number of features available in C and C++. For the benefit of C and C++ programmers, we point out here a few major differences between C/C++ and Java language How Java Differs From C: Java and C Java is not lot like C but the major difference between Java and C is that Java is an object-oriented language and has mechanism to define classes and objects. In an effort to build a simple and safe language, the Java team did not include some of the C features in Java. Java does not include the C unique statement keywords sizeof, and typedef. Java does not contain the data type struct and union. Java does not define the type modifiers keywords auto,extern,register,signed, and unsigned. Java does not support an explicit pointer type. Java does not have a preprocessor and therefore we cannot use # define, # include, and # ifdef statements. Java requires that the functions with no arguments must be declared with empty parenthesis and not with the void keyword as done in C. Java adds new operators such as instanceof and >>>. Java adds labelled break and continue statements. Java adds many features required for object-oriented programming. How Java Differs From C++ : Java and C++ Java is a true object-oriented language while C++ is basically C with object-oriented extension. That is what exactly the increment operator ++ indicates. C++ has maintained backward compatibility with C. Is is therefore possible to write an old style C program and run it successfully under C++. Java appears to be similar to C++ when we consider only the “extensions” part of C++. However, some object -oriented features of C++ make the C++ code extremely difficult to follow and maintain. Listed below are some major C++ features that were intentionally omitted from java or significantly modified. Java does not support operator overloading. Java does not have template classes as in C++. Java does not support multiple inheritance of classes. This is accomplished using a new feature called “Interface”. Java does not support global variables. Every variable and method is declared within classes and forms part of that class. Java does not use pointers. Java has replaced the destructor function with a finalize() function. There are no header files in Java. Java also adds some new features. While C++ is a superset of C, Java is neither a superset nor a subset of C or C++. Java may be considered as a first cousin of C++ and a second cousin of C As a personal note, the reason why Java is slower than C/C++ is because it runs on java virtual machine hence portability of apps whilst the latter run on machine directly hence not portable. However, running on some virtual machine means more processing time because the machine has now to communicate with the hardware unlike a c/c++ program which deals with h/w directly.
  22. Baga si la mine niste detalii
  23. Draga Bogdan, Din moment ce esti un membru nou pe forum, tin sa te anunt ca s-a specificat de multe ori: chat-ul nu are nici o legatura cu forumul. El se afla acolo pur si simplu pentru a comunica liber si a discuta orice subiect se doreste. Mai mult, daca citeai ceea ce scrie imediat cum iti apare chat-ul, aflai ca adminii / moderatorii au voie sa faca ceea ce doresc intrucat si-au meritat intr-un fel sau altul dreptul de a fii in postura anterior mentionata. Banul pe chat iti va fii scos in momentul in care un admin va considera ca e cazul sa ti-l scoata. In cazul in care nu iti place sa frecventezi forumul, du-te pe altul. Aici nu ducem lista de useri. ( totusi recomand sa inveti cate ceva de pe-aici - sunt tutoriale foarte misto si ai ce invata de la multi membrii ) Peace
×
×
  • Create New...