Search Results

Search found 1588 results on 64 pages for 'pascal martin'.

Page 2/64 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Pascal error with array

    - by Donator
    program s;       type info = record                    name, surname: string;                    min, sec: integer;       end;       arrays = array[2..50] of info;       var A: arrays; begin       A[1].name := 'name'; end. What is wrong with that? It gives me range check error and I have no idea what is that.

    Read the article

  • Calculating next date in Turbo Pascal

    - by Chaima Chaimouta
    program date; uses wincrt; var m,ch,ch1,ch2,ch3: string ; mois,j,a,b: integer ; begin write('a');read(a); write('j');read(j); write('mois');read(mois); case mois of 1,3,5,7,8,10: if j<31 then begin b:=j+1; m:=str(b,ch)+'/'+str(mois,ch2)+'/'+str(a,ch3); else if j=31then b:=1; s:=mois+1; m:=concat(str(b,ch),'/',str(s,ch2),'/',str(a,ch3)); end else m:='erreur'; 4,6,9,11:if j<30 then begin b:=j+1; m:=concat(str(b,ch),'/',str(mois,ch2),'/',str(a,ch3)); end else j=30 then begin b:=1; s:=mois+1; m:=concat(str(b,ch),'/',str(mois,ch2),'/',str(a,ch3)); end else m:='erreur'; 2:if j<28 then begin b:=j+1; m:=concat(str(b,ch),'/',str(mois,ch2),'/',str(a,ch3)); end else if j=28 then begin b:=1; m:=concat(str(b,ch),'/',str(mois,ch2,'/',str(a,ch3)); end else if((a mod 4=0)AND (a mod 100<>0)) or ((a mod 100=0)and(a mod 400=0)) then if j<29 then begin b:=j+1; m:=concat(str(b,ch),'/',str(mois,ch2,'/',str(a,ch3)); end else if j=29 then begin b:=1; m:=concat(str(b,ch),'/',str(mois,ch2,'/',str(a,ch3)); end else m:='erreur'; 12:if j<31 then begin b:=j+1; m:=concat(str(b,ch),'/',str(mois,ch2,'/',str(a,ch3)); end else if j=31 then begin b:=1; s:=a+1; m:=concat(str(b,ch),'/',str(mois,ch2,'/',str(s,ch3)); end; writeln(m); end. this is my program i hope you be able to help me

    Read the article

  • Delphi Pascal / Windows API - Small problem with SetFilePointerEx and parameter FILE_END

    - by SuicideClutchX2
    I know I am about to be slapped by at least one person who was helping me with this API. Alright I have been able to use SetFilePointerEx just fine, when setting the position only. SetFilePointerEx(PD,512,@PositionVar,FILE_BEGIN); SetFilePointerEx(PD,0,@PositionVar,FILE_CURRENT); Both work, I can set positions and even check my current one. But when I set FILE_END as per the documentation no matter what the second parameter is and whether or not i provide a pointer for the third parameter it fails even on a valid handle that many other operations are able to use without fail. For Example: SetFailed := SetFilePointerEx(PD,0,@PositionVar,FILE_END); SetFailed := SetFilePointerEx(PD,0,nil,FILE_END); Whatever I put it fails. I am working with a handle to a physical disk and it most definitely has an end. SetFilePointer works just fine its just a little more trouble than I would like. Its not the end of the world, but whats happening.

    Read the article

  • Pascal - bad number format

    - by Donator
    Program: program s; type info = record name, surname: string; min, sek: integer; end; type arrays = array[1..50] of info; var c, b: text; A: arrays; gr_sk, grup_dal: integer; begin assign(c, 'info.txt'); reset(c); read(c, gr_sk); read(c, grup_dal); id := 1; read(c, A[id].name); read(c, A[id].sek); close(c); end. info.txt file: 3 4 yhgf 4 Please, tell me what is wrong with that. It says that it is bad number format for line 19 I guess.

    Read the article

  • Sorting linked lists in Pascal

    - by user3712174
    I'm doing my final project for Informatics class and I can't get my sorting procedure to work. Have a look at my program, specifically the bolded part (some things are in Croatian. - if you need something translated, let me know): type pokazivac=^slog; slog=record prezime_ime:string[30]; redni_broj:string[2]; fakultet:string[50]; bodovi:integer; sljedeci:pokazivac; end; var pocetni, trenutni, prethodni:pokazivac; i:integer; procedure racunaj; var i,a,c:integer; b,d,e,f,g,h,j:real; begin write('Postotak bodova (u decimalnom zapisu) koje ucenik ostvaruje na temelju prosjeka ocjena - '); readln(e); e:=e*1000/4; write('Prosjek ocjena u prvom razredu : '); readln(f); f:=f/5*e; write('Prosjek ocjena u drugom razredu : '); readln(g); g:=g/5*e; write('Prosjek ocjena u trecem razredu : '); readln(h); h:=h/5*e; write('Prosjek ocjena u cetvrtom razredu : '); readln(j); j:=j/5*e; d:=f+g+h+j; write('Broj predmeta (ne racunajuci hrvatski jezik, strani jezik i matematiku) koju je ucenik/ca polagao na maturi - '); readln(a); write('Postotak rijesnosti ispita iz hrvatskog jezika te zatim maksimum bodova koje je ucenik/ca mogao ostvariti - '); readln(b); readln(c); d:=d+b*c; write('Postotak rijesnosti ispita iz stranog jezika te zatim maksimum bodova koje je ucenik/ca mogao ostvariti - '); readln(b); readln(c); d:=d+(b*c); write('Postotak rijesnosti ispita iz matematike te zatim maksimum bodova koje je ucenik/ca mogao ostvariti - '); readln(b); readln(c); d:=d+(b*c); for i:=1 to a do begin writeln('Postotak rijesnosti dodatnog predmeta te zatim maksimum bodova koje je ucenik/ca mogao ostvariti - '); readln(b); readln(c); d:=d+(b*c); end; d:=round(d); writeln('Vas broj bodova je: ', d:4:2); write('Za nastavak pritisnite ENTER..'); readln; end; procedure unos; begin new(trenutni); write('Redni broj ucenika - ');readln(trenutni^.redni_broj); write('Prezime i ime - ');readln(trenutni^.prezime_ime); write('Naziv fakultet - ');readln(trenutni^.fakultet); write('Bodovi - ');readln(trenutni^.bodovi); trenutni^.sljedeci:=pocetni; pocetni:=trenutni; end; procedure ispis; begin writeln(); writeln('Lista popisanih ucenika:'); writeln(); trenutni:=pocetni; while trenutni<>NIL do begin with trenutni^do begin writeln('IME: ',prezime_ime); writeln('FAKULTET: ',fakultet); writeln('BODOVI: ',bodovi); writeln(); end; trenutni:=trenutni^.sljedeci; end; writeln(); write('Za nastavak pritisnite ENTER..'); readln; end; procedure brisi; var s:string; begin trenutni:= pocetni; prethodni:=pocetni; write('Redni broj ucenika kojeg zelite izbrisati - '); readln(s); while trenutni<>NIL do begin if trenutni^.redni_broj=s then begin prethodni^.sljedeci:=trenutni^.sljedeci; dispose(trenutni); break; end; trenutni:=trenutni^.sljedeci; end; end; procedure izmjeni; var s:string; begin trenutni:=pocetni; write('Redni broj ucenika cije podatke zelite izmijeniti - '); readln(s); while trenutni<> NIL do begin if trenutni^.redni_broj=s then begin write(trenutni^.prezime_ime, ' - '); readln(trenutni^.prezime_ime); write(trenutni^.fakultet, ' - '); readln(trenutni^.fakultet); write(trenutni^.bodovi, ' - '); readln(trenutni^.bodovi); break; end; trenutni:=trenutni^.sljedeci; end; end; **procedure sortiraj; var t1,t2,t:pokazivac; begin t1:=pocetni; while t1 <> NIL do begin t2:=t1^.sljedeci; while t2<>NIL do if t2^.bodovi<t1^.bodovi then begin new(t); t^.redni_broj:=t1^.redni_broj; t^.prezime_ime:=t1^.prezime_ime; t^.fakultet:=t1^.fakultet; t^.bodovi:=t1^.bodovi; t1^.redni_broj:=t2^.redni_broj; t1^.prezime_ime:=t2^.prezime_ime; t1^.fakultet:=t2^.fakultet; t1^.bodovi:=t2^.bodovi; t2^.redni_broj:=t^.redni_broj; t2^.prezime_ime:=t^.prezime_ime; t2^.fakultet:=t^.fakultet; t2^.bodovi:=t^.bodovi; dispose(t); end; t2:=t2^.sljedeci; end; t1:=t1^.sljedeci; write('Za nastavak pritisnite ENTER..'); readln; end;** begin pocetni:=NIL; trenutni:=NIL; writeln('******************************************'); writeln('**********DOBRODOSLI U FAX-O-MAT**********'); writeln('******************************************'); repeat writeln('1 - Racunaj broj bodova'); writeln('2 - Dodaj ucenika'); writeln('3 - Brisi ucenika'); writeln('4 - Ispis liste'); writeln('5 - Izmjeni podatke'); writeln('6 - Sortiraj listu prema broju bodova'); writeln('0 - Kraj'); readln(i); case i of 1:racunaj; 2:unos; 3:brisi; 4:ispis; 5:izmjeni; 6:sortiraj; end; until i=0; end. Either it crashes with a fatal error, or when I press the number 6, nothing happens. The pointer keeps blinking and I can't enter any more numbers.

    Read the article

  • Not so long ago in a city not so far away by Carlos Martin

    - by Maria Sandu
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 This is the story of how the EMEA Presales Center turned an Oracle intern into a trusted technology advisor for both Oracle’s Sales and customers. It was the summer of 2011 when I was finishing my Computer Engineering studies as well as my internship at Oracle when I was offered what could possibly be THE dream job for any young European Computer Engineer. Apart from that, it also seemed like the role was particularly tailored to me as I could leverage almost everything I learned at University and during the internship. And all of it in one of the best cities to live in, not only from my home country but arguably from Europe: Malaga! A day at EPC As part of the EPC Technology pillar, and later on completely focused on WebCenter, there was no way to describe a normal day on the job as each day had something unique. Some days I was researching documentation in order to elaborate accurate answers for a customer’s question within a Request for Information or Proposal (RFI/RFP), other days I was doing heavy programming in order to bring a Proof of Concept (PoC) for a customer to life and last not but least, some days I presented to the customer via webconference the demo I built for them the past weeks. So as you can see, the role has research, development and presentation, could you ask for more? Well, don’t worry because there IS more! Internationality As the organization’s name suggests, EMEA Presales Center, it is the Center of Presales within Europe, Middle East and Africa so I got the chance to work with great professionals from all this regions, expanding my network and learning things from one country to apply them to others. In addition to that, the teams based in the Malaga office are comprised of many young professionals hailing mainly from Western and Central European countries (although there are a couple of exceptions!) with very different backgrounds and personalities which guaranteed many laughs and stories during lunch or coffee breaks (or even while working on projects!). Furthermore, having EPC offices in Bucharest and Bangalore and thanks to today’s tele-presence technologies, I was working every day with people from India or Romania as if they were sitting right next to me and the bonding with them got stronger day by day. Career development Apart from the research and self-study I’ve earlier mentioned, one of the EPC’s Key Performance Indicators (KPI) is that 15% of your time is spent on training so you get lots and lots of trainings in order to develop both your technical product knowledge and your presentation, negotiation and other soft skills. Sometimes the training is via webcast, sometimes the trainer comes to the office and sometimes, the best times, you get to travel abroad in order to attend a training, which also helps you to further develop your network by meeting face to face with many people you only know from some email or instant messaging interaction. And as the months go by, your skills improving at a very fast pace, your relevance increasing with each new project you successfully deliver, it’s only a matter of time (and a bit of self-promoting!) that you get the attention of the manager of a more senior team and are offered the opportunity to take a new step in your professional career. For me it took 2 years to move to my current position, Technology Sales Consultant at the Oracle Direct organization. During those 2 years I had built a good relationship with the Oracle Direct Spanish sales and sales managers, who are also based in the Malaga office. I supported their former Sales Consultant in a couple of presentations and demos and were very happy with my overall performance and attitude so even before the position got eventually vacant, I got a heads-up from then in advance that their current Sales Consultant was going to move to a different position. To me it felt like a natural step, same as when I joined EPC, I had at least a 50% of the “homework” already done but wanted to experience that extra 50% to add new product and soft skills to my arsenal. The rest is history, I’ve been in the role for more than half a year as I’m writing this, achieved already some important wins, gained a lot of trust and confidence in front of customers and broadened my view of Oracle’s Fusion Middleware portfolio. I look back at the 2 years I spent in EPC and think: “boy, I’d recommend that experience to absolutely anyone with the slightest interest in IT, there are so many different things you can do as there are different kind of roles you can end up taking thanks to the experience gained at EPC” /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Read the article

  • Programmez un jeu pour téléphone portable avec MIDlet Pascal, par Darryl Kpizingui

    Darryl Kpizingui signe, avec ce tutoriel, le troisième volet de la série d'articles consacrés au compilateur MIDlet Pascal, qui permet de créer des programmes pour téléphones portables. Il nous guide pas à pas dans la réalisation d'un logiciel complet, un jeu de Mario Sokoban. Vous avez à présent toutes les cartes en main pour vous lancer dans la réalisation de vos propres logiciels pour téléphones portables !

    Read the article

  • Pascal's repeat... until vs. C's do... while

    - by Bob
    In C there is a do while loop and pascal's (almost) equivalent is the repeat until loop, but there is a small difference between the two, while both structures will iterate at least once and check whether they need to do the loop again only in the end, in pascal you write the condition that need to met to terminate the loop (REPEAT UNTIL something) in C you write the condition that need to be met to continue the loop (DO WHILE something). Is there a reason why there is this difference or is it just an arbitrary decision?

    Read the article

  • "Agile Principles, Patterns, and Practices in C#": Is this just a .NET-translation of the popular Uncle Bob book?

    - by Louis Rhys
    I found this book sold on Amazon Agile Principles, Patterns, and Practices in C#, written by Robert C Martin and Micah Martin. Is it merely a .NET port of the older, more popular Agile Software Development, Principles, Patterns, and Practices? Or is it just a new book trying to take advantage of the other book's popularity? If I am a .NET developer who hasn't read either book, which one would you recommend?

    Read the article

  • Why do Pascal control structures appear to be inconsistent?

    - by 70Mike
    Most Pascal control structures make sense to me, like: for ... do {statement}; if (condition) then {statement}; while (condition) do {statement}; where the {statement} is either a single statement, or a begin ... end block. I have a problem with: repeat {statement-list} until (expression); try {statement-list} except {statement-list} end; Wouldn't it be better that repeat and try have the same general structure, accepting only a single statement or a begin ... end block, instead of having a statement-list that's not formally blocked with a begin and an end?

    Read the article

  • How can I check if the mouse button is released, and THEN execute a procedure once in Borland Pascal

    - by Robert
    Hi! I use Borland Pascal 7.0, and I would like to make a slots game (If 3 random numbers are the same, you win). The problem is that when I click on the start (Inditas) button on the menu, the procedure executes many times until I release the mouse button. I was told that I should check if the mouse button is released before executing the procedure once. How can I do that? Here's what the menu looks like: procedure eger; begin; mouseinit; mouseon; menu; repeat getmouse(m); if (m.left) and (m.x60) ANd (m.x<130) and (m.y120) and (m.y<150) then teglalap(90,90,300,300,blue); if (m.left) and (m.x60) AND (m.x<130) and (m.y160) and (m.y<190) then jatek(a,b,c,coin,coins); until ((m.left) and (m.x60) ANd (m.x<130) and (m.y240) and (m.y<270)); end; Thanks, Robert

    Read the article

  • Help Me Make My Pascal Program Display Multiple Names Which Were Entered Plz.

    - by Sketchie
    Hey,Guys I'm having trouble displaying names using arrays in my Pascal program. But first heres the question I'm writing the program to answer : Develop pseudocode that accepts as input the name of an unspecified number of masqueraders who each have paid the full cost of their costume and the amount each has paid. A masquerader may have paid for a costume in any of the five sections in the band. The algorithm should determine the section in which the masquerader plays, based on the amount he/she has paid for the costume. The algorithm should also determine the number of masqueraders who have paid for costumes in each section. The names of persons and the section for which they have paid should be printed. A listing of the sections and the total number of persons registered to play in each section should also be printed, along with the total amount paid in each section. And here's what I've done so far(It's a bit messy): program Maqueprgrm; uses wincrt; type names=array [1..30]of string; var name:string; s1_nms:names; s2_nms:names; s3_nms:names; s4_nms:names; s5_nms:names; amt_paid:integer; stop,x,full,ins,ttl1,ttl2,ttl3,ttl4,ttl5,sec_1,sec_2,sec_3,sec_4,sec_5,sec:integer; begin stop := 0; writeln ('To Begin Data Collecting Section Press 1, To End Press 0'); readln(stop); while stop <0 do begin for x:= 1 to 30 do x:= x+1; writeln ('Please Enter The Name of Masquerader.'); readln (name); writeln ('Please Enter The Amount Paid For Costume.'); readln (amt_paid); IF amt_paid = 144 THEN Begin full:=full+1; {people who paid in full + 1} sec_1:=sec_1+1; {people in this section + 1} ttl1:= ttl1+amt_paid; {total money earned in this section + amount person paid} s1_nms[x]:= name; {People's names in this section plus current entry's name} End else IF amt_paid = 184 then Begin ins:=ins+1; sec_1:=sec_1+1; ttl1:=ttl1+amt_paid; s1_nms[x]:= name; end else IF amt_paid = 198 then Begin full:=full+1; sec_2:=sec_2+1; ttl2:=ttl2+amt_paid; s2_nms[x]:= 'name'; end else IF amt_paid = 153 then Begin ins:=ins+1; sec_2:=sec_2+1; ttl2:=ttl2+amt_paid; s2_nms[x]:= 'name'; end else IF amt_paid = 264 then Begin full:=full+1; sec_3:=sec_3+1; ttl3:=ttl3+amt_paid; s3_nms[x]:= 'name'; end else IF amt_paid = 322 then Begin ins:=ins+1; sec_3:=sec_3+1; ttl3:=ttl3+amt_paid; s3_nms[x]:= 'name'; end else IF amt_paid = 315 then Begin full:=full+1; sec_4:=sec_4+1; ttl4:=ttl4+amt_paid; s4_nms[x]:= 'name'; end else IF amt_paid = 402 then Begin ins:=ins+1; sec_4:=sec_4+1; ttl4:=ttl4+amt_paid; s4_nms[x]:= 'name'; end else IF amt_paid = 382. then Begin ins:=ins+1; sec_4:=sec_4+1; ttl4:=ttl4+amt_paid; s4_nms[x]:= 'name'; end else IF amt_paid = 488 then Begin ins:=ins+1; sec_5:=sec_5+1; ttl5:=ttl5+amt_paid; s5_nms[x]:= 'name'; end else begin Writeln ('Invalid Entry'); For x:= 1 to 30 do end; writeln (' To Enter More Data Press 1, To Print Data and Calculations Press 0'); Readln (stop); End; writeln ('For Information on Sections Press 1, 2, 3, 4, or 5 Respectively'); Readln (sec); IF Sec= 1 THEN Begin for x:= 1 to 30 do; begin writeln ('The Number of Revelers in This Section is ',Sec_1,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Full Is ', Full,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Installments is ', Ins ,'.'); Writeln ('The Names of Revelers in This Section is ', S1_Nms[x], '.'); Writeln ('The Total Amount Collected By This Section Is ', Ttl1, '.'); End; end else IF Sec= 2 THEN Begin For x:= 1 to 30 do begin Writeln ('The Number of Revelers in This Section is ', Sec_2,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Full Is ', Full,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Installments is ', Ins ,'.'); Writeln ('The Names of Revelers in This Section is ', S2_Nms[x] ,'.'); Writeln ('The Total Amount Collected By This Section Is ', Ttl2, '.'); End; End else IF Sec= 3 THEN Begin For x:= 1 to 30 do begin writeln ('The Number of Revelers in This Section is ', Sec_3,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Full Is ', Full,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Installments is ', Ins ,'.'); Writeln ('The Names of Revelers in This Section is ', S3_Nms[x] ,'.'); Writeln ('The Total Amount Collected By This Section Is ', Ttl3, '.'); End; End else IF Sec= 4 THEN Begin For x:= 1 to 30 do begin writeln ('The Number of Revelers in This Section is ', Sec_4,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Full Is ', Full,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Installments is ', Ins, '.'); Writeln ('The Names of Revelers in This Section is ', S4_Nms [x],'.'); Writeln ('The Total Amount Collected By This Section Is ', Ttl4 ,'.'); End; End else IF Sec= 5 THEN Begin For x:= 1 to 30 do begin writeln ('The Number of Revelers in This Section is ', Sec_5,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Full Is ', Full,'.'); Writeln ('The Number of Revelers in the Band Who Paid in Installments is ', Ins, '.'); Writeln ('The Names of Revelers in This Section is ', S5_Nms[x], '.'); Writeln ('The Total Amount Collected By This Section Is ', Ttl5 ,'.'); End; End else BEGIN Writeln ('Invalid Entry. For Information on Sections Press 1, 2, 3, 4, or 5 Respectively. '); End; end. The result I keep getting is that for the names in the section it is only the name of the last person entered that is displayed. For example it would display: The number of revelers in this section is 2 The number of revelers in the band who paid in full is 2 {Band is the whole thing divided into 5 section} The number of revelers in the band who paid in installments is 0 The names of revelers in this section is Amy Total amount collected by this section is 288 So yea, the program only displays "Amy" even though I entered more than 1 name. Do you guys know how to fix it also if it's not asking too much could you help me to make a while loop for the last portion of the program so that after the user sees the info for a section he can see another section. It sucks that I've been working on it for a while but if it doesn't run properly tomorrow I'll fail. Help would be greatly appreciated and responses are welcome anytime cause i'll be up anyway. P.S. Sorry for the long post.

    Read the article

  • Are we DELPHI, VCL or Pascal programmers?

    - by José Eduardo
    i´ve been a delphi database programmer since D2. Now i´m facing some digital imaging and 3D challenges that make me to start study OpenGL, DirectX, Color Spaces and so on. I´m really trying but nobody seems to use Delphi for this kind of stuff, just the good-old-paycheck Database programming. ok, i know that we have some very smart guys behind some clever components, some of this open-source. Is there any PhotoShop, Blender, Maya, Office, Sonar, StarCraft, Call of Dutty written in Delphi? Do i have to learn C++ to have access to zillions of books about that kind of stuff? What is the fuzz/hype behind this: int *varName = &anhoterThing? Why pointers seems to be the holy graal to this apps? I´ve downloaded MSVC++ Express and start to learn some WPF and QT integration, and i think: "Man, Delphi does this kind of stuff, with less code, less headaches, since the wheels were invented" This lead my mind to the following... Do you ever tried to write a simple notepad program using just notepad and dcc32 in Pascal/Delphi? if so embarcadero could make our beloved pascal compiler free, and sell just the ide, the vcl, the customer support ... and back to the question: Are we DELPHI, VCL or Pascal programmers?

    Read the article

  • Sourcecode for Paymentroll example in Robert C. Martin book

    - by bitbonk
    Throughout the book "Agile Principles, Patterns, and Practices in C#" by Robert C. Martin a small Paymentroll application is build. While most of the source code is printed in place, some classes are missing and some are incomplete. The book says on the firest page: The book includes many source code examples that are also available for download from the authors' Web site. Unfortunately this seems to be a lie. Unless either this is not the author's website (the book forgets to mention the authors website adress) or I am blind. Does anyone have the comlete source code for that book preferably in form of a Visual Studio project or knows where I can find it.

    Read the article

  • Question About Example In Robert C Martin's _Clean Code_

    - by Jonah
    This is a question about the concept of a function doing only one thing. It won't make sense without some relevant passages for context, so I'll quote them here. They appear on pgs 37-38: To say this differently, we want to be able to read the program as though it were a set of TO paragraphs, each of which is describing the current level of abstraction and referencing subsequent TO paragraphs at the next level down. To include the setups and teardowns, we include setups, then we include the test page content, and then we include the teardowns. To include the setups, we include the suite setup if this is a suite, then we include the regular setup. It turns out to be very dif?cult for programmers to learn to follow this rule and write functions that stay at a single level of abstraction. But learning this trick is also very important. It is the key to keeping functions short and making sure they do “one thing.” Making the code read like a top-down set of TO paragraphs is an effective technique for keeping the abstraction level consistent. He then gives the following example of poor code: public Money calculatePay(Employee e) throws InvalidEmployeeType { switch (e.type) { case COMMISSIONED: return calculateCommissionedPay(e); case HOURLY: return calculateHourlyPay(e); case SALARIED: return calculateSalariedPay(e); default: throw new InvalidEmployeeType(e.type); } } and explains the problems with it as follows: There are several problems with this function. First, it’s large, and when new employee types are added, it will grow. Second, it very clearly does more than one thing. Third, it violates the Single Responsibility Principle7 (SRP) because there is more than one reason for it to change. Fourth, it violates the Open Closed Principle8 (OCP) because it must change whenever new types are added. Now my questions. To begin, it's clear to me how it violates the OCP, and it's clear to me that this alone makes it poor design. However, I am trying to understand each principle, and it's not clear to me how SRP applies. Specifically, the only reason I can imagine for this method to change is the addition of new employee types. There is only one "axis of change." If details of the calculation needed to change, this would only affect the submethods like "calculateHourlyPay()" Also, while in one sense it is obviously doing 3 things, those three things are all at the same level of abstraction, and can all be put into a TO paragraph no different from the example one: TO calculate pay for an employee, we calculate commissioned pay if the employee is commissioned, hourly pay if he is hourly, etc. So aside from its violation of the OCP, this code seems to conform to Martin's other requirements of clean code, even though he's arguing it does not. Can someone please explain what I am missing? Thanks.

    Read the article

  • Game of Thrones : l'arme secrète de George R. R. Martin contre les virus, un PC sous DOS avec Wordstar 4.0 et sans internet

    Game of Thrones : L'arme secrète de George R. R. Martin contre les virus George R. R. MARTIN, auteur de la saga Game of Thrones et co-producteur de la série du même nom a révélé à un Talk-show américain avoir une arme secrète contre les virus qui pourraient attaquer son ordinateur et détruire ses documents. Pour écrire ses livres, il se sert d'un ordinateur non relié à internet et qui fonctionne sous DOS et comme traitement de texte Wordstar 4,0 ! À la question « pourquoi rester avec ce vieux...

    Read the article

  • How would you program Pascal's triangle in R?

    - by Peter Flom
    I am reading, on my own (not for HW) about programming, and one exercise involved programming Pascal's triangle in R. My first idea was to make a list and then append things to it, but that didn't work too well. Then I thought of starting with a vector, and making a list out of that, at the end. Then I thought of making a matrix, and making a list out of that at the end. Not sure which way to even approach this. Any hints? thanks

    Read the article

  • InnoSetup Uninstall Ask Message - Pascal Coding

    - by ryu
    I have created an installer for some of my games and I want the uninstaller to ask me if I want to save my game files. Something like this: when I execute the uninstall.exe to ask me 'Do you want to keep all saved games?' YES or NO. If I hit YES my save files remain and my program files are uninstalled and if I hit NO my program files inclusive save files to be uninstalled. What is the PASCAL code for InnoSetup to do this? Thank you very much! Best regards, Ryan

    Read the article

  • Installing MySQL without root access

    - by vinay
    I am trying to install MySQL without root permissions. I ran through the following steps: Download MySQL Community Server 5.5.8 Linux - Generic Compressed TAR Archive Unpack it, for example to: /home/martin/mysql Create a my.cnf file in your home directory. The file contents should be: [server] user=martin basedir=/home/martin/mysql datadir=/home/martin/sql_data socket=/home/martin/socket port=3666 Go to the /home/martin/mysql directory and execute: ./scripts/mysql_install_db --defaults-file=~/my.cnf --user=martin --basedir=/home/martin/mysql --datadir=/home/martin/sql_data --socket=/home/martin/socket Your MySQL server is ready. Start it with this command: ./bin/mysqld_safe --defaults-file=~/my.cnf & When I try to change the password of MySQL it gives the error: Cannot connect to mysql server through socket '/tmp/mysql.sock' How can I change this path and see whether the mysql.sock is created or not?

    Read the article

  • do console apps run faster than windows based app?

    - by omair iqbal
    i am reletivly new to world of programming i have a few performance questions 1. do console apps run faster than windows based app? 2.are languages like c and pascal faster than object oriented languages like c++ and delphi?i know language speed depends more on compiler than on language itself but do compilers for prcedural languages like c and pascal produce faster code than oo ones like delphi,c++(including c++ compilers that can procuce c code) sorry for my bad english

    Read the article

  • Dealing with Unity's Global Menu and Overlay Scrollbars under Free Pascal/Lazarus

    - by Gustavo Carreno
    I've had some problems under the IDE that were fixed with unsettings and disabling Global menu and the Overlay Scrollbars. I've reported the problem in Lazarus' Mantis: #0021465, #0021467. There is also this bug report talking a bit more about it: #0019266 Their solution was to use unsettings to turn off Global Menu and Overlay Scrollbars. I've had a quick search about the problem and there's an open bug report at Launchpad: overlay scrolling is broken in lazarus. So, is the problem related to "lib overlay scrollbar"? If it is, is there a solution via code, to avoid turning off both the Global Menu and Overlay Scrollbars? If NOT, is there anyone taking notice and fixing the issue? Many thanks, Gus

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >