Daily Archives

Articles indexed Saturday June 30 2012

Page 9/14 | < Previous Page | 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Failed Vista/Ubuntu 12.04 attempt at dual boot. Can only boot Ubuntu now

    - by mathematician1975
    I recently tried installing Ubuntu 12.04 alongside my Windows Vista install. I can boot fine into Ubuntu every time, but now every time I choose to boot into Windows, the process fails completely and restarts (or shuts down) my laptop. Is there anything I can do to recover this. I am very happy with Ubuntu and I do not want to recover my old Vista installation to overwrite it, but I do need to be able to use both OS's. Is it recoverable or should I start from scratch?

    Read the article

  • Google Chrome freezes for seconds

    - by Levan
    I do not know if this is the right place to write about google chrome or not so sorry if it is not after the update ,,Google Chrome 20.0.1132.47" google chrome started to lag ,,It gets stuck for couple of seconds and then it resumes" i think it starts lagging when i enter any flash site when i started chrome from the terminal it showed this before the update non of this appeared ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_direct.c:980:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib pcm_dsnoop.c:623:(snd_pcm_dsnoop_open) unable to initialize slave Firefox does not have any problem is there a way to fix this and thank you for your time

    Read the article

  • nvidia driver problems after upgrading to 3.2.0-26 on Ubuntu 12.04 64bit

    - by Lev Levitsky
    After installing latest updates I can't set screen resolution higher than 1024x768; every time after the boot I get a message Could not apply the stored configuration for the monitors (Note: removing ~/.config/monitors.xml stopped the message, but not the problem) I can boot with 3.2.0-25 and the graphics look normal. Here's what I have in /var/log/apt/term.log (excerpt): Setting up linux-image-3.2.0-26-generic (3.2.0-26.41) ... Running depmod. update-initramfs: deferring update (hook will be called later) Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/dkms 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic Error! Problems with depmod detected. Automatically uninstalling this module. DKMS: Install Failed (depmod problems). Module rolled back to built state. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic update-initramfs: Generating /boot/initrd.img-3.2.0-26-generic run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-26-generic /boot/vmlinuz-3.2.0-26-generic Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.2.0-26-generic Found initrd image: /boot/initrd.img-3.2.0-26-generic Found linux image: /boot/vmlinuz-3.2.0-25-generic Found initrd image: /boot/initrd.img-3.2.0-25-generic Found linux image: /boot/vmlinuz-3.2.0-24-generic Found initrd image: /boot/initrd.img-3.2.0-24-generic Found linux image: /boot/vmlinuz-3.2.0-23-generic Found initrd image: /boot/initrd.img-3.2.0-23-generic Found linux image: /boot/vmlinuz-3.0.0-17-generic Found initrd image: /boot/initrd.img-3.0.0-17-generic Found memtest86+ image: /boot/memtest86+.bin I went to "additional drivers" and saw some updates available there, but an attempt to install them failed, leaving the following in /var/log/jockey.log (long log, pasted here). The full log won't fit in the question, so I'm showing $ fgrep 'ERROR' /var/log/jockey.log 2012-06-30 17:29:57,897 WARNING: modinfo for module vmxnet failed: ERROR: modinfo: could not find module vmxnet 2012-06-30 17:29:57,937 WARNING: modinfo for module wl failed: ERROR: modinfo: could not find module wl 2012-06-30 17:29:58,072 WARNING: modinfo for module nvidia_96 failed: ERROR: modinfo: could not find module nvidia_96 2012-06-30 17:29:58,240 WARNING: modinfo for module nvidia_current failed: ERROR: modinfo: could not find module nvidia_current 2012-06-30 17:29:58,293 WARNING: modinfo for module nvidia_current_updates failed: ERROR: modinfo: could not find module nvidia_current_updates 2012-06-30 17:29:58,351 WARNING: modinfo for module nvidia_173_updates failed: ERROR: modinfo: could not find module nvidia_173_updates 2012-06-30 17:29:58,385 WARNING: modinfo for module nvidia_173 failed: ERROR: modinfo: could not find module nvidia_173 2012-06-30 17:29:58,420 WARNING: modinfo for module nvidia_96_updates failed: ERROR: modinfo: could not find module nvidia_96_updates 2012-06-30 17:29:58,455 WARNING: modinfo for module ath_pci failed: ERROR: modinfo: could not find module ath_pci 2012-06-30 17:29:58,478 WARNING: modinfo for module fglrx_updates failed: ERROR: modinfo: could not find module fglrx_updates 2012-06-30 17:29:58,531 WARNING: modinfo for module fglrx failed: ERROR: modinfo: could not find module fglrx 2012-06-30 17:29:58,588 WARNING: modinfo for module omapdrm_pvr failed: ERROR: modinfo: could not find module omapdrm_pvr 2012-06-30 17:29:59,537 WARNING: modinfo for module nvidia_current failed: ERROR: modinfo: could not find module nvidia_current 2012-06-30 17:29:59,613 WARNING: modinfo for module nvidia_173_updates failed: ERROR: modinfo: could not find module nvidia_173_updates 2012-06-30 17:29:59,686 WARNING: modinfo for module nvidia_173 failed: ERROR: modinfo: could not find module nvidia_173 2012-06-30 17:29:59,764 WARNING: modinfo for module nvidia_current_updates failed: ERROR: modinfo: could not find module nvidia_current_updates 2012-06-30 17:30:29,544 WARNING: modinfo for module nvidia_current_updates failed: ERROR: modinfo: could not find module nvidia_current_updates 2012-06-30 17:30:29,545 ERROR: XorgDriverHandler.enable(): package or module not installed, aborting I'm not sure if it's a bug, as the first log shows some errors. What can I try?

    Read the article

  • Installing g++ on 8.04

    - by mathematician1975
    I am running Ubuntu 8.04 (currently I do not have the option to upgrade due to hardware problems). I need to get g++ onto my installation but as this is no longer supported I am unable to use the traditional apt-get approach. What are my options? Are ubuntu packages configured specifically for each version? For example could I manually download a later version of gcc and g++ that do not originally ship with 8.04 (say the 10.04 version for example) and build them from scratch? Do the compilers work in this way in the sense that they have a version PER ubuntu version or are they maintained as separate entities?? I do not know enough about ubuntu internals really and always use apt-get to obtain/update any packages I need. If it is possible to do it this way is there a way to be certain that I have everything I need with regards to utility packages needed by g++ for the installation??

    Read the article

  • Ubuntu 12.04 on MAC Mini G4

    - by Buford Speed
    I have a MAC Mini G4. I would like to install Ubuntu on it. I have looked at this Q&A Mac G4 with no OS: can Ubuntu be used?, and I have a question. Is it worth the hassle to install Ubuntu, or should I keep MAC OS. The unit has MAC OS 10.4 (Tiger). It is used for normal day to day operations, word processing, spreadsheets, browsing, and keeping track of finances. I'd like to install Ubuntu if I can. So is it possible?

    Read the article

  • Ubuntu 12.04 on Bangho

    - by reyquito
    This question is (mostly) for people in Argentina. ¿Have anyone tried installing Ubuntu 12.04 on a Bangho notebook (with i3-560 processor)? I haven't found any experiences online with this brand. The specs of the sistem are below (in spanish): Procesador Intel Corei3 Serie 2300 Memoria 4Gb. DDR3. - Disco Rígido SATA 500Gb. Chipset Intel HM65 Video Intel HM65 configurable hasta 1748MB Placa de red 10/100/1000, Wireless 802.11b/g/n Bluetooth Pantalla 15.6" HD (1366 x 768) - Peso 2,3Kg. Best regards, Q

    Read the article

  • Proprietary AMD driver freezes my Ideapad

    - by mote
    I got this problem that I can't figure out what to do about. On Ideapad s205 with Ubuntu 12.04* (64), if I install Catalyst Centre 12.1 or newer it Freeze (lock's up), 1-3 times a day. It doesn't suffer freezing when using Radeon driver, but Radeon driver are considerably slower and flickers, so I would really prefer the proprietary driver (with no freezing). I reported the bug to launchpad but it doesn't get attention. -Also tried Ubuntu forums. Reported bug to AMD bug site "http://ati.cchtml.com/", but I don't think anybody reads it. Wrote AMD support several times, but get silly answers like "reinstall Windows". -Asked them to send the bug to Linux driver developers, but never heard a thing (more than once). The same nothing happens when writing to the feedback link from AMD driver download site. I'm so frustrated here, any advice would help. Thanks (*The same on Ubuntu 11.10)

    Read the article

  • Nvidia drivers don't work with mainline kernel

    - by dutchie
    I want to try some of the new features in the btrfs filesystem, and to do that I need to use a newer kernel than is included in Ubuntu 12.04. To do that, I have installed linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb, linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb, and linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb from the mainline kernel download here. However, on rebooting into the 3.4 kernel, my desktop is stuck at a very low resolution and I cannot increase it to the full. This did happen when I first installed, but a simple install of the nvidia-current package got everything working nicely with my GTX570 card. There were appear to be some DKMS errors when I installed the kernel, and they indicated I should look at /var/lib/dkms/nvidia-current/295.40/build/make.log: josh@sirius:~/Downloads$ sudo dpkg -i linux-*.deb Selecting previously unselected package linux-headers-3.4.0-030400. (Reading database ... 309400 files and directories currently installed.) Unpacking linux-headers-3.4.0-030400 (from linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb) ... Selecting previously unselected package linux-headers-3.4.0-030400-generic. Unpacking linux-headers-3.4.0-030400-generic (from linux-headers-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb) ... Selecting previously unselected package linux-image-3.4.0-030400-generic. Unpacking linux-image-3.4.0-030400-generic (from linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb) ... Done. Setting up linux-headers-3.4.0-030400 (3.4.0-030400.201205210521) ... Setting up linux-headers-3.4.0-030400-generic (3.4.0-030400.201205210521) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64) Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information. Setting up linux-image-3.4.0-030400-generic (3.4.0-030400.201205210521) ... Running depmod. update-initramfs: deferring update (hook will be called later) Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/dkms 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic ERROR (dkms apport): kernel package linux-headers-3.4.0-030400-generic is not supported Error! Bad return status for module build on kernel: 3.4.0-030400-generic (x86_64) Consult /var/lib/dkms/nvidia-current/295.40/build/make.log for more information. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic update-initramfs: Generating /boot/initrd.img-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/pm-utils 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/update-notifier 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.4.0-030400-generic /boot/vmlinuz-3.4.0-030400-generic Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.4.0-030400-generic Found initrd image: /boot/initrd.img-3.4.0-030400-generic Found linux image: /boot/vmlinuz-3.2.0-24-generic Found initrd image: /boot/initrd.img-3.2.0-24-generic Found memtest86+ image: /memtest86+.bin Found Ubuntu 12.04 LTS (12.04) on /dev/sda1 Found Windows 7 (loader) on /dev/sda2 Found Windows 7 (loader) on /dev/sda3 done /var/lib/dkms/nvidia-current/295.40/build/make.log: DKMS make.log for nvidia-current-295.40 for kernel 3.4.0-030400-generic (x86_64) Thu Jun 7 00:58:39 BST 2012 NVIDIA: calling KBUILD... test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \ echo; \ echo " ERROR: Kernel configuration is invalid."; \ echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo; \ /bin/false) mkdir -p /var/lib/dkms/nvidia-current/295.40/build/.tmp_versions ; rm -f /var/lib/dkms/nvidia-current/295.40/build/.tmp_versions/* make -f scripts/Makefile.build obj=/var/lib/dkms/nvidia-current/295.40/build cc -Wp,-MD,/var/lib/dkms/nvidia-current/295.40/build/.nv.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/include -I/usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include -Iarch/x86/include/generated -Iinclude -include /usr/src/linux-headers-3.4.0-030400-generic/include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -fstack-protector -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -Wframe-larger-than=1024 -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -I/var/lib/dkms/nvidia-current/295.40/build -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"295.40\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)" -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /var/lib/dkms/nvidia-current/295.40/build/.tmp_nv.o /var/lib/dkms/nvidia-current/295.40/build/nv.c In file included from include/linux/kernel.h:19:0, from include/linux/sched.h:55, from include/linux/utsname.h:35, from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:38, from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13: include/linux/bitops.h: In function ‘hweight_long’: include/linux/bitops.h:66:41: warning: signed and unsigned type in conditional expression [-Wsign-compare] In file included from /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess.h:577:0, from include/linux/poll.h:14, from /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:97, from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13: /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess_64.h: In function ‘copy_from_user’: /usr/src/linux-headers-3.4.0-030400-generic/arch/x86/include/asm/uaccess_64.h:53:6: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] In file included from /var/lib/dkms/nvidia-current/295.40/build/nv.c:13:0: /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h: At top level: /var/lib/dkms/nvidia-current/295.40/build/nv-linux.h:114:75: fatal error: asm/system.h: No such file or directory compilation terminated. make[3]: *** [/var/lib/dkms/nvidia-current/295.40/build/nv.o] Error 1 make[2]: *** [_module_/var/lib/dkms/nvidia-current/295.40/build] Error 2 NVIDIA: left KBUILD. nvidia.ko failed to build! make[1]: *** [module] Error 1 make: *** [module] Error 2

    Read the article

  • How can I reinstall GRUB Bootloader on MBR after installing Kubuntu?

    - by Agnes
    I installed Ubuntu, but then installed Kubuntu over it (formated Ubuntu Partition) because Ubuntu is not compatible with almost any hardware on my PC. Problem is I'm stuck with an old GRUB that says Ubuntu in the options because in my attempts to make it compatible with my hardware I got an old Grub with an image with an Earth that says Debian. How can I replace the GRUB with the one Kubuntu is supposed to install. I don't want to modify just the text, or the command to install on /sdaX, I want to actually re-write the MBR with the latest grub (reinstall the bootloader). Thanks.

    Read the article

  • How do I switch the Command key and Control key on a MacBook Pro (12.04)?

    - by kalaracey
    I have scoured the web, and I can't seem to get Xmodmap / anything to work properly. I want to swap BOTH my Command keys with my Control key - in essence, inverting what they do currently. How would I do that? I tried xmodmap -e "keycode 133 = Control_L" and corresponding commands for keycodes 134 (right command) and 37 (control left). I even tried these commands, plus xmodmap -pke > ~/.Xmodmap and xmodmap ~/.Xmodmap in .xinitrc. My end goal is I want HUD / Dash to come up when I click control and command to functional control, i.e., control-v is a commond shortcut to paste, i would click command-v

    Read the article

  • does anyone know why apt-cacher-ng always downloading index file (Packages.gz) even though its exist on the apt-cacher-ng's cache?

    - by soekarmana
    just updated from 11.04 to 12.04, fresh install installed apt-cacher-ng and notice something strange about it its always downloading index file (Packages.gz) even though the file exist on the apt-cacher-ng's cache, so this is what exactly happened : on ubuntu 10.10 & 11.04 apt-cacher-ng installed & configured on my laptop, then i reload & install some packages after that i configure my friend's laptop with apt-cacher-ng proxy (192.168.1.1:3142), reloading repository was blazingly fast, finished in a second without using my Internet connection (checked on system monitor, total Received just 15kB) on ubuntu 11.10 & 12.04 apt-cacher-ng installed & configured on my laptop, then i reload & install some packages after that i configure my friend's laptop with apt-cacher-ng proxy (192.168.1.1:3142), reloading repository was really slow!, apt-cacher-ng redownload the index file from internet

    Read the article

  • AABB Sweeping, algorithm to solve "stacking box" problem

    - by Ivo Wetzel
    I'm currently working on a simple AABB collision system and after some fiddling the sweeping of a single box vs. another and the calculation of the response velocity needed to push them apart works flawlessly. Now on to the new problem, imagine I'm having a stack of boxes which are falling towards a ground box which isn't moving: Each of these boxes has a vertical velocity for the "gravity" value, let's say this velocity is 5. Now, the result is that they all fall into each other: The reason is obvious, since all the boxes have a downward velocity of 5, this results in no collisions when calculating the relative velocity between the boxes during sweeping. Note: The red ground box here is static (always 0 velocity, can utilize spatial partitioning ), and all dynamic static collisions are resolved first, thus the fact that the boxes stop correctly at this ground box. So, this seems to be simply an issue with the order the boxes are sweept against each other. I imagine that sorting the boxes based on their x and y velocities and then sweeping these groups correctly against each other may resolve this issues. So, I'm looking for algorithms / examples on how to implement such a system. The code can be found here: https://github.com/BonsaiDen/aabb The two files which are of interest are [box/Dynamic.lua][3] and [box/Manager.lua][4]. The project is using Love2D in case you want to run it.

    Read the article

  • Keeping player aligned to grid in Pacman

    - by user17577
    I am making a Pacman game using XNA. The game is tile based, with each tile being 32 pixels. As the player moves, I need to know whenever it is perfectly on a tile (ie position of 32, 64, etc...) so that I can check to see if the next tile is free. I am using the following logic to test this. if (position.X % 32 == 0 && position.Y %32 == 0) { onTile = true; } I figure that I need to make the player's speed evenly divide 32. Everything works fine if I make the player's speed an integer such as 4 or 8. But if I make the speed something like 6.4, I end up with positions such as 64.00001, and my if statement no longer works correctly. How can I keep the player aligned with the grid, while allowing a wider range of player speeds than 1, 2, 4, 8, 16, and 32? Or is there some better way to go about this? Thanks

    Read the article

  • Setting Anchor Point

    - by Siddharth
    I want to set anchor point for the sprite like cocos2d has done for their implementation. I do not found any thing like that in andengine so please provide guidance on that. I want to move the sprite on touch so I use following code but that does not work for me. super.setPosition(pX - this.getWidthScaled() / 2, pY - this.getHeightScaled() / 2); Because I touch on the corner of the image but automatically it comes at center of the image because of above code. I want to remain the touch at desire position and drag it. For me the anchor point became useful. But I don't found anything in andengine.

    Read the article

  • Any faster method?

    - by rajeshverma423
    Manhattan distance is used to the center in chess code that uses an 0x88 board . 0x88 board is 128 square. public static final byte DISTANCE[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; Is there any other faster method instead of 0x88 to find distance?

    Read the article

  • Most proper way to use inherited classes with shared scopes in Mongo?

    - by Trip
    I have the TestVisual class that is inherited by the Game class : class TestVisual < Game include MongoMapper::Document end class Game include MongoMapper::Document belongs_to :maestra key :incorrect, Integer key :correct, Integer key :time_to_complete, Integer key :maestra_id, ObjectId timestamps! end As you can see it belongs to Maestra. So I can do Maestra.first.games But I can not to Maestra.first.test_visuals Since I'm working specifically with TestVisuals, that is ideally what I would like to pull. Is this possible with Mongo. If it isn't or if it isn't necessary, is there any other better way to reach the TestVisual object from Maestra and still have it inherit Game ?

    Read the article

  • auto refresh of div in mvc3 ASP.Net not working

    - by user1493249
    ViewData.cshtml(Partial View) Date Bill Amount PayNow </tr> </thead> <tbody> @{ for (int i = @Model.bill.Count - 1; i >= 0; i--) { <tr> <td width="30%" align="center">@Model.billdate[i]</td> <td width="30%" align="center">@Model.bill[i]</td> <td width="30%" align="center"> <a class="isDone" href="#" data-tododb-itemid="@Model.bill[i]">Paynow</a> </td> </tr> } } </tbody> Index.cshtml(View) $(document).ready(function () { window.setInterval(function () { var url = '@Url.Action("SomeScreen", "Home")'; $('#dynamictabs').load(url) }, 9000); $.ajaxSetup({ cache: false }); }); @Html.Partial("ViewData") HomeController.cs(Controller) public ActionResult Index() { fieldProcessor fp= new fieldProcessor(); return View(fp); } public ActionResult ShowScreen() { return View("ViewData",fp); } Still the same is not working..

    Read the article

  • Java iteration reading & parsing

    - by Patrick Lorio
    I have a log file that I am reading to a string public static String Read (String path) throws IOException { StringBuilder sb = new StringBuilder(); InputStream in = new BufferedInputStream(new FileInputStream(path)); int r; while ((r = in.read()) != -1) { sb.append(r); } return sb.toString(); } Then I have a parser that iterates over the entire string once void Parse () { String con = Read("log.txt"); for (int i = 0; i < con.length; i++) { /* parsing action */ } } This is hugely a waste of cpu cycles. I loop over all the content in Read. Then I loop over all the content in Parse. I could just place the /* parsing action */ under the while loop in the Read method, which would be find but I don't want to copy the same code all over the place. How can I parse the file in one iteration over the contents and still have separate methods for parsing and reading? In C# I understand there is some sort of yield return thing, but I'm locked with Java. What are my options in Java?

    Read the article

  • Canvas draw calls are rendering out of sequence

    - by Tom Murray
    I have the following code for writing draw calls to a "back buffer" canvas, then placing those in a main canvas using drawImage. This is for optimization purposes and to ensure all images get placed in sequence. Before placing the buffer canvas on top of the main one, I'm using fillRect to create a dark-blue background on the main canvas. However, the blue background is rendering after the sprites. This is unexpected, as I am making its fillRect call first. Here is my code: render: function() { this.buffer.clearRect(0,0,this.w,this.h); this.context.fillStyle = "#000044"; this.context.fillRect(0,0,this.w,this.h); for (var i in this.renderQueue) { for (var ii = 0; ii < this.renderQueue[i].length; ii++) { sprite = this.renderQueue[i][ii]; // Draw it! this.buffer.fillStyle = "green"; this.buffer.fillRect(sprite.x, sprite.y, sprite.w, sprite.h); } } this.context.drawImage(this.bufferCanvas,0,0); } This also happens when I use fillRect on the buffer canvas, instead of the main one. Changing the globalCompositeOperation between 'source-over' and 'destination-over' (for both contexts) does nothing to change this. Paradoxically, if I instead place the blue fillRect inside the nested for loops with the other draw calls, it works as expected... Thanks in advance!

    Read the article

  • Convert this SQL Query into LINQ (OVER (PARTITION BY Date))

    - by user1106649
    Here's the query i'm trying to convert into Linq: SELECT R.Code, R.FlightNumber, S.[Date], S.Station, R.Liters, SUM(R.Liters) OVER (PARTITION BY Year([Date]), Month([Date]), Day([Date])) AS Total_Liters FROM S INNER JOIN R ON S.ID = R.SID WHERE (R.Code = 'AC') AND FlightNumber = '124' GROUP BY Station, Code, FlightNumber, [Date], Liter ORDER BY R.FlightNumber, [Date] Thanks for any help.

    Read the article

  • Time complexity to fill hash table (homework)?

    - by Heathcliff
    This is a homework question, but I think there's something missing from it. It asks: Provide a sequence of m keys to fill a hash table implemented with linear probing, such that the time to fill it is minimum. And then Provide another sequence of m keys, but such that the time fill it is maximum. Repeat these two questions if the hash table implements quadratic probing I can only assume that the hash table has size m, both because it's the only number given and because we have been using that letter to address a hash table size before when describing the load factor. But I can't think of any sequence to do the first without knowing the hash function that hashes the sequence into the table. If it is a bad hash function, such that, for instance, it hashes every entry to the same index, then both the minimum and maximum time to fill it will take O(n) time, regardless of what the sequence looks like. And in the average case, where I assume the hash function is OK, how am I suppossed to know how long it will take for that hash function to fill the table? Aren't these questions linked to the hash function stronger than they are to the sequence that is hashed? As for the second question, I can assume that, regardless of the hash function, a sequence of size m with the same key repeated m-times will provide the maximum time, because it will cause linear probing from the second entry on. I think that will take O(n) time. Is that correct? Thanks

    Read the article

  • JavaFX InternalFrame or WindowNode

    - by user1493549
    I was looking for an InternalFrame for JavaFX. Apparently I it seems like there is no InternalFrame available. How does one create an MDI application with JavaFX? I have tried to simulate this behavior by using a custom Region that can be dragged around. Is that the way to go? What about typical window elements such as titlebar, possibility to resize etc. Do I have to implement that myself via custom controls? Thanks, miho

    Read the article

  • how many times a word appears into a txt file

    - by m4g4bu
    I've a problem when i tried to count how many time a word appears into a txt file. 1/ I create a textfield ( txta ) 2/ I create a button to apply the action ( btn ) 3/ I create a textarea ( area ) that is the place where the content of the file is displayed When I select the file, the content of the file is displayed on area, then I enter the word in txta to search and then I clicked the btn but the code is not working public int contarPalabras(String chain, String word) { // Recibe un string y una palabra y devuelve la cantidad de veces que encontró esa palabra en el string. // Si no encuentra la letra devuelve (-1). int cant = 0; int intIndex = chain.indexOf(word); if(intIndex == - 1){ cant = -1; }else{ cant = intIndex; } return cant; }

    Read the article

  • Javascript newbie, how to choose between window.URL.createObjectURL() and window.webkitURL.createObjectURL() based on browser

    - by Rohith Raveendran
    From the firefox developer website I know that firefox use objectURL = window.URL.createObjectURL(file); to get url of file type, but in chrome and other webkit browsers we have window.webkitURL.createObjectURL() for detecting url. I don't know how to swap this functions based on browser engines, and I need it to be worked on both browsers (Chrome and firefox) https://developer.mozilla.org/en/DOM/window.URL.createObjectURL

    Read the article

  • Scala: Correcting type inference of representation type over if statement

    - by drhagen
    This is a follow-up to two questions on representation types, which are type parameters of a trait designed to represent the type underlying a bounded type member (or something like that). I've had success creating instances of classes, e.g ConcreteGarage, that have instances cars of bounded type members CarType. trait Garage { type CarType <: Car[CarType] def cars: Seq[CarType] def copy(cars: Seq[CarType]): Garage def refuel(car: CarType, fuel: CarType#FuelType): Garage = copy( cars.map { case `car` => car.refuel(fuel) case other => other }) } class ConcreteGarage[C <: Car[C]](val cars: Seq[C]) extends Garage { type CarType = C def copy(cars: Seq[C]) = new ConcreteGarage(cars) } trait Car[C <: Car[C]] { type FuelType <: Fuel def fuel: FuelType def copy(fuel: C#FuelType): C def refuel(fuel: C#FuelType): C = copy(fuel) } class Ferrari(val fuel: Benzin) extends Car[Ferrari] { type FuelType = Benzin def copy(fuel: Benzin) = new Ferrari(fuel) } class Mustang(val fuel: Benzin) extends Car[Mustang] { type FuelType = Benzin def copy(fuel: Benzin) = new Mustang(fuel) } trait Fuel case class Benzin() extends Fuel I can easily create instances of Cars like Ferraris and Mustangs and put them into a ConcreteGarage, as long as it's simple: val newFerrari = new Ferrari(Benzin()) val newMustang = new Mustang(Benzin()) val ferrariGarage = new ConcreteGarage(Seq(newFerrari)) val mustangGarage = new ConcreteGarage(Seq(newMustang)) However, if I merely return one or the other, based on a flag, and try to put the result into a garage, it fails: val likesFord = true val new_car = if (likesFord) newFerrari else newMustang val switchedGarage = new ConcreteGarage(Seq(new_car)) // Fails here The switch alone works fine, it is the call to ConcreteGarage constructor that fails with the rather mystical error: error: inferred type arguments [this.Car[_ >: this.Ferrari with this.Mustang <: this.Car[_ >: this.Ferrari with this.Mustang <: ScalaObject]{def fuel: this.Benzin; type FuelType<: this.Benzin}]{def fuel: this.Benzin; type FuelType<: this.Benzin}] do not conform to class ConcreteGarage's type parameter bounds [C <: this.Car[C]] val switchedGarage = new ConcreteGarage(Seq(new_car)) // Fails here ^ I have tried putting those magic [C <: Car[C]] representation type parameters everywhere, but without success in finding the magic spot.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14  | Next Page >