Search Results

Search found 5 results on 1 pages for 'kalec'.

Page 1/1 | 1 

  • What does this regex mean and why

    - by Kalec
    $ sed "s/\(^[a-z,0-9]*\)\(.*\)\( [a-z,0-9]*$\)/\1\2 \1/g" desired_file_name I apreciate it even if you only explain part of it or at lest structure it with words as in s\alphanumerical_at_start\something\alphanumerical_at_end\something_else\global Could someone explain what that means, why and are all regEx so ... awful ? I know that it replaces the first lowcase alphanumerical word with the last one. But could you explain bit by bit what's going on here ? what's with all the /\ and \(.*\)\ and everything else ? I'm just lost. EDIT: Here is what I do get: (^[a-z0-9]*) starting with a trough z and 0 trough 9; and [a-z,0-9]*$ is the same but the last word (however [0-9,a-z] = just first 2 characters / first character, or the entire word ?). Also: what does the * or the \(.*\)\ even mean ?

    Read the article

  • usb mouse connecting and disconnecting randomly and often

    - by Kalec
    Yes, I know this question has been asked here before but I can't add to the discussion over there and it did not help me, so here goes nothing. I've bought an acer aspire 5742G about 2 months ago or so and it's been running great, but sometimes I used to hear the windows error beep but I had no idea what was causing it since the "bug" was automatically fixed so fast I couldn't even see an error message (also it kinda always happened when I was busy also, either in a game or while doing my homework). Later on my mouse would simply not work for 3-5 seconds then work again, I thought nothing of it at the time. I also had a problem where it only worked in one usb and one only ... to move it I had to remove the battery, unplug the laptop and hold the power button for 2 minutes to reset the bios settings. Since today though it went nuts ... sometimes it disconnects / reconnects 12 times in 10 seconds and windows just keeps beeping till I unplug it, then it runs smooth for 5-6 minutes then it goes nuts again. Other times it seems like it skips (disconnects for a fraction of a second) other times just for 2-3 seconds. But this is incredibly frustrating. Sometimes the power just goes down (the laser turns off) and well that at least I would understand but this is a rare occurance. Now I know the usb ports work since I have a lot of other devices connected and I tried the mouse on a room m8's laptop so the mouse also works. My only conclusion is that it's an operating system / settings bug and / or problem (I have tried the mouse in all ports by the way). All drivers and bios are up to date (maybe except mouse but i can't seem to update that and the mouse has no name, just a serial number which helps with nothing. Still it worked till today and nothing should have changed any way). I have made sure windows can't shut it down to save power (in device management). Also I tried to delete the drivers and re-install them, rebooting and the power button trick but nothing ... most I have done is get rid of the 12 discconnects / reconnects every 10 seconds :) but that's all :( I would buy a new one but I'm afraid it might do the same thing :| ****EDIT****** Tried the mouse again at a friend but now it didn't even install it's software nor did the update work ... think I'll just buy a new one but I'd still like a suggestion at least so I'll leave this open

    Read the article

  • USB mouse connecting and disconnecting randomly

    - by Kalec
    I've bought an acer aspire 5742G about 2 months ago or so and it's been running great, but sometimes I used to hear the windows error beep but I had no idea what was causing it since the "bug" was automatically fixed so fast I couldn't even see an error message (also it kinda always happened when I was busy also, either in a game or while doing my homework). Later on my mouse would simply not work for 3-5 seconds then work again, I thought nothing of it at the time. I also had a problem where it only worked in one usb and one only. To move it I had to remove the battery, unplug the laptop and hold the power button for 2 minutes to reset the bios settings. Since today though it went nuts. Sometimes it disconnects / reconnects 12 times in 10 seconds and windows just keeps beeping till I unplug it, then it runs smooth for 5-6 minutes then it goes nuts again. Other times it seems like it skips (disconnects for a fraction of a second) other times just for 2-3 seconds. But this is incredibly frustrating. Sometimes the power just goes down (the laser turns off) and well that at least I would understand but this is a rare occurrence. Now I know the usb ports work since I have a lot of other devices connected and I tried the mouse on a room m8's laptop so the mouse also works. My only conclusion is that it's an operating system / settings bug and / or problem (I have tried the mouse in all ports by the way). All drivers and bios are up to date (maybe except mouse but I can't seem to update that and the mouse has no name, just a serial number which helps with nothing. Still it worked till today and nothing should have changed any way). I have made sure windows can't shut it down to save power (in device management). Also I tried to delete the drivers and re-install them, rebooting and the power button trick but nothing. Most I have done is get rid of the 12 disconnects / reconnects every 10 seconds :) but that's all :( I would buy a new one but I'm afraid it might do the same thing. ****EDIT****** Tried the mouse again at a friend but now it didn't even install it's software nor did the update work. Think I'll just buy a new one but I'd still like a suggestion at least so I'll leave this open #### EDIT 2 Now it works again, I can't explain this. Still thinking of getting a new one though

    Read the article

  • Pipe overwrites buffer, don't know how to overcome

    - by Kalec
    I use a simple pipe. I read with a while, 1 char at a time, I think every time I read a char I overwrite something #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <sys/wait.h> #include <string.h> int main () { int pipefd[2]; int cpid; char buf[31]; if (pipe(pipefd) == -1) { perror("pipe"); exit(EXIT_FAILURE) } cpid = fork(); if (cpid == -1) P perror("cpid"); exit(EXIT_FAILURE); } if (cpid == 0) { // child reads from pipe close (pipefd[1]); // close unused write end while (read (pipefd[0], &buf, 1)>0); printf ("Server receives: %s", buf); close (pipefd[0])l exit (EXIT_SUCCESS); } else { // parent writes to pipe close (pipefd[0]); // closing unused read end; char buf2[30]; printf("Server transmits: "); scanf ("%s", buf2); write (pipefd[1], buf2, strlen(buf2)+1); close(pipefd[1]); wait(NULL); exit(EXIT_SUCCESS); } return 0; } For example, if I input: "Flowers" it prints F and then ~6 unprintable characters

    Read the article

  • Having trouble with a small example from school

    - by Kalec
    The example is from a course, it's for comparing two objects in java: public class Complex { ... public boolean equals (Object obj) { if (obj instanceof Complex) { // if obj is "Complex" (complex number) Complex c = (Complex) obj // No idea return (real == c.real) && (imag == c.imag); // I'm guessing real means [this].real } return false; } } So, my question is: "what does this: Complex c = (Complex) obj actually mean" ? Also I've worked with python and c++, java is new for me.

    Read the article

1