Daily Archives

Articles indexed Sunday June 10 2012

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

  • Will grub overwrite EasyBCD entry if I already have Windows 7 and Windows XP installed?

    - by Sachin
    Installing Ubuntu on EEE PC which already has Windows 7 and Windows XP in dual boot using Easy BCD I have an ASUS EEE PC 1015PEM with Windows 7 starter and Windows XP in dual boot configuration on separate partitions. Now I want to replace my Windows XP with Ubuntu 11. Earlier after installing XP on my system it failed to boot in Windows 7, which I restored easily using EasyBCD. If I install Ubuntu 11 will I be able to boot my Windows 7 also? Will grub overwrite the EasyBCD entry for XP?

    Read the article

  • Force Xorg to run in specific resolution

    - by Z9iT
    From my past experience (using Win-Xp), this particular monitor works only on 60Hz , Best resolution being 1024*768. I have "installed n configured" Ubuntu 12.04 Minimal (on USB stick) so that most of the time terminal is used, however whenever theirs a need to enter GUI I may issue startx command to go into gnome. However the problem is that on this particular system, issuing this command poses problem for its default refresh rate don't synchronize with the monitor. The display keep on flickering and utterly unreadable. It is visible that gnome has been loaded and default wallpaper and desktop items are visible. But the problem is due to refresh rate different than 60Hz. I am looking for a command attribute to startx command which will force the refresh rate to 60Hz and resolution preferably to 1204*768

    Read the article

  • Ubuntu 12.04 OpenCL with Intel and Radeon?

    - by Steve
    I want to setup my Ubuntu 12.04 with OpenCL(Open Computing Language) support for i7 2600k and Radeon HD5870. My Monitor is connected to the integrated Graphics of the i7. Intel OpenCL SDK is installed and working. Iteration of avaliable OpenCL devices shows 2 entries for Intel. As recommended I installed AMD APP SDK 2.6 first and then the fglrx driver. I installed fglrx from Ubuntu repositories. This works fine till here. When I run aticonfig --inital -f and restart the system I get into trouble. Xorg starts only in low-graphics mode. cat /var/log/Xorg.0.log [ 21.201] X.Org X Server 1.12.2 Release Date: 2012-05-29 [ 21.201] X Protocol Version 11, Revision 0 [ 21.201] Build Operating System: Linux 2.6.24-29-xen x86_64 Ubuntu [ 21.201] Current Operating System: Linux chimera 3.2.0-24-generic #39-Ubuntu SMP Mon May 21 16:52:17 UTC 2012 x86_ [ 21.201] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-24-generic root=UUID=c137757b-486b-4514-9dfe-00c97662 [ 21.201] Build Date: 05 June 2012 08:35:55AM [ 21.201] xorg-server 2:1.12.2+git20120605+server-1.12-branch.aaf48906-0ubuntu0ricotz~precise (For technical suppor [ 21.201] Current version of pixman: 0.26.0 [ 21.201] Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. [ 21.201] Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 21.201] (==) Log file: "/var/log/Xorg.0.log", Time: Fri Jun 8 14:22:36 2012 [ 21.247] (==) Using config file: "/etc/X11/xorg.conf" [ 21.247] (==) Using system config directory "/usr/share/X11/xorg.conf.d" [ 21.450] (==) ServerLayout "aticonfig Layout" [ 21.450] (**) |-->Screen "aticonfig-Screen[0]-0" (0) [ 21.450] (**) | |-->Monitor "aticonfig-Monitor[0]-0" [ 21.451] (**) | |-->Device "aticonfig-Device[0]-0" [ 21.451] (==) Automatically adding devices [ 21.451] (==) Automatically enabling devices [ 21.466] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist. [ 21.466] Entry deleted from font path. [ 21.466] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist. [ 21.466] Entry deleted from font path. [ 21.466] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist. [ 21.466] Entry deleted from font path. [ 21.473] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist. [ 21.473] Entry deleted from font path. [ 21.473] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist. [ 21.473] Entry deleted from font path. [ 21.473] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist. [ 21.473] Entry deleted from font path. [ 21.473] (==) FontPath set to: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/Type1, built-ins [ 21.473] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib [ 21.473] (II) The server relies on udev to provide the list of input devices. If no devices become available, reconfigure udev or disable AutoAddDevices. [ 21.473] (II) Loader magic: 0x7f0ad3b9ab00 [ 21.473] (II) Module ABI versions: [ 21.473] X.Org ANSI C Emulation: 0.4 [ 21.473] X.Org Video Driver: 12.0 [ 21.473] X.Org XInput driver : 16.0 [ 21.473] X.Org Server Extension : 6.0 [ 21.473] (--) PCI:*(0:0:2:0) 8086:0122:1458:d000 rev 9, Mem @ 0xfb800000/4194304, 0xe0000000/268435456, I/O @ 0x00 [ 21.473] (--) PCI: (0:1:0:0) 1002:6898:1787:2289 rev 0, Mem @ 0xd0000000/268435456, 0xfbdc0000/131072, I/O @ 0x000 [ 21.473] (II) Open ACPI successful (/var/run/acpid.socket) [ 21.473] (II) "extmod" will be loaded by default. [ 21.473] (II) "dbe" will be loaded by default. [ 21.473] (II) "glx" will be loaded. This was enabled by default and also specified in the config file. [ 21.473] (II) "record" will be loaded by default. [ 21.473] (II) "dri" will be loaded by default. [ 21.473] (II) "dri2" will be loaded by default. [ 21.473] (II) LoadModule: "glx" [ 21.732] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/extra-modules.dpkg-tmp/modules/extensions/libgl [ 21.934] (II) Module glx: vendor="Advanced Micro Devices, Inc." [ 21.934] compiled for 6.9.0, module version = 1.0.0 [ 21.934] (II) Loading extension GLX [ 21.934] (II) LoadModule: "extmod" [ 22.028] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so [ 22.041] (II) Module extmod: vendor="X.Org Foundation" [ 22.041] compiled for 1.12.2, module version = 1.0.0 [ 22.041] Module class: X.Org Server Extension [ 22.041] ABI class: X.Org Server Extension, version 6.0 [ 22.041] (II) Loading extension MIT-SCREEN-SAVER [ 22.041] (II) Loading extension XFree86-VidModeExtension [ 22.041] (II) Loading extension XFree86-DGA [ 22.041] (II) Loading extension DPMS [ 22.041] (II) Loading extension XVideo [ 22.041] (II) Loading extension XVideo-MotionCompensation [ 22.041] (II) Loading extension X-Resource [ 22.041] (II) LoadModule: "dbe" [ 22.041] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so [ 22.066] (II) Module dbe: vendor="X.Org Foundation" [ 22.066] compiled for 1.12.2, module version = 1.0.0 [ 22.066] Module class: X.Org Server Extension [ 22.066] ABI class: X.Org Server Extension, version 6.0 [ 22.066] (II) Loading extension DOUBLE-BUFFER [ 22.066] (II) LoadModule: "record" [ 22.066] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so [ 22.077] (II) Module record: vendor="X.Org Foundation" [ 22.077] compiled for 1.12.2, module version = 1.13.0 [ 22.077] Module class: X.Org Server Extension [ 22.077] ABI class: X.Org Server Extension, version 6.0 [ 22.077] (II) Loading extension RECORD [ 22.077] (II) LoadModule: "dri" [ 22.077] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so [ 22.082] (II) Module dri: vendor="X.Org Foundation" [ 22.082] compiled for 1.12.2, module version = 1.0.0 [ 22.082] ABI class: X.Org Server Extension, version 6.0 [ 22.082] (II) Loading extension XFree86-DRI [ 22.082] (II) LoadModule: "dri2" [ 22.082] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so [ 22.083] (II) Module dri2: vendor="X.Org Foundation" [ 22.083] compiled for 1.12.2, module version = 1.2.0 [ 22.083] ABI class: X.Org Server Extension, version 6.0 [ 22.083] (II) Loading extension DRI2 [ 22.083] (II) LoadModule: "fglrx" [ 22.083] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/extra-modules.dpkg-tmp/modules/drivers/fglrx_dr [ 22.399] (II) Module fglrx: vendor="FireGL - ATI Technologies Inc." [ 22.399] compiled for 1.4.99.906, module version = 8.96.4 [ 22.399] Module class: X.Org Video Driver [ 22.399] (II) Loading sub module "fglrxdrm" [ 22.399] (II) LoadModule: "fglrxdrm" [ 22.399] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/extra-modules.dpkg-tmp/modules/linux/libfglrxdr [ 22.445] (II) Module fglrxdrm: vendor="FireGL - ATI Technologies Inc." [ 22.445] compiled for 1.4.99.906, module version = 8.96.4 [ 22.445] (II) ATI Proprietary Linux Driver Version Identifier:8.96.4 [ 22.445] (II) ATI Proprietary Linux Driver Release Identifier: 8.96.7 [ 22.445] (II) ATI Proprietary Linux Driver Build Date: Mar 12 2012 13:06:50 [ 22.445] (++) using VT number 7 [ 22.445] (WW) Falling back to old probe method for fglrx [ 23.043] (II) Loading PCS database from /etc/ati/amdpcsdb [ 23.082] (--) Chipset Supported AMD Graphics Processor (0x6898) found [ 23.107] (WW) fglrx: No matching Device section for instance (BusID PCI:0@1:0:1) found [ 23.107] (II) fglrx: intel VGA device detected, load intel driver. [ 23.107] (II) LoadModule: "intel" [ 23.211] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so [ 23.475] (II) Module intel: vendor="X.Org Foundation" [ 23.475] compiled for 1.12.2, module version = 2.19.0 [ 23.475] Module class: X.Org Video Driver [ 23.475] ABI class: X.Org Video Driver, version 12.0 [ 23.476] ukiDynamicMajor: found major device number 249 [ 23.476] ukiDynamicMajor: found major device number 249 [ 23.476] ukiOpenByBusid: Searching for BusID PCI:1:0:0 [ 23.476] ukiOpenDevice: node name is /dev/ati/card0 [ 23.476] ukiOpenDevice: open result is 8, (OK) [ 23.476] ukiOpenByBusid: ukiOpenMinor returns 8 [ 23.476] ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0 [ 23.540] (WW) PowerXpress feature is not supported [ 23.540] (EE) No devices detected. [ 23.540] (==) Matched intel as autoconfigured driver 0 [ 23.540] (==) Matched vesa as autoconfigured driver 1 [ 23.540] (==) Matched fbdev as autoconfigured driver 2 [ 23.540] (==) Assigned the driver to the xf86ConfigLayout [ 23.540] (II) LoadModule: "intel" [ 23.540] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so [ 23.540] (II) Module intel: vendor="X.Org Foundation" [ 23.540] compiled for 1.12.2, module version = 2.19.0 [ 23.540] Module class: X.Org Video Driver [ 23.540] ABI class: X.Org Video Driver, version 12.0 [ 23.540] (II) UnloadModule: "intel" [ 23.540] (II) Unloading intel [ 23.540] (II) Failed to load module "intel" (already loaded, 32522) [ 23.540] (II) LoadModule: "vesa" [ 23.583] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so [ 23.620] (II) Module vesa: vendor="X.Org Foundation" [ 23.620] compiled for 1.12.2, module version = 2.3.1 [ 23.620] Module class: X.Org Video Driver [ 23.620] ABI class: X.Org Video Driver, version 12.0 [ 23.620] (II) LoadModule: "fbdev" [ 23.620] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so [ 23.661] (II) Module fbdev: vendor="X.Org Foundation" [ 23.661] compiled for 1.12.2, module version = 0.4.2 [ 23.661] Module class: X.Org Video Driver [ 23.661] ABI class: X.Org Video Driver, version 12.0 [ 23.661] (II) ATI Proprietary Linux Driver Version Identifier:8.96.4 [ 23.661] (II) ATI Proprietary Linux Driver Release Identifier: 8.96.7 [ 23.661] (II) ATI Proprietary Linux Driver Build Date: Mar 12 2012 13:06:50 [ 23.661] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45, 4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale, Sandybridge Desktop (GT1), Sandybridge Desktop (GT2), Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1), Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+), Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2), Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server, Ivybridge Server (GT2) [ 23.661] (II) VESA: driver for VESA chipsets: vesa [ 23.661] (II) FBDEV: driver for framebuffer: fbdev [ 23.661] (++) using VT number 7 [ 23.661] (WW) xf86OpenConsole: setpgid failed: Operation not permitted [ 23.661] (WW) xf86OpenConsole: setsid failed: Operation not permitted [ 23.661] (WW) Falling back to old probe method for fglrx [ 23.661] (II) Loading PCS database from /etc/ati/amdpcsdb [ 23.661] (WW) Falling back to old probe method for vesa [ 23.661] (WW) Falling back to old probe method for fbdev [ 23.661] (EE) No devices detected. [ 23.661] Fatal server error: [ 23.661] no screens found [ 23.661] Please consult the The X.Org Foundation support at http://wiki.x.org for help. [ 23.661] Please also check the log file at "/var/log/Xorg.0.log" for additional information. [ 23.661] xorg.conf: cat /etc/X11/xorg.conf Section "ServerLayout" Identifier "aticonfig Layout" Screen 0 "aticonfig-Screen[0]-0" 0 0 EndSection Section "Module" Load "glx" EndSection Section "Monitor" Identifier "aticonfig-Monitor[0]-0" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Generic Autodetecting Monitor" Option "DPMS" "true" EndSection Section "Device" Identifier "aticonfig-Device[0]-0" Driver "fglrx" BusID "PCI:1:0:0" EndSection Section "Screen" Identifier "aticonfig-Screen[0]-0" Device "aticonfig-Device[0]-0" Monitor "aticonfig-Monitor[0]-0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection Is there a way to get the Radeon to work in a hybrid configuration or to use the Radeon as an OpenCL only device?

    Read the article

  • Ubuntu 12.04 Responsiveness Extremely Slow on Nvidia 8800?

    - by lynxie
    Just installed 12.04... This is the first time I run Ubuntu with the Unity UI, not a pleasant experience. The responsiveness is extremely slow (10s after a mouseclick), the screen flickers, etc, all right after logging in. Switching the display driver from Nvidia current to post-release doesn't help at all. What now? Can't go back, but Ubuntu is useless to me right now. What can I do? (The system is a Intel 4x2.4Ghz with 4Gb RAM and a Nvidia 8800.)

    Read the article

  • How to remove session entries from LightDM?

    - by Lexalt
    I recently added Cairo Dock to my GNOME Shell in 11.10. Cairo Dock is GREAT, but I'm left with one little problem that I'd like to fix: after installing Cairo Dock, LightDM includes two extraneous entries to non-working desktops. (The entries to working desktops remain unaffected, so I guess I could just ignore the extraneous entries, but...) So I'd like to remove/edit the extraneous entries in LightDM. I've looked and looked for discussions on how to do so, but haven't had much luck. Any suggestions on how to go about editing the login menu in 11.10?

    Read the article

  • How to disable visual effects and compiz 100%

    - by oshirowanen
    UPDATE 1: The problem is not a monitor refresh rate flickering problem, as then the whole screen would be flickering. For me, only the application windows flicker in and out of view, then most of the time, when there do decide to show themselves, they only partly show themselves, like just top half, bottom half, left half, corner missing, window disappears when you try moving it or mouse over it even etc etc. I know it is a visual effect problem as I know my computer cannot handle visual effects and for some reason when the windows do appear partly, I can see the shadows behind the windows. Those shadows are part of the visual effects which are turned on by default for some reason. I get the same problem with 10.04, but can quickly turn off the visual effects by right clicking the desktop, selecting change background image, and in the visual effects tab, I can click on none, which stops all the visual problems. ORIGINAL QUESTION: I am having problems with 11.04 on my computer. For some reason it is enabling visual effects by default in the live cd when it should not be as my computer cannot support such effects. My computer cannot support Unity either, but it defaults to standard gnome with visual effects for some reason. It should be defaulting to standard gnome with no visual effects. THerefore, all I get is a very flickery live cd which makes it very difficult to see anything. So my question is, how do I disable the visual effects from the live cd? To put it simply, the live cd flickering is so bad, that I had to log back into my standard 10.04 install just to write this question, as I just couldn't see enough of the screen because of the flickering in 11.04 to even get to askubuntu.com...

    Read the article

  • Deeper Unity search indexing

    - by Chris Bauer
    Unity is currently only indexing and displaying a shallow set of file results. Suppose I want to open the file "/home/Music/Creedence Clearwater Revival/Willy and the Poor Boys/The-Midnight-Special.mp3". I open the "Files and Folders" lens and type "The Midnight Special". Unfortunately, the song doesn't display. I try "Willy and the Poor Boys" but that folder doesn't display either. The only folder that does display in the lens is "Music". Therefore I must open the "Music" folder then navigate through the entire directory tree to open the file I want. How do I get a deeper index of files to display in the "Files and Folders" lens? Thanks for your help!

    Read the article

  • How can I get a complete list of non-standard repositories in use?

    - by MagicFab
    While doing some support audits I'd like to know what would be the most efficient/compact way to get a list of all extra reporitories being used on a given Ubuntu workstation using command line (not via the GUI tools). So far I am using: diff'ing a standard sources.list file against the workstation's examining files under cat /etc/apt/sources.list.d Any other ideas on how to best go about this ?

    Read the article

  • Google Analytics - Traffic Source - Search engine - (Not Provided)

    - by Dharmavir
    I am using Google Analytics, now here when I go to "Traffic Source Overview" under that it shows Keyword as "(Not provided)" which is almost 40% of my traffic source. Now more than 90% of search engine traffic is from Google and still out of that for more than 40% of keywords are "(Not provided)". Can anyone explain me what is going wrong here or how can I get that data? Because that comes as 1st option and is biggest keyword in the list. Will that be some crawler or secure google search?

    Read the article

  • "Untangle"-Game AI

    - by M0rgenstern
    I am trying to program an AI for such untangle games like Untangle game. I tried the following possibilities: 1) Just set one node after the other to a random place. If every node was moved once, start over with the first node in the list. 2) First move all nodes which have the most wrong connections. If all were moved once, move the nodes which have the fewest (but not 0) wrong connections. If all were moved but there are some left, move all which are left. If none are left start over. 3) Just 2) bust starting with the nodes with the fewest connections. 4)/5) As 2) and 3) but when I didn't move nodes which have only correct connections. All of these approaches are too slow and inefficient. Can anyone suggest a solution which does not depend so much on fortune?

    Read the article

  • What is the benefit of triple buffering?

    - by user782220
    I read everything written in a previous question. From what I understand in double buffering the program must wait until the finished drawing is copied or swapped before starting the next drawing. In triple buffering the program has two back buffers and can immediately start drawing in the one that is not involved in such copying. But with triple buffering if you're in a situation where you can take advantage of the third buffer doesn't that suggest that you are drawing frames faster than the monitor can refresh. So then you don't actually get a higher frame rate. So what is the benefit of triple buffering then?

    Read the article

  • Send data to server with GET

    - by coderjoe
    I have made a site where all my highscores from my game are shown. I send the scores from my iphone game to my site using a script made with php. The script works, because if I enter the link produced by my app in my browser the score is added. However I want to send the scores from my app. The script is using the GET method to get name, scores etcetera. This is what i have now: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; NSError * e; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&e]; But it's not sending data to my server. The urlString is correct, because if I enter the link produced by my app in my browser the score is added. How can i solve this problem, Thanks in advance

    Read the article

  • MVC 4 Tutorial Error

    - by yiati
    I am currently following along with http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/accessing-your-model's-data-from-a-controller to get a grasp of MVC 4. I am trying to add the MoviesController, but whenever I do I receive an error that says... "Unable to retrieve metadata for 'MvcMovie.Models.Movie' unrecognized configuration section entityFramework (C:\Users\User\AppData\Local\Temp\tmp4FFB.tmp line 76)" The last thing I did before this was change the Web.config file from the end of the previous page in the tutorial.

    Read the article

  • SQlite insert not working

    - by Ondro Tadanai
    I'm writing a C# database winform app and I have a problem executing this query. It throws me this error: SQLite error near "SELECT": syntax error Can someone help me please? Thanks for any answer or suggestion. INSERT into subor(idsubor, idpodfk, pnazovfk, datumpravop, podiel, podield, cislozLV, datumzaradenia, idmajetok) values (null, " + comboBox1.SelectedValue.ToString() + ", '" + comboBox2.SelectedValue.ToString() + "', '" + dateTimePicker1.Value.ToString("d. M. yyyy") + "', '" + textBox2.Text + "', " + podield.ToString("0.0000", System.Globalization.CultureInfo.InvariantCulture) + ", '" + textBox4.Text + "', '" + dateTimePicker2.Value.ToString("d. M. yyyy") + "', SELECT IFNULL(a, '0') AS idmajetok FROM (SELECT MAX(idmajetok) + 1 AS a FROM subor))";

    Read the article

  • Devise routes /:param not working

    - by Jacob Schatz
    Using devise 2.1.0 I am trying to send the new registration page a PricingPlan model. So in my routes I have: devise_scope :user do delete "/logout" => "devise/sessions#destroy" get "/login" => "devise/sessions#new" get "/signup/:plan" => "devise/registrations#new" end And I override the devise registration controller. With this in my routes.rb to make it work: devise_for :users, :controllers => {:registrations => "registrations"} In my actual Registration controller which overrides Devise's controller I have: class RegistrationsController < Devise::RegistrationsController view_paths = "app/views/devise" def new super @plan = PricingPlan.find_by_name(params[:plan]) end So that the default views still go to devise.... In my new view for the registration controller I call this: <h3>You've chosen the <%= @plan.name %> plan.</h3> And I get this error: undefined method `name' for nil:NilClass Also... in my PricingPlan model: class PricingPlan < ActiveRecord::Base has_many :users And in my User model: class User < ActiveRecord::Base belongs_to :pricing_plan I'm rather new at rails.

    Read the article

  • Dice Emulation - ImageView

    - by Michelle Harris
    I am trying to emulate dice using ImageView. When I click the button, nothing seems to happen. I have hard coded this example to replace the image with imageView4 for debugging purposes (I was making sure the random wasn't fail). Can anyone point out what I am doing wrong? I am new to Java, Eclipse and Android so I'm sure I've probably made more than one mistake. Java: import java.util.Random; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.Spinner; import android.widget.Toast; public class Yahtzee4Activity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Spinner s = (Spinner) findViewById(R.id.spinner); ArrayAdapter adapter = ArrayAdapter.createFromResource( this, R.array.score_types, android.R.layout.simple_spinner_dropdown_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); s.setAdapter(adapter); } public void onMyButtonClick(View view) { ImageView imageView1 = new ImageView(this); Random rand = new Random(); int rndInt = 4; //rand.nextInt(6) + 1; // n = the number of images, that start at index 1 String imgName = "die" + rndInt; int id = getResources().getIdentifier(imgName, "drawable", getPackageName()); imageView1.setImageResource(id); } } XML for the button: <Button android:id="@+id/button_roll" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/roll" android:onClick="onMyButtonClick" />

    Read the article

  • problems with inserting data in database

    - by jannes braet
    $message=$_POST['answer']; $message=nl2br($message); $message=strip_tags($message, '<p><a><b><i><strong><em><code><sub><sup><img><ul><ol><li>'); $message = mysql_real_escape_string($message); $user=$_SESSION['SESS_MEMBER_ID']; $qry="INSERT INTO forum_rules (message,author,date) VALUES ($message,$user,'".date("Y-m-d H:i:s")."')"; $result=mysql_query($qry) or die(mysql_error()); if (!$result) { echo "error inserting data into database"; } else { ... } this codes always outputs error inserting data into database and i don't see what i'm doing wrong. i hav also tried to do it without the date part but that didn't work tho. can someone please tell me what i'm doing wrong here

    Read the article

  • java: communication between threads

    - by TRU7H
    I'm making a little java game in which I would have two threads (well as the FIRST step towards multithreading...), one for the logic and one for the drawing. So my question is: How can I make those two communicating which each other? Requirements: accessing variables and object from a another thread syncing them so they each complete a same number of "loops" in the same time. (the logic calculates and then the another one draws the results and the loop begins again...) So how is this achievable in java? Thanks in advance!

    Read the article

  • JavaScript constructors inside a namespace

    - by Joe
    I have read that creating a namespace for JavaScript projects helps to reduce conflicts with other libraries. I have some code with a lot of different types of objects for which I have defined constructor functions. Is it good practice to put these inside the namespace as well? For example: var shapes = { Rectangle: function(w, h) { this.width = w; this.height = h; } }; which can be called via: var square = new shapes.Rectangle(10,10);

    Read the article

  • How to enable ListView overscroll in HTC One X (may be all htc devices)?

    - by smeghead
    I have a listview in my app, and in my Xoom, and Galaxy S2, you get the normal glow effect when you overscroll. But in HTC One X, it doesn't show any overscroll behaviour. All the HTC apps have an accordion style overscroll behaviour. Do they use some custom listview? In any case, how do I show some sort of overscroll effect in HTC phones? Also, is there some ListView class out there, that implements overscroll effects on all phones (doesn't have to be the same effect). Some Context: The phones are on Android 4.0.3, and Xoom is on 4.0.4. The app is using the Holo Light theme. The min/target API level (as well as the Project API level) is set to 15.

    Read the article

  • Java: Switch statements with methods involving arrays

    - by Shane
    Hi guys I'm currently creating a program that allows the user to create an array, search an array and delete an element from an array. Looking at the LibraryMenu Method, the first case where you create an array in the switch statement works fine, however the other ones create a "cannot find symbol error" when I try to compile. My question is I want the search and delete functions to refer to the first switch case - the create Library array. Any help is appreciated, even if its likely from a simple mistake. import java.util.*; public class EnterLibrary { public static void LibraryMenu() { java.util.Scanner scannerObject =new java.util.Scanner(System.in); LibraryMenu Menu = new LibraryMenu(); Menu.displayMenu(); switch (scannerObject.nextInt() ) { case '1': { System.out.println ("1 - Add Videos"); Library[] newLibrary; newLibrary = createLibrary(); } break; case '2': System.out.println ("2 - Search Videos"); searchLibrary(newLibrary); break; case '3': { System.out.println ("3 - Change Videos"); //Change video method TBA } break; case '4': System.out.println ("4 - Delete Videos"); deleteVideo(newLibrary); break; default: System.out.println ("Unrecognized option - please select options 1-3 "); break; } } public static Library[] createLibrary() { Library[] videos = new Library[4]; java.util.Scanner scannerObject =new java.util.Scanner(System.in); for (int i = 0; i < videos.length; i++) { //User enters values into set methods in Library class System.out.print("Enter video number: " + (i+1) + "\n"); String number = scannerObject.nextLine(); System.out.print("Enter video title: " + (i+1) + "\n"); String title = scannerObject.nextLine(); System.out.print("Enter video publisher: " + (i+1) + "\n"); String publisher = scannerObject.nextLine(); System.out.print("Enter video duration: " + (i+1) + "\n"); String duration = scannerObject.nextLine(); System.out.print("Enter video date: " + (i+1) + "\n"); String date= scannerObject.nextLine(); System.out.print("VIDEO " + (i+1) + " ENTRY ADDED " + "\n \n"); //Initialize arrays videos[i] = new Library (); videos[i].setVideo( number, title, publisher, duration, date ); } return videos; } public static void printVidLibrary( Library[] videos) { //Get methods to print results System.out.print("\n======VIDEO CATALOGUE====== \n"); for (int i = 0; i < videos.length; i++) { System.out.print("Video number " + (i+1) + ": \n" + videos[i].getNumber() + "\n "); System.out.print("Video title " + (i+1) + ": \n" + videos[i].getTitle() + "\n "); System.out.print("Video publisher " + (i+1) + ": \n" + videos[i].getPublisher() + "\n "); System.out.print("Video duration " + (i+1) + ": \n" + videos[i].getDuration() + "\n "); System.out.print("Video date " + (i+1) + ": \n" + videos[i].getDate() + "\n "); } } public static Library searchLibrary( Library[] videos) { //User enters values to setSearch Library titleResult = new Library(); java.util.Scanner scannerObject =new java.util.Scanner(System.in); for (int n = 0; n < videos.length; n++) { System.out.println("Search for video number:\n"); String newSearch = scannerObject.nextLine(); titleResult.getSearch( videos, newSearch); if (!titleResult.equals(-1)) { System.out.print("Match found!\n" + newSearch + "\n"); } else if (titleResult.equals(-1)) { System.out.print("Sorry, no matches found!\n"); } } return titleResult; } public static void deleteVideo( Library[] videos) { Library titleResult = new Library(); java.util.Scanner scannerObject =new java.util.Scanner(System.in); for (int n = 0; n < videos.length; n++) { System.out.println("Search for video number:\n"); String deleteSearch = scannerObject.nextLine(); titleResult.deleteVideo(videos, deleteSearch); System.out.print("Video deleted\n"); } } public static void main(String[] args) { Library[] newLibrary; new LibraryMenu(); } }

    Read the article

  • BroadcastReceiver not triggered by Alarm

    - by Ezekiel Buchheit
    I am trying to set up an alarm that will run in the background and trigger (eventually) a save event. At the moment I simply have this code attached to a button. Press the button and the alarm should start leaving Toast messages behind as an indication that it is functioning. At the moment everything runs except the onReceive in the BroadcastReceiver is never triggered. Here is my code: The class setting up the alarm: //FIXME - rename (ie BackgroundSave; more descriptive) public class AlarmReceiver extends Service{ //FIXME - make sure you kill the service public void onCreate() { super.onCreate(); Toast.makeText(getApplication().getApplicationContext(), "Service onCreate called", Toast.LENGTH_SHORT).show(); } @Override public int onStartCommand(Intent intent, int flags, int startId) { Toast.makeText(getApplication().getApplicationContext(), "Service started", Toast.LENGTH_SHORT).show(); setAlarm(AlarmReceiver.this); // We want this service to continue running until it is explicitly // stopped, so return sticky. return START_STICKY; } public void setAlarm(Context c) { AlarmManager alarmManager = (AlarmManager)c.getSystemService(Context.ALARM_SERVICE); Intent i = new Intent(c, Alarm.class); PendingIntent pi = PendingIntent.getBroadcast(c, 0, i, 0); alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, System.currentTimeMillis() + 1000, 1000, pi); Toast.makeText(c.getApplicationContext(), "setAlarm called", Toast.LENGTH_SHORT).show(); } public void cancelAlarm(Context context) { Intent intent = new Intent(context, Alarm.class); PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, 0); AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarmManager.cancel(sender); } @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } } Here is the BroadcastReceiver: public class Alarm extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Alarm", Toast.LENGTH_SHORT).show(); } } And here is my manifest: <!-- Alarm --> <service android:name="com.xxxx.android.tools.AlarmReceiver" android:enabled="true" /> <receiver android:name="com.xxxx.android.tools.Alarm" ></receiver> The alarm onReceive is never triggered.

    Read the article

  • allowing bb code but not java script

    - by user1405062
    Hello im trying to get the hang of using bb codes onto my normal php site ( not forum or anything just a normal site ) I have seen a few posts like this one http://www.pixel2life.com/forums/index.php?/topic/10659-php-bbcode-parser/ which says i need a bb parser. I was just wondering can anyone show me how i would use one ? I have a status box were users can update there status but i would like to allow bb codes but not java script. So when im doing my inserting into the db i strip the status like so.. $status= mysql_real_escape_string($_POST['status']); $status2= strip_tags($status); And that stops the java script and tags from getting though but i need the bb code tags to come though but carry on blocking the java script code is there anyway to do this ? Also then i just echo it out echo $status2 ; But just plain text shows so was just wondering if anyone knows how to let though bb code and stop java script and could some one show me how to use the bb parasher ? also need to know how to echo out the bb coding...

    Read the article

  • How to store multiple variables from a File Input of unknown size in Java?

    - by AlphaOmegaStrife
    I'm a total beginner with my first programming assignment in Java. For our programming assignment, we will be given a .txt file of students like so: 3 345 Lisa Miller 890238 Y 2 <-(Number of classes) Mathematics MTH345 4 A Physics PHY357 3 B Bill Wilton 798324 N 2 English ENG378 3 B Philosophy PHL534 3 A Dandy Goat 746333 Y 1 History HIS101 3 A" The teacher will give us a .txt file on the day of turning it in with a list of unknown students. My problem is: I have a specific class for turning the data from the file into variables to be used for a different class in printing it to the screen. However, I do not know of a good way to get the variables from the input file for the course numbers, since that number is not predetermined. The only way I can think of to iterate over that unknown amount is using a loop, but that would just overwrite my variables every time. Also, the teacher has requested that we not use any JCL classes (I don't really know what this means.) Sorry if I have done a poor job of explaining this, but I can't think of a better way to conceptualize it. Let me know if I can clarify. Edit: public static void analyzeData() { Scanner inputStream = null; try { inputStream = new Scanner(new FileInputStream("Programming Assignment 1 Data.txt")); } catch (FileNotFoundException e) { System.out.println("File Programming Assignment 1 Data.txt could not be found or opened."); System.exit(0); } int numberOfStudents = inputStream.nextInt(); int tuitionPerHour = inputStream.nextInt(); String firstName = inputStream.next(); String lastname = inputStream.next(); String isTuitionPaid = inputStream.next(); int numberOfCourses = inputStream.nextInt(); String courseName = inputStream.next(); String courseNumber = inputStream.next(); int creditHours = inputStream.nextInt(); String grade = inputStream.next(); To show the methods I am using now, I am just using a Scanner to read from the file and for Scanner inputStream, I am using nextInt() or next() to get variables from the file. Obviously this will not work when I do not know exactly how many classes each student will have.

    Read the article

  • Replace every word with tag

    - by Sherif elKhatib
    JAVASCRIPT or JAVA solution needed The solution I am looking for could use java or javascript. I have the html code in a string so I could manipulate it before using it with java or afterwards with javascript. problem Anyway, I have to wrap each word with a tag. For example: <html> ... > Hello every one, cheers < ... </html> should be changed to <html> ... > <word>Hello</word> <word>every</word> <word>one</word>, <word>cheers</word> < ... </html> JAVASCRIPT hint I am using the following code to highlight a word; however, this will highlight the whole text belonging to a certain tag. When each word is a tag, this will work to some extent. If there is a substitute that will allow me to highlight a word at a certain position, it would also be a solution. function highlightElementAtPoint(xOrdinate, yOrdinate) { var theElement = document.elementFromPoint(xOrdinate, yOrdinate); selectedElement = theElement; theElement.style.backgroundColor = "yellow"; var theName = theElement.nodeName; var theArray = document.getElementsByTagName(theName); var theIndex = -1; for (i = 0; i < theArray.length; i++) { if (theArray[i] == theElement) { theIndex = i; } } window.androidselection.selected(theElement.innerHTML); return theName + " " + theIndex; }

    Read the article

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