Monthly Archives

Articles indexed in December 2012

Page 11/287 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Run fstrim from LiveCD

    - by CharlesW
    A few years ago I installed Ubuntu 10.04 with LVM + LUKS on a system with SSD, TRIM was not enabled. Now I want to install Ubuntu 12.04 on the same SSD. I have found a guide explaining how to enable TRIM on Ubuntu 12.04 with LVM + LUKS, but before installing the new system, I want to clean out all the "marked for deletion" data generated under Ubuntu 10.04, to make the disk fast as new. My plan is to boot a Ubuntu 12.04 LiveCD and create a new ext4 filesystem on the SSD, then mount the filesystem and run fstrim on it. After rebooting the LiveCD I will install the system as normal, and enable TRIM. Can anybody say if this will work?

    Read the article

  • Ubuntu 12.10 blender problem

    - by SamueLL
    please I have a problem i want to install older version of blender becouse i don't fell very well in new UI. I downloaded blender-2.46-linux-glibc236-py25-x86_64 from official site and i had some problems like missing python-2.5 library but i fixed them and now i have problem that i can solve... Compiled with Python version 2.7.3. Warning: could not set Blender.sys.progname Can you help me with this please?

    Read the article

  • Unable to show correctly symbolic icons with appindicator

    - by user1502508
    I'm creating an app under Ubuntu 12.04 and using libappindicator and Vala. I want to use a symbolic icon, to ensure that the colors are adapted to the background in the status bar. Unfortunately, I'm unable to make it work. I installed my icons (which uses the BEBEBE key color) and they are shown, but the color is BEBEBE, not white or black like the other icons. I also tried to put an icon that I was sure to be symbolic (audio-volume-high-symbolic) but, again, it's shown with the original colors, instead of them being replaced by the current FG color. I used both set_icon and set_icon_full methods, but none of them worked :(

    Read the article

  • How to allow remote connections to Flask?

    - by Ilya Smagin
    Inside the system, running on virtual machine, I can access the running server at 127.0.0.1:5000. Although the 'remote' address of the vm is 192.168.56.101 (ping and ssh work fine), I cannot access the server with 192.168.50.101:5000 neither from the virtual machine nor from the local one. I guess there's something preventing remote connections. Here's /etc/network/interfaces: auto eth1 iface eth1 inet static address 192.168.56.101 netmask 255.255.255.0 ufw is inactive. How do I fix this problem?

    Read the article

  • Cryptswap not mounted?

    - by woody
    I believe i have my swap set up but am not sure because on start up it says that it is something along the lines of "could not mount /dev/mapper/cryptswap1 M for manual S for skip". But it appears to be mounted. When i run free -m the output is: total used free shared buffers cached Mem: 3887 769 3117 0 54 348 -/+ buffers/cache: 366 3520 Swap: 4026 0 4026 and sudo bklid is: /dev/sda1: UUID="9fb3ccd6-3732-4989-bfa4-e943a09f1153" TYPE="ext4" /dev/mapper/cryptswap1: UUID="bd9fe154-8621-48b3-95d2-ae5c91f373fd" TYPE="swap" and cat /etc/crypttab is: cryptswap1 /dev/sda5 /dev/urandom swap,cipher=aes-cbc-essiv:sha256 my /etc/fstab is: # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=9fb3ccd6-3732-4989-bfa4-e943a09f1153 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation #UUID=bb0e378e-8742-435a-beda-ae7788a7c1b0 none swap sw 0 0 /dev/mapper/cryptswap1 none swap sw 0 0 The file /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla already exists and its contents are: [Re-enable hibernate by default] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes Is my swap not setup correctly or is it not mounting?

    Read the article

  • HP Pavilion tx2000 - Wifi adapter no longer works after moving from 12.04 to a 12.10 clean install

    - by Marek L.
    I have a HP Pavilion tx2000 that I have been running Ubuntu 12.04 on for a couple of months without any problems (wifi worked great) until yesterday when my hard drive failed. I replaced the hard drive and decided to install Ubuntu 12.10. Unlike 12.04, the wifi did not work after the installation finished and all the updates where installed (over Ethernet). The network drop down in the top right didn't even show a wireless option. I Googled about for a bit and found some solutions that seemed like they might work. Unfortunately they did not. Here is what I tried: sudo apt-get remove bcmwl-kernel-source sudo apt-get install b43-fwcutter sudo apt-get install firmware-b43-lpphy-installer Restart the computer. And the wifi still didn't work. At which point I panicked a bit and tried to undo the previous commands by running: sudo apt-get remove b43-fwcutter firmware-b43-lpphy-installer sudo apt-get install bcmwl-kernel-source Restart the computer. The wifi still doesn't work. This is where I stopped because I have no idea what I am doing and don't want to mess something up. The network drop down still doesn't show a wireless option and the hardware wifi switch on the laptop is amber (it turns blue when the wifi is on). Using the hardware switch does not change the color. Output from: sudo lspci ... 08:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01) ... Output from: sudo lshw -class network *-network UNCLAIMED description: Network controller product: BCM4322 802.11a/b/g/n Wireless LAN Controller vendor: Broadcom Corporation physical id: 0 bus info: pci@0000:08:00.0 version: 01 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list configuration: latency=0 resources: memory:d1100000-d1103fff ... Output from: sudo rfkill list all 0: hp-wifi: Wireless LAN Soft blocked: no Hard blocked: yes UPDATE: After writing up this question tried the following command: sudo rfkill unblock all At first it didn't do anything but after running it about four times, sudo rfkill list all now returns: 0: hp-wifi: Wireless LAN Soft blocked: no Hard blocked: no But the network menu still does not have a wireless option and the hardware switch still glows amber. Pushing the hardware switch turns the hard block back on and I have to run sudo rfkill unblock all multiple times again to turn it off. Any help is appreciated! Update 2: Full output from sudo lspci -nn: 00:00.0 Host bridge [0600]: Advanced Micro Devices [AMD] RS780 Host Bridge [1022:9600] 00:01.0 PCI bridge [0604]: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (int gfx) [1022:9602] 00:04.0 PCI bridge [0604]: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 0) [1022:9604] 00:05.0 PCI bridge [0604]: Advanced Micro Devices [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 1) [1022:9605] 00:06.0 PCI bridge [0604]: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 2) [1022:9606] 00:11.0 SATA controller [0106]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] [1002:4391] 00:12.0 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397] 00:12.1 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 Controller [1002:4398] 00:12.2 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396] 00:13.0 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI0 Controller [1002:4397] 00:13.1 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0 USB OHCI1 Controller [1002:4398] 00:13.2 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB EHCI Controller [1002:4396] 00:14.0 SMBus [0c05]: Advanced Micro Devices [AMD] nee ATI SBx00 SMBus Controller [1002:4385] (rev 3a) 00:14.1 IDE interface [0101]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 IDE Controller [1002:439c] 00:14.2 Audio device [0403]: Advanced Micro Devices [AMD] nee ATI SBx00 Azalia (Intel HDA) [1002:4383] 00:14.3 ISA bridge [0601]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 LPC host controller [1002:439d] 00:14.4 PCI bridge [0604]: Advanced Micro Devices [AMD] nee ATI SBx00 PCI to PCI Bridge [1002:4384] 00:14.5 USB controller [0c03]: Advanced Micro Devices [AMD] nee ATI SB7x0/SB8x0/SB9x0 USB OHCI2 Controller [1002:4399] 00:18.0 Host bridge [0600]: Advanced Micro Devices [AMD] Family 11h Processor HyperTransport Configuration [1022:1300] (rev 40) 00:18.1 Host bridge [0600]: Advanced Micro Devices [AMD] Family 11h Processor Address Map [1022:1301] 00:18.2 Host bridge [0600]: Advanced Micro Devices [AMD] Family 11h Processor DRAM Controller [1022:1302] 00:18.3 Host bridge [0600]: Advanced Micro Devices [AMD] Family 11h Processor Miscellaneous Control [1022:1303] 00:18.4 Host bridge [0600]: Advanced Micro Devices [AMD] Family 11h Processor Link Control [1022:1304] 01:05.0 VGA compatible controller [0300]: Advanced Micro Devices [AMD] nee ATI RS780M/RS780MN [Mobility Radeon HD 3200 Graphics] [1002:9612] 08:00.0 Network controller [0280]: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b] (rev 01) 09:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 02)

    Read the article

  • How to automatically restart Tomcat7 on system reboots?

    - by coding crow
    I have installed Tomcat 7 on Ubuntu 12.04 LTS which run on an Amzon EC2 instance. Now I wish tomcat should restart automatically on system reboot. I read this blog which suggest adding below script to /etc/init.d/tomcat7 # Tomcat auto-start # # description: Auto-starts tomcat # processname: tomcat # pidfile: /var/run/tomcat.pid case $1 in start) sh /usr/share/tomcat7/bin/startup.sh ;; stop) sh /usr/share/tomcat7/bin/shutdown.sh ;; restart) sh /usr/share/tomcat7/bin/shutdown.sh sh /usr/share/tomcat7/bin/startup.sh ;; esac exit 0 and issue the following commands sudo chmod 755 /etc/init.d/tomcat7 sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat sudo /etc/init.d/tomcat7 restart My Questions The tomcat7 already has script in it, where do we have to paste the suggested script? Is the suggested procedure correct?

    Read the article

  • Ubuntu 12.04 - Wakes from Suspend by itself

    - by Peter
    This problem has only just started and I don't know what has changed to cause it. I suspend my ubuntu 12.04 PC and it used to stay asleep until I hit the enter key to wake it up but for the last week or so it's been waking itself up. I've checked the BIOS settings and all the Wake on Lan settings are Disabled. I've used the ethtool command and the wake on lan is set to "d" which I've read been off. Can anyone suggest anything?

    Read the article

  • Can't install any update or software from Software Center

    - by geoh
    I tried to install updates and it's saying to get partial upgrade When trying Partial Upgrade doesn't working again. And when trying to install any software it doesn't installing. Can someone help me? EDIT the sudo apt-get update output is E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

    Read the article

  • How to restart WiFi interface without rebooting (it drops connection)?

    - by Dima
    I boot into ubuntu and it connects to the Wifi network fine. After about 10-15min the DNS stop resolving any website and a couple of minutes later network-managers tells me that I'm disconnected and tries to reconnect constantly to my router and fails to do it. Upon Ubuntu restart everything works fine for the first 10-15min again. When I boot into Mac OS X everything is fine with the same connection! How do I restart wifi interface? sudo ifdow wlan0 just tells me that wlan0 is not configured and wlan0 doesn't appear in /etc/network/interfaces either, which I find strange.... (unless network-manager is doing it behind my back).

    Read the article

  • the limit of pageviews per month in Google Analytics

    - by crmpicco
    I have been looking around to try and find some confirmation and clarity on the limit of pageviews that Google allow per month for a Google Analytics account. I have read that the limit of hits per month is 10,000,000, and the limit of pageviews is 5,000,000. Putting 2 and 2 together I am thinking this is to allow the other 5,000,000 for events and social clicks and the like? Google's documentation states 5m, but the hits/pageviews is a bit of a grey area as i've read suggestions that the limit can be considered as 10m

    Read the article

  • add collision detection to sprite?

    - by xBroak
    bassically im trying to add collision detection to the sprite below, using the following: self.rect = bounds_rect collide = pygame.sprite.spritecollide(self, wall_list, False) if collide: # yes print("collide") However it seems that when the collide is triggered it continuously prints 'collide' over and over when instead i want them to simply not be able to walk through the object, any help? def update(self, time_passed): """ Update the creep. time_passed: The time passed (in ms) since the previous update. """ if self.state == Creep.ALIVE: # Maybe it's time to change the direction ? # self._change_direction(time_passed) # Make the creep point in the correct direction. # Since our direction vector is in screen coordinates # (i.e. right bottom is 1, 1), and rotate() rotates # counter-clockwise, the angle must be inverted to # work correctly. # self.image = pygame.transform.rotate( self.base_image, -self.direction.angle) # Compute and apply the displacement to the position # vector. The displacement is a vector, having the angle # of self.direction (which is normalized to not affect # the magnitude of the displacement) # displacement = vec2d( self.direction.x * self.speed * time_passed, self.direction.y * self.speed * time_passed) self.pos += displacement # When the image is rotated, its size is changed. # We must take the size into account for detecting # collisions with the walls. # self.image_w, self.image_h = self.image.get_size() global bounds_rect bounds_rect = self.field.inflate( -self.image_w, -self.image_h) if self.pos.x < bounds_rect.left: self.pos.x = bounds_rect.left self.direction.x *= -1 elif self.pos.x > bounds_rect.right: self.pos.x = bounds_rect.right self.direction.x *= -1 elif self.pos.y < bounds_rect.top: self.pos.y = bounds_rect.top self.direction.y *= -1 elif self.pos.y > bounds_rect.bottom: self.pos.y = bounds_rect.bottom self.direction.y *= -1 self.rect = bounds_rect collide = pygame.sprite.spritecollide(self, wall_list, False) if collide: # yes print("collide") elif self.state == Creep.EXPLODING: if self.explode_animation.active: self.explode_animation.update(time_passed) else: self.state = Creep.DEAD self.kill() elif self.state == Creep.DEAD: pass #------------------ PRIVATE PARTS ------------------# # States the creep can be in. # # ALIVE: The creep is roaming around the screen # EXPLODING: # The creep is now exploding, just a moment before dying. # DEAD: The creep is dead and inactive # (ALIVE, EXPLODING, DEAD) = range(3) _counter = 0 def _change_direction(self, time_passed): """ Turn by 45 degrees in a random direction once per 0.4 to 0.5 seconds. """ self._counter += time_passed if self._counter > randint(400, 500): self.direction.rotate(45 * randint(-1, 1)) self._counter = 0 def _point_is_inside(self, point): """ Is the point (given as a vec2d) inside our creep's body? """ img_point = point - vec2d( int(self.pos.x - self.image_w / 2), int(self.pos.y - self.image_h / 2)) try: pix = self.image.get_at(img_point) return pix[3] > 0 except IndexError: return False def _decrease_health(self, n): """ Decrease my health by n (or to 0, if it's currently less than n) """ self.health = max(0, self.health - n) if self.health == 0: self._explode() def _explode(self): """ Starts the explosion animation that ends the Creep's life. """ self.state = Creep.EXPLODING pos = ( self.pos.x - self.explosion_images[0].get_width() / 2, self.pos.y - self.explosion_images[0].get_height() / 2) self.explode_animation = SimpleAnimation( self.screen, pos, self.explosion_images, 100, 300) global remainingCreeps remainingCreeps-=1 if remainingCreeps == 0: print("all dead")

    Read the article

  • What is the purpose of the canonical view volume?

    - by breadjesus
    I'm currently learning OpenGL and haven't been able to find an answer to this question. After the projection matrix is applied to the view space, the view space is "normalized" so that all the points lie within the range [-1, 1]. This is generally referred to as the "canonical view volume" or "normalized device coordinates". While I've found plenty of resources telling me about how this happens, I haven't seen anything about why it happens. What is the purpose of this step?

    Read the article

  • What's the RegEx to make sure that delimiters are escaped?

    - by Kuyenda
    I'm looking for a regular expression that will check whether or not delimiters in a string are escaped with a backward slash. The delimiters I am concerned about are comma (\,), colon (\:), semicolon (\;) and of course the backward slash itself has to be escaped (\). For example, the string "test" should return a match because there are no delimiters in it, and no escaping is necessary. The string "te\;st" would return a match because the semicolon delimiter is escaped. "te;st" and "t\;s:t" would both fail because the both contain at least one delimiter that is not escaped. I know that I need a conditional and a positive look behind, and this is what I have so far, but it is not giving me the expected answer. ^(?<delimiter>[:;,\\])?(?(delimiter)\(?<=(?:\\\\)*\\)k<delimiter>|.)$ Any suggestions on how I can make this work? Thanks.

    Read the article

  • Python recursion , Sierpinski triangle with color at each depth

    - by ???? ???
    import turtle w=turtle.Screen() def Tri(t, order, size): if order==0: t.forward(size) t.left(120) t.forward(size) t.left(120) t.forward(size) t.left(120) else: t.pencolor('red') Tri(t, order-1, size/2, color-1) t.fd(size/2) t.pencolor('blue') Tri(t, order-1, size/2, color-1) t.fd(size/2) t.lt(120) t.fd(size) t.lt(120) t.fd(size/2) t.lt(120) t.pencolor('green') Tri(t, order-1, size/2,color-1) t.rt(120) t.fd(size/2) t.lt(120) can anyone help with this problem ? i want to a sierpinski triangle that have color at specific depth like this http://openbookproject.net/thinkcs/python/english3e/_images/sierpinski_color.png i dont know how to make the the triangle color change at specific depth

    Read the article

  • Setting background image in asp.net (Master page)

    - by JRC
    I'm new in asp.net. And I am having trouble setting my background image. Here's the master page source: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Master.master.cs" Inherits="Master"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link rel="stylesheet" type="text/css" href="scripts/style.css"/> <title>Tracker</title> <asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <div class="container"> <a href="#"><img src="images/cross-header.gif" alt="Insert Logo Here" width="100%" id="Insert_logo" style="background: #C6D580; display:block;" /></a> <div class="sidebar1"> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">LINK</a></li> <li><a href="#">LINK</a></li> <li><a href="#"><span style="font-weight:italic">LINK</span></a></li> <li><a href="#"><span style="font-weight:italic">LINK</span></a></li> </ul> </nav> <p>SOME LABEL</p> <p>SOME QUOTE HERE</p> <p></p> </div> </div> <footer> <a href="#">LINK HERE</a> | <a href="#">LINK HERE</a> | <a href="contact.php">CONTACT</a> | <a href="register.php">REGISTER</a> | <a href="login.php">LOGIN</a> <address> Copyright 2012 @JRC </address> </footer> </div> </form> </body> </html> The image that I am trying to use is located at the folder image. I don't know whats wrong. And here's what the style.css source: body { font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif; margin: 0; padding: 0; background-image:url('images/background.jpg'); background-repeat:no-repeat; background-attachment:scroll; background-position:repeat-x; } I also tried this url('image/background.jpeg') etc. but still fails.

    Read the article

  • Transitioning accordions from small height to full height with CSS

    - by arkanciscan
    I am building an accordion list and I want it to animate open and closed using a CSS -webkit-transition:. The animation is triggered by an event handler that simply toggles the .open class on and off. The problem is that when I click it, the animation goes from closed height to 0px height then jerks back to full height instead of smoothly animating to full height. HTML <ul class="accordion"> <li>Foo <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quis leo sit amet justo vulputate volutpat. Suspendisse potenti. Aliquam aliquet justo ut turpis suscipit adipiscing.</p> </li> <li class="open">Baz <p>Ut velit magna, sagittis at blandit accumsan, vestibulum et dolor. Aliquam elit ante, congue vel pharetra ut, ultricies non est. In hac habitasse platea dictumst. Donec velit ligula, sodales a imperdiet non, sagittis id mauris.</p> </li> <li>Bar <p>Cras sit amet gravida lacus. Nulla consequat molestie nunc nec fermentum. Donec lobortis pretium quam sit amet scelerisque.</p> </li> </ul>? Javascript $('.accordion').delegate('li', 'click', function(li){ $(this).toggleClass('open'); }); Css .accordion li.open{ -webkit-transition: height 1s; } .accordion li:not(.open){ height: 1em; -webkit-transition: height 1s; } ? Try it on JSFiddle and see what I mean. I've already figured out how to make it work, but it requires setting an explicit height on the .open class. The accordions have variable height however, and creating an explicit selector for each one is obtrusive and unmaintainable. Can anyone give me a better solution than this? Here it is working with an explicit height that doesn't fit the content

    Read the article

  • stop form during submission if it validates incorrectly

    - by muqman
    I am trying to use JavaScript to validate forms but if the form doesn't validate, I don't want the form to be sent to the "action" page. The validator: <script> function formSubmit() { document.getElementById("signup_form").submit(); var x=document.forms["signup_form"]["tname"].value; if (x==null || x=="") { alert("First name must be filled out"); return false; } } </script> The form itself: <form action="some_file.php" method="post" id="signup_form" name="signup_form" onsubmit="return formSubmit()"> But all this does is if the tname field empty, it will return an alert but as soon as the user hits ok, the form then redirects to some_file.php. What have I missed here? The submit button: <a href="" onclick="return formSubmit(); return false" class="purplebutton">Signup</a> So what have I missed? How do I avoid this in the future?

    Read the article

  • Structs and pointers

    - by user1763861
    I have a few questions about structs and pointers For this struct: typedef struct tNode_t { char *w; } tNode; How come if I want to change/know the value of *w I need to use t.w = "asdfsd" instead of t->w = "asdfasd"? And I compiled this successfully without having t.w = (char *) malloc(28*sizeof(char)); in my testing code, is there a reason why tt's not needed? Sample main: int main() { tNode t; char w[] = "abcd"; //t.word = (char *) malloc(28*sizeof(char)); t.word = w; printf("%s", t.word); } Thanks.

    Read the article

  • Toggle visibility of DIV based on Dropdown

    - by user1869787
    I have never used Javascript before, only HTML and CSS. I am attempting to have my information show only when selected from my drop down. I don't know any Javascript so any help would be overly appreciated. This is my html so far: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8" /> <title>Gone Fishin'</title> <link href="finale.css" rel="stylesheet" type="text/css"> </head> <div id="wrapper"> <div id="nav"> <ul> <li><a href="Index.html">About Us</a></li> <li><a href="Species.html">List by Species</a></li> <li><a href="County.html">List by County</a></li> <li><a href="apply.html">Reservations</a></li> </ul> </div> <body> <div id="content"> <p>ontent</p> <fieldset> <legend>Choose your Target</legend> <select name="option" id="options"> <option value=""></option> <option value="1">American Shad</option> <option value="2">Black Crappie</option> <option value="3">Bluegill</option> <option value="4">Brook Trout</option> <option value="5">Brown Trout</option> <option value="6">Carp</option> <option value="7">Chain Pickerel</option> <option value="8">Channel Catfish</option> <option value="9">Flathead Catfish</option> <option value="10">Largemouth Bass</option> <option value="11">Muskellunge</option> <option value="12">Norhtern Pike</option> <option value="13">Pumkpinseed</option> <option value="14">Rainbow Trout</option> <option value="15">Readbreast Sunfish</option> <option value="16">Rock Bass</option> <option value="17">Sauger</option> <option value="18">Saugeye</option> <option value="19">Smallmouth Bass</option> <option value="20">Steelhead</option> <option value="21">Striped Bass</option> <option value="22">Walleye</option> <option value="23">White Bass</option> <option value="24">White Crappie</option> <option value="25">White Perch</option> <option value="26">Yellow Perch</option> </select> <div id="option"> <div id="1" style="display: block">Test 1</div> <div id="2">Test 2</div> <div id="3">Test 3</div> <div id="4">Test 4</div> <div id="5">Test 5</div> </div> </fieldset> </div> </body> </div> </html> And this is my CSS: @charset "utf-8"; /* CSS Document */ /*General Styles*/ * {font-family:Verdana, Geneva, sans-serif;} #wrapper {width:85%; margin:auto; background-color:#00CC00;} /*End of General Styles*/ /* nav div styles */ #nav {background-color:#FF0000; text-align:center;} #nav ul li {display:inline-block; background-color: #67e667; border:5px dashed; width: 90px text-align:center;} #nav ul li a:link {background-color:#a60000; width: 90px;} #nav ul li a:visited {background-color: #009999;} #nav ul li a:hover {background-color: #a64b00;} /* end nav styles */ /* content div styles*/ #content {padding: 5px;} #option {display:none;} /*end content styles*/ /*start form styles*/ fieldset {background-color:#ff7400; color:white} label {display:inline-block; width: 150px; float:left; margin-right: 3px;} #form li{margin-bottom:10px;} #dtg li{margin-bottom:5px;} Thank you for any help received

    Read the article

  • BFS Shortest Path: Edge weight either 1 or 2

    - by Hackster
    I am trying to implement a shortest path algorithm using BFS. That is I am trying to find the shortest path from a specified vertex to every other vertex. However, its a special case where all edge weights are either 1 or 2. I know it could be done with Dijkstra's algorithm but I must use Breadth First Search. So far I have a working version of BFS that searches first for a vertex connected with an edge of weight 1. If it cannot find it, then returns a vertex connected with an edge of weight 2. After thinking about it, this is not the correct way to find the shortest path. The problem is I cannot think of any reasoning why BFS would work with weights 1 or 2, as opposed to any weight. Here is the code: public void addEdge(int start, int end, int weight) { adjMat[start][end] = 1; adjMat[end][start] = 1; edge_weight[start][end] = weight; edge_weight[end][start] = weight; } // ------------------------------------------------------------- public void bfs() // breadth-first search { // begin at vertex 0 vertexList[0].wasVisited = true; // mark it displayVertex(0); // display it theQueue.insert(0); // insert at tail int v2; while( !theQueue.isEmpty() ) // until queue empty, { int v1 = theQueue.remove(); // remove vertex at head // until it has no unvisited neighbors while( (v2=getAdjUnvisitedVertex(v1)) != -1 ){// get one, vertexList[v2].wasVisited = true; // mark it displayVertex(v2); // display it theQueue.insert(v2); // insert it } } // end while(queue not empty) // queue is empty, so we're done for(int j=0; j<nVerts; j++) // reset flags vertexList[j].wasVisited = false; } // end bfs() // ------------------------------------------------------------- // returns an unvisited vertex adj to v -- ****WITH WEIGHT 1**** public int getAdjUnvisitedVertex(int v) { for (int j = 0; j < nVerts; j++) if (adjMat[v][j] == 1 && vertexList[j].wasVisited == false && edge_weight[v][j] == 1){ //System.out.println("Vertex found with 1:"+ vertexList[j].label); return j; } for (int k = 0; k < nVerts; k++) if (adjMat[v][k] == 1 && vertexList[k].wasVisited == false && edge_weight[v][k] == 2){ //System.out.println("Vertex found with 2:"+vertexList[k].label); return k; } return -1; } // end getAdjUnvisitedVertex() // ------------------------------------------------------------- } //////////////////////////////////////////////////////////////// public class BFS{ public static void main(String[] args) { Graph theGraph = new Graph(); theGraph.addVertex('A'); // 0 (start for bfs) theGraph.addVertex('B'); // 1 theGraph.addVertex('C'); // 2 theGraph.addEdge(0, 1,2); // AB theGraph.addEdge(1, 2,1); // BC theGraph.addEdge(2, 0,1); // AD System.out.print("Visits: "); theGraph.bfs(); // breadth-first search System.out.println(); } // end main() } The problem then is, that I don't know why BFS can work for the shortest path problem with edges of weight 1 or 2 as opposed to any edges of any weight. Any help is appreciated. Thanks!

    Read the article

  • how do i let text fit to UIButton?

    - by iAsk
    problem: Button size is enough, however when I change title, the title text cannot fit the button width. Any SDK function can solve this problem, or I need to manually code to solve it? Please refer to following pictures. design in the nib file. initial show in simulator when I change the title text tried some ways before _button.titleLabel.adjustsFontSizeToFitWidth = YES; the way will change my font size. I cannot accept the way. [_button setTitleEdgeInsets:UIEdgeInsetsMake(10.0, 10.0, 0.0,0.0)]; the way change label's position only, not label size. [_button.titleLabel sizeToFit]; result is same with picture(3). [_button sizeToFit]; title moved to upper left corner, and the title still the same result. Just confused, my button size is big enough, why title size is so small?

    Read the article

  • Multiple PictureBoxs' C#

    - by Austin Smith
    I'm having a hard time figuring this out. I know pictureBox only lets you display one image a time. I'm trying to create a pictureBox for each image in my collection. For instance if I have ten images in my List, then the method should create ten pictureBox for those respective images so each one is displayes in a pictureBox. I'm not sure which would be better a for loop or a foreach loop instead. every time the loop increments both the varaiables XCoordinate and YCoordinate which are the location of the PictireBox shoulld increase so that the PictureBox won't overlap one another in the Form. The reason for the method is that the number of images in the collection can change everytime the application will run. That's why I'm not creating them manually. So after its done all the pictures in the list should appear in a picture.Box. The box should be all the same size the only difference is the location on the form and the images inside them. Please any help and I will be grateful

    Read the article

  • join select from multiple row values?

    - by user1869132
    Two tables 1) product -------------------- id | Name | price 1 | p1 | 10 2 | p2 | 20 3 | p3 | 30 2) product_attributes: --------------------------------------------------- id | product_id | attribute_name | attribute_value --------------------------------------------------- 1 | 1 | size | 10 2 | 1 | colour | red 3 | 2 | size | 20 I need to join these two tables. In the where clause I need to match both the two rows attribute values. Is it possible to get the result based on two rows value. Here if size=10 and colour=red. Output should be 1 | p1 | 10 It could be greatly helpful to get a query for this.

    Read the article

  • python function that returns a function from list of functions

    - by thkang
    I want to make following function: 1)input is a number. 2)functions are indexed, return a function whose index matches given number here's what I came up with: def foo_selector(whatfoo): def foo1(): return def foo2(): return def foo3(): return ... def foo999(): return #something like return foo[whatfoo] the problem is, how can I index the functions (foo#)? I can see functions foo1 to foo999 by dir(). however, dir() returns name of such functions, not the functions themselves. In the example, those foo-functions aren't doing anything. However in my program they perform different tasks and I can't automatically generate them. I write them myself, and have to return them by their name.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >