Daily Archives

Articles indexed Wednesday June 6 2012

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

  • How to have an Arduino wait until it receives data over serial?

    - by SonicDH
    So I've wired up a little robot with a sound shield and some sensors. I'm trying to write a sketch that will let check the sensors. What I'd like for it to do is print out a little menu over serial, wait until the user sends a selection, jump to the function that matches their selection, then (once the function is done) jump back and print the menu again. Here's what I've written, but I'm not a that good of a coder, so it doesn't work. Where am I going wrong? #include <Servo.h> Servo steering; Servo throttle; int pos = 0; int val = 0; void setup(){   Serial.begin(9600);   throttle.write(90);   steering.write(90);   pinMode(A0, INPUT);   pinMode(7, INPUT);   char ch = 0; } void loop(){   Serial.println("Menu");   Serial.println("--------------------");   Serial.println("1. Motion Readout");   Serial.println("2. Distance Readout");   Serial.println("3. SD Directory Listing");   Serial.println("4. Sound Test");   Serial.println("5. Car Test");   Serial.println("--------------------");   Serial.println("Type the number and press enter");   while(char ch = 0){   ch = Serial.read();}   char ch;   switch(ch)   {     case '1':     motion();   }    ch = 0; } //menu over, lets get to work. void motion(){   Serial.println("Haha, it works!"); } I'm pretty sure a While loop is the right thing to do, but I'm probably implementing it wrong. Can anyone shed some light on this?

    Read the article

  • Post 12.04 Update, stuck on splash screen

    - by Lawrence
    I updated to 12.04 a couple of weeks ago and I haven't started up Ubuntu until now. On start up the computer gets stuck on the splash screen. I am a beginner in all of this linux mechanics. I've seen many people post about relatively the same problem but I have a hard time following. I am using Wubi and running it along side Windows Starter on a Toshiba netbook. Thanks for bearing with my unfamiliarity haha,

    Read the article

  • The upgrading service doesn`t work in South Korea

    - by Susung Park
    I am using Ubuntu, and I live in South Korea. I have installed the operating system about three months ago, so the current version in the computer is 11.04. I wanna upgrade this to the new version, and I tried some methods to do so. And when I started upgrading the computer, a message came up that it cannot download the update package because of the problem of internet connection. What should I do?

    Read the article

  • Can't configure 5.1 audio with 12.04

    - by xster
    I have an Intel ALC892 and a Nvidia GT 520m connected to speakers via HDMI. On lspci, I see 00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02) Subsystem: ZOTAC International (MCO) Ltd. Device a218 Flags: bus master, fast devsel, latency 0, IRQ 47 Memory at db400000 (64-bit, non-prefetchable) [size=16K] Capabilities: [50] Power Management version 2 Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00 Capabilities: [100] Virtual Channel 02:00.1 Audio device: NVIDIA Corporation HDMI Audio stub (rev a1) Subsystem: ZOTAC International (MCO) Ltd. Device 2180 Flags: bus master, fast devsel, latency 0, IRQ 18 Memory at db080000 (32-bit, non-prefetchable) [size=16K] Capabilities: [60] Power Management version 3 Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+ Capabilities: [78] Express Endpoint, MSI 00 Kernel driver in use: snd_hda_intel My alsamixer looks like I enabled pulseaudio configuration file to have 6 channels. My sound setting looks like When I use the test dialog, only front left and right have sounds. If I use alsa in XBMC on a 5.1 video, there's no sound. If I use pulseaudio, only front right and left have sound. I can barely hear any speech since I'm guessing it's mapped to front center. Any clues?

    Read the article

  • Can I set my Optimus Nvidia card to run Unity3D with bumblebee?

    - by manuhalo
    I'd like to know whether I can run compiz on my Nvidia card to speed things up. It's a Dell XPS15 laptop but I'm mostly using it as a desktop, so battery life is not important. Apparently my Intel integrated card is able to run unity 3D, but my Nvidia GT 420M is not. Here's the output of unity_support_test, both with optirun and without it: manuhalo@Ubuntu-XPS-L501X:~$ optirun /usr/lib/nux/unity_support_test -p OpenGL vendor string: NVIDIA Corporation OpenGL renderer string: GeForce GT 420M/PCI/SSE2 OpenGL version string: 4.1.0 NVIDIA 280.13 Not software rendered: yes Not blacklisted: yes GLX fbconfig: yes GLX texture from pixmap: no GL npot or rect textures: yes GL vertex program: yes GL fragment program: yes GL vertex buffer object: yes GL framebuffer object: yes GL version is 1.4+: yes Unity 3D supported: no manuhalo@Ubuntu-XPS-L501X:~$ /usr/lib/nux/unity_support_test -p OpenGL vendor string: Tungsten Graphics, Inc OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile OpenGL version string: 2.1 Mesa 7.11 Not software rendered: yes Not blacklisted: yes GLX fbconfig: yes GLX texture from pixmap: yes GL npot or rect textures: yes GL vertex program: yes GL fragment program: yes GL vertex buffer object: yes GL framebuffer object: yes GL version is 1.4+: yes Unity 3D supported: yes Any ideas of why this is happening? Thanks in advance to anyone able to shed some light on this. What I have tried: Installed the v290 drivers from the x-stable PPA. Tried forcing Unity-3D to work by telling Unity to ignore the unity-support-test results i.e. gksudo gedit /etc/environment add the following UNITY_FORCE_START=1 to the end of the file.

    Read the article

  • How do I apt-get -y dist-upgrade without a grub config prompt?

    - by fratrik
    Per Make apt-get (or aptitude) run with -y but not prompt for replacement of configuration files? I did the following: ec2run ami-3c994355 --region us-east-1 -n 1 -t m1.large -z us-east-1d On the machine: sudo apt-get update sudo apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade I still get a prompt asking me which config file I want to use. These are the lines that come before the prompt: Setting up grub-pc (1.99-21ubuntu3.1) ... then: +-------------------------------------------------------¦ Configuring grub-pc +-------------------------------------------------------+ ¦ A new version of configuration file /etc/default/grub is available, but the version installed currently has been locally modified. ¦ ¦ ¦ ¦ What do you want to do about modified configuration file grub? ¦ ¦ ¦ ¦ install the package maintainer's version ¦ (Unrelated, was this too much information?)

    Read the article

  • Gnome Shell got removed after updating Ubuntu 12.04

    - by CMG
    Now when i try to install it...it shows the following error sudo apt-get install gnome-shell Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: gnome-shell : Depends: libgcr-3-1 (>= 3.4.0) but 3.2.2-2ubuntu4 is to be installed Depends: gir1.2-gcr-3 but it is not installable Recommends: gnome-contacts but it is not going to be installed E: Unable to correct problems, you have held broken packages. How can I install GNOME-Shell?

    Read the article

  • launching a program from bash causes bash to go to new prompt

    - by Dan Dman
    When I run a program from the console, e.g. me@box:~$ firefox I expect the console to log error messages (I think this is std out or std err?) and other items from the program, firefox in this case. But today I notice that bash just opens the program and goes to a new prompt, e.g. me@box:~$ firefox me@box:~$ How do I launch a program from bash such that error messages will be written to the console? Why is it that some programs operate this way by default and others (firefox) do not?

    Read the article

  • CONFIG_ATH_USER_REGD variable In Ununtu

    - by BigGenius
    There is a CONFIG_ATH_USER_REGD variable in OpenWrt that allows the user to override the default settings of the wireless NIC. Unfortunately grepping the Arch kernel config doesn't seem to have that, and since OpenWrt has its fair share of hacking and patches, I don't know if that's something they added or that's provided e.g. in compat-wireless. Does this setting exists for Ubuntu or BackTrack-Linux?

    Read the article

  • XEROX Phaser 3160N installation on UBUNTU 12.04 LTE machine

    - by Greg Verrall
    I have recently had windows XP die on one of my machines, and have installed Linux UBUNTU. The OS works great, except for installing the Xerox Phaser 3160N printer. The OS can find and install the network printer, but when I print a test page, it tells me “Internal Error – Please use the correct driver”. I have the correct drivers, as your support team have sent me the link, (http://www.support.xerox.com/support/phaser-3160/file-download/enau.html?operatingSystem=linux&fileLanguage=en_GB&contentId=105724&from=downloads&viewArchived=false) but I cannot install these drivers to run the printer. These are the instructions from the online guide for installing on a Linux machine: 1. Make sure that the machine is connected to your network and powered on. Also, your machine’s IP address should have been set. 2. Insert the supplied software CD into your CD-ROM drive. 3. Double-click CD-ROM icon that appears on your Linux desktop. 4. Double-click the Linux folder. 5. Double-click the install.sh icon. 6. The Xerox Installer window opens. Click Continue. 7. The Add printer wizard window opens. Click Next. 8. Select Network printer and click Search button. 9. The Printer’s IP address and model name appears on list field. 10. Select your machine and click Next. I get as far as step 5, and step 6 never happens, if it did, it would be very easy from there. There are options to add additional software to UBUNTU, however it does not recognise the installation CD as valid when I try to add it as a source. Any ideas on who can help me? regards, Greg Verrall

    Read the article

  • Why doesn't apache2 respect my envvars file?

    - by Avery Chan
    My envvar files has these lines in it: export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data My apache2.conf has these lines in it: # These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} But when I run apache2 -M I get this: apache2: bad user name ${APACHE_RUN_USER} A temporary fix is to hard-code www-data into it my apache2.conf file. There was some speculation here that this was because some configuration script didn't replace the env vars correctly in my apache2.conf file. Regardless how do I get apache2 to consult my envvars file? As another data point this site seems to indicate the envvars is generated at build, but read by apache2ctl at runtime, suggesting that this file isn't just poop leftover by the build process.

    Read the article

  • How do I make the PolicyKit authentication agent window not dissapear when I enter faulty password in Ubuntu 12.04?

    - by Petar
    As far as I remember in previous versions of Ubuntu, whenever authentication was required and when the PolicyKit authentication agent window was presented, it stayed there even after I would enter a faulty password. But now, whenever I make a mistake, the window is closed immediately. I find this behaviour irritating. For instance I use Synaptic rather frequently, and I prefer to start it using Synapse. I press Ctrl+Space to invoke Synapse, then I enter "syn" (s-shows SMplayer, sy- shows System Monitor) and than I press Enter so that Synaptic is invoked. Then I'm presented with the PolicyKit authentication agent window. As my password is rather complicated - using special characters and big letters, it's easy to make a mistake. If I do make a mistake while typing my password, I'm forced to redo all the previous steps. It's annoying as hell, knowing that this is not the way the PolicyKit authentication agent window behaved before. It used to warn me that the password was not correct and than wait for the correct input. I'm not sure if it allowed trying for the correct password indefinitely, or it was limited to 3 retries which is a much saner behaviour than the current one. I'm using Gnome 3, but the same thing happens in Unity too, although the window looks different.

    Read the article

  • redirecting subdomain to root index.php

    - by niku
    I am new to this. Here is the situation and wondering if someone can suggest best solution to it. I have domain "www.mydomain.com" where I have magento website running, we are in development stage so I did URL forwarding "www.mydomain.com" to "www.mydomain.net" and we have under-construction page on "www.mydomain.net'. Because we do not want to show development. I also have subdomain "beta.mydomain.com" which I pointed to "www.mydomain.com/index.php" which works fine. But how can I show this without changing URL in browser from "beta.mydomain.com" to "www.mydomain.com/index.php" this we want to show our development to management.

    Read the article

  • Has anyone had issues with Google Analyticator authenticating?

    - by Marc Benzakein
    I'm using Analyticator on a site and am having an issue. I am getting an error (see below) when I go to authenticate from the settings panel on Analyticator. The structure on this is a bit different and I think that's what is causing it. The website is on a subdomain which is hosted on a different server than the top-level domain. The analytics account on google only has the subdomain listed. Is it possible that the reason for the error is that the primary domain either: A. doesn't have an Analytics account or B. does have an Analytics account but it is not linked to the Analytics account of the subdomain? The page you have requested cannot be displayed. Another site was requesting access to your Google Account, but sent a malformed request. Please contact the site that you were trying to use when you received this message to inform them of the error. A detailed error message follows: The site "http://xxxxx.com" has not been registered.

    Read the article

  • Efficiently checking input and firing events

    - by Jim
    I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events: internal event InputEvent XYZPressed; internal event InputEvent XYZHeld; internal event InputEvent XYZReleased; where XYZ is the name of the Keys object representing that key. To fire these events, I have the following for each key: if (Keyboard.GetState().IsKeyDown(XYZ)) { if (PreviousKeyState.IsKeyDown(XYZ)) { if (XYZHeld != null) XYZHeld(); } else { if (XYZPressed != null) XYZPressed(); } } else if (PreviousKeyState.IsKeyDown(XYZ)) { if (XYZReleased != null) XYZReleased(); } However, this is a lot of repeated code (the above needs to be repeated for each input key). Aside from being a hassle to write, if any keys are added to/removed from the keys (if functionality is added/removed), a new section needs to be added (or an existing one removed). Is there a cleaner way to do this? Perhaps something along the lines of foreach key check which state it's in fire this key's event for that state where the code does the foreach (automatically checking exactly those keys that "exist") rather than the coder?

    Read the article

  • Loading levels from .txt or .XML for XNA

    - by Dave Voyles
    I'm attemptin to add multiple levels to my pong game. I'd like to simply exchange a few elements with each level, nothing crazy. Just the background texture, the color of the AI paddle (the one on the right side), and the music. It seems that the best way to go about this is by utilizing the StreamReader to read and write the files from XML. If there is a better, or more efficient alternative way then I'm all for it. In looking over the XNA Starter Platformer Kit provided by MS it seems that they've done it in this manner as well. I'm perplexed by a few things, however, namely parts within the Level class which aren't commented. /// <summary> /// Iterates over every tile in the structure file and loads its /// appearance and behavior. This method also validates that the /// file is well-formed with a player start point, exit, etc. /// </summary> /// <param name="fileStream"> /// A stream containing the tile data. /// </param> private void LoadTiles(Stream fileStream) { // Load the level and ensure all of the lines are the same length. int width; List<string> lines = new List<string>(); using (StreamReader reader = new StreamReader(fileStream)) { string line = reader.ReadLine(); width = line.Length; while (line != null) { lines.Add(line); if (line.Length != width) throw new Exception(String.Format("The length of line {0} is different from all preceeding lines.", lines.Count)); line = reader.ReadLine(); } } What does width = line.Length mean exactly? I mean I know how it reads the line, but what difference does it make if one line is longer than any of the others? Finally, their levels are simply text files that look like this: .................... .................... .................... .................... .................... .................... .................... .........GGG........ .........###........ .................... ....GGG.......GGG... ....###.......###... .................... .1................X. #################### It can't be that easy..... Can it?

    Read the article

  • How to play the sound of an object sliding on another object for a variable duration

    - by Antoine
    I would like to add sound effects to a basic 2D game. For example, a stone sphere is rolling on wood surface. Let's say I have a 2 second audio recording of this. How could I use the sample to add sound for an arbitrary duration ? So far I have two solutions in mind: a/ record the sound for an amount of time that is greater than the maximum expected duration, and play only a part of it; b/ extract a small portion of the sample and play it in a loop for the duration of the move; however I'm not sure if it makes sense with an audio wave.

    Read the article

  • rotating an object on an arc

    - by gardian06
    I am trying to get a turret to rotate on an arc, and have hit a wall. I have 8 possible starting orientations for the turrets, and want them to rotate on a 90 degree arc. I currently take the starting rotation of the turret, and then from that derive the positive, and negative boundary of the arc. because of engine restrictions (Unity) I have to do all of my tests against a value which is between [0,360], and due to numerical precision issues I can not test against specific values. I would like to write a general test without having to go in, and jury rig cases //my current test is: // member variables public float negBound; public float posBound; // found in Start() function (called immediately after construction) // eulerAngles.y is the the degree measure of the starting y rotation negBound = transform.eulerAngles.y-45; posBound = transform.eulerAngles.y+45; // insure that values are within bounds if(negBound<0){ negBound+=360; }else if(posBound>360){ posBound-=360; } // called from Update() when target not in firing line void Rotate(){ // controlls what direction if(transform.eulerAngles.y>posBound){ dir = -1; } else if(transform.eulerAngles.y < negBound){ dir = 1; } // rotate object } follows is a table of values for my different cases (please excuse my force formatting) read as base is the starting rotation of the turret, neg is the negative boundry, pos is the positive boundry, range is the acceptable range of values, and works is if it performs as expected with the current code. |base-|-neg-|-pos--|----------range-----------|-works-| |---0---|-315-|--45--|-315-0,0-45----------|----------| |--45--|---0---|--90--|-0-45,54-90----------|----x----| |-135-|---90--|-180-|-90-135,135-180---|----x----| |-180-|--135-|-225-|-135-180,180-225-|----x----| |-225-|--180-|-270-|-180-225,225-270-|----x----| |-270-|--225-|-315-|-225-270,270-315-|----------| |-315-|--270-|---0---|--270-315,315-0---|----------| I will need to do all tests from derived, or stored values, but can not figure out how to get all of my cases to work simultaneously. //I attempted to concatenate the 2 tests: if((transform.eulerAngles.y>posBound)&&(transform.eulerAngles.y < negBound)){ dir *= -1; } this caused only the first case to be successful // I attempted to store a opposite value, and do a void Rotate(){ // controlls what direction if((transform.eulerAngles.y > posBound)&&(transform.eulerAngles.y<oposite)){ dir = -1; } else if((transform.eulerAngles.y < negBound)&&(transform.eulerAngles.y>oposite)){ dir = 1; } // rotate object } this causes the opposite situation as indicated on the table. What am I missing here?

    Read the article

  • JavaScript functions in footer

    - by Djave
    I'm currently using html5 boilerplate, which puts jQuery and your plugins into the footer. The only problem is, I use the same footer.php file in every page. How do I go about including page specific functions if the plugins aren't loaded yet? I.e. <?php include_layout_template('header.php', '../');?> <div id='mediaspace'>This text will be replaced</div> <!-- Video for this page: --> <script type='text/javascript'> jwplayer('mediaspace').setup({ 'flashplayer': '../resources/player.swf', 'file': 'http://content.longtailvideo.com/videos/flvplayer.flv', 'controlbar': 'bottom', 'width': '470', 'height': '320' }); </script> <?php //This file has the jwplayer function in it: include_layout_template('footer.php', '../'); ?> Doing this I get Uncaught ReferenceError: jwplayer is not defined Is it going to be easier to just put the plugin includes in the header? How do people usually tackle stuff like this in boilerplate/loading scripts at the end?

    Read the article

  • Right way to get the children

    - by Web Developer
    I have the below code and it works but what is the right way to get table onclick of add HTML <h4 class="titlebar"> Skills <small><a onclick="return false;" href="/add/" data-span="3">Add</a></small> </h4> <div class="body"> <table class="table"><tbody> <tr><td width="125"></td></td></tr> </tbody></table> </div> JQuery var TableBlock = $(this).closest('.titlebar').next().children('table');

    Read the article

  • CDI @Conversation not propagated with handleNavigation()

    - by Thomas Kernstock
    I have a problem with the propagation of a long runnig conversation when I redirect the view by the handleNavigation() method. Here is my test code: I have a conversationscoped bean and two views: conversationStart.xhtml is called in Browser with URL http://localhost/tests/conversationStart.jsf?paramTestId=ParameterInUrl <!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <f:metadata> <f:viewParam name="paramTestId" value="#{conversationTest.fieldTestId}" /> <f:event type="preRenderView" listener="#{conversationTest.preRenderView}" /> </f:metadata> <h:head> <title>Conversation Test</title> </h:head> <h:body> <h:form> <h2>Startpage Test Conversation with Redirect</h2> <h:messages /> <h:outputText value="Testparameter: #{conversationTest.fieldTestId}"/><br /> <h:outputText value="Logged In: #{conversationTest.loggedIn}"/><br /> <h:outputText value="Conversation ID: #{conversationTest.convID}"/><br /> <h:outputText value="Conversation Transient: #{conversationTest.convTransient}"/><br /> <h:commandButton action="#{conversationTest.startLogin}" value="Login ->" rendered="#{conversationTest.loggedIn==false}" /><br /> <h:commandLink action="/tests/conversationLogin.xhtml?faces-redirect=true" value="Login ->" rendered="#{conversationTest.loggedIn==false}" /><br /> </h:form> <h:link outcome="/tests/conversationLogin.xhtml" value="Login Link" rendered="#{conversationTest.loggedIn==false}"> <f:param name="cid" value="#{conversationTest.convID}"></f:param> </h:link> </h:body> </html> The Parameter is written to the beanfield and displayed in the view correctly. There are 3 different possibilites to navigate to the next View. All 3 work fine. The beanfield shows up the next view (conversationLogin.xhtml) too: <!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>Conversation Test</title> </h:head> <h:body> <h:form> <h2>Loginpage Test Conversation with Redirect</h2> <h:messages /> <h:outputText value="Testparameter: #{conversationTest.fieldTestId}"/><br /> <h:outputText value="Logged In: #{conversationTest.loggedIn}"/><br /> <h:outputText value="Conversation ID: #{conversationTest.convID}"/><br /> <h:outputText value="Conversation Transient: #{conversationTest.convTransient}"/><br /> <h:commandButton action="#{conversationTest.login}" value="Login And Return" /><br /> </h:form> </h:body> </html> When I return to the Startpage by clicking the button the conversation bean still contains all values. So everything is fine. Here is the bean: package test; import java.io.Serializable; import javax.annotation.PostConstruct; import javax.enterprise.context.Conversation; import javax.enterprise.context.ConversationScoped; import javax.faces.event.ComponentSystemEvent; import javax.inject.Inject; import javax.inject.Named; @Named @ConversationScoped public class ConversationTest implements Serializable{ private static final long serialVersionUID = 1L; final String CONVERSATION_NAME="longRun"; @Inject Conversation conversation; private boolean loggedIn; private String fieldTestId; @PostConstruct public void init(){ if(conversation.isTransient()){ conversation.begin(CONVERSATION_NAME); System.out.println("New Conversation started"); } loggedIn=false; } public String getConvID(){ return conversation.getId(); } public boolean isConvTransient(){ return conversation.isTransient(); } public boolean getLoggedIn(){ return loggedIn; } public String startLogin(){ return "/tests/conversationLogin.xhtml?faces-redirect=true"; } public String login(){ loggedIn=true; return "/tests/conversationStart.xhtml?faces-redirect=true"; } public void preRenderView(ComponentSystemEvent ev) { // if(!loggedIn){ // System.out.println("Will redirect to Login"); // FacesContext ctx = FacesContext.getCurrentInstance(); // ctx.getApplication().getNavigationHandler().handleNavigation(ctx, null, "/tests/conversationLogin.xhtml?faces-redirect=true"); // ctx.renderResponse(); // } } public void setFieldTestId(String fieldTestId) { System.out.println("fieldTestID was set to: "+fieldTestId); this.fieldTestId = fieldTestId; } public String getFieldTestId() { return fieldTestId; } } Now comes the problem !! As soon as I try to redirect the page in the preRenderView method of the bean (just uncomment the code in the method), using handleNavigation() the bean is created again in the next view instead of using the allready created instance. Although the cid parameter is propagated to the next view ! Has anybody an idea what's wrong ? best regards Thomas

    Read the article

  • JQuery - Microsoft JScript runtime error: Object expected

    - by ydobonmai
    Below is the content of my .aspx page and the "jquery-ui-1.7.1.custom.min.js" is in the same location as the .aspx file. When I run the website with debugging, I get the below error. I know I am terribly missing something here. Any clue? Error :- Microsoft JScript runtime error: Object expected When I run without debugging, I get the following javascript error:- Line: 10 Error: 'jQuery' is undefined ASPX page content:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <!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"> <title></title> <script src="jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script> </head> <body> <form id="form1" runat="server"> <div> <script>$(function () { alert('hello') });</script> </div> </form> </body> </html>

    Read the article

  • vs2010 wpf c#: how to get friends list from facebook? (Desktop application)

    - by Ash
    As per this link code from stack overflow i have try this code for getting friendslist but after login i got this error "requires valid signature" string APIKey = ConfigurationManager.AppSettings["API_Key"]; string APISecret = ConfigurationManager.AppSettings["API_Secret"]; Facebook.Session.ConnectSession connectsession = new Facebook.Session.ConnectSession(APIKey, APISecret); Facebook.Rest.Api api = new Facebook.Rest.Api(connectsession); var friends = api.Friends.GetLists(); foreach (var friend in friends) { System.Console.WriteLine(friend.name); } guide me to find out the solution Thanks ash

    Read the article

  • Efficient algorithm to generate all solutions of a linear diophantine equation with ai=1

    - by Ben
    I am trying to generate all the solutions for the following equations for a given H. With H=4 : 1) ALL solutions for x_1 + x_2 + x_3 + x_4 =4 2) ALL solutions for x_1 + x_2 + x_3 = 4 3) ALL solutions for x_1 + x_2 = 4 4) ALL solutions for x_1 =4 For my problem, there are always 4 equations to solve (independently from the others). There are a total of 2^(H-1) solutions. For the previous one, here are the solutions : 1) 1 1 1 1 2) 1 1 2 and 1 2 1 and 2 1 1 3) 1 3 and 3 1 and 2 2 4) 4 Here is an R algorithm which solve the problem. library(gtools) H<-4 solutions<-NULL for(i in seq(H)) { res<-permutations(H-i+1,i,repeats.allowed=T) resum<-apply(res,1,sum) id<-which(resum==H) print(paste("solutions with ",i," variables",sep="")) print(res[id,]) } However, this algorithm makes more calculations than needed. I am sure it is possible to go faster. By that, I mean not generating the permutations for which the sums is H Any idea of a better algorithm for a given H ?

    Read the article

  • Data binding in gridview column using eval

    - by ROBIN
    I hava grid containing a column for displaying countrynames. I need to display value in that column as contrycode-first 10 letters of country name (in-India) .I tried it using Eval functions with in the item template: <asp:TemplateField> <ItemTemplate> <asp:Label ID="CountryNameLabe" runat="server" Text='<%# Eval("CorporateAddressCountry").SubString(0,6) %>' ></asp:Label> </ItemTemplate> </asp:TemplateField> But it shows error. Can i use custom functions in eval? please help

    Read the article

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