Daily Archives

Articles indexed Friday October 5 2012

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

  • Intel 82576 Network card

    - by No1_Melman
    I have an Intel dual port pcie NIC card with two 82576 interfaces according to ubuntu 12.04. I run the command sudo lshw -html > /home/melman/Documents/hardware.html and it shows both of the interfaces but they're grayed out?! How can enable them? ifconfig output: bond0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet addr:192.168.100.2 Bcast:192.168.100.255 Mask:255.255.255.0 UP BROADCAST MASTER MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth0 Link encap:Ethernet HWaddr e0:69:95:d1:db:ff inet addr:192.168.10.63 Bcast:192.168.10.255 Mask:255.255.255.0 inet6 addr: fe80::e269:95ff:fed1:dbff/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2903 errors:0 dropped:0 overruns:0 frame:0 TX packets:2627 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1524738 (1.5 MB) TX bytes:430196 (430.1 KB) Interrupt:20 Memory:f7f00000-f7f20000 eth3 Link encap:Ethernet HWaddr 00:50:b6:50:a7:f9 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) eth4 Link encap:Ethernet HWaddr 00:1b:21:6e:99:77 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Memory:f7c00000-f7c20000 eth5 Link encap:Ethernet HWaddr 00:1b:21:6e:99:76 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Memory:f7c20000-f7c40000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:246 errors:0 dropped:0 overruns:0 frame:0 TX packets:246 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:17584 (17.5 KB) TX bytes:17584 (17.5 KB)

    Read the article

  • Error when trying to install Menulibre in Lubuntu 12.10 [closed]

    - by cipricus
    Possible Duplicate: How can I fix a 404 Error using a PPA? When trying to add a PPA (to install menulibre) I get these errors: Err http://ppa.launchpad.net quantal/main Sources 404 Not Found Err http://ppa.launchpad.net quantal/main i386 Packages 404 Not Found W: Failed to fetch http://ppa.launchpad.net/menulibre-dev/devel/ubuntu/dists/quantal/main/source/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/menulibre-dev/devel/ubuntu/dists/quantal/main/binary-i386/Packages 404 Not Found Why is that and how to solve it? As the question was flagged as duplicate: I should clarify that I want to know why i cannot add a source that seems active in launchpad, and how could i add it and install the program, not just how to remove the error by removing the source in the software sources list Menulibre seems available in software sources. Why can't I install it? I'm in Lubuntu 12.10

    Read the article

  • Windows 7 doesnt reboot as a dual boot

    - by user94628
    I've recently installed Ubuntu12.04 on my HP Pavillion desktop which came preloaded with Windows 7 (64bit). Since today when I try to boot WIn7 I get a screen firstly saying loading files then it goes to the next screen which tries but fails to fix errors. I've also tried system restore which has also failed. When I run boot repair it says it has been successful and to try and reboot. When I reboot I still get the same error. Please see this file: http://paste.ubuntu.com/1261148/ Please help

    Read the article

  • How to get Visual Studio 2012 working on Ubuntu 12.04.1?

    - by kamil
    I am trying to get visual studio working in Unity (via Wine) without using any virtual machine or other Desktop Environment alternatives. I am convinced Visual Studio is the ultimate IDE for .Net programming languages. I'm not necessarily for dual booting. I have been working more than 10 years on visual studio and I prefer it over other IDEs. I have tried other IDEs but they didn't work too well for me. Does anyone know a way to get this working natively?

    Read the article

  • How to automatically resize the Dash when screen dimensions change?

    - by St.W.
    I use a convertible thinkpad (x201t) and magick-rotation to rotate the screen by 90 degrees in tablet mode. Therefore after rotation the screen's width is only 800 points (the ordinary resolution is 1200x800). The Dash does not adapt to this new state and therefore if I click on it, it is oversized and I cannot reach the applications/files/buttons on its side. Is there a way to tell the Dash that it should only ever use a width of 800 pixels, or any other solution to automatically adapt its size when rotating?

    Read the article

  • Can't get Minecraft to run on Ubuntu

    - by Dennis
    I have installed JDK and JRE from this tutorial and have tried many methods of starting it up, yet my results are always the same. If any one could please help me I would be very grateful. Exception in thread "Thread-3" java.lang.UnsatisfiedLinkError: /home/dennis/.minecraft/bin/natives/liblwjgl.so: /home/dennis/.minecraft/bin/natives/liblwjgl.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch) at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary1(Unknown Source) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.load0(Unknown Source) at java.lang.System.load(Unknown Source) at org.lwjgl.Sys$1.run(Sys.java:69) at java.security.AccessController.doPrivileged(Native Method) at org.lwjgl.Sys.doLoadLibrary(Sys.java:65) at org.lwjgl.Sys.loadLibrary(Sys.java:81) at org.lwjgl.Sys.<clinit>(Sys.java:98) at net.minecraft.client.Minecraft.F(SourceFile:1853) at aoe.<init>(SourceFile:20) at net.minecraft.client.Minecraft.<init>(SourceFile:77) at anv.<init>(SourceFile:36) at net.minecraft.client.MinecraftApplet.init(SourceFile:36) at net.minecraft.Launcher.replace(Launcher.java:136) at net.minecraft.Launcher$1.run(Launcher.java:79)

    Read the article

  • Alternative to Firefox's Tab Groups feature for Chromium/Chrome

    - by Halkinn
    Firefox keeps crashing the whole time on my Lubuntu 12.04 since version 12, I don't know why, I am running it on a Pentium IV desktop so might be CPU shortage, however I use the same set of extensions and configurations that I have on Windows' Firefox and it rarely crashes, runs smoothly and besides on Windows it can handle much more tabs opened before some freeze actually happens. Chromium is working better so far on Lubuntu, but I really do miss the Tab Groups Firefox feature, which is great to group tabs and organize them, it really is a boost on my productivity. Are you aware of any add-on which is similar for Chrome/Chromium? I've searched around on Chrome's Web Store but no luck at the moment.

    Read the article

  • Problem to install Apache 2.4.2 in Ubuntu 12.04

    - by Michael
    I followed these steps to install Apache 2.4.2 in Ubuntu 12.04, but it seems Apache is not installed, here's what I did (I followed the steps in this site http://www.discusswire.com/apache-2-4-installation-ubuntu/): sudo apt-get install build-essential sudo apt-get build-dep apache2 wget http://apache.mirrors.pair.com/httpd/httpd-2.4.2.tar.gz tar -xzvf httpd-2.4.2.tar.gz && cd httpd-2.4.2 sudo ./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http --with-mpm=prefork sudo make sudo make install when I tried to start by issuing sudo /usr/local/apache2/bin/apachectl start at terminal, I got the following warning: "AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message" and when I typed top at terminal, the apache is not there. I also tried to go to http://localhost/ or 127.0.0.1 or even 127.0.1.1 it showed "Can't establish connection to server ..." message. ps: I checked the error log and it showed "[Fri Jul 27 15:49:00.703901 2012] [proxy_balancer:emerg] [pid 20781] AH01177: Failed to lookup provider 'shm' for 'slotmem': is mod_slotmem_shm loaded?? [Fri Jul 27 15:49:00.704083 2012] [:emerg] [pid 20781] AH00020: Configuration Failed, exiting" What I'm missing? Thanks Michael

    Read the article

  • How to execute a scipt just by double clicking like .EXE files in Windows?

    - by maythux
    How can I make a bash script executable by double clicking just like .exe files in Windows? I tried creating a launcher and assigning the script to it, but there are two consequences: the terminal twinkles, disappears, and nothing is done. you must specify to run in terminal in order to work. I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu. Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how?

    Read the article

  • Password protected website

    - by danie7L T
    I need to add a user authentication page before the actual homepage of the website. In Joomla! I just set the website offline and the offline page loads in place of the homepage but then it's automatically throwing a "503 Service Temporarily Unavailable" error which I would like to avoid. That's why I would like to know the other ways to load an authentication page before the homepage. NB: I'm using Apache servers if that's relevant Thank you

    Read the article

  • Ideal web application framework for newcomers and whether it is better to use Java or PHP based framework?

    - by Pawan
    My primary question is whether a Java based web application framework is better or a PHP based one and why? Moreover, if I were just starting web development then what would be some ideal frameworks to start with, considering I may want to make a full CMS out of it later? I am not looking for a 'best', rather some good recommendations as I understand that CodeIgnitor has not got a long way to go from here : http://heybigname.com/2012/05/06/why-codeigniter-is-dead/

    Read the article

  • How do I find information on who links to my sites?

    - by bobdobbs
    I'm trying to figure out if there's a free way to get information on backlinks to my site. I've had webmaster tools and google analytics set up for years. But I can't find access to data about site backlinks in either toolset. Webmaster tools, under 'traffic'-'links to your site' gives me the same message for all of my sites: "No data available". I haven't been able to find anything in GA that gives any information on backlinks. I've heard of using "links:" as an operator in google search, but for each of my sites, this returns either zero or very few results in cases when I know I have many backlinks. Most of the links simple aren't shown. My thinking is that google maintains a graph of who links to my site, so I figured that they might let me see it. But I can't figure out how. I've found this tool on a spammy website: http://www.backlinkwatch.com. It offers more data than google on my backlines, and offers more results in exchange for a paid subscription. The data it offers for free looks good, but the results are limited and the site has popups and obnoxious ads. So, in short: how do I get data on who links to me? Is there a free way?

    Read the article

  • Drawing application on OpenGL for iOS (iPad)

    - by Alesia
    Some help is needed. I'm developing drawing application on OpenGL (deployment target 4.0) for iOS (iPad). We have 3 drawing tools: pen, marker (with alfa) and eraser. I draw with textures, using blending in orthographic projection. I can't use z-ordering because in this case I have to face a lot of troubles with cutting and erasing. The thing that I need is to make the pen be always on the top. When I first use marker and than pen - it's ok. But if I use pen first and marker over the pen - I can't see pen color under marker. I'd appreciate any help or advice. Thank you veeeeeery much!

    Read the article

  • Why do I get a blinking screen when running lwjgl?

    - by SystemNetworks
    I didn't have any errors. But When I run my lwjgl game, it gives me a blinking screen. Here is the code: package L1F3; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.LWJGLException; import static org.lwjgl.opengl.GL11.*; public class Main { public static void main(String[] args) { try { Display.setDisplayMode(new DisplayMode(640, 480)); Display.setTitle("A fresh display!"); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); Display.destroy(); System.exit(1); } while(!Display.isCloseRequested()) { Display.update(); } Display.destroy(); System.exit(0); } } How do I stop the blinking screen? I was thinking its my framerate. I deleted Display.sync but it still gives me all white and black. Last time it didn't give me a blinking screen. EDIT When I remove Display.update() , it gives me a perfect screen, no blinking or no white. Will my game work without it? I can also close it perfectly.

    Read the article

  • How do I make time?

    - by SystemNetworks
    I wanted to output a text for a certain amount of time. One way is to use threads. Are there any other ways? I can't use threads for slick2d. This is my code when I use threads for slick: package javagame; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Image; import java.util.Random; import org.newdawn.slick.Input; import org.newdawn.slick.*; import org.newdawn.slick.state.*; import org.lwjgl.input.Mouse; public class thread1 implements Runnable { String showUp; int timeLeft; public thread1(String s) { s = showUp; } public void run(Graphics g) { try { g.drawString("%s is sleeping %d", 500, 500); Thread.sleep(timeLeft); g.drawString("%s is awake", 600,600); } catch(Exception e) { } } @Override public void run() { // TODO Auto-generated method stub run(); } } It auto generates a new run() And also when I call it to my main class it has stack overflow!

    Read the article

  • Trouble with AABB collision response and physics

    - by WCM
    I have been racking my brain trying to figure out a problem I am having with physics and basic AABB collision response. I am fairly close as the physics are mostly right. Gravity feels good and movement is solid. The issue I am running into is that when I land on the test block in my project, I can jump off of it most of the time. If I repeatedly jump in place, I will eventually get stuck one or two pixels below the surface of the test block. If I try to jump, I can become free of the other block, but it will happen again a few jumps later. I feel like I am missing something really obvious with this. I have two functions that support the detection and function to return a vector for the overlap of the two rectangle bounding boxes. I have a single update method that is processing the physics and collision for the entity. I feel like I am missing something very simple, like an ordering of the physics vs. collision response handling. Any thoughts or help can be appreciated. I apologize for the format of the code, tis prototype code mostly. The collision detection function: public static bool Collides(Rectangle source, Rectangle target) { if (source.Right < target.Left || source.Bottom < target.Top || source.Left > target.Right || source.Top > target.Bottom) { return false; } return true; } The overlap function: public static Vector2 GetMinimumTranslation(Rectangle source, Rectangle target) { Vector2 mtd = new Vector2(); Vector2 amin = source.Min(); Vector2 amax = source.Max(); Vector2 bmin = target.Min(); Vector2 bmax = target.Max(); float left = (bmin.X - amax.X); float right = (bmax.X - amin.X); float top = (bmin.Y - amax.Y); float bottom = (bmax.Y - amin.Y); if (left > 0 || right < 0) return Vector2.Zero; if (top > 0 || bottom < 0) return Vector2.Zero; if (Math.Abs(left) < right) mtd.X = left; else mtd.X = right; if (Math.Abs(top) < bottom) mtd.Y = top; else mtd.Y = bottom; // 0 the axis with the largest mtd value. if (Math.Abs(mtd.X) < Math.Abs(mtd.Y)) mtd.Y = 0; else mtd.X = 0; return mtd; } The update routine (gravity = 0.001f, jumpHeight = 0.35f, moveAmount = 0.15f): public void Update(GameTime gameTime) { Acceleration.Y = gravity; Position += new Vector2((float)(movement * moveAmount * gameTime.ElapsedGameTime.TotalMilliseconds), (float)(Velocity.Y * gameTime.ElapsedGameTime.TotalMilliseconds)); Velocity.Y += Acceleration.Y; Vector2 previousPosition = new Vector2((int)Position.X, (int)Position.Y); KeyboardState keyboard = Keyboard.GetState(); movement = 0; if (keyboard.IsKeyDown(Keys.Left)) { movement -= 1; } if (keyboard.IsKeyDown(Keys.Right)) { movement += 1; } if (Position.Y + 16 > GameClass.Instance.GraphicsDevice.Viewport.Height) { Velocity.Y = 0; Position = new Vector2(Position.X, GameClass.Instance.GraphicsDevice.Viewport.Height - 16); IsOnSurface = true; } if (Collision.Collides(BoundingBox, GameClass.Instance.block.BoundingBox)) { Vector2 mtd = Collision.GetMinimumTranslation(BoundingBox, GameClass.Instance.block.BoundingBox); Position += mtd; Velocity.Y = 0; IsOnSurface = true; } if (keyboard.IsKeyDown(Keys.Space) && !previousKeyboard.IsKeyDown(Keys.Space)) { if (IsOnSurface) { Velocity.Y = -jumpHeight; IsOnSurface = false; } } previousKeyboard = keyboard; } This is also a full download to the project. https://www.box.com/s/3rkdtbso3xgfgc2asawy P.S. I know that I could do this with the XNA Platformer Starter Kit algo, but it has some deep flaws that I am going to try to live without. I'd rather go the route of collision response via an overlay function. Thanks for any and all insight!

    Read the article

  • Poco library for c++, declare namespace for custom element

    - by Mikhail
    I want to create an XML document by building a DOM document from scratch, with syntax like: AutoPtr<Document> doc = new Document; AutoPtr<Element> root = doc->createElement("root"); doc->appendChild(root); AutoPtr<Element> element1 = doc->createElementNS("http://ns1", "ns1:element1"); root->appendChild(element1); AutoPtr<Element> element2 = doc->createElementNS("http://ns1", "ns1:element2"); root->appendChild(element2); DOMWriter writer; writer.setNewLine("\n"); writer.setOptions(XMLWriter::PRETTY_PRINT); writer.writeNode(std::cout, doc); But, when I write it, I get next result: <root> <ns1:element1 xmlns:ns1="http://ns1"/> <ns1:element2 xmlns:ns1="http://ns1"/> </root> So namespace ns1 declared two times, and I want to declare it inside "root" element. Is there way to get next representation: <root xmlns:ns1="http://ns1"/> <ns1:element1/> <ns1:element2/> </root>

    Read the article

  • Embedding Youtube Videos on user's wall with the Javascript API

    - by dragonmantank
    I'm attempting to embed a Youtube video on a user's wall using the Javascript API. I've poured over a bunch of different tutorials and came up with this: var data = { method: 'feed', link: current_video_url, // Link to the vide on our site source: current_video_src, // Link to the Youtube video, http://youtube.com/v/[hash] picture: current_picture_url, // Thumbnail from youtube title: current_video_title, // Title from our page caption: current_video_description // Text from our page } FB.ui(data); Running the Facebook Debugger shows that the current_video_url link is being properly parsed for OG tags and is available as an embedded video. I ran a debugger and all the variables are being properly set in the data variable. This worked fine for about 2 days, and then we pushed the site live. We set up a new AppID in Facebook but now all the videos are just thumbnails instead of being embedded in the user's wall. I thought maybe this is a problem with the live site but now the dev site is broken too. What's the best way to get this to work consistently?

    Read the article

  • Jquery .$.ajax is not working

    - by Saravanan I M
    I am using $.ajax for facebook invite and calling the url (Yii framework controller). The below code is not working. $.ajax is not working. function FacebookInviteFriends() { FB.ui ( { method : 'apprequests', data: '', display: 'dialog', title : 'Invite a Friend', message: 'I just sent you an invitation to play My Game.', filters: ['app_non_users'] }, function(response) { alert("start"); if (response && response.to) { alert("inside if"); $.ajax({ url: 'http://localhost:83/invitechips/createRecord', type: 'POST', data: {id : response.to} }).done(function() { alert( "Data Saved: "); }); } else { alert("inside else"); } } ); }

    Read the article

  • How to disambiguate subdirs with the same name in the Projects list?

    - by jlstrecker
    My Qt project has 2 subdirs/subprojects with the same name. Their directories are myproject/node and myproject/compiler/test/node. The problem (or annoyance) is that, in the Projects list in Qt, both subdirs are listed as "node". So you have to open them up to figure out which is which. myproject.pro is like this: TEMPLATE = subdirs QMAKE_CLEAN = Makefile SUBDIRS += \ compiler_test_node \ node \ ... compiler_test_node.subdir = compiler/test/node node.depends = compiler_vuo_compile ... Without renaming the myproject/compiler/test/node directory, is there a way to make it show up with a different name in the Projects list?

    Read the article

  • Turning A Stacked List into workable data

    - by BoSox
    In Excel I have a list of names that in the cell appear stacked, and I want each name in its own column. I was thinking Python may be a good way to do this? Example: Joe Smith John Hawk Mike Green Lauren Smith One cell will look exactly like that, with each name on its line within the cell but all of the names contained in the cell. I have 50 cells each with 1-20 stacked names and I want to put each name in its own cell on a given row. So, in my example all of those names would occupy the same row but each would have their own column. Any ideas?

    Read the article

  • My partial is not where rails expects it to be (nested partials)

    - by new2ruby
    I have a model Submissions which has many Performers. I have a partial for showing an individual submissions (app/views/submissions/_submission.html.erb): <div> Show stuff relating to @submission ... <%= render @performers %> </div> and a partial for showing performers (app/views/performers/_performer.html.erb): <%= div_for performer do %> <%= performer.name %> <% end %> This works fine from (app/views/submissions/show.html.erb): <%= render @submission %> But I want to use this from a different namespace too (app/views/curator/submissions/show.html.erb). But I get this error: Missing partial curator/submissions/submission with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/ircmullaney/RubyCode/cif/app/views" * "/Users/ircmullaney/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/devise-2.1.2/app/views" I can fix this by changing the render to this: <%= render 'submissions/submission' %> But, then the nested partial fails: Missing partial curator/performers/performer with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "/Users/ircmullaney/RubyCode/cif/app/views" * "/Users/ircmullaney/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/devise-2.1.2/app/views" This doesn't work: <%= render 'performers/performer' %> because of the div_for: undefined method `model_name' for NilClass:Class Any ideas how I should do this?

    Read the article

  • crunching multiple js files during development

    - by Yaron Naveh
    I'm writing a backbone.js app. I have multiple js, css and html template files. I also have a script to crunch them into a single file so it is faster to download. How should I work during development: Add a listener to the file system and after every change compile the files so I can see it in a browser. This implies a 1-2 seconds overhead before I can see what I did, which is annoying for html fine-tuning. Somehow browse using the multiple files during development and only crunch before going to production. This means I need to have a separate index.html for dev and prod. What's your take?

    Read the article

  • How to call a Thor task multiple times?

    - by deepak
    Thor like Rake (and Make) has task management. If I call a task multiple times, it will effectively call the task only once. How can I call a task multiple times? I tried modifying the @_invocations hash, but that did not work: require 'csv' require './config/environment' class MisReport < Thor desc "all", "generate mysql and postgres mis" def all generate("pg_mis_report", "pg") generate("mysql_mis_report", "mysql") end desc "generate", "generate mis report" def generate(file_name = "mis_report_#{Time.now.to_s(:number)}", connection = "postgres") if connection == "pg" puts "== postgres database" ActiveRecord::Base.establish_connection :development_mysql else puts "== mysql database" ActiveRecord::Base.establish_connection :development end # generate MIS puts puts "mis file is at: #{file_path}" end end

    Read the article

  • PHP Fizzbuzz Challenge

    - by Pez Cuckow
    Someone at work as poised the challenge to create a script that prints the FizzBuzz game in as few likes as possible using PHP The challenge Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. My attempt: foreach(range(1,100) as $i) { $val = ($i % 3 == 0 ? "Fizz" : "").($i % 5 == 0 ? "Buzz" : ""); echo (empty($val) ? $i : $val) . '<br />'; } Someone's Pythons attempt [ ("Fizz" if not i % 3 else "") + ("Buzz" if not i % 5 else "") + ("Baz" if not i % 7 else "") if _ else "" for i in range(0, 100) ] Can you see how to make this better/improve it? Or even do it better? Thanks for your time

    Read the article

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