Search Results

Search found 6442 results on 258 pages for 'beginner programmer'.

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

  • I am a beginner to C and this is the dumbest question..Confused about getchar() function

    - by happysoul
    Sorry if I am not supposed to post beginner level questions here..I am new to this site Please read the code below first I am confused about getchar() 's role in the following code.. I mean I know its helping me see the output window which will only be closed when I press enter key So getchar() is basically waiting for me to press enter and then reads a single character .. Now my question.. what is that single character this function is reading ?? I did not press any key from the keyboard for it to read Now when its not reading anything..why it does not give an error saying hey u didn't enter anything for me to read ..lol...(told u its a dumb question) #include <stdio.h> int main() { printf( "blah \n" ); getchar(); return 0; }

    Read the article

  • Searching for a Kohana Beginner's Tutorial for PHP

    - by Andreas Grech
    I am going to try to build a PHP website using a framework for the first time, and after some research here and there, I've decided to try to use Kohana I downloaded the source from their website, and ran the downloaded stuff on my web server, and was then greeted with a 'Welcome to Kohana!' page, and nothing more... I've tried to find some beginner tutorials on the web as regard this particular framework, but to my surprise, came up with almost nothing (only this one, but it's not a great deal of help) I am not new to PHP and neither am I new to the MVC concept, but I am very new to PHP Frameworks...so can anyone point me to a Kohana tutorial somewhere on the web that will help me get started in building my website using this framework, from scratch ? P.S. As I said, I want a beginners tutorial as regarding this case. [UPDATE] I am currently reading the Official Guide...we'll see how that goes.

    Read the article

  • Understanding Thread/BeginInvoke? [beginner]

    - by Moberg
    Consider the code: class Work { public void DoStuff(string s) { Console.WriteLine(s); // .. whatever } } class Master { private readonly Work work = new Work(); public void Execute() { string hello = "hello"; // (1) is this an ugly hack ? var thread1 = new Thread(new ParameterizedThreadStart(o => this.work.DoStuff((string)o))); thread1.Start(hello); thread1.Join(); // (2) is this similar to the one above? new Action<string>(s => this.work.DoStuff(s)).BeginInvoke(hello, null, null); } } Is (1) an acceptable way of easy starting some work in a seperate thread? If not a better alternative would be much appreciated. Is (2) doing the same? I guess what I ask is if a new thread is started, or.. Hope you can help a beginner to a better understanding :) /Moberg

    Read the article

  • Pythonic mapping of an array (Beginner)

    - by scott_karana
    Hey StackOverflow, I've got a question related to a beginner Python snippet I've written to introduce myself to the language. It's an admittedly trivial early effort, but I'm still wondering how I could have written it more elegantly. The program outputs NATO phoenetic readable versions of an argument, such "H2O" - "Hotel 2 Oscar", or (lacking an argument) just outputs the whole alphabet. I mainly use it for calling in MAC addresses and IQNs, but it's useful for other phone support too. Here's the body of the relevant portion of the program: #!/usr/bin/env python import sys nato = { "a": 'Alfa', "b": 'Bravo', "c": 'Charlie', "d": 'Delta', "e": 'Echo', "f": 'Foxtrot', "g": 'Golf', "h": 'Hotel', "i": 'India', "j": 'Juliet', "k": 'Kilo', "l": 'Lima', "m": 'Mike', "n": 'November', "o": 'Oscar', "p": 'Papa', "q": 'Quebec', "r": 'Romeo', "s": 'Sierra', "t": 'Tango', "u": 'Uniform', "v": 'Victor', "w": 'Whiskey', "x": 'Xray', "y": 'Yankee', "z": 'Zulu', } if len(sys.argv) < 2: for n in nato.keys(): print nato[n] else: # if sys.argv[1] == "-i" # TODO for char in sys.argv[1].lower(): if char in nato: print nato[char], else: print char, As I mentioned, I just want to see suggestions for a more elegant way to code this. My first guess was to use a list comprehension along the lines of [nato[x] for x in sys.argv[1].lower() if x in nato], but that doesn't allow me to output any non-alphabetic characters. My next guess was to use map, but I couldn't format any lambdas that didn't suffer from the same corner case. Any suggestions? Maybe something with first-class functions? Messing with Array's guts? This seems like it could almost be a Code Golf question, but I feel like I'm just overthinking :)

    Read the article

  • Beginner problems with references to arrays in python 3.1.1

    - by Protean
    As part of the last assignment in a beginner python programing class, I have been assigned a traveling sales man problem. I settled on a recursive function to find each permutation and the sum of the distances between the destinations, however, I am have a lot of problems with references. Arrays in different instances of the Permute and Main functions of TSP seem to be pointing to the same reference. from math import sqrt class TSP: def __init__(self): self.CartisianCoordinates = [['A',[1,1]], ['B',[2,2]], ['C',[2,1]], ['D',[1,2]], ['E',[3,3]]] self.Array = [] self.Max = 0 self.StoredList = ['',0] def Distance(self, i1, i2): x1 = self.CartisianCoordinates[i1][1][0] y1 = self.CartisianCoordinates[i1][1][1] x2 = self.CartisianCoordinates[i2][1][0] y2 = self.CartisianCoordinates[i2][1][1] return sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2)) def Evaluate(self): temparray = [] Data = [] for i in range(len(self.CartisianCoordinates)): Data.append([]) for i1 in range(len(self.CartisianCoordinates)): for i2 in range(len(self.CartisianCoordinates)): if i1 != i2: temparray.append(self.Distance(i1, i2)) else: temparray.append('X') Data[i1] = temparray temparray = [] self.Array = Data self.Max = len(Data) def Permute(self,varray,index,vcarry,mcarry): #Problem Class array = varray[:] carry = vcarry[:] for i in range(self.Max): print ('ARRAY:', array) print (index,i,carry,array[index][i]) if array[index][i] != 'X': carry[0] += self.CartisianCoordinates[i][0] carry[1] += array[index][i] if len(carry) != self.Max: temparray = array[:] for j in range(self.Max):temparray[j][i] = 'X' index = i mcarry += self.Permute(temparray,index,carry,mcarry) else: return mcarry print ('pass',mcarry) return mcarry def Main(self): out = [] self.Evaluate() for i in range(self.Max): array = self.Array[:] #array appears to maintain the same reference after each copy, resulting in an incorrect array being passed to Permute after the first iteration. print (self.Array[:]) for j in range(self.Max):array[j][i] = 'X' print('I:', i, array) out.append(self.Permute(array,i,[str(self.CartisianCoordinates[i][0]),0],[])) return out SalesPerson = TSP() print(SalesPerson.Main()) It would be greatly appreciated if you could provide me with help in solving the reference problems I am having. Thank you.

    Read the article

  • Before and After the Programmer Life [closed]

    - by Gio Borje
    How were people before and after becoming programmers through a black box? In a black box, the implementation is irrelevant; therefore, we focus on the input and output: High School Nerd -> becomeProgrammer() -> Manager (Person Before) -> (Person as Programmer) -> (New Person) (Person Before) -> (Person as Programmer) How are the typical lives of people before they became programmers? Why do people pursue life as a programmer? (Person as Programmer) -> (New Person) How has becoming a programmer changed people afterwards? Why quit being a programmer? Anecdotes would be nice. If many programmers have similar backgrounds and fates, do you think that there is some sort of stereotypical person that are destined to become programmers?

    Read the article

  • Python for a hobbyist programmer ( a few questions)

    - by Matt
    I'm a hobbyist programmer (only in TI-Basic before now), and after much, much, much debating with myself, I've decided to learn Python. I don't have a ton of free time to teach myself a hundred languages and all programming I do will be for personal use or for distributing to people who need them, so I decided that I needed one good, strong language to be good at. My questions: Is python powerful enough to handle most things that a typical programmer might do in his off-time? I have in mind things like complex stat generators based on user input for tabletop games, making small games, automate install processes, and build interactive websites, but probably a hundred things along those lines Does python handle networking tasks fairly well? Can python source be obscufated (mispelled I think), or is it going to be open-source by nature? The reason I ask this is because if I make something cool and distribute it, I don't want some idiot script kiddie to edit his own name in and say he wrote it And how popular is python, compared to other languages. Ideally, my language would be good and useful with help found online without extreme difficulty, but not so common that every idiot with computer knows python. I like the idea of knowing a slightly obscure language. Thanks a ton for any help you can provide.

    Read the article

  • Grails beginner problem "Failed to invoke Servlet 2.5"

    - by A Lion
    I'm trying to get Groovy on Grails set up on a Snow Leopard machine. I followed all the grails.com install directions and am trying to start the application from Grails: A Quick-Start Guide by Dave Klein. I ran grails create-app TekDays with no apparent problems and was able to cd to the TekDays folder, but when I try to run grails run-app I get the following: Welcome to Grails 1.3.1 - http://grails.org/ Licensed under Apache Standard License 2.0 Grails home is set to: /grails Base Directory: /apps/TekDays Resolving dependencies... Dependencies resolved in 4469ms. Running script /grails/scripts/RunApp.groovy Environment set to development [delete] Deleting directory /Users/name/.grails/1.3.1/projects/TekDays/tomcat Running Grails application.. 2010-05-24 21:42:39,559 [main] ERROR context.GrailsContextLoader - Error executing bootstraps: Failed to invoke Servlet 2.5 getContextPath method java.lang.IllegalStateException: Failed to invoke Servlet 2.5 getContextPath method at org.grails.tomcat.TomcatServer.start(TomcatServer.groovy:164) at grails.web.container.EmbeddableServer$start.call(Unknown Source) at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy:159) at _GrailsRun_groovy$_run_closure5_closure12.doCall(_GrailsRun_groovy) at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:282) at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy) at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:150) at _GrailsRun_groovy$_run_closure5.call(_GrailsRun_groovy) at _GrailsRun_groovy.runInline(_GrailsRun_groovy:116) at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy) at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59) at RunApp$_run_closure1.doCall(RunApp.groovy:33) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:590) at gant.Gant.executeTargets(Gant.groovy:589) Caused by: java.lang.NoSuchMethodException: javax.servlet.ServletContext.getContextPath() at java.lang.Class.getMethod(Class.java:1605) ... 23 more I've googled every derivative of "Failed to invoke Servlet 2.5" that I can think of, but have thus far been unable to find anything that helps me understand, yet alone resolve, the error. Any advice to help me resolve this would be very much appreciated!

    Read the article

  • Beginner to RUBY - require_relative problem

    - by WANNABE
    Hi, I'm learning Ruby (using version 1.8.6) on Windows 7. When I try to run the stock_stats.rb program below, I get the following error: C:\Users\Will\Desktop\ruby>ruby stock_stats.rb stock_stats.rb:1: undefined method `require_relative' for main:Object (NoMethodE rror) I have three v.small code files: stock_stats.rb require_relative 'csv_reader' reader = CsvReader.new ARGV.each do |csv_file_name| STDERR.puts "Processing #{csv_file_name}" reader.read_in_csv_data(csv_file_name) end puts "Total value = #{reader.total_value_in_stock}" csv_reader.rb require 'csv' require_relative 'book_in_stock' class CsvReader def initialize @books_in_stock = [] end def read_in_csv_data(csv_file_name) CSV.foreach(csv_file_name, headers: true) do |row| @books_in_stock << BookInStock.new(row["ISBN"], row["Amount"]) end end # later we'll see how to use inject to sum a collection def total_value_in_stock sum = 0.0 @books_in_stock.each {|book| sum += book.price} sum end def number_of_each_isbn # ... end end book_in_stock.rb require 'csv' require_relative 'book_in_stock' class CsvReader def initialize @books_in_stock = [] end def read_in_csv_data(csv_file_name) CSV.foreach(csv_file_name, headers: true) do |row| @books_in_stock << BookInStock.new(row["ISBN"], row["Amount"]) end end # later we'll see how to use inject to sum a collection def total_value_in_stock sum = 0.0 @books_in_stock.each {|book| sum += book.price} sum end def number_of_each_isbn # ... end end Thanks in advance for any help.

    Read the article

  • Quick, beginner MASM register question - DX:AX

    - by Francisco P.
    Hello, I am currently studying for an exam I'll have on x86 assembly. I didn't have much luck googling for ":", too common of a punctuation mark :/ IDIV - Signed Integer Division Usage: IDIV src Modifies flags: (AF,CF,OF,PF,SF,ZF undefined) Signed binary division of accumulator by source. If source is a byte value, AX is divided by "src" and the quotient is stored in AL and the remainder in AH. If source is a word value, DX:AX is divided by "src", and the quotient is stored in AL and the remainder in DX. Taken from "Intel Opcodes and Mnemonics" What does DX:AX mean? Thanks a lot for your time :)

    Read the article

  • WPF Beginner - A simple XAML layout not working as expected

    - by OrWhen
    Hi, I've just started learning WPF, and followed a book to make this sample calculator application in XAML. The XAML code is attached below. I don't have any UI specific code in the xaml.cs file. However, I'm seeing a difference between design time and runtime. As you can see in the attached screenshot, the upper left button of the calculator is bigger than the rest. Even more confusingly, the designer when I edit the XAML shows the button correctly. I've tried to determine why is that, and I'm stumped. Can anyone help? I'm using VS2008, targeting framework 3.5, if it's any help. Here's the XAML: <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" FontSize="24" Name="Header" VerticalAlignment="Center" HorizontalAlignment="Center">Calculator</TextBlock> <TextBox Grid.ColumnSpan="4" Grid.Column="0" Grid.Row="1" Name="Display" HorizontalContentAlignment="Left" Margin="5" /> <Button Grid.Row="2" Grid.Column="0" Click="Button_Click">7</Button> <Button Grid.Row="2" Grid.Column="1" Click="Button_Click">8</Button> <Button Grid.Row="2" Grid.Column="2" Click="Button_Click">9</Button> <Button Grid.Row="3" Grid.Column="0" Click="Button_Click">4</Button> <Button Grid.Row="3" Grid.Column="1" Click="Button_Click">5</Button> <Button Grid.Column="2" Grid.Row="3" Click="Button_Click">6</Button> <Button Grid.Row="4" Grid.Column="0" Click="Button_Click">1</Button> <Button Grid.Row="4" Grid.Column="1" Click="Button_Click">2</Button> <Button Grid.Row="4" Grid.Column="2" Click="Button_Click">3</Button> <Button Grid.Row="5" Grid.Column="0" Click="Button_Click">0</Button> <Button Grid.Row="5" Grid.Column="3" Tag="{x:Static local:Operation.PLUS}" Click="Op_Click">+</Button> <Button Grid.Row="4" Grid.Column="3" Tag="{x:Static local:Operation.MINUS}" Click="Op_Click">-</Button> <Button Grid.Row="3" Grid.Column="3" Tag="{x:Static local:Operation.TIMES}" Click="Op_Click">*</Button> <Button Grid.Row="2" Grid.Column="3" Tag="{x:Static local:Operation.DIVIDE}" Click="Op_Click">/</Button> <Button Grid.Row="5" Grid.Column="1" >.</Button> <Button Grid.Row="5" Grid.Column="2" Tag="{x:Static local:Operation.EQUALS}" Click="Op_Click">=</Button> </Grid>

    Read the article

  • High level macro not recognized - Beginner MASM

    - by Francisco P.
    main proc finit .while ang < 91 invoke func, ang fstp res print real8$(ang), 13, 10 print real8$(res), 13, 10 fld ang fld1 fadd fstp ang .endw ret main endp What's wrong with this piece of MASM code? I get an error on .endw. I have ran some tests to ensure myself of that. Assembler tells me invalid instruction operands. Thank you for your time!

    Read the article

  • Python beginner having trouble running code

    - by Protean
    For some reason this code will not seem to run in the interpreter. When I hit F5 nothing happens, not even the debugger seems to recognize it. I assume it has something to do with the class, as when removed the interpreter seems to recognize the rest of the code. Please tell me what I am doing wrong. Edit: I have restarted the interpreter multiple times, any other piece of code I try to load runs fine, just this one is having trouble. print ('Why won't this work?') class sorting_class: def __init__(self): self.order = ['a', 'b', 'c', 'd'] self.globali = 0 self.orderi = 0 self.sortedlist = [] def sort(self, array): carry, leave = [] for arrayi in array: print ('run', arrayi) if self.order[self.orderi] == arrayi[self.globali]: carry.append(arrayi) else: if self.globali != 0: leave.append(arrayi) return carry, leave def srt(self, array): globalii = 0 carry, leave = my.sort(array) while len(self.sortedlist) != len(array): if len(self.carry) == 1: self.sortedlist.append(carry) arrayt = leave self.globali = 1 self.orderi = 0 carry, leave = my.sort(arrayt) elif len(self.carry) == 0: if len(self.leave) != 0: arrayt = leave self.globali = 1 self.orderi += 1 my.sort(arrayt) else: self.arrayt globalii += 1 self.orderi = globalii self.globali = 0 my.sort(arrayt) self.orderi = 0 else: arrayt = carry carry = [] self.globali += 1 carry, leave += my.sort(arrayt) my = sorting_class() x = ['ac', 'bc' ,'ab', 'da'] my.srt(x)

    Read the article

  • Beginner - C# iteration through directory to produce a file list

    - by dassouki
    The end goal is to have some form of a data structure that stores a hierarchal structure of a directory to be stored in a txt file. I'm using the following code and so far, and I'm struggling with combining dirs, subdirs, and files. /// <summary> /// code based on http://msdn.microsoft.com/en-us/library/bb513869.aspx /// </summary> /// <param name="strFolder"></param> public static void TraverseTree ( string strFolder ) { // Data structure to hold names of subfolders to be // examined for files. Stack<string> dirs = new Stack<string>( 20 ); if ( !System.IO.Directory.Exists( strFolder ) ) { throw new ArgumentException(); } dirs.Push( strFolder ); while ( dirs.Count > 0 ) { string currentDir = dirs.Pop(); string[] subDirs; try { subDirs = System.IO.Directory.GetDirectories( currentDir ); } catch ( UnauthorizedAccessException e ) { MessageBox.Show( "Error: " + e.Message ); continue; } catch ( System.IO.DirectoryNotFoundException e ) { MessageBox.Show( "Error: " + e.Message ); continue; } string[] files = null; try { files = System.IO.Directory.GetFiles( currentDir ); } catch ( UnauthorizedAccessException e ) { MessageBox.Show( "Error: " + e.Message ); continue; } catch ( System.IO.DirectoryNotFoundException e ) { MessageBox.Show( "Error: " + e.Message ); continue; } // Perform the required action on each file here. // Modify this block to perform your required task. /* foreach ( string file in files ) { try { // Perform whatever action is required in your scenario. System.IO.FileInfo fi = new System.IO.FileInfo( file ); Console.WriteLine( "{0}: {1}, {2}", fi.Name, fi.Length, fi.CreationTime ); } catch ( System.IO.FileNotFoundException e ) { // If file was deleted by a separate application // or thread since the call to TraverseTree() // then just continue. MessageBox.Show( "Error: " + e.Message ); continue; } } */ // Push the subdirectories onto the stack for traversal. // This could also be done before handing the files. foreach ( string str in subDirs ) dirs.Push( str ); foreach ( string str in files ) MessageBox.Show( str ); }

    Read the article

  • c# beginner problem

    - by Yehonatan
    I am trying to learning C# and I have problem with following code using System; class IfSelect { public static void Main() { string myInput; int myInt; Console.Write("Please enter a number: "); myInput = Console.ReadLine(); myInt = Int32.Parse(myInput); if (myInt = 10) { Console.WriteLine("Your number is 10.", myInt); } } }

    Read the article

  • Beginner python - stuck in a loop

    - by Jeremy
    I have two begininer programs, both using the 'while' function, one works correctly, and the other gets me stuck in a loop. The first program is this; num=54 bob = True print('The guess a number Game!') while bob == True: guess = int(input('What is your guess? ')) if guess==num: print('wow! You\'re awesome!') print('but don\'t worry, you still suck') bob = False elif guess>num: print('try a lower number') else: print('close, but too low') print('game over')`` and it gives the predictable output of; The guess a number Game! What is your guess? 12 close, but too low What is your guess? 56 try a lower number What is your guess? 54 wow! You're awesome! but don't worry, you still suck game over However, I also have this program, which doesn't work; #define vars a = int(input('Please insert a number: ')) b = int(input('Please insert a second number: ')) #try a function def func_tim(a,b): bob = True while bob == True: if a == b: print('nice and equal') bob = False elif b > a: print('b is picking on a!') else: print('a is picking on b!') #call a function func_tim(a,b) Which outputs; Please insert a number: 12 Please insert a second number: 14 b is picking on a! b is picking on a! b is picking on a! ...(repeat in a loop).... Can someone please let me know why these programs are different? Thank you!

    Read the article

  • jQuery simplifying code (beginner)

    - by Jonny Wood
    I'm getting to grips with jQuery but find myself repeating code over and over again... Surely there's a simpler way to write this: $('#more-mcr, #more-hilton, #more-lpool').hide(); $('#mcr-hatters').hoverIntent(function() { $('#mcr-hilton').stop().animate({opacity: 0.4}); $('#more-mcr').fadeIn({duration:200}); }, function() { $('#mcr-hilton').stop().animate({opacity: 1}); $('#more-mcr').fadeOut({duration:200}); }); $('#mcr-hilton').hoverIntent(function() { $('#mcr-hatters').stop().animate({opacity: 0.4}); $('#more-hilton').fadeIn({duration:200}); }, function() { $('#mcr-hatters').stop().animate({opacity: 1}); $('#more-hilton').fadeOut({duration:200}); }); $('#lpool-hostel').hoverIntent(function() { $('#more-lpool').fadeIn({duration:200}); }, function() { $('#more-lpool').fadeOut({duration:200}); }); $('#offers-mcr').hoverIntent(function() { $('#offers-lpool').stop().animate({opacity: 0.4}); $('#offers-bham').stop().animate({opacity: 0.4}); }, function() { $('#offers-lpool').stop().animate({opacity: 1}); $('#offers-bham').stop().animate({opacity: 1}); }); $('#offers-lpool').hoverIntent(function() { $('#offers-mcr').stop().animate({opacity: 0.4}); $('#offers-bham').stop().animate({opacity: 0.4}); }, function() { $('#offers-mcr').stop().animate({opacity: 1}); $('#offers-bham').stop().animate({opacity: 1}); }); $('#offers-bham').hoverIntent(function() { $('#offers-lpool').stop().animate({opacity: 0.4}); $('#offers-mcr').stop().animate({opacity: 0.4}); }, function() { $('#offers-lpool').stop().animate({opacity: 1}); $('#offers-mcr').stop().animate({opacity: 1}); }); I'd also like to set the delay for hoverIntent but I don't think this is possible with the way I've written the code currently...?

    Read the article

  • Beginner SQL question: querying gold and silver tag badges in Stack Exchange Data Explorer

    - by polygenelubricants
    I'm using the Stack Exchange Data Explorer to learn SQL, but I think the fundamentals of the question is applicable to other databases. I'm trying to query the Badges table, which according to Stexdex (that's what I'm going to call it from now on) has the following schema: Badges Id UserId Name Date This works well for badges like [Epic] and [Legendary] which have unique names, but the silver and gold tag-specific badges seems to be mixed in together by having the same exact name. Here's an example query I wrote for [mysql] tag: SELECT UserId as [User Link], Date FROM Badges Where Name = 'mysql' Order By Date ASC The (slightly annotated) output is: as seen on stexdex: User Link Date --------------- ------------------- // all for silver except where noted Bill Karwin 2009-02-20 11:00:25 Quassnoi 2009-06-01 10:00:16 Greg 2009-10-22 10:00:25 Quassnoi 2009-10-31 10:00:24 // for gold Bill Karwin 2009-11-23 11:00:30 // for gold cletus 2010-01-01 11:00:23 OMG Ponies 2010-01-03 11:00:48 Pascal MARTIN 2010-02-17 11:00:29 Mark Byers 2010-04-07 10:00:35 Daniel Vassallo 2010-05-14 10:00:38 This is consistent with the current list of silver and gold earners at the moment of this writing, but to speak in more timeless terms, as of the end of May 2010 only 2 users have earned the gold [mysql] tag: Quassnoi and Bill Karwin, as evidenced in the above result by their names being the only ones that appear twice. So this is the way I understand it: The first time an Id appears (in chronological order) is for the silver badge The second time is for the gold Now, the above result mixes the silver and gold entries together. My questions are: Is this a typical design, or are there much friendlier schema/normalization/whatever you call it? In the current design, how would you query the silver and gold badges separately? GROUP BY Id and picking the min/max or first/second by the Date somehow? How can you write a query that lists all the silver badges first then all the gold badges next? Imagine also that the "real" query may be more complicated, i.e. not just listing by date. How would you write it so that it doesn't have too many repetition between the silver and gold subqueries? Is it perhaps more typical to do two totally separate queries instead? What is this idiom called? A row "partitioning" query to put them into "buckets" or something?

    Read the article

  • C++ Beginner - Trouble using classes inside of classes

    - by Francisco P.
    Hello, I am working on a college project, where I have to implement a simple Scrabble game. I have a player class (containing a Score and the player's hand, in the form of a std::string, and a score class (containing a name and numeric (int) score). One of Player's member-functions is Score getScore(), which returns a Score object for that player. However, I get the following error on compile time: player.h(27) : error C2146: syntax error : missing ';' before identifier 'getScore' player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(27) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(27) : warning C4183: 'getScore': missing return type; assumed to be a member function returning 'int' player.h(35) : error C2146: syntax error : missing ';' before identifier '_score' player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int player.h(35) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Here's lines 27 and 35, respectively: Score getScore(); //defined as public (...) Score _score; //defined as private I get that the compiler is having trouble recognizing Score as a valid type... But why? I have correctly included Score.h at the beginning of player.h: #include "Score.h" #include "Deck.h" #include <string> I have a default constructor for Score defined in Score.h: Score(); //score.h //score.cpp Score::Score() { _name = ""; _points = 0; } Any input would be appreciated! Thanks for your time, Francisco EDIT: As requested, score.h and player.h: http://pastebin.com/3JzXP36i http://pastebin.com/y7sGVZ4A

    Read the article

  • Beginner SQL question: arithmetic with multiple COUNT(*) results

    - by polygenelubricants
    Continuing with the spirit of using the Stack Exchange Data Explorer to learn SQL, (see: Can we become our own “Northwind” for teaching SQL / databases?), I've decided to try to write a query to answer a simple question (on meta): What % of stackoverflow users have over 10,000 rep?. Here's what I've done: Query#1 SELECT COUNT(*) FROM Users WHERE Users.Reputation >= 10000 Result: 556 Query#2 SELECT COUNT(*) FROM USERS Result: 227691 Now, how do I put them together into one query? What is this query idiom called? What do I need to write so I can get, say, a one-row three-column result like this: 556 227691 0,00244190592

    Read the article

  • Beginner's guide for rails

    - by piemesons
    Hello friends i need a book/ tutorials for rails without using scoffold. All the books mentioned in the other questions are creating some depot application or etc using scaffold and then explaining things. I believe in the thing that creating big depot is worthless when you are not getting anything. All of my frnds are suggesting me to go for this pragmatic book. look i understand the book is good but i m not getting the proper things. I got the logic cause i m good in php doctrine. asp.net c c++ so i m getting the things but i m not feeling confident. I want to have a another book. Can anybody suggest me some other books. I m saying this cause it really feels good when u create a simple form and insert the values in db and u can retreive those values and MOST IMP you can explain the whole logic of the that small form application instaed of that colorfull Depot application in which things are done with scaffold and u r not getting the thing and u are confused abt the real picture.

    Read the article

  • Android beginner

    - by Karthick
    Hi I am new android. I need to know how to install it in windows xp and which one is the best IDE and what are the requirements are needed. And I need to know how to develop an application in that platform.

    Read the article

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