Daily Archives

Articles indexed Sunday September 30 2012

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

  • Unable to start lightdm but can startx

    - by wzyboy
    I am trying to make my own Live USB and I have successfully generated an ISO file with a newly installed, configured and customized Xubuntu 12.04 LTS installation. My problem is that, no matter I boot the ISO in VirtualBox or in GRUB with loopback, it just cannot start the lightdm. When booting, I can see the log messages on the screen, it stucks at Stopping System V compablities or Configuring Network security. And tty7 is frozen... If I switch to tty1, I can get a logged-in shell as ubuntu@ubuntu. The weird thing is: When I type sudo start lightdm or just sudo lightdm, it will switch to tty7 and the screen flashes. Then nothing happened. Return to tty1 and I can see lightdm running, process xxxx. But the process does not exist. It was just crashed immediately I think. (That's why the screen flashes.) However, when I type startx, I can get into the desktop! That's amazing for me. I am not very clear about the relationship between X Server and Display Manager, but I think lightdm is running when I see the desktop! Then, what's wrong with sudo start lightdm? I use this command every time I power on my laptop since I have a text parameter added in grub.cfg. It never "crashed immediately". I need to use sudo start lightdm because it gets me into "Xubuntu Session" instead of "Xfce Session", the prior is more beautiful... Could anyone help?

    Read the article

  • Ubuntu 12.04 forgetting XModmap settings often

    - by PKKid
    I have the following contents in my ~/.Xmodmap file. It seems a couple times a day (without rebooting or logging out) I need to rerun the command "xmodmap ~/.Xmodmap" to reset my settings. The only thing I can think is that it seems to happen when I walk away from my computer for a bit. Maybe it forgets the settings when the computer locks itself? remove control = Control_L remove mod1 = Alt_L keycode 64 = Control_L keycode 37 = Alt_L add control = Control_L add mod1 = Alt_L Anyone else seeing similar issues?

    Read the article

  • How to customise window decoration whilst using Compiz on Xubuntu?

    - by Benjamin
    I have installed Compiz on Xubuntu 11.10 with sudo apt-get install compiz compizconfig-settings-manager compiz --replace ccp & In the process the XFCE window decoration theme is overridden by that of Compiz (Gtk) which uses the Adwaita theme instead of the Greybird theme. Since Gtk is doing window decoration, I cannot change it back using the XFCE settings. I just need compiz for scale and window switch and I would like to return window decoration to XFCE (Xfwm4) or to be able to change the Gtk window decoration theme. How can I do that? I have found part of the (workaround) answer already: download Greybird Gtk theme install theme (here is where I failed I think) use dconf-editor to change the Gtk theme in org.gnome.desktop.interface The problem really at stage 2 is where do I place the theme? I tried in ~/.themes/ and then changed the value of gtk-theme in the editor to Greybird. But I saw no change.

    Read the article

  • Youtube video streaming slow

    - by Newbie
    When I try to stream youtube videos on my ubuntu 11.04, they don't stream smoothly. They buffer well and are choppy. Here's my Config: Laptop: Gateway NV58 Ram : 4 GB Ethernet Controller: Broadcom Corp NetLink BCM5784M Gigabit Ethernet PCIe (rev10) Let me know if you need more details. Output of lspci: 00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07) 00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) 00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) 00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03) 00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03) 00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03) 00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03) 00:1d.3 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03) 00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93) 00:1f.0 ISA bridge: Intel Corporation ICH9M LPC Interface Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03) 00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03) 02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5784M Gigabit Ethernet PCIe (rev 10) 04:00.0 Network controller: Intel Corporation WiFi Link 5100

    Read the article

  • Should I pass link juice to my pages on other websites that are already high PR domains?

    - by huzzah
    I am starting a new website for a local business and have entries listed for it on places like urbanspoon, yelp, google+ local, etc. I am thinking of listing these citation sites on my business website to encourage visitors of my site to go and review the business on those sites. If I dofollow I will pass link juice to my page on that site, but doesn't that mean that the very very little PR juice I have will be leached away from me? Is it better to nofollow them?

    Read the article

  • Wild card redirect in htaccess giving error this webpage has a redirect loop

    - by kath
    In my website I changed the directory name "vehicles-cars" to "vehicles-cars-for-sale". When I tried to redirect using a wild card redirect from my old directory name to new directory name in my web hosting cPanel account, I get an error every time I open pages from that directory: this webpage has a redirect loop The website is php. The problem is that that I have lots of pages with the old directory indexed in Google and they are getting duplicate content. I really need some advice on what to do with this problem. Here is .htaccess file code for redirect, thanks. RewriteEngine on RewriteCond %{HTTP_HOST} ^adsbuz\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.adsbuz\.com$ RewriteRule ^vehicles\-cars\/?(.*)$ "http\:\/\/adsbuz\.com\/vehicles\-cars\-for\-sale\/$1" [R=301,L]

    Read the article

  • Why does my game loop speed vary on different platforms with the same hardware?

    - by Sri Harsha Chilakapati
    I've got a serious issue with my game loop. This loop varies in time with the platform and with the same hardware. This is a list of FPS achieved: - Windows ======= 140 to 150 - Linux ======= 120 to 125 - Windows(WINE) ======= 125 to 135 And since my game loop is fixed timestep, the speed of the game is not stable. Here's my game loop. public final void run() { // Initialize the resources Map.initMap(); initResources(); // Start the timer GTimer.startTimer(); GTimer.refresh(); long elapsedTime = 0; // The game loop while (running) { // Update the game update(elapsedTime); if (state == GameState.GAME_PLAYING) { Map.updateObjects(elapsedTime); } // Show or hide the cursor if (Global.HIDE_CURSOR) { setCursor(GInput.INVISIBLE_CURSOR); } else { setCursor(Cursor.getDefaultCursor()); } // Repaint the game and sync repaint(); elapsedTime = GTimer.sync(); Toolkit.getDefaultToolkit().sync(); } } The timer package How could I improve it?

    Read the article

  • How to do the Geometry Wars gravity well effect

    - by Mykel Stone
    I'm not talking about the background grid here, I'm talking about the swirly particles going around the Gravity Wells! I've always liked the effect and decided it'd be a fun experiment to replicate it, I know GW uses Hooke's law all over the place, but I don't think the Particle-to-Well effect is done using springs, it looks like a distance-squared function. Here is a video demonstrating the effect: http://www.youtube.com/watch?v=YgJe0YI18Fg I can implement a spring or gravity effect on some particles just fine, that's easy. But I can't seem to get the effect to look similar to GWs effect. When I watch the effect in game it seems that the particles are emitted in bunches from the Well itself, they spiral outward around the center of the well, and eventually get flung outward, fall back towards the well, and repeat. How does he make the particles spiral outward when spawned? How does he keep the particle bunches together when near the Well but spread away from each other when they're flung outward? How does he keep the particles so strongly attached to the Well?

    Read the article

  • Python .app doesn't read .txt file like it should

    - by Bambo
    This question relates to this one: Python app which reads and writes into its current working directory as a .app/exe i got the path to the .txt file fine however now when i try to open it and read the contents it seems that it doesn't extract the data properly. Here's my code - http://pastie.org/4876896 These are the errors i'm getting: 30/09/2012 10:28:49.103 [0x0-0x4e04e].org.pythonmac.unspecified.main: for index, item in enumerate( lines ): # iterate through lines 30/09/2012 10:28:49.103 [0x0-0x4e04e].org.pythonmac.unspecified.main: TypeError: 'NoneType' object is not iterable I kind of understand what the errors mean however i'm not sure why they are being flagged up because if i run my script with it not in a .app form it doesn't get these errors and extracts the data fine.

    Read the article

  • For each level of factor aggregate values over all levels except the current one (in R)

    - by Andrey Chetverikov
    For each level of factor I need to extract values aggregated over all subsets of data.frame except the current one. For example, there is a several subjects doing a reaction time task during several days, and I need to compute mean reaction time for all subjects and all days, but not including the subject for whom the mean is computed. Currently, I do it like this: library(lme4) ddply(sleepstudy, .(Subject, Days), summarise , avg_rt=mean(sleepstudy[sleepstudy$Subject!=Subject&sleepstudy$Days==Days,"Reaction"]), .progress="text") It works fine for small data sets, but for large ones it can be very slow. Is there a way to do it faster?

    Read the article

  • requestAccessToEntity for both iOS6 and 5.x - EKEventStore

    - by ShiShi
    following iOS6 eventKit and the new privacy settings I am using the following code - which works perfectly fine on iOS6 devices. Still, I would like the same code to work also for devices with iOS 5.x and I wish not to write a the "same code" twice - Seems wrong. Can anyone assist in an elegant solution ? EKEventStore *eventStore = [[EKEventStore alloc] init]; [eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { // some code }];

    Read the article

  • ActiveX won't run from server

    - by user1709555
    I have a MFC activeX that runs fine from disk but when I put it on a server I get errors. Client: WIN7 machine Server: Ubunto running apache The HTML and the errors are below, please advice. 10xs, Nahum HTML: <html> <HEAD> <TITLE>myFirstOCX.CAB</TITLE> <script type="text/javascript" FOR="window"> function fn() { try{ document.all('Ctrl1').AboutBox();//error: Undifiend : object doesn't have AboutBox() method //OR var obj = new ActiveXObject ("activex.activexCtrl"); obj.AboutBox ();//error: Undifiend : Automation server can't create object } catch (ex) { alert("Error: " + ex.Description + " : " + ex.message); } } </script> </HEAD> <body bgcolor=lightblue > <TABLE BORDER> <TR> <TD><OBJECT CLASSID="CLSID:E228C560-FA68-48E6-850F-B1167515C920" CODEBASE=".\nsip.CAB#version=1,0,0,1" ID="Ctrl1" name="Ctrl1"> </OBJECT> </TD> </TR> <TR> <TD ALIGN="CENTER"> <INPUT TYPE=BUTTON VALUE="Click Me" onclick="fn()" > </TD> </TR> </TABLE> <INPUT TYPE=TEXT ID="ConnectionString" VALUE="" > </body> </html>

    Read the article

  • Laravel - public layout not needed in every function

    - by fischer
    I have just recently started working with Laravel. Great framework so far! However I have a question. I am using a layout template like this: public $layout = 'layouts.private'; This is set in my Base_Controller: public function __construct(){ //Styles Asset::add('reset', 'css/reset.css'); Asset::add('main', 'css/main.css'); //Scripts Asset::add('jQuery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js'); //Switch layout template according to the users auth credentials. if (Auth::check()) { $this -> layout = 'layouts.private'; } else { $this -> layout = 'layouts.public'; } parent::__construct(); } However I get an error exception now when I try to access functions in my diffrent controllers, which should not call any view, i.e. when a user is going to login: class Login_Controller extends Base_Controller { public $restful = true; public function post_index() { $user = new User(); $credentials = array('username' => Input::get('email'), 'password' => Input::get('password')); if (Auth::attempt($credentials)) { } else { } } } The error I get, is that I do not set the content of the different variables in my public $layout. But since no view is needed in this function, how do I tell Laravel not to include the layout in this function? The best solution that I my self have come a cross (don't know if this is a bad way?) is to unset($this -> layout); from function post_index()... To sum up my question: how do I tell Laravel not to include public $layout in certain functions, where a view is not needed? Thanks in advance, fischer

    Read the article

  • Multiplication of 2 positive numbers giving a negative result

    - by krandiash
    My program is an implementation of a bloom filter. However, when I'm storing my hash function results in the bit array, the function (of the form f(i) = (a*i + b) % m where a,b,i,m are all positive integers) is giving me a negative result. The problem seems to be in the calculation of a*i which is coming out to be negative. Ignore the print statements in the code; those were for debugging. Basically, the value of temp in this block of code is coming out to be negative and so I'm getting an ArrayOutOfBoundsException. m is the bit array length, z is the number of hash functions being used, S is the set of values which are members of this bloom filter and H stores the values of a and b for the hash functions f1, f2, ..., fz. public static int[] makeBitArray(int m, int z, ArrayList<Integer> S, int[] H) { int[] C = new int[m]; for (int i = 0; i < z; i++) { for (int q = 0; q < S.size() ; q++) { System.out.println(H[2*i]); int temp = S.get(q)*(H[2*i]); System.out.println(temp); System.out.println(S.get(q)); System.out.println(H[2*i + 1]); System.out.println(m); int t = ((H[2*i]*S.get(q)) + H[2*i + 1])%m; System.out.println(t); C[t] = 1; } } return C; } Any help is appreciated.

    Read the article

  • mysql error #1452 appearing when trying to add a constraint

    - by user1701484
    I am trying to alter a table so That I can add a foreign key constraint in mysql database: ALTER TABLE `Question` ADD CONSTRAINT `FK_question` FOREIGN KEY (`QuestionId`) REFERENCES `Image_Question` (`QuestionId`) ON DELETE CASCADE ; Problem is that it is giving me this error: 1452 - Cannot add or update a child row: a foreign key constraint fails (mobile_app. '#sql-4517_15241', CONSTRAINT FK_question FOREIGN KEY (QuestionId) REFERENCES Image_Question (QuestionId) ON DELETE CASCADE) What does this error actually mean and what are the possible solutions I might have to undertake in order to fix this?

    Read the article

  • php switch statement error on int = 0

    - by Jagdeep Singh
    I am having a problem in php switch case. When i set $number=0 it should run very first case but here this code returns 10-20K that is in second case. I checked comparison operators, tested them in if else case they return correct values but here first case do not run on $number=0 Why is this happening ? php consider 0 as false or something wrong in code ? Link to codepad paste http://codepad.org/2glDh39K also here is the code <?php $number = 0; switch ($number) { case ($number <= 10000): echo "0-10K"; break; case ($number > 10000 && $number <= 20000): echo "10-20K"; break; case ($number > 20000 && $number <= 30000): echo "20-30K"; break; case ($number > 30000 && $number <= 40000): echo "30-40K"; break; case ($number > 40000 && $number <= 50000): echo "40-50K"; break; case ($number > 50000 && $number <= 60000): echo "50-60K"; break; case ($number > 60000 && $number <= 70000): echo "60-70K"; break; case ($number > 70000 && $number <= 80000): echo "70-80K"; break; case ($number > 80000 && $number <= 90000): echo "80-90K"; break; case ($number > 90000): echo "90K+"; break; default: //default echo "N/A"; break; } ?>

    Read the article

  • PHP attempting to make JavaScript friendly timestamp, failing, returns 1.34899651119E+12

    - by chris
    Well, not sure whats going on. I have been trying to follow by examples I have found here on stack, on google, even an answer someone gave me a week+ ago, which unfortunately I wasn't able to test until today. Anyway I am attempting to generate a javascript friendly timestamp via php so I can get my times synced up. The best logic I could find overall was something dealing with microtime. However that doesn't seem to work as expected, not even in the slightest. Right now I am using microtime(true)*1000; and am getting 1.34899651119E+12 for the result. Did I some how manage to mess up that one tiny line of code, Im not sure.

    Read the article

  • Dll Import : Unable to find Entry Point "fnMultiply" in DLL "ImportDLL"

    - by user662285
    I am trying to use DLLImport for using Win32 dll method in C#. Win32 dll C++ // .h file #ifdef IMPORTDLL_EXPORTS #define IMPORTDLL_API __declspec(dllexport) #else #define IMPORTDLL_API __declspec(dllimport) #endif // This class is exported from the ImportDLL.dll class IMPORTDLL_API CImportDLL { public: CImportDLL(void); // TODO: add your methods here. int Add(int a , int b); }; extern IMPORTDLL_API int nImportDLL; IMPORTDLL_API int fnImportDLL(void); IMPORTDLL_API int fnMultiply(int a,int b); // .cpp file // ImportDLL.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "ImportDLL.h" // This is an example of an exported variable IMPORTDLL_API int nImportDLL=0; // This is an example of an exported function. IMPORTDLL_API int fnImportDLL(void) { return 42; } IMPORTDLL_API int fnMultiply(int a , int b) { return (a*b); } Once i build this i get ImportDLL.dll Now i create Windows Application and add this dll in debug folder and try to use this method using DLLImport [DllImport("ImportDLL.dll")] public static extern int fnMultiply(int a, int b); And I try to call this in C# int a = fnMultiply(5, 6); // This line gives error Unable to find an entry point Can any body tell what i am missing? Thanks.

    Read the article

  • Why my json_encode get corrupted

    - by Cullen SUN
    $model = new XUploadForm; $model->file = CUploadedFile::getInstance( $model, 'file' ); //We check that the file was successfully uploaded if( $model->file !== null ) { //Grab some data $model->mime_type = $model->file->getType( ); $model->size = $model->file->getSize( ); $model->name = $model->file->getName( ); $file_extention = $model->file->getExtensionName( ); //(optional) Generate a random name for our file $file_tem_name = md5(Yii::app( )->user->id.microtime( ).$model->name); $file_thumb_name = $file_tem_name.'_thumb.'.$file_extention; $file_image_name = $file_tem_name.".".$file_extention; if( $model->validate( ) ) { //Move our file to our temporary dir $model->file->saveAs( $path.$file_image_name ); if(chmod($path.$file_image_name, 0777 )){ // Yii::import("ext.EPhpThumb.EPhpThumb"); // $thumb_=new EPhpThumb(); // $thumb_->init(); // $thumb_->create($path.$file_image_name) // ->resize(110,80) // ->save($path.$file_thumb_name); } //here you can also generate the image versions you need //using something like PHPThumb //Now we need to save this path to the user's session if( Yii::app( )->user->hasState( 'images' ) ) { $userImages = Yii::app( )->user->getState( 'images' ); } else { $userImages = array(); } $userImages[] = array( "filename" => $file_image_name, 'size' => $model->size, 'mime' => $model->mime_type, "path" => $path.$file_image_name, // "thumb" => $path.$file_thumb_name, ); Yii::app( )->user->setState('images', $userImages); //Now we need to tell our widget that the upload was succesfull //We do so, using the json structure defined in // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup echo json_encode( array( array( "type" => $model->mime_type, "size" => $model->size, "url" => $publicPath.$file_image_name, //"thumbnail_url" => $publicPath.$file_thumb_name, //"thumbnail_url" => $publicPath."thumbs/$filename", "delete_url" => $this->createUrl( "upload", array( "_method" => "delete", "file" => $file_image_name ) ), "delete_type" => "POST" ) ) ); Above code give me correct response, [{"type":"image/jpeg","size":2266,"url":"/uploads/tmp/0b00cbaee07c6410241428c74aae1dca.jpeg","delete_url":"/api/imageUpload/upload?_method=delete&file=0b00cbaee07c6410241428c74aae1dca.jpeg","delete_type":"POST"}] but if I uncomment the following // Yii::import("ext.EPhpThumb.EPhpThumb"); // $thumb_=new EPhpThumb(); // $thumb_->init(); // $thumb_->create($path.$file_image_name) // ->resize(110,80) // ->save($path.$file_thumb_name); it gave me corrupted response: Mac OS X 2??ATTR?dA??Y?Ycom.apple.quarantine0001;50655994;Google\x20Chrome.app;2599ECF9-69C5-4386-B3D9-9F5CC7E0EE1D|com.google.ChromeThis resource fork intentionally left blank ??[{"type":"image/jpeg","size":1941,"url":"/uploads/tmp/409c5921c6d20944e1a81f32b12fc380.jpeg","delete_url":"/api/imageUpload/upload?_method=delete&file=409c5921c6d20944e1a81f32b12fc380.jpeg","delete_type":"POST"}]

    Read the article

  • Receive Ajax and display output in a Photo?

    - by user1709469
    how to Receive Ajax and display output in a Photo? Images should be displayed inside the div tag After each of Bayer text, change the text to change the photo content The photos displayed are written in the form Thanks this code <script> function AjaxRequest() { var xmlhttp = null; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } // else // code for IE6, IE5 return xmlhttp; } function ajaxAction() { var font_category = document.getElementById("ajaxField").value; var xmlHttp = AjaxRequest(); xmlHttp.open("POST" , "ajax.php?message=" + message , true); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 1) response.innerHTML = "Loading..."; if (xmlHttp.readyState == 4 && xmlHttp.status == 200) response.innerHTML = xmlHttp.responseText; } xmlHttp.send(null); } </script> <textarea id="ajaxField12" name="message" rows="2" cols="20" value="Send" onchange="javascript:ajaxAction();"> </textarea> <div id="ajaxResponse" height="42" width="42"> </div>

    Read the article

  • shutdown windows 8 from metro app

    - by MindFreak
    I'm doing a metro app for Windows 8. And as part of its functionality, I need to initiate shutdown of Winodws 8 from the Metro App. Here are the questions: 1) Firstly, I researched a lot on this topic and I found out that System.Diagnostics.Process is not available for Metro App. So, is there a another way around? 2) Even if I can't directly shutdown, is there a way to trigger it from the Metro App? I would prefer a solution in C#. Thanks.

    Read the article

  • C++ option/long option implementation

    - by K Hein
    I am working on a parser for meta programming language using C++ on Linux platform. Right now, I need to implement option/long option for the parser to provide some additional features. Basically, if the user pass in some additional option, the parser needs to store statistics while parsing the text files. I can think of two ways to implement it. One way is to user global to store options entered by users. Another way is to create a singleton class to store options. So I would like to know if there is any other way to implement it. What is the best/most recommended way of implementing it? Thanks in advance. Regards, K.Hein

    Read the article

  • assistance required, hangman game.

    - by Phillip Gibson
    I am making a hangman game and am having trouble with part of it. I have selected a random word from a file, but I want to display the word as a series of undersocres __ and then match the letter chosen to a position in the undersocres. Can anyone help me? cout <<"1. Select to play the game\n"; cout <<"2. Ask for help\n"; cout <<"3. Select to quit the game\n"; cout << "Enter a selection: "; int number; cin >> number; while(number < 1 || number > 3 || cin.fail()) { if(cin.fail()) { cin.sync(); cin.clear(); cout << "You have not entered a number, please enter a menu selection between 1 and 3\n"; cin >> number; } else { cout << "Your selection must be between 1 and 3!\n"; cin >> number; } } switch (number) { case 1: { string word; string name; cout << " Whats your name? "; cin >> name; Player player(); ifstream FileReader; FileReader.open("words.txt"); if(!FileReader.is_open()) cout << "Error"; //this is for the random selection of words srand(time(0)); int randnum = rand()%10+1; for(int counter = 0; counter < randnum; counter++) { getline(FileReader, word, '\n'); } cout << "my word: " << word << "\n"; // get length of word int length; //create for loop for(int i = 0; i < length; i++) cout << "_"; //_ _ _ _ _ SetCursorPos(2,10); FileReader.close(); break;

    Read the article

  • Java input Letter

    - by xyvyre
    I'm doing an java activity that if Name start with letter A-G and Ends with Letter H-z the output is invalid heres my code: System.out.print("Enter your name: "); String str = in.readLine(); if(str.startsWith("a" )){ System.out.print("INVALID!"); } if(str.endsWith("h")){ System.out.print("INVALID!"); } This works but how can i implement letter a to g and h to z i already try this [a-g] and it not WORK!

    Read the article

  • Display different layout according to Facebook connection status in Android

    - by Rom Freiman
    I'm building an Android application where I want users to connect by their facebook details. According to my design, when the application starts first time, I want to display a layout with LOGIN facebook button. After the user will perform login for the first time, I dont want to display this layout/activity again - when the application would be relanched, I want t display another (home) screen, and not the LOGIN one. How should I implement this functionality? Thanks

    Read the article

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