Search Results

Search found 321 results on 13 pages for 'gabriel burns'.

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

  • Do we need use case levels or not?

    - by Gabriel Šcerbák
    I guess no one would argue for decomposing use cases, that is just wrong. However sometimes it is necessary to specify use cases, which are on lower, more technical level, like for example authetication and authorization, which give the actor value, but are further from his business needs. Cockburn argues for levels when needed and explains how to move use cases from/to different levels and how to determine the right level. On the other hand, e.g. Bittner argues against use case levels, although he uses subflows and at the end of his book mentions, that at least two levels areneeded most of the time. My questionis, do you find use case levels necessary, helpful or unwanted? What are the reasons? Am I misssing some important arguments?

    Read the article

  • How to get Autocad working with Wine?

    - by gabriel
    I am trying 3 years now installing Autocad,*3ds Max* and Revit architecture on Ubuntu with wine! Every year I am very optimistic 'cause I see the new wine versions already improved. So, now I am starting again in a clean Ubuntu installation to install Autocad 2013 with wine 1.4. I am not trying to have an answer only for me, but I want this community to try and finally we can achieve that! The winetricks have already net framework 4 to install which is the reason I have not already ran to the past Autocad. So, I would like to remove completely my windows 7 partition from my pc and go on a linux machine without loosing the powerfull architectural programms.I know all about Blender and staff so I just want you to help find a solution on that, because I know there is a solution! Maybe I will have to learn all the c++ or python etc. But I am sure that a solution can come with the help of all of us! Any suggestion about this problem will be very nice and helpfull.

    Read the article

  • Can't install Oracle J2EE due to "An internal Error has occurred"

    - by Gabriel Mendez
    I am trying to install Oracle JavaEE 6 SDK with Glassfish on Ubuntu 12.04 with Java SDK 7. I have downloaded java_ee_sdk-6u4-jdk7-linux-x64.sh already, but when I run it on terminal, the wizard appears, and after few steps, I get an Error Message Dialog: An internal Error has occurred. Please contact your system administrator... null. And, the terminal is showing something like WARNING: Could not process a navigation event for command=AC_NEXT [Command=AC_NEXT Error=null ] What can I do? How can I install J2EE/Glassfish under linux x64?

    Read the article

  • Ubuntu studio/xubuntu 12.04 instead of Ubuntu 12.04/12.10 for CAD/ arhcitectural workflow. Worth it?

    - by gabriel
    I am currently using Ubuntu 12.10. So, as described in the title I am planning to install Ubuntu studio. The programs i use are Blender, Maya 2013, NukeX, Bricscad, Sketchup (with wine) and also i am planning to install revit architecture through VirtualBox. Well, I am using a quad-core CPU and i want to have all the power of my system for rendering/modelling. So, i decided to try a more lightweight desktop than unity. Also, what made me to decide this, is that when i tried to install Bricscad v12 the program does not work. So, i thought that if i want something more professional for my work i should have only LTS versions of lightweight Ubuntu. So, my 2 questions are :1) Worth it? 2) Can i have global menu(close,minimize,maximize buttons, menu) like ubuntu/unity? Thanks

    Read the article

  • Show USB drives in launcher, but not mounted internal partitions

    - by Gabriel
    Well the title pretty much says it all. I have partitions that appear in the launcher when the system mounts them, just like when a USB key is plugged in. I do not want these mounted internal hard disc partitions to show as icons in the launcher, but I do want my external USB to show there when I plug it in. I've tried MyUnity - it has only an option to not show/hide all mounted devices, which is not what I want. Can this be done? From /proc/mounts (in order seen in screenshot): /dev/sdb1 /media/CEDD-DE31 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0 /dev/sda3 /media/A423-E0E8 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0 /dev/sda5 /media/586C25656C253EDE fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0 /dev/sda6 /home/greg/80gb ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0 Other items from /proc/mounts not appearing in Unity launcher: /dev/sda1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0 /dev/sda9 /mnt/backup ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0

    Read the article

  • Can't install Skype on Ubuntu 12.04 64 bit

    - by Gabriel Alvim
    I've tried many different ways: I downloaded the file on the Skype website, which returned me this error "Cannot install ia-32-libs" I followed this instructions https://help.ubuntu.com/community/Skype and here is what I got: **W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/partner/Packages/binary-amd64/Packages 404 Not Found [IP: 91.189.92.191 80] W: Failed to fetch http://archive.canonical.com/ubuntu/dists/precise/partner/Packages/binary-i386/Packages 404 Not Found [IP: 91.189.92.191 80] E: Some index files failed to download. They have been ignored, or old ones used instead.** I even tried this command line: sudo apt-get install lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 skype And this is what I got: **Error: need a repository as argument pandora@ubuntu:~$ sudo apt-get install lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 skype Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch skype : Depends: skype-bin E: Unable to correct problems, you have held broken packages.** I just don't know what to do anymore, if I can't use skype, I might as well not use ubuntu at all. Please, someone help

    Read the article

  • Where should libraries be placed, in windows?

    - by Gabriel Diaconescu
    I have just moved from Linux to Windows, and I have to use the Zend Framework library. Where should the library be placed? Directly on C drive Create a lib folder like C:/lib/ Create a lib folder in my user folder I am wondering if there is a classic folder where these kind of libraries are placed. Update:I am asking about the location on my own standpoint. The Zend Framework library is a PHP framework.

    Read the article

  • Shouldn't we count characters of code and comments instead of lines of code and comments? [closed]

    - by Gabriel
    Counting lines of code and comments is sometimes bogus, since most of what we write may be written in one or more lines, depending column count limitations, screen size, style and so forth. Since the commonly used languages (say C, C++, C# and Java) are free-form, wouldn't it be more clever to count characters instead? Edit: I'm not considering LOC-oriented programming where coders try to artificially match requirements by adding irrelevant comments or using multiple lines where less would be enough (or the opposite). I'm interested in better metrics that would be independent of coding style, to be used by honest programmers.

    Read the article

  • is there a formal algebra method to analyze programs?

    - by Gabriel
    Is there a formal/academic connection between an imperative program and algebra, and if so where would I learn about it? The example I'm thinking of is: if(C1) { A1(); A2(); } if(C2) { A1(); A2(); } Represented as a sum of terms: (C1)(A1) + (C1)(A2) + (C2)(A1) + (C2)(A2) = (C1+C2)(A1+A2) The idea being that manipulation could lead to programatic refactoring - "factoring" being the common concept in this example.

    Read the article

  • How can I get started using TDD to code some simple functionality?

    - by Gabriel
    I basically have the gist of TDD. I'm sold that it's useful and I've got a reasonable command of the MSTEST framework. However, to date I have not been able to graduate to using it as a primary development method. Mostly, I use it as a surrogate for writing console apps as test drivers (my traditional approach). The most useful thing about it for me is the way it absorbs the role of regression testing. I have not yet built anything yet that specifically isolates various testable behaviors, which is another big part of the picture I know. So this question is to ask for pointers on what the first test(s) I might write for the following development task: I want to produce code that encapsulates task execution in the fashion of producer/consumer. I stopped and decided to write this question after I wrote this code (wondering if I could actually use TDD for real this time) Code: interface ITask { Guid TaskId { get; } bool IsComplete { get; } bool IsFailed { get; } bool IsRunning { get; } } interface ITaskContainer { Guid AddTask(ICommand action); } interface ICommand { string CommandName { get; } Dictionary<string, object> Parameters { get; } void Execute(); }

    Read the article

  • Stop KDE services from running

    - by Gabriel
    I recently installed KDE with the command sudo apt-get install kubuntu-desktop. Now whenever I log into Unity I can see KDE-related services running in the background and I see no obvious way to prevent them from opening at startup. I checked bum but I see nothing there. These are the services I see running right now: kde4 klauncher knotify4 These ones I can identify as being related to KDE given their names, but there could be more. How can I prevent these services from launching by themselves? I should mention I often use KDE applications such as kate, okular and kile. Could these be responsible for opening those services?

    Read the article

  • Two graphical entities, smooth blending between them (e.g. asphalt and grass)

    - by Gabriel Conrad
    Supposedly in a scenario there are, among other things, a tarmac strip and a meadow. The tarmac has an asphalt texture and its model is a triangle strip long that might bifurcate at some point into other tinier strips, and suppose that the meadow is covered with grass. What can be done to make the two graphical entities seem less cut out from a photo and just pasted one on top of the other at the edges? To better understand the problem, picture a strip of asphalt and a plane covered with grass. The grass texture should also "enter" the tarmac strip a little bit at the edges (i.e. feathering effect). My ideas involve two approaches: put two textures on the tarmac entity, but that involves a serious restriction in how the strip is modeled and its texture coordinates are mapped or try and apply a post-processing filter that mimics a bloom effect where "grass" is used instead of light. This could be a terrible failure to achieve correct results. So, is there a better or at least a more obvious way that's widely used in the game dev industry?

    Read the article

  • Bricscad V12 on ubuntu 11.10!

    - by gabriel
    i tried to install bricscad from the deb file but is for 32bit systems.So i had problems and i downloaded the .tgz file and ran tar -xvf and i was in the directory /opt/bricsys/bricscad/v12 So i managed to run bricscad with the command sudo sh bricscad.sh in the directory this.So my question is, do you have any idea of how to make a launcher or smthing so i can run the program from an easier way?I cannot find it in dash(unity) or in the desktop. Any help will be great! Thanks

    Read the article

  • Can't login to Ubuntu One

    - by Gabriel
    I uninstalled Ubuntu One about two months ago and now I re-installed it. I can still login with my account through the site (Ubuntu One) but the client keeps telling me "The authentication failed". If I try to use the Recover password option it also fails with telling me that my email address is not recognized (while I can use it with zero issues through the site) If I attempt to create a new account from the client, it also fails to load the captcha every time. Something is clearly broken here but I can't figure out what it is. Any ideas?

    Read the article

  • Is there a jQuery lightbox plugin that has thumbnails inside the box?

    - by Gabriel
    I'm trying to find a lightbox style plugin in jQuery that displays thumbnails at the bottom of the picture (or video, or whatever). I found plenty of lightbox plugins, but none that allows navigation by thumbnail inside the box. The plugin must be able to open images, swf and inline content. I realize that jQuery will not be able to generate the thumbnails and that's ok. Do you have any good ones to suggest? Thanks

    Read the article

  • How do you proactively guard against errors of omission?

    - by Gabriel
    I'll preface this with I don't know if anyone else who's been programming as long as I have actually has this problem, but at the very least, the answer might help someone with less xp. I just stared at this code for 5 minutes, thinking I was losing my mind that it didn't work: var usedNames = new HashSet<string>(); Func<string, string> l = (s) => { for (int i = 0; ; i++) { var next = (s + i).TrimEnd('0'); if (!usedNames.Contains(next)) { return next; } } }; Finally I noticed I forgot to add the used name to the hash set. Similarly, I've spent minutes upon minutes over omitting context.SaveChanges(). I think I get so distracted by the details that I'm thinking about that some really small details become invisible to me - it's almost at the level of mental block. Are there tactics to prevent this? update: a side effect of asking this was fixing the error it would have for i 9 (Thanks!) var usedNames = new HashSet<string>(); Func<string, string> name = (s) => { string result = s; if(usedNames.Contains(s)) for (int i = 1; ; result = s + i++) if (!usedNames.Contains(result)) break; usedNames.Add(result); return result; };

    Read the article

  • Customizing Texmaker

    - by Gabriel Furstenheim
    I use LaTeX a lot but I find quite obnoxious all the crappy files it leaves behind when you compile: .aux, .log... Fortunately TeXMaker has the option "clean" that deletes all of these. However, I don't like having to remember to click on it every time I'm going to close a document, ie I'd like a button that both closes a document and cleans all that stuff. Any hint as how to do it? I suppose if I knew how to access the program code I'd be able to do it as I'd just have to put together two options that already exist. Thanks

    Read the article

  • How to deal with elimination of duplicate logic vs. cost of complexity increase?

    - by Gabriel
    I just wrote some code that is very representative of a recurring theme (in my coding world lately): repeated logic leads to an instinct to eliminate duplication which results in something that is more complex the tradeoff seems wrong to me (the examples of the negative side aren't worth posting - but this is probably the 20th console utility I've written in the past 12 months). I'm curious if I'm missing some techniques or if this is really just on of those "experience tells you when to do what" type of issues. Here's the code... I'm tempted to leave it as is, even though there will be about 20 of those if-blocks when I'm done. static void Main(string[] sargs) { try { var urls = new DirectTrackRestUrls(); var restCall = new DirectTrackRestCall(); var logger = new ConsoleLogger(); Args args = (Args)Enum.Parse(typeof(Args), string.Join(",", sargs)); if (args.HasFlag(Args.Campaigns)) { var getter = new ResourceGetter(logger, urls.ListAdvertisers, restCall); restCall.UriVariables.Add("access_id", 1); getter.GotResource += new ResourceGetter.GotResourceEventHandler(getter_GotResource); getter.GetResources(); SaveResources(); } if (args.HasFlag(Args.Advertisers)) { var getter = new ResourceGetter(logger, urls.ListAdvertisers, restCall); restCall.UriVariables.Add("access_id", 1); getter.GotResource += new ResourceGetter.GotResourceEventHandler(getter_GotResource); getter.GetResources(); SaveResources(); } if (args.HasFlag(Args.CampaignGroups)) { var getter = new ResourceGetter(logger, urls.ListCampaignGroups, restCall); getter.GotResource += new ResourceGetter.GotResourceEventHandler(getter_GotResource); getter.GetResources(); SaveResources(); } } catch (Exception e) { Console.WriteLine(e.InnerException); Console.WriteLine(e.StackTrace); }

    Read the article

  • NerdDinner form validation DataAnnotations ERROR in MVC2 when a form field is left blank.

    - by Edward Burns
    Platform: Windows 7 Ultimate IDE: Visual Studio 2010 Ultimate Web Environment: ASP.NET MVC 2 Database: SQL Server 2008 R2 Express Data Access: Entity Framework 4 Form Validation: DataAnnotations Sample App: NerdDinner from Wrox Pro ASP.NET MVC 2 Book: Wrox Professional MVC 2 Problem with Chapter 1 - Section: "Integrating Validation and Business Rule Logic with Model Classes" (pages 33 to 35) ERROR Synopsis: NerdDinner form validation ERROR with DataAnnotations and db nulls. DataAnnotations in sample code does not work when the database fields are set to not allow nulls. ERROR occurs with the code from the book and with the sample code downloaded from codeplex. Help! I'm really frustrated by this!! I can't believe something so simple just doesn't work??? Steps to reproduce ERROR: Set Database fields to not allow NULLs (See Picture) Set NerdDinnerEntityModel Dinner class fields' Nullable property to false (See Picture) Add DataAnnotations for Dinner_Validation class (CODE A) Create Dinner repository class (CODE B) Add CREATE action to DinnerController (CODE C) This is blank form before posting (See Picture) This null ERROR occurs when posting a blank form which should be intercepted by the Dinner_Validation class DataAnnotations. Note ERROR message says that "This property cannot be set to a null value. WTH??? (See Picture) The next ERROR occurs during the edit process. Here is the Edit controller action (CODE D) This is the "Edit" form with intentionally wrong input to test Dinner Validation DataAnnotations (See Picture) The ERROR occurs again when posting the edit form with blank form fields. The post request should be intercepted by the Dinner_Validation class DataAnnotations. Same null entry error. WTH??? (See Picture) See screen shots at: http://www.intermedia4web.com/temp/nerdDinner/StackOverflowNerdDinnerQuestionshort.png CODE A: [MetadataType(typeof(Dinner_Validation))] public partial class Dinner { } [Bind(Include = "Title, EventDate, Description, Address, Country, ContactPhone, Latitude, Longitude")] public class Dinner_Validation { [Required(ErrorMessage = "Title is required")] [StringLength(50, ErrorMessage = "Title may not be longer than 50 characters")] public string Title { get; set; } [Required(ErrorMessage = "Description is required")] [StringLength(265, ErrorMessage = "Description must be 256 characters or less")] public string Description { get; set; } [Required(ErrorMessage="Event date is required")] public DateTime EventDate { get; set; } [Required(ErrorMessage = "Address is required")] public string Address { get; set; } [Required(ErrorMessage = "Country is required")] public string Country { get; set; } [Required(ErrorMessage = "Contact phone is required")] public string ContactPhone { get; set; } [Required(ErrorMessage = "Latitude is required")] public double Latitude { get; set; } [Required(ErrorMessage = "Longitude is required")] public double Longitude { get; set; } } CODE B: public class DinnerRepository { private NerdDinnerEntities _NerdDinnerEntity = new NerdDinnerEntities(); // Query Method public IQueryable<Dinner> FindAllDinners() { return _NerdDinnerEntity.Dinners; } // Query Method public IQueryable<Dinner> FindUpcomingDinners() { return from dinner in _NerdDinnerEntity.Dinners where dinner.EventDate > DateTime.Now orderby dinner.EventDate select dinner; } // Query Method public Dinner GetDinner(int id) { return _NerdDinnerEntity.Dinners.FirstOrDefault(d => d.DinnerID == id); } // Insert Method public void Add(Dinner dinner) { _NerdDinnerEntity.Dinners.AddObject(dinner); } // Delete Method public void Delete(Dinner dinner) { foreach (var rsvp in dinner.RSVPs) { _NerdDinnerEntity.RSVPs.DeleteObject(rsvp); } _NerdDinnerEntity.Dinners.DeleteObject(dinner); } // Persistence Method public void Save() { _NerdDinnerEntity.SaveChanges(); } } CODE C: // ************************************** // GET: /Dinners/Create/ // ************************************** public ActionResult Create() { Dinner dinner = new Dinner() { EventDate = DateTime.Now.AddDays(7) }; return View(dinner); } // ************************************** // POST: /Dinners/Create/ // ************************************** [HttpPost] public ActionResult Create(Dinner dinner) { if (ModelState.IsValid) { dinner.HostedBy = "The Code Dude"; _dinnerRepository.Add(dinner); _dinnerRepository.Save(); return RedirectToAction("Details", new { id = dinner.DinnerID }); } else { return View(dinner); } } CODE D: // ************************************** // GET: /Dinners/Edit/{id} // ************************************** public ActionResult Edit(int id) { Dinner dinner = _dinnerRepository.GetDinner(id); return View(dinner); } // ************************************** // POST: /Dinners/Edit/{id} // ************************************** [HttpPost] public ActionResult Edit(int id, FormCollection formValues) { Dinner dinner = _dinnerRepository.GetDinner(id); if (TryUpdateModel(dinner)){ _dinnerRepository.Save(); return RedirectToAction("Details", new { id=dinner.DinnerID }); } return View(dinner); } I have sent Wrox and one of the authors a request for help but have not heard back from anyone. Readers of the book cannot even continue to finish the rest of chapter 1 because of these errors. Even if I download the latest build from Codeplex, it still has the same errors. Can someone please help me and tell me what needs to be fixed? Thanks - Ed.

    Read the article

  • Rails, RSpec and Webrat: Expected output matches rendered output but still getting error in view spe

    - by Anthony Burns
    Hello all, I've just gotten started using BDD with RSpec/Cucumber/Webrat and Rails and I've run into some frustration trying to get my view spec to pass. First of all, I am running Ruby 1.9.1p129 with Rails 2.3.2, RSpec and RSpec-Rails 1.2.6, Cucumber 0.3.11, and Webrat 0.4.4. Here is the code relevant to my question config/routes.rb: map.b_posts 'backend/posts', :controller => 'backend/posts', :action => 'backend_index', :conditions => { :method => :get } map.connect 'backend/posts', :controller => 'backend/posts', :action => 'create', :conditions => { :method => :post } views/backend/posts/create.html.erb: <% form_tag do %> <% end %> *spec/views/backend/posts/create.html.erb_spec.rb:* describe "backend/posts/create.html.erb" do it "should render a form to create a post" do render "backend/posts/create.html.erb" response.should have_selector("form", :method => 'post', :action => b_posts_path) do |form| # Nothing here yet. end end end Here is the relevant part of the output when I run script/spec: 'backend/posts/create.html.erb should render a form to create a post' FAILED expected following output to contain a <form method='post' action='/backend/posts'/> tag: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><form action="/backend/posts" method="post"> </form></body></html> It would appear to me that what have_selector is looking for is exactly what the template generates, yet the example still fails. I am very much looking forward to seeing my error (because I have a feeling it is my error). Any help is much appreciated!

    Read the article

  • jQuery UI blind effect - reveal from bottom

    - by ronnie burns
    This could be really obvious and I'm completely missing it. I've searched for hours and can't seem to find a way to, using jQuery, reveal a hidden div from the bottom up. What I am trying to achieve is exactly as in the following link, but in reverse: http://jqueryui.com/demos/show/ I can slide a div from the bottom to the top, but this reveals itself as it moves, rather than being 'masked' in. Like I said, this could (should?) be really obvious and I'm not seeing it, but I've been looking for ages and can't find a solution to this relatively simple problem. Thanks, Ronnie

    Read the article

  • jQuery AJAX with two domains

    - by Andrew Burns
    OK here is the situation: I have an externally hosted CMS which works great for 99% of our needs. However on the more advanced things I inject my own CSS+JS and do magic. The problem I am running into is loading a simple HTML page from jQuery.ajax() calls. It appears to work in the sense that no warnings or errors are thrown; however in my success handler (which IS ran), the response is blank! I have been scratching my head for the whole morning trying to figure this out and the only thing I can think of is that is has something to do with the cross domain issue (even though it appears to work). Injected JavaScript: $(document).ready(function() { doui(); }); function doui() { $.ajax({ url: 'http://apps.natronacounty-wy.gov/css/feecalc/ui.htm', cache: false, success: ajax_createUI, charset: "utf-8", error: function(e) { alert(e); } }); } function ajax_createUI(data, textStatus) { alert(data); $("#ajax-content").html(data); } My ajax_createUI() success handler is called and textStatus is "success"; however data is empty. This JS file resides @ http://apps.natronacounty-wy.gov/css/js/feecalc.js however the CMS website (which gets the JS injected into it) resides @ http://www.natronacounty-wy.gov/ Am I just being stupid or is it a bug that it looks like it should be working but isn't?

    Read the article

  • For Loop help In a Hash Cracker Homework.

    - by aaron burns
    On the homework I am working on we are making a hash cracker. I am implementing it so as to have my cracker. java call worker.java. Worker.java implements Runnable. Worker is to take the start and end of a list of char, the hash it is to crack, and the max length of the password that made the hash. I know I want to do a loop in run() BUT I cannot think of how I would do it so it would go to the given max pasword length. I have posted the code I have so far. Any directions or areas I should look into.... I thought there was a way to do this with a certain way to write the loop but I don't know or can't find the correct syntax. Oh.. also. In main I divide up so x amount of threads can be chosen and I know that as of write now it only works for an even number of the 40 possible char given. package HashCracker; import java.util.*; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class Cracker { // Array of chars used to produce strings public static final char[] CHARS = "abcdefghijklmnopqrstuvwxyz0123456789.,-!".toCharArray(); public static final int numOfChar=40; /* Given a byte[] array, produces a hex String, such as "234a6f". with 2 chars for each byte in the array. (provided code) */ public static String hexToString(byte[] bytes) { StringBuffer buff = new StringBuffer(); for (int i=0; i<bytes.length; i++) { int val = bytes[i]; val = val & 0xff; // remove higher bits, sign if (val<16) buff.append('0'); // leading 0 buff.append(Integer.toString(val, 16)); } return buff.toString(); } /* Given a string of hex byte values such as "24a26f", creates a byte[] array of those values, one byte value -128..127 for each 2 chars. (provided code) */ public static byte[] hexToArray(String hex) { byte[] result = new byte[hex.length()/2]; for (int i=0; i<hex.length(); i+=2) { result[i/2] = (byte) Integer.parseInt(hex.substring(i, i+2), 16); } return result; } public static void main(String args[]) throws NoSuchAlgorithmException { if(args.length==1)//Hash Maker { //create a byte array , meassage digestand put password into it //and get out a hash value printed to the screen using provided methods. byte[] myByteArray=args[0].getBytes(); MessageDigest hasher=MessageDigest.getInstance("SHA-1"); hasher.update(myByteArray); byte[] digestedByte=hasher.digest(); String hashValue=Cracker.hexToString(digestedByte); System.out.println(hashValue); } else//Hash Cracker { ArrayList<Thread> myRunnables=new ArrayList<Thread>(); int numOfThreads = Integer.parseInt(args[2]); int charPerThread=Cracker.numOfChar/numOfThreads; int start=0; int end=charPerThread-1; for(int i=0; i<numOfThreads; i++) { //creates, stores and starts threads. Runnable tempWorker=new Worker(start, end, args[1], Integer.parseInt(args[1])); Thread temp=new Thread(tempWorker); myRunnables.add(temp); temp.start(); start=end+1; end=end+charPerThread; } } } import java.util.*; public class Worker implements Runnable{ private int charStart; private int charEnd; private String Hash2Crack; private int maxLength; public Worker(int start, int end, String hashValue, int maxPWlength) { charStart=start; charEnd=end; Hash2Crack=hashValue; maxLength=maxPWlength; } public void run() { byte[] myHash2Crack_=Cracker.hexToArray(Hash2Crack); for(int i=charStart; i<charEnd+1; i++) { Cracker.numOfChar[i]////// this is where I am stuck. } } }

    Read the article

  • Uncatchable errors in node.js

    - by Peter Burns
    So I'm trying to write a simple TCP socket server that broadcasts information to all connected clients. So when a user connects, they get added to the list of clients, and when the stream emits the close event, they get removed from the client list. This works well, except that sometimes I'm sending a message just as a user disconnects. I've tried wrapping stream.write() in a try/catch block, but no luck. It seems like the error is uncatchable.

    Read the article

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