Search Results

Search found 8942 results on 358 pages for 'print r'.

Page 201/358 | < Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >

  • word after the space NSlog

    - by DD007
    I am new bie to xcode may be question is silly but I am lagging with my home work. In a file I want to read a specific character after the string. I want to read all the character after the space. ex: asasasasasas wewewewewewe qwqwqwqwqwqw xyz_ 22 aaaaaaaaaaa bbbbbbbbbbb ccccccccccccccc ddddddddddddd fgfgfgfgfgfgfg ererererererer abc_ 12 bbbbbbbbbb dddddddd jkjkjkjkjkjkjk lalallalalalal everything is fine .. but i want to print after "xyz_ 22" as aaaaaaa then bbbb ccc

    Read the article

  • python and overflowing byte?

    - by Meloun
    Hi all, I need to make a variable with similar behaviour like in C lanquage. I need byte or unsigned char with range 0-255. This variable should overflow, that means... myVar = 255 myVar += 1 print myVar #!!myVar = 0!!

    Read the article

  • How to get attributes from parent?

    - by bribon
    Hi all, Let's say we have these classes: class Foo(object): _bar = "" def __init__(self): self.bar = "hello" def getBar(self): return self._bar def setBar(self, bar): self._bar = bar def getAttributes(self): for attr in self.__dict__: print attr bar = property(getBar, setBar) class Child(Foo): def __init__(self): super(Child, self).__init__() self.a = "" self.b = "" if I do something like: child = Child() child.getAttributes() I get all the attributes from parent and child. How could I get the attributes only from the parent? Thanks in advance!

    Read the article

  • rake does not returning anything

    - by CHID
    Hi, I jus created a rails application. I created a model using ruby script/generate model Article next i edited the my articles.rb file by adding these lines in self.up method def self.up create_table :articles do |t| t.string :title t.text :body t.string :published_at t.timestamps end end Now i ran rake db:migrate . But migrate does not work, it simply does no print anything. Anyone knows where i am going wrong?

    Read the article

  • recursion resulting in extra unwanted data

    - by spacerace
    I'm writing a module to handle dice rolling. Given x die of y sides, I'm trying to come up with a list of all potential roll combinations. This code assumes 3 die, each with 3 sides labeled 1, 2, and 3. (I realize I'm using "magic numbers" but this is just an attempt to simplify and get the base code working.) int[] set = { 1, 1, 1 }; list = diceroll.recurse(0,0, list, set); ... public ArrayList<Integer> recurse(int index, int i, ArrayList<Integer> list, int[] set){ if(index < 3){ // System.out.print("\n(looping on "+index+")\n"); for(int k=1;k<=3;k++){ // System.out.print("setting i"+index+" to "+k+" "); set[index] = k; dump(set); recurse(index+1, i, list, set); } } return list; } (dump() is a simple method to just display the contents of list[]. The variable i is not used at the moment.) What I'm attempting to do is increment a list[index] by one, stepping through the entire length of the list and incrementing as I go. This is my "best attempt" code. Here is the output: Bold output is what I'm looking for. I can't figure out how to get rid of the rest. (This is assuming three dice, each with 3 sides. Using recursion so I can scale it up to any x dice with y sides.) [1][1][1] [1][1][1] [1][1][1] [1][1][2] [1][1][3] [1][2][3] [1][2][1] [1][2][2] [1][2][3] [1][3][3] [1][3][1] [1][3][2] [1][3][3] [2][3][3] [2][1][3] [2][1][1] [2][1][2] [2][1][3] [2][2][3] [2][2][1] [2][2][2] [2][2][3] [2][3][3] [2][3][1] [2][3][2] [2][3][3] [3][3][3] [3][1][3] [3][1][1] [3][1][2] [3][1][3] [3][2][3] [3][2][1] [3][2][2] [3][2][3] [3][3][3] [3][3][1] [3][3][2] [3][3][3] I apologize for the formatting, best I could come up with. Any help would be greatly appreciated. (This method was actually stemmed to use the data for something quite trivial, but has turned into a personal challenge. :) edit: If there is another approach to solving this problem I'd be all ears, but I'd also like to solve my current problem and successfully use recursion for something useful.

    Read the article

  • Adding Refresh Tag to View

    - by RJL
    I need a view to refresh automatically every 20 seconds, and have added the following code to the view header via the views GUI - with no success. The code (or portions of it) are simply displayed on the view and no updating is performed. I've tried omitting both and just the ending ?php statement. If someone can tell me the proper code to use, or a better approach at updating the view automatically, I'd be very appreciative. Thanks. print ";

    Read the article

  • Creating an instance within the Class itself

    - by didxga
    What's going on when the assignment statement executed at Line 4, does compiler ignore the new operator and keep the foo variable being null or something else happen to handle this awkward moment? public class Foo { // creating an instance before its constructor has been invoked, suppose the "initializing" // gets printed in constructor as a result of the next line, of course it will not print it private Foo foo = new Foo();//Line 4 public Foo() { System.out.println("initializing"); } }

    Read the article

  • Arena in Malloc Function

    - by Vaibhav
    I am using malloc_stats() to print malloc related statistics in which I am finding "Arena 0" for some programs and "Arena 0 and Arena 1" for some other programs. What do these arenas represent?

    Read the article

  • SMS connecting to phone from VBA

    - by I__
    here's my code: Public Sub SendSMS() Dim n As Integer n = FreeFile ' Change the string below if using a different COM port or the port speed Open "COM3:9600,N,8,1" For Output As #n Print #n, "AT" Close #n End Sub i'm trying to connect to my phone that is attached to this computer. how do i catch responses to my AT COMMANDS? in hyperterminal you see responses right away, i want to be able to see them here as well, how do i do it?

    Read the article

  • can't read from stream until child exits?

    - by BobTurbo
    OK I have a program that creates two pipes - forks - the child's stdin and stdout are redirected to one end of each pipe - the parent is connected to the other ends of the pipes and tries to read the stream associated with the child's output and print it to the screen (and I will also make it write to the input of the child eventually). The problem is, when the parent tries to fgets the child's output stream, it just stalls and waits until the child dies to fgets and then print the output. If the child doesn't exit, it just waits forever. What is going on? I thought that maybe fgets would block until SOMETHING was in the stream, but not block all the way until the child gives up its file descriptors. Here is the code: #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <unistd.h> int main(int argc, char *argv[]) { FILE* fpin; FILE* fpout; int input_fd[2]; int output_fd[2]; pid_t pid; int status; char input[100]; char output[100]; char *args[] = {"/somepath/someprogram", NULL}; fgets(input, 100, stdin); // the user inputs the program name to exec pipe(input_fd); pipe(output_fd); pid = fork(); if (pid == 0) { close(input_fd[1]); close(output_fd[0]); dup2(input_fd[0], 0); dup2(output_fd[1], 1); input[strlen(input)-1] = '\0'; execvp(input, args); } else { close(input_fd[0]); close(output_fd[1]); fpin = fdopen(input_fd[1], "w"); fpout = fdopen(output_fd[0], "r"); while(!feof(fpout)) { fgets(output, 100, fpout); printf("output: %s\n", output); } } return 0; }

    Read the article

  • Need to constantly monitor serial data in Python

    - by jakke34
    Right now I am using an arduino to send data from an analog sensor to COM4. I am trying to make a python script that continuously monitors that data and looks for a certain parameter. I tried something like this but it isn't outputing the data like I want. import serial port = "COM4" ser = serial.Serial(port,9600, timeout =1) value = 0 while 1: value = ser.read() print value

    Read the article

  • Python/Django: log to console under runserver, log to file under Apache

    - by Justin Grant
    How can I send trace messages to the console (like print) when I'm running my Django app under manage.py runserver, but have those messages sent to a log file when I'm running the app under Apache? I reviewed Django logging and although I was impressed with its flexibility and configurability for advanced uses, I'm still stumped with how to handle my simple use-case. My apologies for not being able to find the answer elsewhere-- this is a newbie question I know.

    Read the article

  • Write failed, errno 0

    - by EpsilonVector
    I have a client server situation in which I receive data using read(socket, char_buf, BUF_SIZE) and then try to write it into a log file using write(filefd, char_buf, strlen(char_buf)) Strangely enough this fails (write returns -1), and yet the errno is set to 0, and I can print the message, AND the log file descriptor works (I write to it before and after this command). What's going on?? (Working on Linux kernel 2.4 (homework))

    Read the article

  • C++ Class Construction and Member Initialization

    - by anachoret
    The first print shows the member value to be false, and the other two prints show it as true. Why does the first output differ from the last two? #include #include using namespace std; class MyClass { public: bool value; bool stuff; }; class Container { public: vector my_classes; Container() { MyClass c; cout

    Read the article

  • array with sessions, only prints one letter

    - by jolabero
    On login: $result = mysql_query("SELECT `id`, `username`, `email` FROM `users` WHERE `username` = '$username' AND `password` = '$passwd'"); $userdata = array('id','username','email'); $_SESSION['user'] = mysql_result($result, 0, $userdata); And when i want to print the users username echo $_SESSION['user']['username'] it only prints the first letter :/ whats wrong`?

    Read the article

  • Convert octet string to human readable

    - by Michael Lang
    Using the pysnmp framework i get some values doing a snmp walk. Unfortunately for the oid 1.3.6.1.21.69.1.5.8.1.2 (DOCS-CABLE-DEVICE-MIB) i get a weird result which i cant correctly print here since it contains ascii chars like BEL ACK When doing a repr i get: OctetString('\x07\xd8\t\x17\x03\x184\x00') But the output should look like: 2008-9-23,3:24:52.0 the format is called "DateAndTime". How can i translate the OctetString output to a "human readable" date/time ?

    Read the article

  • rb plugin the hot key not working

    - by Bunny Rabbit
    def activate(self,shell): self.shell = shell self.action = gtk.Action ('foo','bar','baz',None) self.activate_id = self.action.connect ('activate', self.call_bk_fn,self.shell) self.action_group = gtk.ActionGroup ('hot_key_action_group') self.action_group.add_action_with_accel (self.action, "<control>E") uim = shell.get_ui_manager () uim.insert_action_group (self.action_group, 0) uim.ensure_update () def call_bk_fn(self,shell): print('hello world') i am using the above code in a plugin for rhythmbox ,and here i am trying to register the key ctr+e so that the call_bk_fn gets called whenever the key combination is pressed , but its not working why is that so ?

    Read the article

< Previous Page | 197 198 199 200 201 202 203 204 205 206 207 208  | Next Page >