Jump to content
xisto Community

DrK3055A

Members
  • Content Count

    44
  • Joined

  • Last visited

Everything posted by DrK3055A

  1. OK Hasan Arbab, I don't intend to start a flame, because all opinions deserve respectfulness, but i disagree with the 3 logical arguments you stated as proofs. 1. You can never proof anything with a 100% certainty, neither what you can see. Senses are tools that provide our cognitive system a way to obtain data from the outside (they are sensors). Muscles are actuators, that make the system interact or modify the outer environment. Everything of those consist of electrical and chemical signals that can be interfered to recreate an untrue (or less certain) model of reality. The extremal case is a situation pictured out from The Matrix film (Wachowsky brothers-1995), where there is a virtual reality created from a big computer that sends electric signals to human bodies directly to sensitive nerves. In real world, we can see the boundaries of our senses, when they can't depict a logical conclusion for some situations (illusion), or when they fail to depict the reality as it is perceived in an usual condition (allucination, psicosis). We know that we exist, because we can remember facts of our existence, extract, and sort the data in order to find relationships among items of the reality around us. And this lead us to the following point.... 2. The clue for this matter is the existence of an inteligence threshold for a being to realize about how it was created and how it came to this world. We can not travel backwards in time, but we can rewind the tape to watch what happened. This is named as deductive reasoning. We can use the data adquired in our memory to learn about facts of reality and deduct what happened before, due to our inteligent stage. Also, we can have certain control of what happens to something that we created, but we can't decide for every aspect of that thing, because we understand some rules of the universe, but not all (that's impossible due to our nature of trying to quantize the infinity). Concept of "Creator" is not always the same as "omnipotent", maybe is never the same. 3. The discussion about the existance of god relies on the fact that god is not an ancient, but the most ancient, the origin, the begining of everything (as for we short sighted human that conceive the time as linear, so there must exist a begining and will exist an end of reality). There are some other discussions about ancient topics (in fact, there've been writen lots of books about ancient professors of many disciplines) . But the strongest discussion is the one that links every human to a common origin. The one that tries to give a short and pleasant answer to the trivial question "where do we come from?", the only need to accept this answer is "faith". But this "faith" has nothing to do in order to proof certainty. Still i think that "beliefs" are good, because they impulse us to research and discover things that can lead us to some answers, but many times lead us to many more questions.
  2. There is a powerful resouce, but it isn't easy to use because you need to learn a script language suited for video editing. This is AviSynth, it's an opensource programming language for video processing and editing. I succesfully used it to reverse a music video for making a joke involving satanic messages and so on.(I know that this thread is older than 1 year, but this info might be of any use for some people, or at least i hope so)
  3. Any Switching Mode Power Supply where from you can obtain 18.5Volts and at least 4-6Amps will do the task. These are the common parameters for Laptop Power Supplies. Many SMPS supplies need some load attached at output when starting up, otherwise they won't boot at all. Some SMPS show this behaviour while they're aging, because parameters of some electronic components (such as capacitors) vary slightly over the time. Two options, try to identify the iffy component and do some surgeon for replacement, or a much better opt, get a new SMPS as they are not as expensive.
  4. Is that a personal matter? or just an opinion that i guess is built up from the "mass media" education?. I've interpreted this sentece with an ironic meaning. I don't think that a hacker is a loser, lamer or script kiddie wanting to earn up skills for doing dissaster to other people's computers. I think that people developing PHP, MySQL, APACHE, Every branches of Linux, GNU, or maybe experts that assist other people to create better internet, they and only they are the true hackers. Of course they own the secrets of internet and can do what a script kiddie does and much more effective, but "what's the need for this?". In general, a Hacker is a person that feeds the hunger of curiosity by exploring every detail of a system, and hence, it becomes an expert. If your target were to destroy, would you enjoy the process of creation and evolution of such a system?? I don't think so.
  5. Two more things to add to the comments of our fellows.As Hasan Arbab has stated, http://php.net/ is a great resource for looking up php functions and how do their job. But besides that, you might check the comments on each page at php.net. It' common to find very nice examples, maybe hundreds, that are contributed by PHP experts. And a delicate topic to talk about PHP, and CGI scripting in general speaking, is the Security Issue. You can be a PHP expert, but if your code lacks on security considerations, maybe you rendered an useless code, as long as it can be a risk for the entire server integrity. So i would put an eye on the security topic when programming CGIs in order to make strong PHPs.NOTE: (for all that don't know what PHP has to do with CGI, say that PHP is just an implementation of CGI communication (it stands for Common Gateway Interface)).
  6. We should not argue about the name of the rose. Life is just a name, but an abstract concept aswell (we know something is alive because it shares some "not every" properties with us; associating patterns is an intrinsic feature of our nature, and the basis for our inteligence), and because of that is hard and nearly impossible to define or quantize. Is like whether we try to define what a fractal is. You know that a system is fractal defined because it share some properties with other fractals, but it may happen that two set of fractals can be different each other, so it cannot be established a common criteria or definition. Our neural systems tend to sort things by their features, and maybe there are contradictory items (that is, non "linear or direct classification") that can't be sorted by this criteria. We can always find counterexamples that fit any definition for life, still we would set them into the nonliving objects bag.
  7. Why don't use CPUID instruction for getting the CPU serial number, stepping, ID string...? I guess there is a way for implementing such instruction in VB, or some activex control or dll..., well there must be a way.
  8. I like crimpson editor, It colours the php instructions, separate php sintax from html code, and it does advanced search/replace features that i appreciate a lot for many uses, not just php coding.
  9. I think C++ is well suited for most of applications. Java is open/platform, but is an "emulated" language, you need a virtual machine in order to run the code, so it doesn't make much difference with an interpreted language.C++ can compile to native machine code that run fast, and can be used for task that are suited for other languages. For instance, i compiled CGI programs writen in c for server side execution (for very fast runtime) compared to those writen in php (similar sintax, but interpreted by an engine).
  10. Here is my version of a BrainF*ck compiler for DOS, 114 byte sized: MOV AH,9h MOV DX,EMPEZAR INT 021h LEER: MOV AH,8h INT 021h MOV DI,BFLOOP AUN_NO: DEC DI CMP B[DI],AL JE IMPRIME CMP B[DI],CH JNE AUN_NO JMP LEER+2 IMPRIME: MOV DX,DI INC DX PUSH AX MOV AH,9h INT 021h POP AX CMP AL,040h JNE LEER RET EMPEZAR: MOV BH,80h MOV CX,BX MOV DI,BX REP STOSB DB '$',0 DB '>' INC BX DB '$' DB '<' DEC BX DB '$' DB '+' INC B[BX] DB '$' DB '-' DEC B[BX] DB '$' DB '.' MOV AH,2 MOV DL,B[BX] INT 021h DB '$' DB ',' MOV AH,8 INT 021h MOV B[BX],AL DB '$' DB '@' INT 20h DB ']' RET DB '$' DB '[' BFLOOP: CALL AQUI AQUI: POP SI SUB SI,3h PUSH SI OR B[BX],CH JNE FUERA POP AX BUCLE: LODSB CMP AL,0E8h JNE OTRO INC CX OTRO: CMP AL,0C3h JNE BUCLE LOOP BUCLE JMP SI FUERA: DB '$' For those who don't want to assemble this compiler of BF, here is the uuencoded version of the COM executable: begin 644 bf.com MM`FZ)P'-(;0(S2&_5@%/.`5T!C@M=??K\(GZ0E"T"<TA6#Q`=>'#MX"+RXG? M\ZHD`#Y#)#Q+)"O^!R0M_@\D+K0"BA?-(20LM`C-(8@')$#-(%W#)%OH``!> 8@^X#5@@O=0]8K#SH=0%!/,-U]N+T_^8D ` end You use this compiler to generate .COM executables from BF source code. The source code must not have any character other than BF commands, and the BF program must end with the "@" character flag. For example, the random number generator above mentioned: >>>++[<++++++++[<[<++>-]>>[>>]+>>+[-[->>+<<<[<[<<]<+>]>[>[>>]]]<[>>[-]]>[>[-<<]>[<+<]]+<<]<[>+<-]>>-]<.[-]>>]@ Then you use the compiler by writing this command line: BF <RANDOM.BF >RANDOM.COM And then you run RANDOM.COM to watch the result... If you need to clean up the code, you can use my BF sourcecode cleaner (CLEAN.BF): +[>,[>+>>+<<<-]++++++++[>--------<-]>[<<+>><+++[>+++++++<-]+>[<->[ ->+<]]<[>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>+[<->[->+<]]<[>>> .<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>>+++++++[<-->-]<[<->[->+<]]< [>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>>+++++++[<---->-]<-[<->[ ->+<]]<[>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]>[-]]>>[-]<<<<-]>++ ++++++[<++++++++>-]<.@ Then you compile CLEAN.BF into CLEAN.com: BF <CLEAN.BF >CLEAN.COM And then, to compile any commented BF program: CLEAN <program.bf | BF >program.com Try out this code: +[->,.-------------]<[++++++++++++++.<]@ This is my Hello World in BF: >+++++++++[<++++++++>-]<.>+++++[<++++++++>-]<-.---.>+++[<---->-]<+.[-]>+++++[<++++++>-]<++.>++++++[<+++++++>-]<+++.>+++++[<++++++++>-]<.-------.+>>>+++++[<+++++[<++++>-]>-]<<.<.>>>+++++[<++++++>-]<+++.-.<<++++.----.++++++++++.>>.<[-]>[<++>-]+++[<++++>-]<+.[-]++++[<------>-]<.>++++[<++++>-]<+.---------.++++++.[-]>++++++++[<++++++>-]<--.@ I've attached a BF debugger of my creation for debugging these BF programs (so you will understand quickly their operation.
  11. Maybe the problem is that human beings need to find a reason for us and other organisms showing complex and dynamic behaviour, so they [we] can be sorted in another group than stones, metals, etc, because such materials are too much little things compared to the "self-named living beings" importance.
  12. I would not consider them alive. I'll explain the reason. I think that a system is alive, when it consist of hardware with embedded software inherent to the properties of the hardware (so if you change the structure or composition of such hardware, then the software changes aswell, in a sort of instrinsic coding). Also, this system must be able to hold a sequence of code that once is given raw material, system will generate by its own, at least one more functional hardware unit with functional embedded code. Not needed to be an exact replication, but might keep the most relevant features of the generator system, otherwise both systems would be different. By this concept, viruses cannot be alive systems, because although they are pieces of software (genes) hardcoded in ADN (hardware), they lack of other hardware (proteins for replication) so they need to use the "replication plants" of other systems in order to keep their existence. And computer viruses lack of any own hardware, they are just a conceptual matter given the analogy of some properties of real viruses and those pieces of computer code. Furthermore, robots (at least by the current technology) cannot be considered as alive systems, because although they could own replication schemes to produce more robots from raw material, the code used for those schemes is independent of the hardware. That is, never matter what stuff the memory chip is built with, if you replace with other chip with the same code and function, but different technology (consider that chip as a black box), robot will function in the same fashion, but a real alive system function would have changed because of the substitution of an elementary hardware part. (hence, in alive systems, code is intrinsic to the hardware)
  13. This program is inmediate. The sum of an arithmetic serie, when you know the first and last term of a serie of n elements: S=N*(a[1]+a[N])/2; but you know that a[N]=a[1]+(N-1)*d; Doing arithmetics, then: a[1]=S/N-(N-1)*d/2; a[n]=S/N+(N-1)*d/2; #include <stdio.h>int main(){ double d,s,a1,an; long n; printf("\nHow many terms? "); scanf("%d",&n); printf("\nSum of all terms? "); scanf("%lf",&s); printf("\nCommon difference? "); scanf("%lf",&d); a1=s/n-(n-1)*d/2; an=s/n+(n-1)*d/2; printf("\nFist term A[1]: %f\nLast term A[%d]: %f\n\nSerie:",a1,n,an); for(long i=1;i<=n;i++){ printf("%f",a1+(i-1)*d); if(i<n) printf(", "); }}
  14. Yess, you've got the right clue. This is a simple Mandelbrot explorer, it uses int 10h video 640x480x16 graphic mode for drawing, it uses int 33h for mouse handling, and uses int 16h for getchar/kbhit functions. It uses extended doubles for floating point arithmetic (80 bit prec), and have the capability for zooming x2 when clicking over an area of the mandelbrot set. I know there are smaller mandelbrot viewers, but not many that can let you zoom until processor capabilities while this is around 400bytes.
  15. The following source code was a self-challenge to see if i could program such algorythm in assembler and generate the smallest file possible that keeps the functionality of my program. This is sort of minimalistic programming. Here is the code. It generates a 432byte length .COM executable file that needs to run from command line at full screen (uses graphic resources). So, what is this program for?, do you dare to give an answer? ;To assemble, use A86 assembler under DOS/WIN machine. It generates a 432 byte COM executable. SCRX equ LOOP1-2 SCRY equ LOOP2-2 INCX equ INITCOORD+400 INCY equ INCX+10 ITER equ INCY+10 MOUSX equ ITER+2 MOUSY equ ITER+4 XMIN equ INITCOORD+15 XMAX equ INITCOORD+25 YMIN equ INITCOORD+35 YMAX equ INITCOORD+45 CUATRO equ INITCOORD+55INITMB: MOV CX,200 MOV W[ITER],CX LEA DI,INITCOORD+15 REP STOSB LEA SI,INITCOORD LEA DI,INITCOORD+15+7 MOV CL,50-7 XOR AH,AHL0: CMP AH,10 JNE L3 XOR AH,AHL3: XOR AL,AL CMP AH,2 JA L1 LODSBL1: STOSB INC AH LOOP L0 THEMB: MOV AX,02 INT 33hDELTAVALUE: FINIT FLD T[XMAX] FLD T[XMIN] FSUBP ST(1),ST FILD W[SCRX] FDIVP ST(1),ST FSTP T[INCX] FLD T[YMAX] FLD T[YMIN] FSUBP ST(1),ST FILD W[SCRY] FDIVP ST(1),ST FSTP T[INCY] MOV AX,12h INT 10h DRAWMB: FINIT FLD T[XMIN] FLDZ MOV CX,640 LOOP1: PUSH CX FLD T[YMIN] FSTP ST(1) MOV CX,480 LOOP2: PUSH CX CALL ITERING FLD T[INCY] FADDP ST(1),ST POP CX LOOP LOOP2 FLD T[INCX] FADDP ST(2),ST POP CX LOOP LOOP1 MOUSEHANDLE: XOR AX,AX INT 33h OR AL,AL JE EXIT3 INC AX INC AX INT 33h MWAIT: MOV AX,100h INT 16h JNZ EXIT3 MOV AX,3 INT 33h CMP BL,1 JE ZOOM JL MWAIT JMP INITMB XOR AX,AX INT 16h EXIT3: MOV AX,2 INT 33h MOV AX,3 INT 10h MOV AH,09 LEA DX,[SIGNATURE] INT 21h MOV AX,4C00h INT 21hZOOM: SUB DX,120 SUB CX,160 CALL ZOOM_TMP ADD DX,240 ADD CX,320 CALL ZOOM_TMP FSTP T[YMAX] FSTP T[XMAX] FSTP T[YMIN] FSTP T[XMIN] ADD W[ITER],150 JMP THEMB ITERING: FLDZ FLDZ FLDZ FLDZ MOV DL,0Eh MOV CX,W[ITER] LAZO1: FST ST(1) FMUL ST,ST INC DL AND DL,0Fh FXCH ST(1),ST FMUL ST,ST(2) OR DL,DL JNZ SIGUE INC DL SIGUE: FADD ST,ST FADD ST,ST(4) FINCSTP FINCSTP FST ST(1) FMUL ST,ST FXCH ST(1),ST FDECSTP FST ST(1) FINCSTP FCHS FADD ST,ST(1) FADD ST,ST(3) FDECSTP FDECSTP FLDZ FADD ST,ST(2) FADD ST,ST(4) FLD T[CUATRO] FCOMPP FSTSW AX FWAIT SAHF JNA SALIR LOOP LAZO1 XOR DL,DL SALIR: FSTP ST FSTP ST FSTP ST FSTP ST MOV BP,SP MOV AL,DL MOV CX,640 MOV DX,480 MOV BX,[BP+2] SUB DX,BX MOV BX,[BP+4] SUB CX,BX MOV AH,0Ch XOR BX,BX INT 10h RET ZOOM_TMP: MOV W[MOUSY],DX MOV W[MOUSX],CX FLD T[INCX] FIMUL W[MOUSX] FLD T[XMIN] FADDP ST(1),ST FLD T[INCY] FIMUL W[MOUSY] FLD T[YMIN] FADDP ST(1),ST RETSIGNATURE: DB "By DrK3055A.",10,13,'$'INITCOORD: DB 80h,0,0C0h,0C0h,0FFh,03Fh,0A0h,0FFh,0BFh,0A0h,0FFh,03Fh,080h,1,040h Also, it was my first atempt for programming the Floating Point Unit by te use of assembler.
  16. What's the plot with all of this?You can't access a NT-based windows "even in safe mode" without knowing the Administrator's password, unless it's blank. (Don't you realize that normal people when find a password box, they think that there is a password that is protecting the access to the system, and this is not mandatory...?).If you intend to boot from safe mode because once then there reapears the "administrator login" from the menu, why don't log in as administrator without safe mode restrictions?, just press <ctrl>+<alt>+<del> twice, and you get the old fashoned login box of NT/2000 systems, then you change the current username to "Administrator" and leave the password empty. If the person that installed the XP is really naive, it left the Administrator password blank, thinking that you cannot access this computer if you cannot find the "administrator icon" at the login screen.My ex-boss parted some months ago from the company i work for, and he didn't tell anybody the password of the computer he used at office. One of the assistants needed to get some reports that were inside that PC, so she tried to log in for 5 days. Once i was felt ashamed of myself for not helping her, i tried the trick mentioned above. so after 1 minute, i was logged in as administrator and changed the passwords for all users. I told here to bear my child, but she told me she's a daughter with her husband though.
  17. This is not the case for all systems. Some compilers will warn about an "int main" function without a returning value. Some will add just a transparent "return -1;" just before the program ends, and some will use the last value stored (i.e. the last value returned by some function) in the accumulator register (EAX when talking about i386+) as the program return value. OS doesn't expect necessary to find a "nice" execution of a program by getting 1 (or in a general condition, non-zero return). For instance, on MS-DOS, a "0" returning value will clear the ERRORLEVEL environment variable, meaning for a fair ending of the program. Other values will set up an ERRORLEVEL code so it will indicate an unusual termination state (not just an error, but any especial condition; i can think of 0 for Retry, 1, for Ignore, and 2 for Cancel). On Windows, by returning 1 to the system means that the program has quit the execution in a good behaviour. This is the opposite to MS-DOS convenction. #include<stdio.h>int main(){printf(" %d",printf("1 2"));return(1);} printf usually is an alias for fprintf(stdout,...). fprintf will return the numbers of chars writen to the stream when returned successfully. Otherwise it will return a negative value. printf is expected to behave in the same fashion, as long as stdout may be redirected to a file or a socket through pipe redirection. Thus, when the inner call to printf retuns fine, the output of the program will be: "1 2 3". #include<stdio.h>int main(){int i=10;i=i<2;printf("%d",i);} The asignment operator owns the least precedence order. That is, the comparison (i<2) is performed before the asignment. And, because i<2 condition is false, the asignment will lead to value 0 (C convection for false conditions). That value is what is printed to stdout then... This is funny and pretty easy. The trick is to make such a program only consisting of empty structure blocks, and performing the print out from a function located outside the structure blocks but not in the main program(for instance, inside a comparison). The following code will do the task: #include <stdio.h>int main(){if(putchar(0x3B)) { }} Notice that there isn't any quote char aswell, as long as putchar doesn't require any string for output (contrary to printf). Ok, let's consider this code: #include <stdio.h>int main(){char *b="Surname",*a="Name";printf("\nWhat's your name? ");scanf("%s",b);printf("\nWhat's your Surname? ");scanf("%s",a);printf("\nYour full name is %s, %s",b,a);} Case 1: What's your name? JamesWhat's your Surname? BondYour full name is James, Bond Case 2: What's your name? BondWhat's your Surname? JamesYour full name is , James Where is the error? why in the second case, there is a word missed?? And this one? #include <stdio.h>int main(){char a[256];int size=0;FILE *f;for(int i=0;i<4000;i++) a[i]=i;if((f=fopen("test.file","w+"))!=NULL) { size=fwrite(a,sizeof(char),256,f); fclose(f); }if((f=fopen("test.file","r+"))!=NULL) { size=fread(a,sizeof(char),256,f); fclose(f); }if(size==256) printf("\nOK, the file has been created and read successful."); else printf("\nExpected 256 caracters to be read, but just %d did so, what the **** is going on here?",size);} Case 1. Executed on a win32 console: Expected 256 caracters to be read, but just 26 did so, what the **** is going on here? Case 2. Executed on a linux console: Expected 256 caracters to be read, but just 25 did so, what the **** is going on here? So, what is the answer to the programmer's question for each case? (when i was a novell programmer i wondered about this issue for 4 hours before i realized what i did wrong). This is a program intended to work as a CGI for a webserver: #include <stdio.h>#include <stdlib.h>char a[4096];strcpy(a,getenv("QUERY_STRING"));printf("<html><head><title>Test page</title></head>\n");printf("<body>You asked the webserver for this query: %s\n",a);pirntf("</body></html>");} Why the free access to this CGI is a real danger for the entire server security? and, how much is dangerous for a normal user? I guess here're some guru programmers willing to answer to these questions...
  18. 1.void main() { printf(â%dâ,(float)3/2); } Assuming that the code compiles to single precision floats, the 1.5 represents 4 bytes data in intel notation (least significant byte at first): 00000000 00000000 11000000 00111111 If i think of 16 integers, it will print just "0" (the 2 first bytes). To fix this, use "%f" for the format string. 2.void main() { char *s=âHello Worldâ; printf(â%câ,s); } *s is a pointer, so the character printed will depend on the value of the address in that pointer (its least significant byte) To fix this, use "%s" for the format string. 3.#include <stdio.h>int main(){char *str = "Hello, world";int i = sizeof(str);for(; i >= 0; i--)printf("%c" , str[i]);} sizeof(str) will return 4 (the size of a 32bit pointer in bytes), so the result will be: olleH To fix this, use strlen(str) instead of sizeof(str) 4.#define MAX(A , B) ( A < B ? B : A ) #include <stdio.h>int main(){int a = MAX( 4+2 , 3*2); printf(" %d " , a);} This is suposed to fail because a variable cannot be initialized by a macro (asuming ANSI C) . But it depends up on the compiler if this is valid or not (C++ should be fine with this). 1.#include <stdio.h>int main(){char *str = "Hello, world";printf("%5s" , str);} Maybe the programmer wanted the code to print "Hello", that is, printing up to the fifth character of str. The result is that str, as is longer that 5 chars, it will be printed as it, the whole string. I'd correct the code this way: #include <stdio.h>int main(){char *str = "Hello, world",str2[6]="";strncat(str2,str,5);printf("%s" , str2);} #include <stdio.h>void temp();void temp(void);int main(){temp();}void temp(){printf("C is exciting!");} This is suposed to fail because of multiple definition for the prototype of temp. Besides that, one of the prototypes doesn't tell the compiler the type of input parameters (in this case, this is "void"). To fix this, remove the line "void temp();" NOTE: Some compilers will forgive this, asuming that both prototypes are equivalent. The fact is that when in the declaration of the function, you specify "void", then the calls to that function must be without any parameters in a mandatory fashion. If you don't specify void, function calls can hold parameters, but the function doesn't take care of them. 3.main(){int x=0,y=1;if(x=y) y= 7;elsey=2;value of y?} This is quite simple. x was initially 0 (false), but the expression inside the brackets is not a comparison, but an asignment. After the asignment, x becomes 1 (true) so the "if statement" is executed, and y is assigned to value 7. to correct this, just replace the "=" asignment operator with the "==" comparison operator. main(){int a[]={1,2,9,8,6,3,5,7,8,9};int *p=a+1;int *q=a+6;printf("\n%d",q-p);} p and q are pointers, but a substraction of 2 pointers will lead us to the difference of their offsets. It will print a+6-a-1=5. If you wanted to print the result of a[6]-a[1], you would use printf("\n%d",(*q)-(*p)); and it would print 3.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.