Search Results

Search found 6502 results on 261 pages for 'dont reinvent the wheel'.

Page 63/261 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • How copy with shell commands(Linux) from 1 computer have (permanent url + open port) to 2 computer (secure way)?

    - by BenBen
    How copy with shell commands(Linux) from remote(my office computer) computer (permanent url + open port) to my (home) computer home/remote_computer_user/Desktop/test1.txt to my home computer home/home_computer_user/Downloads/ ? What I am doing: 1. ssh <user>@<computer1address> -p <port> :: success to get remote computer shell () 2. (I think I should use scp , but I dont how exactly in my case) Please if you can, write the exact commands that i should to from the shell Thanks in advance

    Read the article

  • What is . and .. in a directory?

    Based on the qestion How to make using command prompt less painful what is the . and .. in the most voted answer? I see it when i do a dir command but it isn't visible to the user in the form of a file. In case you dont know what I mean heres the example . .. Su.exe Sup.txt SuperUser.COM

    Read the article

  • linux output show only right of ':'

    - by acidzombie24
    I forgot a lot of my command line. I am doing cat file | grep "error" and i would like it to show everything to the right of G:/ including G:/ if possible. I figure its an awk command but i dont know what. I tried awk '{print $8+}' but + does not work like i hoped and guessed.

    Read the article

  • Svn hook on commit makes lock

    - by dynback.com
    My post-commit hook looks like this: pushd C:\Websites\Project svn update I am updating my server copy of repository. When I commit client stopped on sending content and locked or I dont know. Its is waiting for something. So when I cancel and try to update manually on server, I see: Working copy "." lockedsvn And only after manual cleanup and update again, I get updated revision, that was really commited. What I do wrong?

    Read the article

  • want to restore windows 7 from linux ubuntu

    - by elisi
    Hi, I want to recovery Win7 from Linux and I dont have the Win7 CD or any previous back up files. Please tell me if there is a way to recovery Win7 from Linux because I do not want to boot it from the beginning cause I have important files and they are in one partition.

    Read the article

  • Lost network on ubuntu server

    - by user1838473
    I have a virtual machine on Vsphere 5.0 running Ubuntu 12.04 when i put dinamic IP (/etc/network/interfaces) iface eth0 inet dhcp Ubuntu have network and i can do ping to google for example (8.8.8.8) but when i put static IP and configure resolv.conf My interfaces file: auto eth0 iface eth0 inet static address 192.168.1.54 gateway 192.168.1.1 netmask 255.255.255.0 it lost the network and i cant do ping to anything...i dont understand where is the problem... Thanks a lot

    Read the article

  • Should I refactor this code?

    - by user156814
    The code is for a view debate page. The code is supposed to determine whether or not to show an add reply form to the viewing user. If the user is logged in, and the user is not the creator of the debate, then check if the user already replied to the debate. If the user did not already reply to the debate then show the form... Otherwise, Check If the user wants to edit their already existing reply by looking in the url for the reply id If any of these tests dont pass, Then I save the reason as an int and pass that to a switch statement in the view. The logic seems easy enough, but my code seems a little sloppy. Here's the code.. (using Kohana V2.3.4) public function view($id = 0) { $debate = ORM::factory('debate')->with('user')->with('category')->find($id); if ($debate->loaded == FALSE) { url::redirect(); } // series of tests to show an add reply form if ($this->logged_in) { // is the viewer the creator? if ($this->user->id != $debate->user->id) { // has the user already replied? if (ORM::factory('reply') ->where(array('debate_id' => $id, 'user_id' => $this->user->id)) ->count_all() == 0) { $form = $errors = array ( 'body' => '', 'choice_id' => '', 'add' => '' ); if ($post = $this->input->post()) { $reply = ORM::factory('reply'); // validate and insert the reply if ($reply->add($post, TRUE)) { url::redirect(url::current()); } $form = arr::overwrite($form, $post->as_array()); $errors = arr::overwrite($errors, $post->errors('reply_errors')); } } // editing a reply? else if (($rid = (int) $this->input->get('edit')) AND ($reply = ORM::factory('reply') ->where(array('debate_id' => $id, 'user_id' => $this->user->id)) ->find($rid))) { $form = $errors = array ( 'body' => '', 'choice_id' => '', 'add' => '' ); // autocomplete the form $form = arr::overwrite($form, $reply->as_array()); if ($post = $this->input->post()) { // validate and insert the reply if ($reply->edit($post, TRUE)) { url::redirect(url::current()); } $form = arr::overwrite($form, $post->as_array()); $errors = arr::overwrite($errors, $post->errors('reply_errors')); } } else { // user already replied $reason = 3; } } else { // user started the debate $reason = 2; } } else { // user is not logged in. $reason = 1; } $limits = Kohana::config('app/debate.limits'); $page = (int) $this->input->get('page', 1); $offset = ($page > 0) ? ($page - 1) * $limits['replies'] : 0; $replies = ORM::factory('reply')->with('user')->with('choice')->where('replies.debate_id', $id); $this->template->title = $debate->topic; $this->template->debate = $debate; $this->template->body = View::factory('debate/view') ->set('debate', $debate) ->set('replies', $replies->find_all($limits['replies'], $offset)) ->set('pagination', Pagination::factory(array ( 'style' => 'digg', 'items_per_page' => $limits['replies'], 'query_string' => 'page', 'auto_hide' => TRUE, 'total_items' => $total = $replies->count_last_query() )) ) ->set('total', $total); // are we showing the add reply form? if (isset($form, $errors)) { $this->template->body->add_reply_form = View::factory('reply/add_reply_form') ->set('debate', $debate) ->set('form', $form) ->set('errors', $errors); } else { $this->template->body->reason = $reason; } } Heres the view, theres some logic in here that determines what message to show the user. <!-- Add Reply Form --> <?php if (isset($add_reply_form)): ?> <?php echo $add_reply_form; ?> <?php else: ?> <?php switch ($reason) { case 1 : // not logged in, show a message $message = 'Add your ' . html::anchor('login?url=' . url::current(TRUE), '<b>vote</b>') . ' to this discussion'; break; case 2 : // started the debate. dont show a message for that. $message = NULL; break; case 3: // already replied, show a message $message = 'You have already replied to this debate'; break; default: // unknown reason. dont show a message $message = NULL; break; } ?> <?php echo app::show_message($message, 'h2'); ?> <?php endif; ?> <!-- End Add Reply Form --> Should I refactor the add reply logic into another function or something.... It all works, it just seems real sloppy. Thanks

    Read the article

  • Is there any better way for creating a dynamic HTML table without using any javascript library like

    - by piemesons
    Dont worry we dont need to find out any bug in this code.. Its working perfectly.:-P My boss came to me and said "Hey just tell me whats the best of way of writing code for a dynamic HTML table (add row, delete row, update row).No need to add any CSS. Just javascript. No Jquery library etc. I was confused that in the middle of the project why he asking for some stupid exercise like this. What ever i wrote the following code and mailed him and after 15 mins i got a mail from him. " I was expecting much better code from a guy like you. Anyways good job monkey.(And with a picture of monkey as attachment.) thats was the mail. Line by line. I want to reply him but before that i want to know about the quality of my code. Is this really shitty...!!! Or he was just making fun of mine. I dont think that code is really shitty. Still correct me if you can.Code is working perfectly fine. Just copy paste it in a HTML file. <html> <head> <title> Exercise CSS </title> <script type="text/javascript"> function add_row() { var table = document.getElementById('table'); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); var element1 = document.createElement("input"); element1.type = "text"; cell1.appendChild(element1); var cell2 = row.insertCell(1); var element2 = document.createElement("input"); element2.type = "text"; cell2.appendChild(element2); var cell3 = row.insertCell(2); cell3.innerHTML = ' <span onClick="edit(this)">Edit</span>/<span onClick="delete_row(this)">Delete</span>'; cell3.setAttribute("style", "display:none;"); var cell4 = row.insertCell(3); cell4.innerHTML = '<span onClick="save(this)">Save</span>'; } function save(e) { var elTableCells = e.parentNode.parentNode.getElementsByTagName("td"); elTableCells[0].innerHTML=elTableCells[0].firstChild.value; elTableCells[1].innerHTML=elTableCells[1].firstChild.value; elTableCells[2].setAttribute("style", "display:block;"); elTableCells[3].setAttribute("style", "display:none;"); } function edit(e) { var elTableCells = e.parentNode.parentNode.getElementsByTagName("td"); elTableCells[0].innerHTML='<input type="text" value="'+elTableCells[0].innerHTML+'">'; elTableCells[1].innerHTML='<input type="text" value="'+elTableCells[1].innerHTML+'">'; elTableCells[2].setAttribute("style", "display:none;"); elTableCells[3].setAttribute("style", "display:block;"); } function delete_row(e) { e.parentNode.parentNode.parentNode.removeChild(e.parentNode.parentNode); } </script> </head> <body > <div id="display"> <table id='table'> <tr id='id'> <td> Piemesons </td> <td> 23 </td> <td > <span onClick="edit(this)">Edit</span>/<span onClick="delete_row(this)">Delete</span> </td> <td style="display:none;"> <span onClick="save(this)">Save</span> </td> </tr> </table> <input type="button" value="Add new row" onClick="add_row();" /> </div> </body>

    Read the article

  • Bandwidth Limit Php Not working

    - by Saxtor
    Hey How are you doing guys, i am trying to limit bandwidth per users not by ipaddress for some reason my code doesnt work i need some help, what i am trying to do is to limit the download of the user that they would only have 10Gb per day to download however it seems to me that my buffer is not working when i use multiple connections it doesnt work, but when i use one connect it works 80% here is my code can you debug the error for me thanks. /** * @author saxtor if you can improve this code email me [email protected] * @copyright 2010 */ /** * CREATE TABLE IF NOT EXISTS `max_traffic` ( `id` int(255) NOT NULL AUTO_INCREMENT, `limit` int(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; */ //SQL Connection [this is hackable for testing] date_default_timezone_set("America/Guyana"); mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("Quota") or die(mysql_error()); function quota($id) { $result = mysql_query("SELECT `limit` FROM max_traffic WHERE id='$id' ") or die(error_log(mysql_error()));; $row = mysql_fetch_array($result); return $row[0]; } function update_quota($id,$value) { $result = mysql_query("UPDATE `max_traffic` SET `limit`='$value' WHERE id='$id'") or die(mysql_error()); return $value; } if ( quota(1) != 0) $limit = quota(1); else $limit = 0; $multipart = false; //was a part of the file requested? (partial download) $range = $_SERVER["HTTP_RANGE"]; if ($range) { $cookie .= "\r\nRange: $range"; $multipart = true; header("X-UR-RANGE-Range: $range"); } $url = 'http://127.0.0.1/puppy.iso'; $filename = basename($url); //octet-stream + attachment => client always stores file header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$filename.'"'); //always included so clients know this script supports resuming header("Accept-Ranges: bytes"); $user_agent = ini_get("user_agent"); ini_set("user_agent", $user_agent . "\r\nCookie: enc=$cookie"); $httphandle = fopen($url, "r"); $headers = stream_get_meta_data($httphandle); $size = $headers["wrapper_data"][6]; $sizer = explode(' ',$size); $size = $sizer[1]; //let's check the return header of rapidshare for range / length indicators //we'll just pass these to the client foreach ($headers["wrapper_data"] as $header) { $header = trim($header); if (substr(strtolower($header), 0, strlen("content-range")) == "content-range") { // _insert($range); header($header); header("X-RS-RANGE-" . $header); $multipart = true; //content-range indicates partial download } elseif (substr(strtolower($header), 0, strlen("Content-Length")) == "content-length") { // _insert($range); header($header); header("X-RS-CL-" . $header); } } if ($multipart) header('HTTP/1.1 206 Partial Content'); flush(); $speed = 4128; $packet = 1; //this is private dont touch. $bufsize = 128; //this is private dont touch/ $bandwidth = 0; //this is private dont touch. while (!(connection_aborted() || connection_status() == 1) && $size > 0) { while (!feof($httphandle) && $size > 0) { if ($limit <= 0 ) $size = 0; if ( $size < $bufsize && $size != 0 && $limit != 0) { echo fread($httphandle,$size); $bandwidth += $size; } else { if( $limit != 0) echo fread($httphandle,$bufsize); $bandwidth += $bufsize; } $size -= $bufsize; $limit -= $bufsize; flush(); if ($speed > 0 && ($bandwidth > $speed*$packet*103)) { usleep(100000); $packet++; //update_quota(1,$limit); } error_log(update_quota(1,$limit)); $limit = quota(1); //if( $size <= 0 ) // exit; } fclose($httphandle); } exit;

    Read the article

  • ASp.Net Mvc 1.0 Dynamic Images Returned from Controller taking 154 seconds+ to display in IE8, firef

    - by julian guppy
    I have a curious problem with IE, IIS 6.0 dynamic PNG files and I am baffled as to how to fix.. Snippet from Helper (this returns the URL to the view for requesting the images from my Controller. string url = LinkBuilder.BuildUrlFromExpression(helper.ViewContext.RequestContext, helper.RouteCollection, c = c.FixHeight(ir.Filename, ir.AltText, "FFFFFF")); url = url.Replace("&", "&"); sb.Append(string.Format("<removed id=\"TheImage\" src=\"{0}\" alt=\"\" /", url)+Environment.NewLine); This produces a piece of html as follows:- img id="TheImage" src="/ImgText/FixHeight?sFile=Images%2FUser%2FJulianGuppy%2FMediums%2Fconservatory.jpg&backgroundColour=FFFFFF" alt="" / brackets missing because i cant post an image... even though I dont want to post an image I jsut want to post the markup... sigh Snippet from Controller ImgTextController /// <summary> /// This function fixes the height of the image /// </summary> /// <param name="sFile"></param> /// <param name="alternateText"></param> /// <param name="backgroundColour"></param> /// <returns></returns> [AcceptVerbs(HttpVerbs.Get)] public ActionResult FixHeight(string sFile, string alternateText, string backgroundColour) { #region File if (string.IsNullOrEmpty(sFile)) { return new ImgTextResult(); } // MVC specific change to prepend the new directory if (sFile.IndexOf("Content") == -1) { sFile = "~/Content/" + sFile; } // open the file System.Drawing.Image img; try { img = System.Drawing.Image.FromFile(Server.MapPath(sFile)); } catch { img = null; } // did we fail? if (img == null) { return new ImgTextResult(); } #endregion File #region Width // Sort out the width from the image passed to me Int32 nWidth = img.Width; #endregion Width #region Height Int32 nHeight = img.Height; #endregion Height // What is the ideal height given a width of 2100 this should be 1400. var nIdealHeight = (int)(nWidth / 1.40920096852); // So is the actual height of the image already greater than the ideal height? Int32 nSplit; if (nIdealHeight < nHeight) { // Yes, do nothing, well i need to return the iamge... nSplit = 0; } else { // rob wants to not show the white at the top or bottom, so if we were to crop the image how would be do it // 1. Calculate what the width should be If we dont adjust the heigt var newIdealWidth = (int)(nHeight * 1.40920096852); // 2. This newIdealWidth should be smaller than the existing width... so work out the split on that Int32 newSplit = (nWidth - newIdealWidth) / 2; // 3. Now recrop the image using 0-nHeight as the height (i.e. full height) // but crop the sides so that its the correct aspect ration var newRect = new Rectangle(newSplit, 0, newIdealWidth, nHeight); img = CropImage(img, newRect); nHeight = img.Height; nWidth = img.Width; nSplit = 0; } // No, so I want to place this image on a larger canvas and we do this by Creating a new image to be the size that we want System.Drawing.Image canvas = new Bitmap(nWidth, nIdealHeight, PixelFormat.Format24bppRgb); Graphics g = Graphics.FromImage(canvas); #region Color // Whilst we can set the background colour we shall default to white if (string.IsNullOrEmpty(backgroundColour)) { backgroundColour = "FFFFFF"; } Color bc = ColorTranslator.FromHtml("#" + backgroundColour); #endregion Color // Filling the background (which gives us our broder) Brush backgroundBrush = new SolidBrush(bc); g.FillRectangle(backgroundBrush, -1, -1, nWidth + 1, nIdealHeight + 1); // draw the image at the position var rect = new Rectangle(0, nSplit, nWidth, nHeight); g.DrawImage(img, rect); return new ImgTextResult { Image = canvas, ImageFormat = ImageFormat.Png }; } My ImgTextResult is a class that returns an Action result for me but embedding the image from a memory stream into the response.outputstream. snippet from my ImageResults /// <summary> /// Execute the result /// </summary> /// <param name="context"></param> public override void ExecuteResult(ControllerContext context) { // output context.HttpContext.Response.Clear(); context.HttpContext.Response.ContentType = "image/png"; try { var memStream = new MemoryStream(); Image.Save(memStream, ImageFormat.Png); context.HttpContext.Response.BinaryWrite(memStream.ToArray()); context.HttpContext.Response.Flush(); context.HttpContext.Response.Close(); memStream.Dispose(); Image.Dispose(); } catch (Exception ex) { string a = ex.Message; } } Now all of this works locally and lovely, and indeed all of this works on my production server BUT Only for Firefox, Safari, Chrome (and other browsers) IE has a fit and decides that it either wont display the image or it does display the image after approx 154seconds of waiting..... I have made sure my HTML is XHTML compliant, I have made sure I am getting no Routing errors or crashes in my event log on the server.... Now obviously I have been a muppet and have done something wrong... but what I cant fathom is why in development all works fine, and in production all non IE browsers also work fine, but IE 8 using IIS 6.0 production server is having some kind of problem in returning this PNG and I dont have an error to trace... so what I am looking for is guidance as to how I can debug this problem.

    Read the article

  • OpenGL, draw two polygons in the same time (by mouse clicks)

    - by YoungSalafi
    im trying to draw 2 polygons at the same time depending on user input from the opengl screen... so i made 2 arrays which each one of them will carry the vertices of each polygon ... i think my logic is right but the program still prints only polygon and delete the old polygon if you draw a polygon again . and its acting weird too please check the code yourself here it is : P.S dont mind the delete function right now.. i know it missing something. #include <windows.h> #include <gl/gl.h> #include <gl/glut.h> void Draw(); void Set_Transformations(); void Initialize(int argc, char *argv[]); void OnKeyPress(unsigned char key, int x, int y); void DeleteVer(); void MouseClick(int bin, int state , int x , int y); void GetOGLPos(int x, int y,float* arrY,float* arrX); void DrawPolygon(float* arrX,float* arrY); float xPos[20]; float yPos[20]; float xPos2[20]; float yPos2[20]; float fx = 0,fy = 0; float size = 10; int count = 0; bool done = false; bool flag = true; void Initialize(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA); glutInitWindowPosition(100, 100); glutInitWindowSize(600, 600); glutCreateWindow("OpenGL Lab1"); Set_Transformations(); glutDisplayFunc(Draw); glutMouseFunc(MouseClick); glutKeyboardFunc(OnKeyPress); glutMainLoop(); } void Set_Transformations() { glClearColor(1, 1, 1, 1); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-200, 200, -200, 200); } void OnKeyPress(unsigned char key, int x, int y) { if (key == 27) exit(0); switch(key) { case 13: //enter key it will draw done = true; glutPostRedisplay(); flag=!flag; // this flag to switch to the other array that the vertices will be stored in, in order to draw the second polygon break; } } void MouseClick(int button, int state , int x , int y) { switch (button) { case GLUT_RIGHT_BUTTON: if (state == GLUT_DOWN) { if (count>0) { DeleteVer(); //dont mind this right now } } break; case GLUT_LEFT_BUTTON: if (state == GLUT_DOWN) { if(count<20) { if(flag =true){ // drawing first polygon GetOGLPos(x, y,xPos,yPos);} if (flag=false) //drawing second polygon after Enter is pressed GetOGLPos(x, y,xPos2,yPos2); } } break; } } void GetOGLPos(int x, int y,float* arrY,float* arrX) //getting the vertices from the user { GLint viewport[4]; GLdouble modelview[16]; GLdouble projection[16]; GLfloat winX, winY, winZ; GLdouble posX, posY, posZ; glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetIntegerv( GL_VIEWPORT, viewport ); winX = (float)x; winY = (float)viewport[3] - (float)y; glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ ); gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ); arrX[count] = posX; arrY[count] = posY; count++; glPointSize( 6.0 ); glBegin(GL_POINTS); glVertex2f(posX,posY); glEnd(); glFlush(); } void DeleteVer(){ //dont mind this glColor3f ( 1, 1, 1); glBegin(GL_POINTS); glVertex2f(xPos[count-1],yPos[count-1]); glEnd(); glFlush(); xPos[count] = NULL; yPos[count] = NULL; count--; glColor3f ( 0, 0, 0); } void DrawPolygon(float* arrX,float* arrY) { int n=0; glColor3f ( 0, 0, 0); glBegin(GL_POLYGON); while(n<count) { glVertex2f(arrX[n],arrY[n]); n++; } count=0; glEnd(); glFlush(); } void Draw() //main drawing func { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0, 0, 0); if(done) { DrawPolygon(xPos,yPos); DrawPolygon(xPos2,yPos2); } glFlush(); } int main(int argc, char *argv[]) { Initialize(argc, argv); return 0; }

    Read the article

  • What are the arguments against parsing the Cthulhu way?

    - by smarmy53
    I have been assigned the task of implementing a Domain Specific Language for a tool that may become quite important for the company. The language is simple but not trivial, it already allows nested loops, string concatenation, etc. and it is practically sure that other constructs will be added as the project advances. I know by experience that writing a lexer/parser by hand -unless the grammar is trivial- is a time consuming and error prone process. So I was left with two options: a parser generator à la yacc or a combinator library like Parsec. The former was good as well but I picked the latter for various reasons, and implemented the solution in a functional language. The result is pretty spectacular to my eyes, the code is very concise, elegant and readable/fluent. I concede it may look a bit weird if you never programmed in anything other than java/c#, but then this would be true of anything not written in java/c#. At some point however, I've been literally attacked by a co-worker. After a quick glance at my screen he declared that the code is uncomprehensible and that I should not reinvent parsing but just use a stack and String.Split like everybody does. He made a lot of noise, and I could not convince him, partially because I've been taken by surprise and had no clear explanation, partially because his opinion was immutable (no pun intended). I even offered to explain him the language, but to no avail. I'm positive the discussion is going to re-surface in front of management, so I'm preparing some solid arguments. These are the first few reasons that come to my mind to avoid a String.Split-based solution: you need lot of ifs to handle special cases and things quickly spiral out of control lots of hardcoded array indexes makes maintenance painful extremely difficult to handle things like a function call as a method argument (ex. add( (add a, b), c) very difficult to provide meaningful error messages in case of syntax errors (very likely to happen) I'm all for simplicity, clarity and avoiding unnecessary smart-cryptic stuff, but I also believe it's a mistake to dumb down every part of the codebase so that even a burger flipper can understand it. It's the same argument I hear for not using interfaces, not adopting separation of concerns, copying-pasting code around, etc. A minimum of technical competence and willingness to learn is required to work on a software project after all. (I won't use this argument as it will probably sound offensive, and starting a war is not going to help anybody) What are your favorite arguments against parsing the Cthulhu way?* *of course if you can convince me he's right I'll be perfectly happy as well

    Read the article

  • How can a solo programmer become a good team player?

    - by Nick
    I've been programming (obsessively) since I was 12. I am fairly knowledgeable across the spectrum of languages out there, from assembly, to C++, to Javascript, to Haskell, Lisp, and Qi. But all of my projects have been by myself. I got my degree in chemical engineering, not CS or computer engineering, but for the first time this fall I'll be working on a large programming project with other people, and I have no clue how to prepare. I've been using Windows all of my life, but this project is going to be very unix-y, so I purchased a Mac recently in the hopes of familiarizing myself with the environment. I was fortunate to participate in a hackathon with some friends this past year -- both CS majors -- and excitingly enough, we won. But I realized as I worked with them that their workflow was very different from mine. They used Git for version control. I had never used it at the time, but I've since learned all that I can about it. They also used a lot of frameworks and libraries. I had to learn what Rails was pretty much overnight for the hackathon (on the other hand, they didn't know what lexical scoping or closures were). All of our code worked well, but they didn't understand mine, and I didn't understand theirs. I hear references to things that real programmers do on a daily basis -- unit testing, code reviews, but I only have the vaguest sense of what these are. I normally don't have many bugs in my little projects, so I have never needed a bug tracking system or tests for them. And the last thing is that it takes me a long time to understand other people's code. Variable naming conventions (that vary with each new language) are difficult (__mzkwpSomRidicAbbrev), and I find the loose coupling difficult. That's not to say I don't loosely couple things -- I think I'm quite good at it for my own work, but when I download something like the Linux kernel or the Chromium source code to look at it, I spend hours trying to figure out how all of these oddly named directories and files connect. It's a programming sin to reinvent the wheel, but I often find it's just quicker to write up the functionality myself than to spend hours dissecting some library. Obviously, people who do this for a living don't have these problems, and I'll need to get to that point myself. Question: What are some steps that I can take to begin "integrating" with everyone else? Thanks!

    Read the article

  • How to become a good team player?

    - by Nick
    I've been programming (obsessively) since I was 12. I am fairly knowledgeable across the spectrum of languages out there, from assembly, to C++, to Javascript, to Haskell, Lisp, and Qi. But all of my projects have been by myself. I got my degree in chemical engineering, not CS or computer engineering, but for the first time this fall I'll be working on a large programming project with other people, and I have no clue how to prepare. I've been using Windows all of my life, but this project is going to be very unix-y, so I purchased a Mac recently in the hopes of familiarizing myself with the environment. I was fortunate to participate in a hackathon with some friends this past year -- both CS majors -- and excitingly enough, we won. But I realized as I worked with them that their workflow was very different from mine. They used Git for version control. I had never used it at the time, but I've since learned all that I can about it. They also used a lot of frameworks and libraries. I had to learn what Rails was pretty much overnight for the hackathon (on the other hand, they didn't know what lexical scoping or closures were). All of our code worked well, but they didn't understand mine, and I didn't understand theirs. I hear references to things that real programmers do on a daily basis -- unit testing, code reviews, but I only have the vaguest sense of what these are. I normally don't have many bugs in my little projects, so I have never needed a bug tracking system or tests for them. And the last thing is that it takes me a long time to understand other people's code. Variable naming conventions (that vary with each new language) are difficult (__mzkwpSomRidicAbbrev), and I find the loose coupling difficult. That's not to say I don't loosely couple things -- I think I'm quite good at it for my own work, but when I download something like the Linux kernel or the Chromium source code to look at it, I spend hours trying to figure out how all of these oddly named directories and files connect. It's a programming sin to reinvent the wheel, but I often find it's just quicker to write up the functionality myself than to spend hours dissecting some library. Obviously, people who do this for a living don't have these problems, and I'll need to get to that point myself. Question: What are some steps that I can take to begin "integrating" with everyone else? Thanks!

    Read the article

  • OSX Snow Leopard hangs after login

    - by sleepyjames
    After restoring from backup following filesystem corruption my user account hangs after login (After entering my password the login window disappears and all I get is the background and a mouse pointer, no spinning wheel of death etc ..) I can login as a different user and then logout and login as my main account (sometimes!) but this is not consistant. I can login with safemode ok and have tried deleting /System/Caches, ~/Library/Caches and removing all my ~/Library/Preferences which worked once but not again. Does anyone have an any idea which logs I can look in, if any, to see whats happening after login or any other tips? I'm using 10.6.2. Cheers.

    Read the article

  • Can't create PID file on MySQL server, permission denied

    - by James Barnhill
    The MySQL server won't start and is reporting the following error: /usr/local/mysql/bin/mysqld: Can't create/write to file '/usr/local/mysql/data/James-Barnhills-Mac-Pro.local.pid' (Errcode: 13) Can't start server: can't create PID file: Permission denied All the permissions are set recursively as: lrwxr-xr-x 1 _mysql wheel 27 Nov 22 09:25 mysql -> mysql-5.5.18-osx10.6-x86_64 but it won't start. I've tried reinstalling several times to no avail. I'm running as root on Mac OS, and MySQL has read, write, and execute permissions on the "data" folder.

    Read the article

  • setting up a shared folder in linux

    - by Chris
    I'm trying to set up a folder in my home directory that will be shared with another user but for some reason it is not working this is what I've done, I have tried two different ways using ACL's and chown/chgrp etc I set up a group called say: sharedgroup and added both my user (john) and fred to it so when I run groups john john wheel sharedgroup groups fred sharedgroup fred mkdir /home/john/shared vim /home/john/shared/hello.txt (typed in some text saved it) chown -R :sharedgroup shared chmod -R o=-rwx shared ll drwxrwx--- 2 john sharedgroup 4096 Sep 9 21:14 shared ll shared -rw-rw-r-- 1 john sharedgroup 7 Sep 9 21:14 hello.txt (I also tried adding in the s permissions but that didn't help either) then when I log out of the server and log back in as fred and try these commands they fail vim /home/john/shared/hello.txt (won't allow me to write opens a blank file) cd /home/john/shared -bash: cd: /home/john/cis: Permission Denied ls /home/john/shared -ls: /home/john/shared: Permission Denied ls -lad /home/john/shared -ls: /home/john/shared: Permission Denied id fred uid=500(fred) gid=502(sharedgroup) groups=502(sharedgroup),500(fred) context=user_u:system_r:unconfined_t Any idea what I'm doing wrong??

    Read the article

  • Linking "Wave Volume" to "Main Speaker Volume"

    - by ZorbaTHut
    I've got a Logitech keyboard and a digital sound device. The Logitech keyboard has a little volume wheel that sets the Main Speaker Volume. The digital sound device ignores the Main Speaker Volume and only pays attention to Wave Volume. See the issue? I'm looking for a program that can link Wave Volume to Main Speaker Volume. The closest I've found is a little utility named VolumeTracker, but it eats an entire CPU core, which is a bit much for a program of this functionality. Alternatively, I'd take a way to make the standard Logitech drivers change Wave Volume instead of Main Speaker Volume.

    Read the article

  • Daemon/Software that takes changes from sql database and applies them to unix config files

    - by Dude Man
    I was wondering if there was a unix daemon available that would be capable of something like this: admin adds an IP entry to a DB; daemon finds change after wait interval and manipulates ifconfig/config files I was thinking maybe there is a plugin for cfengine that might be able to do this, but I couldn't find any. I mean this would be a fairly easy thing to script up in perl, but why re-invent the wheel if theres already something out there that is better than what my limited programming abilities can make. Lastly, if it worked on FreeBSD that'd be great.

    Read the article

  • Use trackball to scroll, zoom, etc

    - by filledvoid
    I've got a Logitech Marble Trackball (which is great, btw). By setting one of the extra buttons as a "middle" mouse button, when I click it, many apps (like browsers) will start "scrolling mode" so that moving the trackball will scroll up and down. Most of the time, this is sufficient, but I figure it would be way cooler if I could have several "modes" to do different things like zooming, panning, rotating (particularly in GIMP). Then when I hold CTRL, CTRL+SHIFT, or some such, it would enter a new mode, and the trackball would behave differently. I found a couple questions similar to this that suggest using AutoHotKey, but I haven't found an example script to do this, nor can I find out to track mouse movements within AHK. Any pointers? hotkey for scrollwheel remedy for a no scroll wheel trackball? Thanks!

    Read the article

  • ReadyNAS running slow

    - by Simon Callan
    We have a NetGear ReadyNAS NV+ that we are using just for filestorage. While it appears to be running normally as a fileserver, the admin functions run incredibly slow. Sometimes, backups take so long that they don't finish before the next run is due to start, and if I try to look at the backup logs or download the system logs, all I get is the busy "whirling wheel", until I get a "System is busy message". Is this just the system being bolshy, or is it a sign of problems to come, and what can I do to diagnose them?

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >