Daily Archives

Articles indexed Tuesday October 9 2012

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

  • Disable/remove Cinnamon keyboard shortcurts

    - by Robin
    I installed Cinnamon on Ubuntu 12.04 using sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable sudo apt-get update sudo apt-get install cinnamon Now I am looking for a way to disable the keyboard shortcuts ALTF7 (move window) and ALTF8 (resize windows). I already disabled those key bindings under Keyboard - Shortcuts. This has no effect. I did not find them in gconf-editor under apps -> muffin . Does anybody know how to remove/edit/disable those key bindings ?

    Read the article

  • After I backed up my ubuntu 12.04, my system crashed

    - by user95490
    Outline: I use the way shown on http://ubuntuforums.org/showthread.php?t=35087 to backup my linux system, but somehow when I restore it, it crashes. Problem Description: When I reboot, there's an information: Gave up waiting for root device. Common problems: -- Boot args (cat /proc/cmdline) -- Check rootdisplay = (did the system wait long enough?) -- Check root = (did the system wait for the right device?) -- Missing modules (cat /proc/modules; ls dev) ALERT! /dev/disk/by-uuid/9cf6f563-86d1-47be-bc26-92dd7df35cb3 does not exist. Dropping to a shell!

    Read the article

  • Need a graphical renaming tool which can rename files recursively

    - by user37991
    ATM I am forced to use freeware in Windows to rename SOME Linux data files. Linux also creates files like "Filename.ext" as being different to "filename.ext", and !@#$hg".ext ... which cannot be recognized by Windows. "pyrenamer" ... mentioned in another answer cannot auto-rename more than the one immediate folder. I use Ubuntu, not ARCH linux, because I am not CLI. Despite some answers here (designed by and for CLI programmers), how can Ubuntu GUI (not CLI) do file renaming? BTY: in ONE folder only, THUNAR is far better than silly pyrenamer. But Thunar cannot auto-rename recursively.

    Read the article

  • FTP Connection established...Connection timed out problem with all my sites and FTP programs?

    - by janoChen
    Just few hours ago FileZilla was working fine. Then, suddenly I started to get this error: Status: Resolving address of ftp.readtypechinese.com Status: Connecting to 69.175.14.60:21... Status: Connection established, waiting for welcome message... Error: Connection timed out Error: Could not connect to server And it happens with all my sites: Status: Resolving address of edasich.dreamhost.com Status: Connecting to 173.236.223.223:21... Status: Connection established, waiting for welcome message... Error: Connection timed out Error: Could not connect to server I'm using FileZilla 3.5.0 and Ubuntu 11.10. Any suggestions to fix this? (I already tried Passive mode and it doesn't work). EDIT: Ocasionally, the log goes beyond the ...waiting for welcome message: Status: Connection established, waiting for welcome message... Response: 220 DreamHost FTP Server Command: USER aleche23 Error: Connection timed out Error: Could not connect to server But the connection gets timed out again. Weird...I just realized that I have the same problems with other FTP programs too: gFTP: Looking up ftp.readtypechinese.com Trying readtypechinese.com:21 Connected to readtypechinese.com:21 220 ProFTPD 1.3.2 Server (server) [69.175.14.60] USER [email protected] Connection to ftp.readtypechinese.com timed out

    Read the article

  • Temporary dimming of desktop in 12.04

    - by deshmukh
    I am running Ubuntu 12.04 (almost default install regularly updated) Unity interface on ASUS X53U (AMD Brazos Dual Core C60 with 2GB RAM). On launching Thunderbird and Firefox, the application dims and the cursor changes to wait mode. In case of Thunderbird, this is most pronounced with the wait time of up to a minute. Memory status checked with free indicates around 500MB of free memory on such occasions. The OS is stable and I can switch to a different work-space, etc. What could this be? Is this something normal?

    Read the article

  • Ubuntu 12.04 hangs on install using VMware Player on Windows 7

    - by Beauness_Round
    At my job, we're migrating to Ubuntu 12.04 from 10.10 (we skipped a generation), so everyone needs to make one or more new Virtual Machines for 12.04 on their Windows 7 workstation. The problem is, only some have had success while most encounter a hang during install. I was tasked with researching this problem and here are my findings (while somewhat inconclusive) I have tried uninstalling and reinstalling VMware Player, using versions 4.0.2, 4.0.4, and 5.0.0 but every install hangs at "retrieving file 55 of 129." Additionally I have installed before updating the VMware tools, as well as after (one can pre-download them) with every install hanging at "retrieving file 55 of 129." The file i was using for the above two is called: ubuntu-12.04-desktop-amd64.iso I have burned a disc with ubuntu-12.04.1-desktop-amd64.iso and tried to install it, and later tried ubuntu-12.04.1-desktop-i386.iso (which is not what i want but i wanted to see if it would work), but both times I get "PXE-E53: No boot filename recieved PXE-M0F: Exiting Intel PXE ROM. Operating System not found" This is all in VMware and the goal is to find a settings recipe that will allow an unbroken 64bit Ubuntu 12.04 install from an .iso hosted on the Windows OS. Thank you in advance to anyone with ideas!

    Read the article

  • Awesome WordPress modular theme builder?

    - by Matt M.
    I came across a really neat modular theme for WordPress a while ago, but I can't remember the name so I'm wondering if somebody can help out. It was a paid theme with a dedicated company behind it if I'm not mistaken. The theme allowed you to change the colors of all the content areas, define widgets, and resize content areas. I'm really interested in being able to resize columns and such at the touch of a button, getting too old for the usual CSS micromanagement that goes on with brittle themes.

    Read the article

  • how to stop the array of sprite in cocos2d?

    - by prakash s
    I am devoloping the bubble shooter game in cocos2d how to stop the sprite movement at the center of the game scene in my game bec i want to shoot the bubble after stopping the movenent at certain position here is my code -(void)addTarget { CGSize winSize = [[CCDirector sharedDirector] winSize]; NSMutableArray * movableSprites = [[NSMutableArray alloc] init]; NSArray *images = [NSArray arrayWithObjects:@"1.png", @"2.png", @"3.png", @"4.png",@"5.png", @"6.png", @"7.png",@"8.png" ,nil]; for(int i = 0; i < images.count; ++i) { int index = (arc4random() % 8)+1; NSString *image = [NSString stringWithFormat:@"%d.png", index]; CCSprite*target = [CCSprite spriteWithFile:image]; // generate random number based on size of array (array size is larger than 10) float offsetFraction = ((float)(i+1))/(images.count+1); //target.position = ccp(winSize.width*offsetFraction, winSize.height/2); target.position = ccp(350*offsetFraction, 460); [self addChild:target]; [movableSprites addObject:target]; id actionMove = [CCMoveTo actionWithDuration:10 position:ccp(350*offsetFraction, 100)]; id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)]; [target runAction:[CCSequence actions:actionMove, actionMoveDone, nil]]; } here bubbles are moving from top to bottom but after 5 rows my bubble movement should be stop so please help me to get that logic

    Read the article

  • glReadPixels and save to image

    - by Julius Petraška
    I have app, where user drags and drops image, and it is being redrawn with OpenGL for some aviable processing. Everything works. And when user wants to save his image it works like that: glReadPixels -> NSBitmapImageRep -> NSData -> Write to file This works too. Almost. With some images it is not working as it should work. For example: .png when I open and save this image: I get: And if I open and save this image: I get: .jpg If I open and save: I get: And when I open and save: I get: So sometimes images saves badly. Why is it happening?

    Read the article

  • Curl: How to insert value to a cookie?

    - by Crazy_Bash
    Ho to insert cookies value in curl? from firebug "request headers" i can see in the following "Cookie: PHPSESSID=gg792c2ktu6sch6n8q0udd94o0; was=1; uncheck2=1; uncheck3=1; uncheck4=1; uncheck5=0; hd=1; uncheck1=1" I have tried the following: curl http://site.com/ -s -L -b cookie.c -c cookie.c -d "was=1; uncheck2=1; uncheck3=1; uncheck4=1; uncheck5=0; hd=1; uncheck1=1" > comic and the only thing i see in cookie.c is PHPSESSID=gg792c2ktu6sch6n8q0udd94o0; was=1;

    Read the article

  • Use of 'super' keyword when accessing non-overridden superclass methods

    - by jonny
    I'm trying to get the hang of inheritance in Java and have learnt that when overriding methods (and hiding fields) in sub classes, they can still be accessed from the super class by using the 'super' keyword. What I want to know is, should the 'super' keyword be used for non-overridden methods? Is there any difference (for non-overridden methods / non-hidden fields)? I've put together an example below. public class Vehicle { public int tyreCost; public Vehicle(int tyreCost) { this.tyreCost = tyreCost; } public int getTyreCost() { return tyreCost; } } and public class Car extends Vehicle { public int wheelCount; public Vehicle(int tyreCost, int wheelCount) { super(tyreCost); this.wheelCount = wheelCount; } public int getTotalTyreReplacementCost() { return getTyreCost() * wheelCount; } } Specifically, given that getTyreCost() hasn't been overridden, should getTotalTyreReplacementCost() use getTyreCost(), or super.getTyreCost() ? I'm wondering whether super should be used in all instances where fields or methods of the superclass are accessed (to show in the code that you are accessing the superclass), or only in the overridden/hidden ones (so they stand out).

    Read the article

  • Resolve property at runtime. C#

    - by user1031381
    I have some class which have some code public IEnumerable<TypeOne> TypeOne { get { if (db != null) { var col = db.Select<TypeOne>(); if (col.Count > 0) return col; } return db2.TypeOne; } } public IEnumerable<TypeTwo> TypeTwo { get { if (db != null) { var col = db.Select<TypeTwo>(); if (col.Count > 0) return col; } return db2.TypeTwo; } } So as You can see there is a lot of duplicated Code and there are same property name and item type of enumerable. I want to call some property of object like "obj.MyProp". And MyProp must be resolved at runtime with some generic or non-generic method. Is it possible?

    Read the article

  • How to map code points to unicode characters depending on the font used?

    - by Alex Schröder
    The client prints labels and has been using a set of symbolic (?) fonts to do this. The application uses a single byte database (Oracle with Latin-1). The old application I am replacing was not Unicode aware. It somehow did OK. The replacement application I am writing is supposed to handle the old data. The symbols picked from the charmap application often map to particular Unicode characters, but sometimes they don't. What looks like the Moon using the LAB3 font, for example, is in fact U+2014 (EM DASH). When users paste this character into a Swing text field, the character has the code point 8212. It was "moved" into the Private Use Area (by Windows? Java?). When saving this character to the database, Oracle decides that it cannot be safely encoded and replaces it with the dreaded ¿. Thus, I started shifting the characters by 8000: -= 8000 when saving, += 8000 when displaying the field. Unfortunately I discovered that other characters were not shifted by the same amount. In one particular font, for example, ž has the code point 382, so I shifted it by +/-256 to "fix" it. By now I'm dreading the discovery of more strange offsets and I wonder: Can I get at this mapping using Java? Perhaps the TTF font has a list of the 255 glyphs it encodes and what Unicode characters those correspond to and I can do it "right"? Right now I'm using the following kludge: static String fromDatabase(String str, String fontFamily) { if (str != null && fontFamily != null) { Font font = new Font(fontFamily, Font.PLAIN, 1); boolean changed = false; char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { if (font.canDisplay(chars[i] + 0xF000)) { // WE8MSWIN1252 + WinXP chars[i] += 0xF000; changed = true; } else if (chars[i] >= 128 && font.canDisplay(chars[i] + 8000)) { // WE8ISO8859P1 + WinXP chars[i] += 8000; changed = true; } else if (font.canDisplay(chars[i] + 256)) { // ž in LAB1 Eastern = 382 chars[i] += 256; changed = true; } } if (changed) str = new String(chars); } return str; } static String toDatabase(String str, String fontFamily) { if (str != null && fontFamily != null) { boolean changed = false; char[] chars = str.toCharArray(); for (int i = 0; i < chars.length; i++) { int chr = chars[i]; if (chars[i] > 0xF000) { // WE8MSWIN1252 + WinXP chars[i] -= 0xF000; changed = true; } else if (chars[i] > 8000) { // WE8ISO8859P1 + WinXP chars[i] = (char) (chars[i] - 8000); changed = true; } else if (chars[i] > 256) { // ž in LAB1 Eastern = 382 chars[i] = (char) (chars[i] - 256); changed = true; } } if (changed) return new String(chars); } return str; }

    Read the article

  • Lua operations, that works in mutitheaded environment

    - by SBKarr
    My application uses Lua in multithreaded environment with global mutex. It implemented like this: Thread locks mutex, Call lua_newthread Perform some initialization on coroutine Run lua_resume on coroutine Unlocks mutex lua_lock/unlock is not implemented, GC is stopped, when lua works with coroutine. My question is, can I perform steps 2 and 3 without locking, if initialisation process does not requires any global Lua structs? Can i perform all this process without locking at all, if coroutine does not requires globals too? In what case I generally can use Lua functions without locking?

    Read the article

  • Is there any declare for toggle() that if its open do this, closed to that?

    - by Dejan.S
    Im doing some jquery stuff with toggle(), I'm doing different actions depending on if the current div is closing or showing, i know i can easy check if a div hasClass() or is(':visible') for what i want to do, but I'm thinking maybe there is somehow that i can reduce the amount of code or just do it more efficient? like declare the toggle() with two functions that this is for when its showing and this is for when its closing, is this possible? hope you get what i mean? like this, or check a jsfiddle $('#click_me').on('click', function() { $('#contain').toogle('blind', 300, function (){ alert('open'); }, function (){ alert('close'); }); });

    Read the article

  • Compiling VIM on OS X Mountain Lion

    - by Lauri L
    Compiling VIM on Mountain Lion does not work for me. I compile VIM with the following sequence: hg clone https://vim.googlecode.com/hg/ vim cd vim ./configure --enable-rubyinterp --with-features=huge -prefix=/usr make I then try to start the compiled binary with src/vim, but it crashes like this: $ src/vim Vim: Caught deadly signal SEGV Vim: Finished. Segmentation fault: 11 What am I missing here?

    Read the article

  • Azure Table Storage rejects an entity with a Property whose value is an Interface

    - by Andrew B Schultz
    I have a type called "Comment" that I'm saving to Azure Table Storage. Since a comment can be about any number of other types, I created an interface which all of these types implement, and then put a property of type ICommentable on the comment. So Comment has a property called About of type ICommentable. When I try to save a Comment to Azure Table Storage, if the Comment.About property has a value, I get the worthless invalid input error. However, if there is no value for Comment.About, I have no problem. Why would this be? Comment.About is not the only property that is a reference type. For example, Comment.From is a reference type, but the Comment.About is the only property of a type that is an interface. Fails: var comment = new Comment(); comment.CommentText = "It fails!"; comment.PartitionKey = "TEST"; comment.RowKey = "TEST123"; comment.About = sow1; comment.From = person1; Works: var comment = new Comment(); comment.CommentText = "It works!"; comment.PartitionKey = "TEST"; comment.RowKey = "TEST123"; //comment.About = sow1; comment.From = person1; Thanks!

    Read the article

  • Team Foundation Server 2010 and Offline development?

    - by Bobby Ortiz
    Did Microsoft add anything to improve offline development? I'm comparing TFS with Mercurial. Edit #1: Work Environment Details 20 Developers. 1 location. TFS 2005 is already installed, but only being used by 4 developers. Those that use TFS, are only using it for Source Control Others using VSS. :( Many small projects (Over 50 projects active) Project Team size: 1 to 3 Several employees work from home one day a week, but have VPN access There is a group of our devs that have never used TFS that are still on VSS. They are the ones pushing use to jump ship to Mercurial. Mercurial offline features is one reason they prefer it. Another reason is they just associate TFS with VSS regardless of my assertions to the contrary. We do use FogBugz and everyone agrees that it is great! This kind of excited our love for NON Microsoft products that our MUCH lighter. I don't think it is worth it.

    Read the article

  • Crowdsourcing translation for mobile developers?

    - by superg
    I am developing applications for mobile phones with different operating systems (Android, Symbian, iPhone). Applications are sold internationally so they need to be translated to different languages in addition to english version. I assume most mobile developers do the translations using some paid external service each time. This approach does not look very cost-effective to me. Would it make sense to have a website where simple translations would be done using crowdsourcing (other developers)? Most strings in mobile applications are very simple and short, for example "OK, "Cancel", "Are you sure?", "Please enter your password". Also the same strings are used in hundreds of applications. Instead of paying for translating all strings, developers could save money by only buying their difficult application specific translations. Does anyone agree with this idea? I have seen many opensource projects doing the translations succesfully using volunteers.

    Read the article

  • Automatically create bug resolution task using the TFS 2010 API

    - by Bob Hardister
    My customer requires bug resolution to be approved and tracked.  To minimize the overhead for developers I implemented a TFS 2010 server-side plug-in to automatically create a child resolution task for the bug when the “CCB” field is set to approved. The CCB field is a custom field.  I also added the story points field to the bug WIT for sizing purposes. Redundant tasks will not be created unless the bug title is changed or the prior task is closed. The program writes an audit trail to a log file visible in the TFS Admin Console Log view. Here’s the code. BugAutoTask.cs /* SPECIFICATION * When the CCB field on the bug is set to approved, create a child task where the task: * name = Resolve bug [ID] - [Title of bug] * assigned to = same as assigned to field on the bug * same area path * same iteration path * activity = Bug Resolution * original estimate = bug points * * The source code is used to build a dll (Ows.TeamFoundation.BugAutoTaskCreation.PlugIns.dll), * which needs to be copied to * C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\bin\Plugins * on ALL TFS application-tier servers. * * Author: Bob Hardister. */ using System; using System.Collections.Generic; using System.IO; using System.Xml; using System.Text; using System.Diagnostics; using System.Linq; using Microsoft.TeamFoundation.Common; using Microsoft.TeamFoundation.Framework.Server; using Microsoft.TeamFoundation.WorkItemTracking.Client; using Microsoft.TeamFoundation.WorkItemTracking.Server; using Microsoft.TeamFoundation.Client; using System.Collections; namespace BugAutoTaskCreation { public class BugAutoTask : ISubscriber { public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties) { statusCode = 0; properties = null; statusMessage = String.Empty; // Error message for for tracing last code executed and optional fields string lastStep = "No field values found or set "; try { if ((notificationType == NotificationType.Notification) && (notificationEventArgs.GetType() == typeof(WorkItemChangedEvent))) { WorkItemChangedEvent workItemChange = (WorkItemChangedEvent)notificationEventArgs; // see ConnectToTFS() method below to select which TFS instance/collection // to connect to TfsTeamProjectCollection tfs = ConnectToTFS(); WorkItemStore wiStore = tfs.GetService<WorkItemStore>(); lastStep = lastStep + ": connection to TFS successful "; // Get the work item that was just changed by the user. WorkItem witem = wiStore.GetWorkItem(workItemChange.CoreFields.IntegerFields[0].NewValue); lastStep = lastStep + ": retrieved changed work item, ID:" + witem.Id + " "; // Filter for Bug work items only if (witem.Type.Name == "Bug") { // DEBUG lastStep = lastStep + ": changed work item is a bug "; // Filter for CCB (i.e. Baseline Status) field set to approved only bool BaselineStatusChange = false; if (workItemChange.ChangedFields != null) { ProcessBugRevision(ref lastStep, workItemChange, wiStore, ref witem, ref BaselineStatusChange); } } } } catch (Exception e) { Trace.WriteLine(e.Message); Logger log = new Logger(); log.WriteLineToLog(MsgLevel.Error, "Application error: " + lastStep + " - " + e.Message + " - " + e.InnerException); } statusCode = 1; statusMessage = "Bug Auto Task Evaluation Completed"; properties = null; return EventNotificationStatus.ActionApproved; } // PRIVATE METHODS private static void ProcessBugRevision(ref string lastStep, WorkItemChangedEvent workItemChange, WorkItemStore wiStore, ref WorkItem witem, ref bool BaselineStatusChange) { foreach (StringField field in workItemChange.ChangedFields.StringFields) { // DEBUG lastStep = lastStep + ": last changed field is - " + field.Name + " "; if (field.Name == "Baseline Status") { lastStep = lastStep + ": retrieved bug baseline status field value, bug ID:" + witem.Id + " "; BaselineStatusChange = (field.NewValue != field.OldValue); if ((BaselineStatusChange) && (field.NewValue == "Approved")) { // Instanciate logger Logger log = new Logger(); // *** Create resolution task for this bug *** // ******************************************* // Get the team project and selected field values of the bug work item Project teamProject = witem.Project; int bugID = witem.Id; string bugTitle = witem.Fields["System.Title"].Value.ToString(); string bugAssignedTo = witem.Fields["System.AssignedTo"].Value.ToString(); string bugAreaPath = witem.Fields["System.AreaPath"].Value.ToString(); string bugIterationPath = witem.Fields["System.IterationPath"].Value.ToString(); string bugChangedBy = witem.Fields["System.ChangedBy"].OriginalValue.ToString(); string bugTeamProject = witem.Project.Name; lastStep = lastStep + ": all mandatory bug field values found "; // Optional fields Field bugPoints = witem.Fields["Microsoft.VSTS.Scheduling.StoryPoints"]; if (bugPoints.Value != null) { lastStep = lastStep + ": all mandatory and optional bug field values found "; } // Initialize child resolution task title string childTaskTitle = "Resolve bug " + bugID + " - " + bugTitle; // At this point I can check if a resolution task (of the same name) // for the bug already exist // If so, do not create a new resolution task bool createResolutionTask = true; WorkItem parentBug = wiStore.GetWorkItem(bugID); WorkItemLinkCollection links = parentBug.WorkItemLinks; foreach (WorkItemLink wil in links) { if (wil.LinkTypeEnd.Name == "Child") { WorkItem childTask = wiStore.GetWorkItem(wil.TargetId); if ((childTask.Title == childTaskTitle) && (childTask.State != "Closed")) { createResolutionTask = false; log.WriteLineToLog(MsgLevel.Info, "Team project " + bugTeamProject + ": " + bugChangedBy + " - set the CCB field to \"Approved\" for bug, ID: " + bugID + ". Task not created as open one of the same name already exist, ID:" + childTask.Id); } } } if (createResolutionTask) { // Define the work item type of the new work item WorkItemTypeCollection workItemTypes = wiStore.Projects[teamProject.Name].WorkItemTypes; WorkItemType wiType = workItemTypes["Task"]; // Setup the new task and assign field values witem = new WorkItem(wiType); witem.Fields["System.Title"].Value = "Resolve bug " + bugID + " - " + bugTitle; witem.Fields["System.AssignedTo"].Value = bugAssignedTo; witem.Fields["System.AreaPath"].Value = bugAreaPath; witem.Fields["System.IterationPath"].Value = bugIterationPath; witem.Fields["Microsoft.VSTS.Common.Activity"].Value = "Bug Resolution"; lastStep = lastStep + ": all mandatory task field values set "; // Optional fields if (bugPoints.Value != null) { witem.Fields["Microsoft.VSTS.Scheduling.OriginalEstimate"].Value = bugPoints.Value; lastStep = lastStep + ": all mandatory and optional task field values set "; } // Check for validation errors before saving the new task and linking it to the bug ArrayList validationErrors = witem.Validate(); if (validationErrors.Count == 0) { witem.Save(); // Link the new task (child) to the bug (parent) var linkType = wiStore.WorkItemLinkTypes[CoreLinkTypeReferenceNames.Hierarchy]; // Fetch the work items to be linked var parentWorkItem = wiStore.GetWorkItem(bugID); int taskID = witem.Id; var childWorkItem = wiStore.GetWorkItem(taskID); // Add a new link to the parent relating the child and save it parentWorkItem.Links.Add(new WorkItemLink(linkType.ForwardEnd, childWorkItem.Id)); parentWorkItem.Save(); log.WriteLineToLog(MsgLevel.Info, "Team project " + bugTeamProject + ": " + bugChangedBy + " - set the CCB field to \"Approved\" for bug, ID:" + bugID + ", which automatically created child resolution task, ID:" + taskID); } else { log.WriteLineToLog(MsgLevel.Error, "Error in creating bug resolution child task for bug ID:" + bugID); foreach (Field taskField in validationErrors) { log.WriteLineToLog(MsgLevel.Error, " - Validation Error in task field: " + taskField.ReferenceName); } } } } } } } private TfsTeamProjectCollection ConnectToTFS() { // Connect to TFS string tfsUri = string.Empty; // Production TFS instance production collection tfsUri = @"xxxx"; // Production TFS instance admin collection //tfsUri = @"xxxxx"; // Local TFS testing instance default collection //tfsUri = @"xxxxx"; TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new System.Uri(tfsUri)); tfs.EnsureAuthenticated(); return tfs; } // HELPERS public string Name { get { return "Bug Auto Task Creation Event Handler"; } } public SubscriberPriority Priority { get { return SubscriberPriority.Normal; } } public enum MsgLevel { Info, Warning, Error }; public Type[] SubscribedTypes() { return new Type[1] { typeof(WorkItemChangedEvent) }; } } } Logger.cs using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Windows.Forms; namespace BugAutoTaskCreation { class Logger { // fields private string _ApplicationDirectory = @"C:\ProgramData\Microsoft\Team Foundation\Server Configuration\Logs"; private string _LogFileName = @"\CFG_ACCT_AT_OWS_BugAutoTaskCreation.log"; private string _LogFile; private string _LogTimestamp = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); private string _MsgLevelText = string.Empty; // default constructor public Logger() { // check for a prior log file FileInfo logFile = new FileInfo(_ApplicationDirectory + _LogFileName); if (!logFile.Exists) { CreateNewLogFile(ref logFile); } } // properties public string ApplicationDirectory { get { return _ApplicationDirectory; } set { _ApplicationDirectory = value; } } public string LogFile { get { _LogFile = _ApplicationDirectory + _LogFileName; return _LogFile; } set { _LogFile = value; } } // PUBLIC METHODS public void WriteLineToLog(BugAutoTask.MsgLevel msgLevel, string logRecord) { try { // set msgLevel text if (msgLevel == BugAutoTask.MsgLevel.Info) { _MsgLevelText = "[Info @" + MsgTimeStamp() + "] "; } else if (msgLevel == BugAutoTask.MsgLevel.Warning) { _MsgLevelText = "[Warning @" + MsgTimeStamp() + "] "; } else if (msgLevel == BugAutoTask.MsgLevel.Error) { _MsgLevelText = "[Error @" + MsgTimeStamp() + "] "; } else { _MsgLevelText = "[Error: unsupported message level @" + MsgTimeStamp() + "] "; } // write a line to the log file StreamWriter logFile = new StreamWriter(_ApplicationDirectory + _LogFileName, true); logFile.WriteLine(_MsgLevelText + logRecord); logFile.Close(); } catch (Exception) { throw; } } // PRIVATE METHODS private void CreateNewLogFile(ref FileInfo logFile) { try { string logFilePath = logFile.FullName; // write the log file header _MsgLevelText = "[Info @" + MsgTimeStamp() + "] "; string cpu = string.Empty; if (Environment.Is64BitOperatingSystem) { cpu = " (x64)"; } StreamWriter newLog = new StreamWriter(logFilePath, false); newLog.Flush(); newLog.WriteLine(_MsgLevelText + "===================================================================="); newLog.WriteLine(_MsgLevelText + "Team Foundation Server Administration Log"); newLog.WriteLine(_MsgLevelText + "Version : " + "1.0.0 Author: Bob Hardister"); newLog.WriteLine(_MsgLevelText + "DateTime : " + _LogTimestamp); newLog.WriteLine(_MsgLevelText + "Type : " + "OWS Custom TFS API Plug-in"); newLog.WriteLine(_MsgLevelText + "Activity : " + "Bug Auto Task Creation for CCB Approved Bugs"); newLog.WriteLine(_MsgLevelText + "Area : " + "Build Explorer"); newLog.WriteLine(_MsgLevelText + "Assembly : " + "Ows.TeamFoundation.BugAutoTaskCreation.PlugIns.dll"); newLog.WriteLine(_MsgLevelText + "Location : " + @"C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services\bin\Plugins"); newLog.WriteLine(_MsgLevelText + "User : " + Environment.UserDomainName + @"\" + Environment.UserName); newLog.WriteLine(_MsgLevelText + "Machine : " + Environment.MachineName); newLog.WriteLine(_MsgLevelText + "System : " + Environment.OSVersion + cpu); newLog.WriteLine(_MsgLevelText + "===================================================================="); newLog.WriteLine(_MsgLevelText); newLog.Close(); } catch (Exception) { throw; } } private string MsgTimeStamp() { string msgTimestamp = string.Empty; return msgTimestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:fff"); } } }

    Read the article

  • Doctorii in bancuri

    - by interesante
    Un medic citeste in birou un ziar. Intra o pacienta si incepe sa-si ridice fusta. Medicul priveste si spune: "Mai sus!" si citeste mai departe. Ea ridica fusta mai sus. El ii repeta: "Mai sus!" si iarasi se intoarce la ziar. Ea il asculta si ridica fusta si mai sus. Atunci el ii spune: "Domnisoara, ginecologul e mai sus!".Medicul catre pacient: - Aveti o boala contagioasa extrem de rara. O sa fiti mutat intr-o camera separata si acolo veti minca numai pizza si clatite. - Si astea ma vor ajuta sa ma fac bine? - Nu, dar asta-i singura mincare care incape pe sub usaMai multe bancuri de acest fel pe un blog amuzant pentru toti.Buna ziua! - Buna ziua, domnule politist! - Dumneata, tinere domn, pe gheata asta conduci cu 70 km pe ora? Vrei sa ajungi la spital? - Da! - Bravo, frumos raspuns! Esti smecher? - Nu! Sunt doctor!

    Read the article

  • Hazlii cu politisti

    - by interesante
    Mor 6 politisti si se ancheteaza cazul:-Pai...Trei dintre ei erau cu barca pe lac si doi si-au aprins cate-o tigara.Unul si-a adus aminte ca a uitat sa stinga chibritul si a sarit in apa sa-l stinga si sa-necat.Al doilea uitase se-si stinga chistocul si a sarit si el si sa-necat.-Si al treilea?-Nu pornea barca si s-a dat jos s-o-mpinga si sa-necat.-Bine, dar ceilalti trei ?-Ei au murit la reconstituire.....Distreaza-te copios si cu jocuri flash de pe un site cu jocuri online.Doua sotii de politisti stau de vorba. Una zice:- Draga, sotul meu are post langa o florarie. Niciodata nu mi-a adus vreo floare...- Si ce? Al meu are post langa conservator. O conserva n-am vazut pana acum...

    Read the article

  • Nullable types and ?? operator C# [en-US]

    - by ruimachado
    Nullable types vs Non-nullable types   While developing our C# projects its frequent the null comparison operation to avoid null exceptions. This simple operation is mainly coded using the "var x = null" code example inside an if clause. However not all types of variables are nullable, which means that setting a variable to null is not allowed in every cases, it depends on what kind of type are you defining. But what if there was an extension to your non-nullable type that would convert your variable types to nullable? This extension really exists. As I said before in C# you have nullable types which represent all the values of an underlying type, and an additional null value and can be declared easily using "T?", where T is the type of the variable and for example the normal int type cannot be null, so its a non-nullable type, however if you define a "int?" your variable can be null, what you do is convert a non-nullable type to a nullable type. Example: int x=null;     Not allowed     int? x=null;   Allowed     While using nullable types you can check if a variable is null the same way you do it with nullable types:     But what about setting a default value when a certain variable is null?   In this cases the c# .net framework let you set a default value when you try to assign a nullable type to a non-nullable type, using the ?? operator. If you don't use this operator you can still catch the InvalidOperationException which is throw in this cases. For example  without the ?? operator :     Using the ?? operator your code becomes cleaner and more easy to read and you get a bonus, you can set a default value for multiple variables using the ?? in a chain set.     That’s it,   Thanks, Rui Machado rpmachado.wordpress.com

    Read the article

  • Consuming OData based Rest service in C# [en-US]

    - by ruimachado
    Nowadays comunication between applications is an active topic with daily usage and a large amount of pratical appliances. While developing an app in witch I had to consume an OData I found out that combining Linq with my code made this operation pretty easy.The algorithm to consume OData starts with adding a service reference to Visual Studio:After adding the service reference in wich you define the uri to the service, we start building our code.In your code the algorithm is the following:Define the Uri to your OData ServiceDefine the context of your odata, wich contains all entities exposed by the service.Query the context using LinqPrint the resultEasy and simple.Example code:01public static void Main(string[] args){02 03        Uri serviceUri= newUri("http://example.host.odataservice.net/service.svc", UriKind.Absolute);04        ODataService.ServiceEntities context = newODataService.ServiceEntities (serviceUri);05 06        context.Credentials = newSystem.Net.NetworkCredential(Username,Password);07 08         var query = from ServiceObject in context.YourEntity09                     select ServiceObject ;10 11        foreach (var myObject in query)12        {13            Console.WriteLine("\n Field1: {0} | Field2: {1}",14            myObject .Field1, myObject .Field2);15 16        }17}That’s it.Thank you,Rui Machadorpmachado.wordpress.com

    Read the article

  • Raspberry Pi, Time Capsule Progress

    - by Richard Jones
    So by way of an update. I thought all was good with my Raspberry Pi, Debian and Netatalk Apple Time Capsule Clone. However something very strange going on. Although I could backup my Mac's + PC's fine to Raspberry Pi with external USB HD; strangely with RPI running, I couldn't use AirPlay. I found myself unable to play anything from Mac to Apple TV. So after lots of trying to make this work, I about turned and finally went out and got myself a 2TB Apple Time Capsule. More cash than I would want to spend on anything like this, but Apple you got me. I would like to offer a top tip, which maybe goes a small way to justifying silly expenditure... You can easily add a USB HD to any Time Capsule. I've just added a 3 TB external USB HD, giving me a 5 TB of total backup grunt. 3 TB External USB HD, was peanuts by comparison to Apple kit. So all working, its all solid as you'd expect.Apple 2, maybe me .5. But strong, solid backups now happening, without hassle (but a bit of a credit card bill to follow)

    Read the article

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