Daily Archives

Articles indexed Friday December 31 2010

Page 16/30 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Rails Seed confusion

    - by sscirrus
    I'm having trouble seeding my database using seed.rb, specifically where table relationships are concerned. Here's a sample of the code: # seed.rb user = User.find_or_create_by_login( :login => "myname", :email => "[email protected]", :user_type => "Admin", :password => "admin", :password_confirmation => "admin") project = Project.find_or_create_by_user_id( :user_id => user.id, :name => "Test Project") When project is created (along with other unrelated parameters I've left out from above), user_id is empty. How can I get this to work?

    Read the article

  • List of blogs - year 2010

    - by hajan
    This is the last day of year 2010 and I would like to add links to all blogs I have posted in this year. First, I would like to mention that I started blogging in ASP.NET Community in May / June 2010 and have really enjoyed writing for my favorite technologies, such as: ASP.NET, jQuery/JavaScript, C#, LINQ, Web Services etc. I also had great feedback either through comments on my blogs or in Twitter, Facebook, LinkedIn where I met many new experts just as a result of my blog posts. Thanks to the interesting topics I have in my blog, I became DZone MVB. Here is the list of blogs I made in 2010 in my ASP.NET Community Weblog: (newest to oldest) Great library of ASP.NET videos – Pluralsight! NDepend – Code Query Language (CQL) NDepend tool – Why every developer working with Visual Studio.NET must try it! jQuery Templates in ASP.NET - Blogs Series jQuery Templates - XHTML Validation jQuery Templates with ASP.NET MVC jQuery Templates - {Supported Tags} jQuery Templates – tmpl(), template() and tmplItem() Introduction to jQuery Templates ViewBag dynamic in ASP.NET MVC 3 - RC 2 Today I had a presentation on "Deep Dive into jQuery Templates in ASP.NET" jQuery Data Linking in ASP.NET How do you prefer getting bundles of technologies?? Case-insensitive XPath query search on XML Document in ASP.NET jQuery UI Accordion in ASP.NET MVC - feed with data from database (Part 3) jQuery UI Accordion in ASP.NET WebForms - feed with data from database (Part 2) jQuery UI Accordion in ASP.NET – Client side implementation (Part 1) Using Images embedded in Project’s Assembly Macedonian Code Camp 2010 event has finished successfully Tips and Tricks: Deferred execution using LINQ Using System.Diagnostics.Stopwatch class to measure the elapsed time Speaking at Macedonian Code Camp 2010 URL Routing in ASP.NET 4.0 Web Forms Conflicts between ASP.NET AJAX UpdatePanels & jQuery functions Integration of jQuery DatePicker in ASP.NET Website – Localization (part 3) Why not to use HttpResponse.Close and HttpResponse.End Calculate Business Days using LINQ Get Distinct values of an Array using LINQ Using CodeRun browser-based IDE to create ASP.NET Web Applications Using params keyword – Methods with variable number of parameters Working with Code Snippets in VS.NET  Working with System.IO.Path static class Calculating GridView total using JavaScript/JQuery The new SortedSet<T> Collection in .NET 4.0 JavaScriptSerializer – Dictionary to JSON Serialization and Deserialization Integration of jQuery DatePicker in ASP.NET Website – JS Validation Script (part 2) Integration of jQuery DatePicker in ASP.NET Website (part 1) Transferring large data when using Web Services Forums dedicated to WebMatrix Microsoft WebMatrix – Short overview & installation Working with embedded resources in Project's assembly Debugging ASP.NET Web Services Save and Display YouTube Videos on ASP.NET Website Hello ASP.NET World... In addition, I would like to mention that I have big list of blog posts in CodeASP.NET Community (total 60 blogs) and the local MKDOT.NET Community (total 61 blogs). You may find most of my weblogs.asp.net/hajan blogs posted there too, but there you can find many others. In my blog on MKDOT.NET Community you can find most of my ASP.NET Weblog posts translated in Macedonian language, some of them posted in English and some other blogs that were posted only there. By reading my blogs, I hope you have learnt something new or at least have confirmed your knowledge. And also, if you haven't, I encourage you to start blogging and share your Microsoft Tech. thoughts with all of us... Sharing and spreading knowledge is definitely one of the noblest things which we can do in our life. "Give a man a fish and he will eat for a day. Teach a man to fish and he will eat for a lifetime" HAPPY NEW 2011 YEAR!!! Best Regards, Hajan

    Read the article

  • Why I Love Microsoft Development

    - by Brian Lanham
    I've been writing software for a while and recently had an opportunity to broaden my horizons and start developing for iOS. We decided to leverage, as much as possible, our existing skills and use MonoTouch and MonoDevelop by Novell.    For those of you who do not know, Mono is a .NET port originally designed for Linux but adapted for other platforms as well. MonoTouch is a port specifically for building iOS applications using the .NET framework. MonoDroid is a port (in CTP-esque release) for Android.   A MISSING COMPONENT - VISUAL DESIGNER   MonoDevelop lacks one very significant component compared with other tools I am using: NO VISUAL DESIGNER. Instead of using an integrated visual designer, MonoDevelop shells to the Mac OS "Interface Builder".  Since MonoDevelop lets me have a "Visual Studio-esque" feel *and* I get to use C#, AND it's FREE, I am gladly willing to overlook this.  In fact, it's not even a question.  Free?  Sure, I'll take it with no Visual Designer.   In my experiences I've grown from UNIX and DOS to .NET development through many steps. Java/JSP/Servlets; Windows; Web; etc. I've been doing .NET for quite a few years and I guess I just got "comfortable" with the tools.   WHY AM I NOT GETTING IT?   Interface Builder (IB) is amazingly confusing for me. I had the opportunity to speak at the Northern VA Code Camp on 12/11/2010. My presentation was "Getting Started with iOS Development using MonoTouch and C#".    At the visual design part of the presentation, I asked one of the 3 or 4 Mac developers in the room about my confusion with the IB. I don't understand why the "Classes" list includes objects. I don't understand what "File's Owner" is. And, most importantly, WHAT THE HECK IS AN OUTLET AND WHY IS IT NECESSARY?!?!?"   His response to these question (especially Outlets): "They did it wrong."   I'm accustom to a visual designer that creates variables for graphical widgets for me. Not IB. Instead, I have to create "Outlets" manually. I still do not understand why and, the explanation from a seasoned Mac developer is that it's wrong. (He received nods of confirmation from the other Mac devs in the room.)   I LOVE MS DEV   I love development for Microsoft platforms using Microsoft development tools. I love Windows 7. I love Visual Studio 2010. I love SQL Server. Azure, Entity Framework, Active Directory, Office, WCF/WF/WPF, etc. are all designed with integration in mind. They are also all designed with developers in mind.   Steve Ballmer recently ranted "It's the developers!" That's why it is relatively quick to build apps using MS tools. Clearly, MS knows that while we usually enjoy building technology solutions, we are here to make money. And we need tools that accelerate our time to market without compromising the power and quality of our solutions.   So, yeah, I am sucking up I guess. But I love Microsoft Development. Thank you, Microsoft, for providing the plethora of great development tools.    P.S. (but please slow down a bit…I'm having trouble keeping up!)

    Read the article

  • Making my SVN Public

    - by azz0r
    Hello, I'm looking todo an SVN checkout on a server so I need to make my local SVN public. I looked into GITHUB, but I'm not willing to pay or let the world see my project. Are there any alternates? Okay so I went through this tutorial: http://www.petri.co.il/setup-ssh-server-vista.htm Had some issues, so I did this: mail-archive.com/[email protected]/msg84875.html Now I'm wondering how let the SSH access my SVN repo found in c:/wamp/svnRepo. Any tutorials or advice (please no: go read this book crap) greatly welcome!

    Read the article

  • Question marks showing in ls of directory. IO errors too.

    - by jaymoo
    Has anyone seen this before? I've got a raid 5 mounted on my server and for whatever reason it started showing this: jason@box2:/mnt/raid1/cra$ ls -alh ls: cannot access e6eacc985fea729b2d5bc74078632738: Input/output error ls: cannot access 257ad35ee0b12a714530c30dccf9210f: Input/output error total 0 drwxr-xr-x 5 root root 123 2009-08-19 16:33 . drwxr-xr-x 3 root root 16 2009-08-14 17:15 .. ?????????? ? ? ? ? ? 257ad35ee0b12a714530c30dccf9210f drwxr-xr-x 3 root root 57 2009-08-19 16:58 9c89a78e93ae6738e01136db9153361b ?????????? ? ? ? ? ? e6eacc985fea729b2d5bc74078632738 The md5 strings are actual directory names and not part of the error. The question marks are odd, and any directory with a question mark throws an io error when you attempt to use/delete/etc it. I was unable to umount the drive due to "busy". Rebooting the server "fixed" it but it was throwing some raid errors on shutdown. I have configured two raid 5 arrays and both started doing this on random files. Both are using the following config: mkfs.xfs -l size=128m -d agcount=32 mount -t xfs -o noatime,logbufs=8 Nothing too fancy, but part of an optimized config for this box. We're not partitioning the drives and that was suggested as a possible issue. Could this be the culprit?

    Read the article

  • Ubuntu cannot resolve unmet dependency

    - by DisgruntledGoat
    I'm trying to install a package on my Ubuntu 8.10 server. However, I get this message: The following packages have unmet dependencies. webmin: Depends: apt-show-versions but it is not going to be installed E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution). So I run apt-get -f install which offers to install apt-show-versions and libapt-pkg-perl. After selecting to install without verification, I get these errors: Err http://gb.archive.ubuntu.com intrepid/universe libapt-pkg-perl 0.1.22build1 404 Not Found Err http://gb.archive.ubuntu.com intrepid/universe apt-show-versions 0.13 404 Not Found Failed to fetch http://gb.archive.ubuntu.com/ubuntu/pool/universe/liba/libapt-pkg-perl/libapt-pkg-perl_0.1.22build1_i386.deb 404 Not Found Failed to fetch http://gb.archive.ubuntu.com/ubuntu/pool/universe/a/apt-show-versions/apt-show-versions_0.13_all.deb 404 Not Found E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? I've tried running apt-get update and adding --fix-missing as suggested, but neither works. Where do I go from here?

    Read the article

  • Host a Debian repository on a Windows Web/Ftp server

    - by Dave
    At the risk of causing a matter vs. antimatter paradox that would end the world as we know it ... Is it possible to host a Debian repository on a Windows server? We have some applications which are available for Windows, Mac OS X, and Linux. Our web site, from where the application can be downloaded, is a Windows Server 2008 box running IIS 7. That is not going to change, and I would like to avoid having to purchase another server and/or domain. I would like to take advantage of the Debian packaging system so that I can just instruct users to add our repository to their software sources, and then they can install, get updates, resolve dependencies (some of which are not yet in the stable/main distributions of my target platforms), etc. The instructions I can find on the internet require linux-specific tools to create a local repository, but are unclear as to whether or not that can be copied to an FTP site as is, or if it requires some local daemons to be running or something.

    Read the article

  • Fedora 14 update probelem

    - by Marko
    How is everybody doin? :) Im having this problem with Fedora 14 update for last couple of weeks.. when I run yum update I get the following result: Running rpm_check_debug ERROR with rpm_check_debug vs depsolve: kernel-uname-r = 2.6.32.10-90.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.10-90.fc12.i686.PAE-1:195.36.15-1.fc12.1.i686 kernel-uname-r = 2.6.32.16-150.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.16-150.fc12.i686.PAE-1:195.36.31-1.fc12.2.i686 kernel-uname-r = 2.6.32.21-168.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.21-168.fc12.i686.PAE-1:195.36.31-1.fc12.5.i686 kernel-uname-r = 2.6.32.10-90.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.10-90.fc12.i686.PAE-1:195.36.15-1.fc12.1.i686 kernel-uname-r = 2.6.32.16-150.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.16-150.fc12.i686.PAE-1:195.36.31-1.fc12.2.i686 kernel-uname-r = 2.6.32.21-168.fc12.i686.PAE is needed by (installed) kmod-nvidia-2.6.32.21-168.fc12.i686.PAE-1:195.36.31-1.fc12.5.i686 Please report this error in http://yum.baseurl.org/report ** Found 9 pre-existing rpmdb problem(s), 'yum check' output follows: VirtualBox-3.2-3.2.10_66523_fedora13-1.i686 has missing requires of libpython2.6.so.1.0 VirtualBox-3.2-3.2.10_66523_fedora13-1.i686 has missing requires of python(abi) = ('0', '2.6', None) 1:kmod-nvidia-2.6.32.10-90.fc12.i686.PAE-195.36.15-1.fc12.1.i686 has missing requires of kernel-uname-r = ('0', '2.6.32.10', '90.fc12.i686.PAE') 1:kmod-nvidia-2.6.32.16-150.fc12.i686.PAE-195.36.31-1.fc12.2.i686 has missing requires of kernel-uname-r = ('0', '2.6.32.16', '150.fc12.i686.PAE') 1:kmod-nvidia-2.6.32.21-168.fc12.i686.PAE-195.36.31-1.fc12.5.i686 has missing requires of kernel-uname-r = ('0', '2.6.32.21', '168.fc12.i686.PAE') mysql-workbench-gpl-5.2.28-1fc13.i386 has missing requires of libpython2.6.so.1.0 pysvn-1.7.2-1.fc13.i686 has missing requires of python(abi) = ('0', '2.6', None) system-config-display-2.2-1.fc12.i686 has missing requires of libpython2.6.so.1.0 system-config-display-2.2-1.fc12.i686 has missing requires of python(abi) = ('0', '2.6', None) does anybody have a similar issue?

    Read the article

  • i7 Windows 7 laptop or Macbook Pro 15" (For making 3D model and Animation)

    - by sppdhs
    Hi everyone, I'm thinking of buying a new laptop as my current one will be 5 years old next year and it currently gives me a blue screen everytime I run a heavy software to make 3D models and animation. Question is: Should I buy Macbook Pro or a Windows 7 laptop? I tried to research and some say that Windows would be better, especially because you can buy a very high spec laptop with cheaper price. While some other say Macbook Pro is the better choice as it can run bootcamp with windows 7 100% performance on every software even though it's a mac. Is this true? Which one is actually better? Btw, the software that I usually use is 3Ds Max, Maya, and ZBrush. To note as well, I have never used a Mac before. I've checked around some stores and budget wise, I'll need around AU$3000+ to buy a Macbook pro, and AU$2000+ to buy a windows laptop. Quite a big difference in price range. Thanks in advance for your help.

    Read the article

  • i7 x980 at 70% speed

    - by Buxley
    Hi we bought a nice computer to use to solve optimization problems. intel i7 X980@3,33 Mhz with 12 Gb of Team Group 1600 MHz ddr3 Ram. When we use Gurobi The Computer uses all 12 cores at maximum in the beginning of the solve. However after a while (about 8 hrs) it all cores jump between 65 and 85% When I solve the same models on an I7 930 all cores are at a near 100% level even after longer solution times. we first thought that the Harddisk was the bottleneck since Gurobi writes out nodefiles after the memorylimit is used. However since the new computer have 12 GB of Ram we put the memorylimit to 7 GB so the solver only used the RAM and still with the same performance in the processor. Any Ideas about the bottleneck? As I said earlier it works at 100% for the first hours or so . Thanks very much for any answers! Our plan was to overclock it but we can't even get it to work at normal speed yet!

    Read the article

  • Keyboard not responding on startup

    - by Mestika
    I’m having a weird problem with one of the laptops at my work. Every now and then (not a systematic repeating pattern, but kind of random) the keyboard will not function on start up. The computer boots and it gets to the CTRL + ALT + DELETE screen and it is responding to nothing from the keyboard. The mouse works fine. I then try to force a shutdown and reboot the machine and most of the time it then works. My first thought was that it was a hardware malfunction with the keyboard hardware but it seems strange that the computer can be stationed for several days without being removed and it still “loses” connection to the keyboard. The OS is Windows 7 Pro and it is a Dell Laptop Vostro. Does anyone experienced this kind of problem with a laptop with/with out Windows 7 and maybe got a solution to the problem?

    Read the article

  • computer plays movie fine but ps3 plays it with no sound?

    - by kacalapy
    i have a movie that plays fine on my computer but when i copy it to an SD card and play it in my PS3 it has no sound. the audio format is mpeg layer-3 bit rate is 128 frame rate is 25frames/ second data rate is 1068 kbps video sample size is 12 bit video compression is DivX i got these stats by right clicking the file and viewing properties. can i open it in some editor and re-save it? what editor? thanks all

    Read the article

  • Attributes of an Ethical Programmer?

    - by ahmed
    Software that we write has ramifications in the real world. If not, it wouldn't be very useful. Thus, it has the potential to sweep across the world faster than a deadly manmade virus or to affect society every bit as much as genetic manipulation. Maybe we can't see how right now, but in the future our code will have ever-greater potential for harm or good. Of course, there's the issue of hacking. That's clearly a crime. Or is it that clear? Isn't hacking acceptable for our government in the event of national security? What about for other governments? Cases of life-and-death emergency? Tracking down deadbeat parents? Screening the genetic profile of job candidates? Where is the line drawn? Who decides? Do programmers have responsibility for how their code is used? What if a programmer writes code to pry into confidential information or copy-protected material? Does he bear responsibility along with the person who used the program? What about a programmer who knowingly or unknowingly writes code to "fix the books?" Should he be liable?

    Read the article

  • How would you practice concurrency and multi-threading?

    - by Xavier Nodet
    I've been reading about concurrency, multi-threading, and how "the free lunch is over". But I've not yet had the possibility to use MT in my job. I'm thus looking for suggestions about what I could do to get some practice of CPU heavy MT through exercises or participation in some open-source projects. Thanks. Edit: I'm more interested in open-source projects that use MT for CPU-bound tasks, or simply algorithms that are interesting to implement using MT, rather than books or papers about the tools like threads, mutexes and locks...

    Read the article

  • Why can't we capture the design of software more effectively?

    - by Ira Baxter
    As engineers, we all "design" artifacts (buildings, programs, circuits, molecules...). That's an activity (design-the-verb) that produces some kind of result (design-the-noun). I think we all agree that design-the-noun is a different entity than the artifact itself. A key activity in the software business (indeed, in any business where the resulting product artifact needs to be enhanced) is to understand the "design (the-noun)". Yet we seem, as a community, to be pretty much complete failures at recording it, as evidenced by the amount of effort people put into rediscovering facts about their code base. Ask somebody to show you the design of their code and see what you get. I think of a design for software as having: An explicit specification for what the software is supposed to do and how well it does it An explicit version of the code (this part is easy, everybody has it) An explanation for how each part of the code serves to achieve the specification A rationale as to why the code is the way it is (e.g., why a particualr choice rather than another) What is NOT a design is a particular perspective on the code. For example [not to pick specifically on] UML diagrams are not designs. Rather, they are properties you can derive from the code, or arguably, properties you wish you could derive from the code. But as a general rule, you can't derive the code from UML. Why is it that after 50+ years of building software, why don't we have regular ways to express this? My personal opinion is that we don't have good ways to express this. Even if we do, most of the community seems so focused on getting "code" that design-the-noun gets lost anyway. (IMHO, until design becomes the purpose of engineering, with the artifact extracted from the design, we're not going to get around this). What have you seen as means for recording designs (in the sense I have described it)? Explicit references to papers would be good. Why do you think specific and general means have not been succesful? How can we change this?

    Read the article

  • How to remove keyboard icon from keyboard layout indicator (to leave just the language abbr. alone)?

    - by Ivan
    I'd like to remove a keyboard icon, so replacing "[###] USA" as keyboard layout indicator to just "En", an English or American flag, or "USA" at least. How can I achieve this? UPDATE: When I've clicked to remove e-mail icon from the bar, keyboard language indication has disappeared also, and now I only see that useless keyboard icon, and don't see what language is selected now :-( I use Ubuntu 10.10.

    Read the article

  • How to pass an int value on UIButton click inside UITableView

    - by Toran Billups
    So I have a view controller with a single UITableView that shows a string to the user. But I needed a way to have the user select this object by id using a normal UIButton so I added it as a subview and the click event works as expected. The issue is this - how can I pass an int value to this click event? I've tried using attributes of the button like button.tag or button.accessibilityhint without much success. How do the professionals pass an int value like this? Also it's important that I can get the actual [x intValue] from the int later in the process. A while back I thought I could do this with a simple NSLog(@"the actual selected hat was %d", [obj.idValue intValue]); But this doesn't appear to work (any idea how I can pull the actual int value directly from the variable?). The working code I have is below - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } if ([self.hats count] > 0) { Hat* obj = [self.hats objectAtIndex: [indexPath row]]; NSMutableString* fullName = [[NSMutableString alloc] init]; [fullName appendFormat:@"%@", obj.name]; [fullName appendFormat:@" %@", obj.type]; cell.textLabel.text = fullName; cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; //add the button to subview hack UIButton* button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(50, 5, 50, 25); [button setTitle:@"Select" forState:UIControlStateNormal]; button.backgroundColor = [UIColor clearColor]; button.adjustsImageWhenHighlighted = YES; button.tag = obj.idValue; //this is my current hack to add the id but no dice :( [button addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside]; [cell.contentView addSubview:button]; //hack } return cell; } - (void)action:(id)sender { int* hatId = ((UIButton *)sender).tag; //try to pull the id value I added above ... //do something w/ the hatId }

    Read the article

  • Why its not working?

    - by Andrew Hoffmann
    BinaryReader br = new BinaryReader(Console.OpenStandardInput()); BinaryWriter bw = new BinaryWriter(Console.OpenStandardOutput()); int n = br.ReadInt32(); bw.Write(n); always getting this error: Unhandled Exception: System.IO.EndOfStreamException: Failed to read past end of stream. at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x00000] in <filename unknown>:0 at System.IO.BinaryReader.ReadInt32 () [0x00000] in <filename unknown>:0 at Program.Main () [0x00025] in /home/skydos/ACM/Csharp/Csharp/Main.cs:24 Is there any way to make reading data in C# faster from Console?

    Read the article

  • Developing Air (Flex) Applications for Android and Desktop

    - by Roaders
    I am an experienced Flex and Air Developer and love Android having owned a G1, a milestone (Droid), a Nexus One, a Galaxy S and now a Nexus S. Understandably I am interested in developing Flex applications for Android. I have just started working through the flex for android in 90 mins tutorial here: http://coenraets.org/flexandroid90/FlexAndroid90Minutes.pdf The very first step says that I have to create a Flex Mobile Project. I was under the impression that the whole point of Air is that the same application could run on many different platforms. I was intending on creating an air app with different skins that could be swapped in and out depending on the platform it was running on. This seems to imply that I will have to compile my Air app once for desktop and once for mobile. This isn't the end of the world but it's not quite how I expected it to work. I suppose that if I am creating mobile specific skins then I may as well create a mobile specific app. Is it possible to create one Air app that will run on both mobile and desktop? Is this a good idea?

    Read the article

  • How to extract the actual NSString from json object as NSArray

    - by Toran Billups
    I'm working with a large set of json and really just need the NSString representation of what's inside the NSArray -including all the { } My question is this - is their a better way than simply looping through each NSArray inside the main NSArray and outputting the description one by one? ie- the below is a start to this process but it's very brittle meaning I need to know each item inside the hat {} and this isn't something I actually care about. I just need the json string to move forward. The working code is below (thank you in advance!) NSString* responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding]; [responseData release]; NSArray* json = [responseString JSONValue]; NSArray* item = [json valueForKeyPath:@"d.data"]; NSArray* hatjson = [item objectForKey:@"hat"]; NSMutableString * result = [[NSMutableString alloc] init]; for (NSObject * obj in hatjson) { [result appendString:[obj description]]; } NSLog(@"the hat json is .. %@", result);

    Read the article

  • Tower of Hanoi, stop sliding

    - by ArtWorkAD
    Hi, I developed a solution for the Tower of Hanoi problem: public static void bewege(int h, char quelle, char ablage, char ziel) { if(h > 0){ bewege(h - 1, quelle, ziel, ablage); System.out.println("Move "+ h +" from " + quelle + " to " + ziel); bewege(h - 1, ablage, quelle, ziel); } } It works fine. Now i want to limit the number of slides and throw an exception if a certain limit is reached. I tried it with a counter but it does not work: class HanoiNK{ public static void main(String args[]){ Integer n = Integer.parseInt(args[0]); Integer k = Integer.parseInt(args[1]); try{ bewege(k, n, 'A', 'B', 'C'); }catch(Exception e){ System.out.println(e); } } public static void bewege(int c, int h, char quelle, char ablage, char ziel) throws Exception{ if(h > 0){ if(counter != 0){ bewege(c, h - 1, quelle, ziel, ablage); c--; System.out.println("Move "+ h +" from " + quelle + " to " + ziel); bewege(c, h - 1, ablage, quelle, ziel); c--; }else{ throw new Exception("stop sliding"); } } } } The exception is never thrown. Any ideas?

    Read the article

  • Drawing tree diagram in ASP.Net MVC

    - by Ivan Crojach Karacic
    I am creating an web application for my tae kwon do club. People are able to register online for a tournament. After the registration deadline the web application generates a dendrogram. Something like this: I am wondering now how to draw it. Because of the fact that there are my weight and age categories i have to draw them dynamicly for each group. What is the easiest way to draw this inside a MVC view?

    Read the article

  • problem in playing next song in the avaudioplayer

    - by Rajashekar
    Hello friends my delegate method looks like this. after the first song is played it goes into this method and plays the second song , however when the second song is done playing it stops. it does not go into the delegate method.i need to play all the songs continuously. i am not sure, why. can someone help me. (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)p successfully:(BOOL)flag { if (flag == NO) NSLog(@"Playback finished unsuccessfully"); else { //[player stop]; index++; NSLog(@"%d",index); path=[[NSBundle mainBundle] pathForResource:[songlist objectAtIndex:index] ofType:@"mp3"]; [player initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL]; [songlabel2 setTitle:[songlist objectAtIndex:index]]; [endtime setText:[NSString stringWithFormat:@"%.2f",[player duration]/100]]; [player play]; } }

    Read the article

  • Phonegap - Share functionality to Email, Twitter and Facebook

    - by Nik
    Hi, is there an example how to programm the functionality with the Phonegap Framework to share a URL to email, twitter and Facebook? For Example in Android this functionality is in 90% of the apps. In Iphone it is in any Apps. In the app of techcrunch for Iphone you can see it, when You open an article. It is possible to create this with phonegap too? Please for examples or docu if it is possible. Thanks and Happy New Year Cheers Nik

    Read the article

  • Formatting Field Declarations in Eclipse

    - by geeko
    Greetings Overflowers, Problem: public abstract class Filter { private long id; protected String expression; } how can I align fields automatically in Eclipse, such in: public abstract class Filter { private long id; protected String expression; } Note the space before long, thank you ! UPDATE: I cannot find a customization option to align types of class members (e.g.: long and String) under Eclipse formatter options. Yes, there is one to align names of class members (e.g.: id and expression) but not their types. Please, take a lock at this issue in my examples above. Any solution ?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >