Search Results

Search found 27766 results on 1111 pages for 'bad idea jeans'.

Page 72/1111 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • How to upload video on YouTube with Ruby

    - by viatropos
    I am trying to upload a youtube video using the GData gem (I have seen the youtube_g gem but would like to make it work with pure GData if possible), but I keep getting this error: GData::Client::BadRequestError in 'MyProject::Google::YouTube should upload the actual video to youtube (once it does, mock this test out)' request error 400: No file found in upload request. I am using this code: def metadata data = <<-EOF <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> EOF end @yt = GData::Client::YouTube.new @yt.clientlogin("name", "pass") @yt.developer_key = "myKey" url = "http://uploads.gdata.youtube.com/feeds/api/users/name/uploads" mime_type = "multipart/related" file_path = "sample_upload.mp4" @yt.post_file(url, file_path, mime_type, metadata) What is the recommended/standard way for uploading videos to youtube with ruby, what is your method? Update After applying the changes to wrapped_entry, the string it produces looks like this: --END_OF_PART_59003 Content-Type: application/atom+xml; charset=UTF-8 <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> --END_OF_PART_59003 Content-Type: multipart/related Content-Transfer-Encoding: binary ... and inspecting the request and response looks like this: Request: <GData::HTTP::Request:0x1b8bb44 @method=:post @url="http://uploads.gdata.youtube.com/feeds/api/users/lancejpollard/uploads" @body=#<GData::HTTP::MimeBody:0x1b8c738 @parts=[#<GData::HTTP::MimeBodyString:0x1b8c058 @bytes_read=0 @string="--END_OF_PART_30909\r\nContent-Type: application/atom+xml; charset=UTF-8\r\n\r\n <?xml version=\"1.0\"?>\n<entry xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">\n <media:group>\n <media:title type=\"plain\">Bad Wedding Toast</media:title>\n <media:description type=\"plain\">\n I gave a bad toast at my friend's wedding.\n </media:description>\n <media:category scheme=\"http://gdata.youtube.com/schemas/2007/categories.cat\">People</media:category>\n <media:keywords>toast wedding</media:keywords>\n </media:group>\n</entry> \n\r\n--END_OF_PART_30909\r\nContent-Type: multipart/related\r\nContent-Transfer-Encoding: binary\r\n\r\n"> #<File:/Users/Lance/Documents/Development/git/thing/spec/fixtures/sample_upload.mp4> #<GData::HTTP::MimeBodyString:0x1b8c044 @bytes_read=0 @string="\r\n--END_OF_PART_30909--"] @current_part=0 @boundary="END_OF_PART_30909" @headers={"Slug"="sample_upload.mp4" "User-Agent"="GoogleDataRubyUtil-AnonymousApp" "GData-Version"="2" "X-GData-Key"="key=AI39si7jkhs_ECjF4unOQz8gpWGSKXgq0KJpm8wywkvBSw4s8oJd5p5vkpvURHBNh-hiYJtoKwQqSfot7KoCkeCE32rNcZqMxA" "Content-Type"="multipart/related; boundary=\"END_OF_PART_30909\"" "MIME-Version"="1.0"} Response: #<GData::HTTP::Response:0x1b897e0 @body="No file found in upload request." @headers={"cache-control"=>"no-cache no-store must-revalidate" "connection"=>"close" "expires"=>"Fri 01 Jan 1990 00:00:00 GMT" "content-type"=>"text/plain; charset=utf-8" "date"=>"Fri 11 Dec 2009 02:10:25 GMT" "server"=>"Upload Server Built on Nov 30 2009 13:21:18 (1259616078)" "x-xss-protection"=>"0" "content-length"=>"32" "pragma"=>"no-cache"} @status_code=400> Still not working, I'll have to check it out more with those changes.

    Read the article

  • Extending Throwable in Java

    - by polygenelubricants
    Java lets you create an entirely new subtype of Throwable, e.g: public class FlyingPig extends Throwable { ... } Now, very rarely, I may do something like this: throw new FlyingPig("Oink!"); and of course elsewhere: try { ... } catch (FlyingPig porky) { ... } My questions are: Is this a bad idea? And if so, why? What could've been done to prevent this subtyping if it is a bad idea? Since it's not preventable (as far as I know), what catastrophies could result? If this isn't such a bad idea, why not? How can you make something useful out of the fact that you can extends Throwable?

    Read the article

  • What's the best way to detect web applications attacks ?

    - by paulgreg
    What is the best way to survey and detect bad users behavior or attacks like deny of services or exploits on my web app ? I know server's statistics (like Awstats) are very useful for that kind of purpose, specially to see 3XX, 4XX and 5XX errors (here's an Awstats example page) which are often bots or bad intentioned users that try well-known bad or malformed URLs. Is there others (and betters) ways to analyze and detect that kind of attack tentative ? Note : I'm speaking about URL based attacks, not attacks on server's component (like database or TCP/IP).

    Read the article

  • align WMD editor's preview HTML with server-side HTML validation (e.g. no embedded javascript)

    - by Justin Grant
    There are many SO questions (e.g. here and here) about how to do server-side scrubbing of Markdown produced by the WMD editor to ensure the HTML generated doesn't contain malicious script, like this: <img onload="alert('haha');" src="http://www.google.com/intl/en_ALL/images/srpr/logo1w.png" /> This doesn't affect the WMD client's preview box. I doubt this is a big deal since if you're scrubbing the HTML on the server, an attacker can't save the bad HTML so no one else will be able to see it later and have their cookies stolen or sessions hijacked by the bad script. But it's still kinda odd to allow an attacker to run any script in the context of your site, and it's probably a bad idea to allow the client preview window to allow different HTML than your server will allow. StackOverflow has clearly plugged this hole. How did they do it? [NOTE: I already figured this out but it required some tricky javascript debugging, so I'm answering my own question here to help others who may want to do ths same thing]

    Read the article

  • Python: User-Defined Exception That Proves The Rule

    - by bandana
    Python documentations states: Exceptions should typically be derived from the Exception class, either directly or indirectly. the word 'typically' leaves me in an ambiguous state. consider the code: class good(Exception): pass class bad(object): pass Heaven = good() Hell = bad() >>> raise Heaven Traceback (most recent call last): File "<pyshell#163>", line 1, in <module> raise Heaven good >>> raise Hell Traceback (most recent call last): File "<pyshell#171>", line 1, in <module> raise Hell TypeError: exceptions must be classes or instances, not bad so when reading the python docs, should i change 'typically' with ''? what if i have a class hierarchy that has nothing to do with the Exception class, and i want to 'raise' objects belonging to the hierarchy? i can always raise an exception with an argument: raise Exception, Hell This seems slightly awkward to me What's so special about the Exception class, that only its family members can be raised?

    Read the article

  • Why people are so afraid of using clone() (on collection and JDK classes) ?

    - by Bozho
    A number of times I've argued that using clone() isn't such a bad practice. Yes, I know the arguments. Bloch said it's bad. He indeed did, but he said that implementing clone() is bad. Using clone on the other hand, especially if it is implemented correctly by a trusted library, such as the JDK, is OK. Just yesterday I had a discussion about an answer of mine that merely suggests that using clone() for ArrayList is OK (and got no upvotes for that reason, I guess). If we look at the @author of ArrayList, we can see a familiar name - Josh Bloch. So clone() on ArrayList (and other collections) is perfectly fine. (Just look at the implementation). Same goes for Calendar and perhaps most of the java.lang and java.util classes. So, give me a reason why not to use clone() with JDK classes?

    Read the article

  • MySQL, how can I SELECT WHERE one field value doesn't occurs in another?

    - by Jules
    I'm trying to do a search on my test server, speed isn't so important. I want to find if a phrase, the whole contents of one field, occurs in any part (as a whole) doesn't occur in another field. Heres my current query which finds if the phrase does occur SELECT pads.padid, pads.programname, keywords.word FROM Pads JOIN keywords ON Pads.Padid = keywords.Padid WHERE pads.Programname = keywords.word AND RemoveMeDate = '2001-01-01 00:00:00' My problem is that the field word contains other words too. I need to produce a count of where there isn't a keywords record with keywords.word equal to pads.programname ? EDIT: So if I have these records Pads: PadID=3 ProgramName=my prog PadID=4 ProgramName=Bad prog PadID=5 ProgramName=Good prog PadID=6 ProgramName=other prog Keywords: PadID=3 word=fox prog PadID=3 word=pig prog PadID=4 word=big prog PadID=4 word=nice prog PadID=5 word=fox prog PadID=6 word=bad prog PadID=6 word=fox prog The query I want would retun a count of 3 and record 6 has bad prog

    Read the article

  • two where conditions in a mysql query

    - by Kaartz
    I have a table like below |date|dom|guid|pid|errors|QA|comm| |2010-03-22|xxxx.com|jsd3j234j|ab|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|ab|No|xxxxxx|| |2010-03-22|xxxx.com|jsd3j234j|if|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|if|No|xxxxxx|| |2010-03-22|xxxx.com|jsd3j234j|he|Yes|xxxxxx|bad| |2010-03-22|xxxx.com|jsd3j234j|he|No|xxxxxx|| I want to retrieve the total count of "dom" referred to each "QA" and also I need the count of "errors" detected by the "QA" SELECT date, count(dom), QA FROM reports WHERE date="2010-03-22" GROUP BY QA |2010-03-22|2|ab| |2010-03-22|2|if| |2010-03-22|2|he| SELECT date, count(dom), count(errors), QA FROM reports WHERE errors="Yes" GROUP BY QA |2010-03-22|1|ab| |2010-03-22|1|if| |2010-03-22|1|he| I want to combine the above two queries, is it possible. If I use the below query, I am not getting the desired result. SELECT date, count(dom), QA, count(errors) FROM reports WHERE date="2010-03-22" AND errors="Yes" GROUP BY QA I want the below output |2010-03-22|2|ab|1| |2010-03-22|2|if|1| |2010-03-22|2|he|1| Please help me.

    Read the article

  • Core Data produces Analyzer warnings

    - by RickiG
    Hi I am doing the final touch ups on an app and I am getting rid of every compiler/analyzer warning. I have a bunch of Class methods that wrap my apps access to Core Data entities. This is "provoking" the analyzer. + (CDProductEntity*) newProductEntity { return (CDProductEntity*)[NSEntityDescription insertNewObjectForEntityForName:@"CDProductEntity" inManagedObjectContext:[self context]]; } Which results in an Analyzer warning: Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected In the method that calls the above Class Method I have this: CDProductEntity *newEntity = [self newProductEntity]; Which results in an Analyzer warning: Method returns an Objective-C object with a +1 retain count (owning reference) Explicitly releasing or autoreleasing a Core Data entity is usually very very bad, but is that what it is asking me to do here? First it tells me it has a +0 retain count and that is bad, then it tells me it has a +1 which is also bad. What can I do to ensure that I am either dealing with a Analyzer hiccup or that I release correctly? Thanks in advance

    Read the article

  • Is GOTO really as evil as we are led to believe?

    - by RoboShop
    I'm a young programmer, so all my working life I've been told GOTO is evil, don't use it, if you do, your first born son will die. Recently, I've realized that GOTO actually still exists in .NET and I was wondering, is GOTO really as bad as they say, or is it just because everyone says you shouldn't use it, so that's why you don't. I know GOTO can be used badly, but are there any legit situations where you may possibly use it. The only thing I can think of is maybe to use GOTO to break out of a bunch of nested loops. I reckon that might be better then having to "break" out of each of them but because GOTO is supposedly always bad, I would never use it and it would probably never pass a peer review. What are your views? Is GOTO always bad? Can it sometimes be good? Has anyone here actually been gutsy enough to use GOTO for a real life system?

    Read the article

  • make a tree based on the key of each element in list.

    - by cocobear
    >>> s [{'000000': [['apple', 'pear']]}, {'100000': ['good', 'bad']}, {'200000': ['yeah', 'ogg']}, {'300000': [['foo', 'foo']]}, {'310000': [['#'], ['#']]}, {'320000': ['$', ['1']]}, {'321000': [['abc', 'abc']]}, {'322000': [['#'], ['#']]}, {'400000': [['yeah', 'baby']]}] >>> for i in s: ... print i ... {'000000': [['apple', 'pear']]} {'100000': ['good', 'bad']} {'200000': ['yeah', 'ogg']} {'300000': [['foo', 'foo']]} {'310000': [['#'], ['#']]} {'320000': ['$', ['1']]} {'321000': [['abc', 'abc']]} {'322000': [['#'], ['#']]} {'400000': [['yeah', 'baby']]} i want to make a tree based on the key of each element in list. result in logic will be: {'000000': [['apple', 'pear']]} {'100000': ['good', 'bad']} {'200000': ['yeah', 'ogg']} {'300000': [['foo', 'foo']]} {'310000': [['#'], ['#']]} {'320000': ['$', ['1']]} {'321000': [['abc', 'abc']]} {'322000': [['#'], ['#']]} {'400000': [['yeah', 'baby']]} perhaps a nested list can implement this or I need a tree type?

    Read the article

  • TCP 30 small packets per second polutes connection with server

    - by Denis Ermolin
    I'm testing connection with flash client and cloud server(boost::asio for software) over TCP connection. My connection with server already is really poor - 120 ms ping in average. I found when i start to send packets with 2 bytes size (without tcp header) with speed 30 packets/s ping grow to 170-200 average. I think that it's really bad and my bad connection and bad cloud provider is reason for this high ping without any load. What do you think? (I tested my software and can compute about 50k packets/s so software is not a problem).

    Read the article

  • ActionScript: Using 'in' on protected/private variables?

    - by David Wolever
    Is there any way to mimic the in operator, but testing for the existence of protected or private fields? For example, this: <mx:Script><![CDATA[ public var pub:Boolean = true; protected var prot:Boolean = true; private var priv:Boolean = true; ]]></mx:Script> <mx:creationComplete><![CDATA[ for each (var prop in ["pub", "prot", "priv", "bad"]) trace(prop + ":", prop in this); ]]></mx:creationComplete> Will trace: pub: true prot: false priv: false bad: false When I want to see: pub: true prot: true priv: true bad: false

    Read the article

  • Why does the compiler complain "while expected" when I try to add more code?

    - by user1893578
    Write a program with a word containing @ character as an input. If the word doesn't contain @, it should prompt the user for a word with @. Once a word with @ is read, it should output the word then terminate. This is what I have done so far: public class find { public static void main(String[] args) { System.out.println(" Please enter a word with @ "); Scanner scan = new Scanner(System.in); String bad = "@"; String word = scan.next(); do if (!word.contains(bad)) System.out.println(" Please try again "); else System.out.println(" " + word); while (!word.contains(bad)); } } I can get it to terminate after a word containing "@" is given as input, but if I try to add a Scanner to the line after "please try again", it says while expected.

    Read the article

  • Member classes versus #includes

    - by ShallowThoughts
    I've recently discovered that it is bad form to have #includes in your header files because anyone who uses your code gets all those extra includes they won't necessarily want. However, for classes that have member variables defined as a type of another class, what's the alternative? For example, I was doing things the following way for the longest time: /* Header file for class myGrades */ #include <vector> //bad #include "classResult.h" //bad class myGrades { vector<classResult> grades; int average; int bestScore; } (Please excuse the fact that this is a highly artificial example) So, if I want to get rid of the #include lines, is there any way I can keep the vector or do I have to approach programming my code in an entirely different way?

    Read the article

  • Z axis in isometric tilemap

    - by gyhgowvi
    I'm experimenting with isometric tile maps in JavaScript and HTML5 Canvas. I'm storing tile map data in JavaScript 2D array. // 0 - Grass // 1 - Dirt // ... var mapData = [ [0, 0, 0, 0, 0], [0, 0, 1, 0, 0, ... ] and draw for(var i = 0; i < mapData.length; i++) { for(var j = 0; j < mapData[i].length; j++) { var p = iso2screen(i, j, 0); // X, Y, Z context.drawImage(tileArray[mapData[i][j]], p.x, p.y); } } but this function mean's all tile Z axis is equal to zero. var p = iso2screen(i, j, 0); Maybe anyone have idea and how to do something like mapData[0][0] Z axis equal to 3 mapData[5][5] Z axis equal to 5? I have idea: Write function for grass, dirt and store this function to 2D array and draw and later mapData[0][0].setZ(3); But it is good idea to write functions for each tiles?

    Read the article

  • using ‘using’ and scope. Not try finally!

    - by Edward Boyle
    An object that implements IDisposable has, you guessed it, a Dispose() method. In the code you write you should both declare and instantiate any object that implements IDisposable with the using statement. The using statement allows you to set the scope of an object and when your code exits that scope, the object will be disposed of. Note that when an exception occurs, this will pull your code out of scope, so it still forces a Dispose() using (mObject o = new mObject()) { // do stuff } //<- out of Scope, object is disposed. // Note that you can also use multiple objects using // the using statement if of the same type: using (mObject o = new mObject(), o2 = new mObject(), o3 = new mObject()) { // do stuff } //<- out of Scope, objects are disposed. What about try{ }finally{}? It is not needed when you use the using statement. Additionally, using is preferred, Microsoft’s own documents put it this way: As a rule, when you use an IDisposable object, you should declare and instantiate it in a using statement. When I started out in .NET I had a very bad habit of not using the using statement. As a result I ran into what many developers do: #region BAD CODE - DO NOT DO try { mObject o = new mObject(); //do stuff } finally { o.Dispose(); // error - o is out of scope, no such object. } // and here is what I find on blogs all over the place as a solution // pox upon them for creating bad habits. mObject o = new mObject(); try { //do stuff } finally { o.Dispose(); } #endregion So when should I use the using statement? Very simple rule, if an object implements IDisposable, use it. This of course does not apply if the object is going to be used as a global object outside of a method. If that is the case, don’t forget to dispose of the object in code somewhere. It should be made clear that using the try{}finally{} code block is not going to break your code, nor cause memory leaks. It is perfectly acceptable coding practice, just not best coding practice in C#. This is how VB.NET developers must code, as there is no using equivalent for them to use.

    Read the article

  • HTC Legend get’s 2.2 Froyo update – India

    - by Boonei
    HTC Legend started to received 2.2 Froyo update from yesterday night. If you did not receive an automatic update prompt, please check the same manually in your phone, I am pretty sure you will get it now. Ok, lets get into business Good news Update went off smooth – over Wi-Fi App’s like, Flash light, App sharing, easy adding of attachments in sms, etc are part of update Google Maps 5.0 [But no 3D view] Much awaited Good voice with full integration with the phone!!!! Flash 10 Now for really bad news Phone seems to slow down a lot, that’s not something that we really want New browser with the Froyo update does not seems be all that good as the one installed already Since phone is little sluggish, the really smooth touch effects seem to be bad! This article titled,HTC Legend get’s 2.2 Froyo update – India, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • Blender mesh mirroring screws up normals when importing in Unity

    - by Shivan Dragon
    My issue is as follows: I've modeled a robot in Blender 2.6. It's a mech-like biped or if you prefer, it kindda looks like a chicken. Since it's symmetrical on the XZ plane, I've decided to mirror some of its parts instead of re-modeling them. Problem is, those mirrored meshes look fine in Blender (faces all show up properly and light falls on them as it should) but in Unity faces and lighting on those very same mirrored meshes is wrong. What also stumps me is the fact that even if I flip normals in Blender, I still get bad results in Unity for those meshes (though now I get different bad results than before). Here's the details: Here's a Blender screen shot of the robot. I've took 2 pictures and slightly rotated the camera around so the geometry in question can be clearly seen: Now, the selected cog-wheel-like piece is the mirrored mesh obtained from mirroring the other cog-wheel on the other (far) side of the robot torso. The back-face culling is turned of here, so it's actually showing the faces as dictated by their normals. As you can see it looks ok, faces are orientated correctly and light falls on it ok (as it does on the original cog-wheel from which it was mirrored). Now if I export this as fbx using the following settings: and then import it into Unity, it looks all screwy: It looks like the normals are in the wrong direction. This is already very strange, because, while in Blender, the original cog-wheel and its mirrored counter part both had normals facing one way, when importing this in Unity, the original cog-wheel still looks ok (like in Blender) but the mirrored one now has normals inverted. First thing I've tried is to go "ok, so I'll flip normals in Blender for the mirrored cog-wheel and then it'll display ok in Unity and that's that". So I went back to Blender, flipped the normals on that mesh, so now it looks bad in Blender: and then re-exported as fbx with the same settings as before, and re-imported into Unity. Sure enough the cog-wheel now looks ok in Unity, in the sense where the faces show up properly, but if you look closely you'll notice that light and shadows are now wrong: Now in Unity, even though the light comes from the back of the robot, the cog-wheel in question acts as if light was coming from some-where else, its faces which should be in shadow are lit up, and those that should be lit up are dark. Here's some things I've tried and which didn't do anything: in Blender I tried mirroring the mesh in 2 ways: first by using the scale to -1 trick, then by using the mirroring tool (select mesh, hit crtl-m, select mirror axis), both ways yield the exact same result in Unity I've tried playing around with the prefab import settings like "normals: import/calculate", "tangents: import/calculate" I've also tired not exporting as fbx manually from Blender, but just dropping the .blend file in the assets folder inside the Unity project So, my question is: is there a way to actually mirror a mesh in Blender and then have it imported in Unity so that it displays properly (as it does in Blender)? If yes, how? Thank you, and please excuse the TL;DR style.

    Read the article

  • Talking JavaOne with Rock Star Martijn Verburg

    - by Janice J. Heiss
    JavaOne Rock Stars, conceived in 2005, are the top-rated speakers at each JavaOne Conference. They are awarded by their peers, who, through conference surveys, recognize them for their outstanding sessions and speaking ability. Over the years many of the world’s leading Java developers have been so recognized. Martijn Verburg has, in recent years, established himself as an important mover and shaker in the Java community. His “Diabolical Developer” session at the JavaOne 2011 Conference got people’s attention by identifying some of the worst practices Java developers are prone to engage in. Among other things, he is co-leader and organizer of the thriving London Java User Group (JUG) which has more than 2,500 members, co-represents the London JUG on the Executive Committee of the Java Community Process, and leads the global effort for the Java User Group “Adopt a JSR” and “Adopt OpenJDK” programs. Career highlights include overhauling technology stacks and SDLC practices at Mizuho International, mentoring Oracle on technical community management, and running off shore development teams for AIG. He is currently CTO at jClarity, a start-up focusing on automating optimization for Java/JVM related technologies, and Product Advisor at ZeroTurnaround. He co-authored, with Ben Evans, "The Well-Grounded Java Developer" published by Manning and, as a leading authority on technical team optimization, he is in high demand at major software conferences.Verburg is participating in five sessions, a busy man indeed. Here they are: CON6152 - Modern Software Development Antipatterns (with Ben Evans) UGF10434 - JCP and OpenJDK: Using the JUGs’ “Adopt” Programs in Your Group (with Csaba Toth) BOF4047 - OpenJDK Building and Testing: Case Study—Java User Group OpenJDK Bugathon (with Ben Evans and Cecilia Borg) BOF6283 - 101 Ways to Improve Java: Why Developer Participation Matters (with Bruno Souza and Heather Vancura-Chilson) HOL6500 - Finding and Solving Java Deadlocks (with Heinz Kabutz, Kirk Pepperdine, Ellen Kraffmiller and Henri Tremblay) When I asked Verburg about the biggest mistakes Java developers tend to make, he listed three: A lack of communication -- Software development is far more a social activity than a technical one; most projects fail because of communication issues and social dynamics, not because of a bad technical decision. Sadly, many developers never learn this lesson. No source control -- Developers simply storing code in local filesystems and emailing code in order to integrate Design-driven Design -- The need for some developers to cram every design pattern from the Gang of Four (GoF) book into their source code All of which raises the question: If these practices are so bad, why do developers engage in them? “I've seen a wide gamut of reasons,” said Verburg, who lists them as: * They were never taught at high school/university that their bad habits were harmful.* They weren't mentored in their first professional roles.* They've lost passion for their craft.* They're being deliberately malicious!* They think software development is a technical activity and not a social one.* They think that they'll be able to tidy it up later.A couple of key confusions and misconceptions beset Java developers, according to Verburg. “With Java and the JVM in particular I've seen a couple of trends,” he remarked. “One is that developers think that the JVM is a magic box that will clean up their memory, make their code run fast, as well as make them cups of coffee. The JVM does help in a lot of cases, but bad code can and will still lead to terrible results! The other trend is to try and force Java (the language) to do something it's not very good at, such as rapid web development. So you get a proliferation of overly complex frameworks, libraries and techniques trying to get around the fact that Java is a monolithic, statically typed, compiled, OO environment. It's not a Golden Hammer!”I asked him about the keys to running a good Java User Group. “You need to have a ‘Why,’” he observed. “Many user groups know what they do (typically, events) and how they do it (the logistics), but what really drives users to join your group and to stay is to give them a purpose. For example, within the LJC we constantly talk about the ‘Why,’ which in our case is several whys:* Re-ignite the passion that developers have for their craft* Raise the bar of Java developers in London* We want developers to have a voice in deciding the future of Java* We want to inspire the next generation of tech leaders* To bring the disparate tech groups in London together* So we could learn from each other* We believe that the Java ecosystem forms a cornerstone of our society today -- we want to protect that for the futureLooking ahead to Java 8 Verburg expressed excitement about Lambdas. “I cannot wait for Lambdas,” he enthused. “Brian Goetz and his group are doing a great job, especially given some of the backwards compatibility that they have to maintain. It's going to remove a lot of boiler plate and yet maintain readability, plus enable massive scaling.”Check out Martijn Verburg at JavaOne if you get a chance, and, stay tuned for a longer interview yours truly did with Martijn to be publish on otn/java some time after JavaOne. Originally published on blogs.oracle.com/javaone.

    Read the article

  • Talking JavaOne with Rock Star Martijn Verburg

    - by Janice J. Heiss
    JavaOne Rock Stars, conceived in 2005, are the top-rated speakers at each JavaOne Conference. They are awarded by their peers, who, through conference surveys, recognize them for their outstanding sessions and speaking ability. Over the years many of the world’s leading Java developers have been so recognized. Martijn Verburg has, in recent years, established himself as an important mover and shaker in the Java community. His “Diabolical Developer” session at the JavaOne 2011 Conference got people’s attention by identifying some of the worst practices Java developers are prone to engage in. Among other things, he is co-leader and organizer of the thriving London Java User Group (JUG) which has more than 2,500 members, co-represents the London JUG on the Executive Committee of the Java Community Process, and leads the global effort for the Java User Group “Adopt a JSR” and “Adopt OpenJDK” programs. Career highlights include overhauling technology stacks and SDLC practices at Mizuho International, mentoring Oracle on technical community management, and running off shore development teams for AIG. He is currently CTO at jClarity, a start-up focusing on automating optimization for Java/JVM related technologies, and Product Advisor at ZeroTurnaround. He co-authored, with Ben Evans, "The Well-Grounded Java Developer" published by Manning and, as a leading authority on technical team optimization, he is in high demand at major software conferences.Verburg is participating in five sessions, a busy man indeed. Here they are: CON6152 - Modern Software Development Antipatterns (with Ben Evans) UGF10434 - JCP and OpenJDK: Using the JUGs’ “Adopt” Programs in Your Group (with Csaba Toth) BOF4047 - OpenJDK Building and Testing: Case Study—Java User Group OpenJDK Bugathon (with Ben Evans and Cecilia Borg) BOF6283 - 101 Ways to Improve Java: Why Developer Participation Matters (with Bruno Souza and Heather Vancura-Chilson) HOL6500 - Finding and Solving Java Deadlocks (with Heinz Kabutz, Kirk Pepperdine, Ellen Kraffmiller and Henri Tremblay) When I asked Verburg about the biggest mistakes Java developers tend to make, he listed three: A lack of communication -- Software development is far more a social activity than a technical one; most projects fail because of communication issues and social dynamics, not because of a bad technical decision. Sadly, many developers never learn this lesson. No source control -- Developers simply storing code in local filesystems and emailing code in order to integrate Design-driven Design -- The need for some developers to cram every design pattern from the Gang of Four (GoF) book into their source code All of which raises the question: If these practices are so bad, why do developers engage in them? “I've seen a wide gamut of reasons,” said Verburg, who lists them as: * They were never taught at high school/university that their bad habits were harmful.* They weren't mentored in their first professional roles.* They've lost passion for their craft.* They're being deliberately malicious!* They think software development is a technical activity and not a social one.* They think that they'll be able to tidy it up later.A couple of key confusions and misconceptions beset Java developers, according to Verburg. “With Java and the JVM in particular I've seen a couple of trends,” he remarked. “One is that developers think that the JVM is a magic box that will clean up their memory, make their code run fast, as well as make them cups of coffee. The JVM does help in a lot of cases, but bad code can and will still lead to terrible results! The other trend is to try and force Java (the language) to do something it's not very good at, such as rapid web development. So you get a proliferation of overly complex frameworks, libraries and techniques trying to get around the fact that Java is a monolithic, statically typed, compiled, OO environment. It's not a Golden Hammer!”I asked him about the keys to running a good Java User Group. “You need to have a ‘Why,’” he observed. “Many user groups know what they do (typically, events) and how they do it (the logistics), but what really drives users to join your group and to stay is to give them a purpose. For example, within the LJC we constantly talk about the ‘Why,’ which in our case is several whys:* Re-ignite the passion that developers have for their craft* Raise the bar of Java developers in London* We want developers to have a voice in deciding the future of Java* We want to inspire the next generation of tech leaders* To bring the disparate tech groups in London together* So we could learn from each other* We believe that the Java ecosystem forms a cornerstone of our society today -- we want to protect that for the futureLooking ahead to Java 8 Verburg expressed excitement about Lambdas. “I cannot wait for Lambdas,” he enthused. “Brian Goetz and his group are doing a great job, especially given some of the backwards compatibility that they have to maintain. It's going to remove a lot of boiler plate and yet maintain readability, plus enable massive scaling.”Check out Martijn Verburg at JavaOne if you get a chance, and, stay tuned for a longer interview yours truly did with Martijn to be publish on otn/java some time after JavaOne.

    Read the article

  • Do I suffer from encapsulation overuse?

    - by Florenc
    I have noticed something in my code in various projects that seems like code smell to me and something bad to do, but I can't deal with it. While trying to write "clean code" I tend to over-use private methods in order to make my code easier to read. The problem is that the code is indeed cleaner but it's also more difficult to test (yeah I know I can test private methods...) and in general it seems a bad habit to me. Here's an example of a class that reads some data from a .csv file and returns a group of customers (another object with various fields and attributes). public class GroupOfCustomersImporter { //... Call fields .... public GroupOfCustomersImporter(String filePath) { this.filePath = filePath; customers = new HashSet<Customer>(); createCSVReader(); read(); constructTTRP_Instance(); } private void createCSVReader() { //.... } private void read() { //.... Reades the file and initializes the class attributes } private void readFirstLine(String[] inputLine) { //.... Method used by the read() method } private void readSecondLine(String[] inputLine) { //.... Method used by the read() method } private void readCustomerLine(String[] inputLine) { //.... Method used by the read() method } private void constructGroupOfCustomers() { //this.groupOfCustomers = new GroupOfCustomers(**attributes of the class**); } public GroupOfCustomers getConstructedGroupOfCustomers() { return this.GroupOfCustomers; } } As you can see the class has only a constructor which calls some private methods to get the job done, I know that's not a good practice not a good practice in general but I prefer to encapsulate all the functionality in the class instead of making the methods public in which case a client should work this way: GroupOfCustomersImporter importer = new GroupOfCustomersImporter(filepath) importer.createCSVReader(); read(); GroupOfCustomer group = constructGoupOfCustomerInstance(); I prefer this because I don't want to put useless lines of code in the client's side code bothering the client class with implementation details. So, Is this actually a bad habit? If yes, how can I avoid it? Please note that the above is just a simple example. Imagine the same situation happening in something a little bit more complex.

    Read the article

  • Rolling your own Hackathon

    - by Terrance
    Background Info Hey, I pitched the idea of a company Hackathon that would donate our time to a charity to work on a project (for free) to improve morale in my company and increase developer cohesion. As it turns out most like the idea but, guess who's gonna be the one to put it together. lol Yeah me. I should add that we are a fairly small shop with about 10-12 programmers (some pull double duty as programmers, inters etc..) So, that might make things a bit easier. Base Question While I am no means a project manager or of any level of authority (Entry level guy) I was wondering if anyone knew the best approach for someone in my position to put together such an even with possibly (some) company backing. Or for that matter have any helpful advice to pass along to a young padawan. So far..... As of right now it is just an idea so, to start with I presumably would have to put together some sort of proposal and do some that office stuff that I became a programmer to steer clear of to some extent.

    Read the article

  • Sign of a Good Game

    - by Matt Christian
    (Warning: This post contains spoilers about SILENT HILL 2.  If you haven't played this game, you are dumb) What is one sign of a great game? One of the signs I realized recently is when a game continues to stun and surprise you years and years after you've played and beaten it.  As a major Silent Hill fan, I recently was reminded of Silent Hill 2 and even though see it as one of my favorite Silent Hill games, there are still things I'm learning about it that are neat little additions that add to the atmosphere (atmosphere also makes a great game!). For instance, when you start the game you are given a letter by your wife who has been deceased for years and years.  You are directed to Silent Hill and start treking through hell all by your lonesome (with the exception of a few psychos).  As you continue through the game, pieces of the letter begin to fade and disappear until eventually it is completely non-existent, thus implying the letter was never real and the letter was a delusion you created. Another example is the game's use of imagery the player knows about but might not notice at first.  For me, the most apparent of these was the dress you find near the start when you find the flashlight, which is the same dress you see Mary (your wife) wearing in the flashback sequences.  However, one thing I didn't know was that several deceased bodies you encounter laying around Silent Hill are actually the body of the main character (James) which invokes an idea you've seen that body before but can't pinpoint where... It's amazing to see a game go to such unique lengths to provide a psychological horror game.  Sure, all the dead bodies could be randomly modelled and the dress could be any ol' dress, but just the idea of your brain knowing something deep down but you can't pinpoint it is a really unique idea.  In my opinion, it ties less into subconscious and more into natural tendencies, it taps into the fear hidden inside us all.

    Read the article

  • PPTP network for server backend LAN?

    - by Sebastian Hoitz
    Here is our problem: We have several webservers, which should be reached from public. The database servers that store the data for the web apps on those webservers though shall not have a public IP. So, since I want to be able to connect to the SQL servers using ssh for example, and those servers need to talk with each other, I had this idea: Internet | ------------------ | | Webserver 1 Webserver 2 Database Server | | | -------------- vLAN -------------- | PPTP | Workstation (my PC) My idea was that I can connect to the vLAN using PPTP so that I have access to all servers in that LAN, but the database server remains unvisible to the public. Is this infrastructure a good idea?

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >