Search Results

Search found 18854 results on 755 pages for 'mr null'.

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

  • null pointers vs. Null Object Pattern

    - by GlenH7
    Attribution: This grew out of a related P.SE question My background is in C / C++, but I have worked a fair amount in Java and am currently coding C#. Because of my C background, checking passed and returned pointers is second-hand, but I acknowledge it biases my point of view. I recently saw mention of the Null Object Pattern where the idea is than an object is always returned. Normal case returns the expected, populated object and the error case returns empty object instead of a null pointer. The premise being that the calling function will always have some sort of object to access and therefore avoid null access memory violations. So what are the pros / cons of a null check versus using the Null Object Pattern? I can see cleaner calling code with the NOP, but I can also see where it would create hidden failures that don't otherwise get raised. I would rather have my application fail hard (aka an exception) while I'm developing it than have a silent mistake escape into the wild. Can't the Null Object Pattern have similar problems as not performing a null check? Many of the objects I have worked with hold objects or containers of their own. It seems like I would have to have a special case to guarantee all of the main object's containers had empty objects of their own. Seems like this could get ugly with multiple layers of nesting.

    Read the article

  • How do I fix a noisy input device (Internal Mic)? snd_hda_intel - debug included

    - by hazrpg
    As the title says, I'm having trouble with a very noisy audio input device - the internal mic or any plugged in mics. So far I've narrowed it down to an problem in ALSA since my debug info is showing a lot of "null" values. Can anyone help? Debug Info: http://www.alsa-project.org/db/?f=e0c6fb7e10624bf7691aa2b405cf0d3968e56c63 Exert from the debug: model : (null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null),(null)

    Read the article

  • Unity completely broken after upgrade to 12.10?

    - by NlightNFotis
    I am facing a very frustrating issue with my computer right now. I successfully upgraded to Ubuntu 12.10 this afternoon, but after the upgrade, the graphical user interface seems completely broken. To be more specific, I can not get the Unity bar to appear on the right. I have tried many things, including (but not limited to) purging and then reinstalling the fglrx drivers, apt-get install --reinstall ubuntu-desktop, apt-get install --reinstall unity, tried to remove the Xorg and Compiz configurations, checked to see if the Ubuntu Unity wall was enabled (it was) in ccsm, all to no avail. Could someone help me troubleshoot and essentially fix this issue? NOTE: This is the output when I try to enable unity via a terminal: compiz (core) - Info: Loading plugin: core compiz (core) - Info: Starting plugin: core unity-panel-service: no process found compiz (core) - Info: Loading plugin: reset compiz (core) - Error: Failed to load plugin: reset compiz (core) - Info: Loading plugin: ccp compiz (core) - Info: Starting plugin: ccp compizconfig - Info: Backend : gsettings compizconfig - Info: Integration : true compizconfig - Info: Profile : unity compiz (core) - Info: Loading plugin: composite compiz (core) - Info: Starting plugin: composite compiz (core) - Info: Loading plugin: opengl X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 153 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 22 Current serial number in output stream: 22 compiz (core) - Info: Unity is not supported by your hardware. Enabling software rendering instead (slow). compiz (core) - Info: Starting plugin: opengl Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 compiz (core) - Error: Plugin initScreen failed: opengl compiz (core) - Error: Failed to start plugin: opengl compiz (core) - Info: Unloading plugin: opengl compiz (core) - Info: Loading plugin: decor compiz (core) - Info: Starting plugin: decor compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available compiz (decor) - Warn: requested a pixmap type decoration when compositing isn't available Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 compiz (core) - Info: Loading plugin: imgpng compiz (core) - Info: Starting plugin: imgpng compiz (core) - Info: Loading plugin: vpswitch compiz (core) - Info: Starting plugin: vpswitch compiz (core) - Info: Loading plugin: resize compiz (core) - Info: Starting plugin: resize Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 compiz (core) - Info: Loading plugin: compiztoolbox compiz (core) - Info: Starting plugin: compiztoolbox compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Info: Loading plugin: move compiz (core) - Info: Starting plugin: move compiz (core) - Info: Loading plugin: gnomecompat compiz (core) - Info: Starting plugin: gnomecompat compiz (core) - Info: Loading plugin: mousepoll compiz (core) - Info: Starting plugin: mousepoll compiz (core) - Info: Loading plugin: wall compiz (core) - Info: Starting plugin: wall compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: wall compiz (core) - Error: Failed to start plugin: wall compiz (core) - Info: Unloading plugin: wall compiz (core) - Info: Loading plugin: regex compiz (core) - Info: Starting plugin: regex compiz (core) - Info: Loading plugin: snap compiz (core) - Info: Starting plugin: snap compiz (core) - Info: Loading plugin: unitymtgrabhandles compiz (core) - Info: Starting plugin: unitymtgrabhandles compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: unitymtgrabhandles compiz (core) - Error: Failed to start plugin: unitymtgrabhandles compiz (core) - Info: Unloading plugin: unitymtgrabhandles compiz (core) - Info: Loading plugin: place compiz (core) - Info: Starting plugin: place compiz (core) - Info: Loading plugin: grid compiz (core) - Info: Starting plugin: grid Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 compiz (core) - Info: Loading plugin: animation compiz (core) - Info: Starting plugin: animation compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: animation compiz (core) - Error: Failed to start plugin: animation compiz (core) - Info: Unloading plugin: animation compiz (core) - Info: Loading plugin: fade compiz (core) - Info: Starting plugin: fade compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: fade compiz (core) - Error: Failed to start plugin: fade compiz (core) - Info: Unloading plugin: fade compiz (core) - Info: Loading plugin: session compiz (core) - Info: Starting plugin: session compiz (core) - Info: Loading plugin: expo compiz (core) - Info: Starting plugin: expo compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: expo compiz (core) - Error: Failed to start plugin: expo compiz (core) - Info: Unloading plugin: expo compiz (core) - Info: Loading plugin: ezoom compiz (core) - Info: Starting plugin: ezoom compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: ezoom compiz (core) - Error: Failed to start plugin: ezoom compiz (core) - Info: Unloading plugin: ezoom compiz (core) - Info: Loading plugin: workarounds compiz (core) - Info: Starting plugin: workarounds compiz (core) - Error: Plugin 'opengl' not loaded. Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 compiz (core) - Info: Loading plugin: scale compiz (core) - Info: Starting plugin: scale compiz (core) - Error: Plugin 'opengl' not loaded. compiz (core) - Error: Plugin init failed: scale compiz (core) - Error: Failed to start plugin: scale compiz (core) - Info: Unloading plugin: scale Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Compiz (opengl) - Fatal: glXQueryExtensionsString is NULL for screen 0 Segmentation fault (core dumped)

    Read the article

  • Listing both null and not null in mysql query

    - by tomasz
    Let's say I have the table NAME | ID | REF foo1 | 1 | NULL foo2 | 2 | 1234 foo2 | 3 | 567 foo1 | 4 | NULL foo3 | 5 | 89 I'd like to count all instances of NULL and NOT NULL in one query so that I can say NAME | null | not null foo1 | 0 | 2 foo2 | 2 | 0 foo3 | 0 | 1 I could run these two queries select NAME,count(*) from TABLE where REF is not null select NAME,count(*) from TABLE where REF is null But I'm sure there must be a simple way to do it in one mysql query.

    Read the article

  • Bunny Inc. – Episode 1. Mr. CIO meets Mr. Executive Manager

    - by kellsey.ruppel(at)oracle.com
    To make accurate and timely business decisions, executive managers are constantly in need of valuable information that is often hidden in old-style traditional systems. What can Mr. CIO come up with to help make Mr. Executive Manager's job easier at Bunny Inc.? Take a look and discover how you too can make informed business decisions by combining back-office systems with social media. Bunny Inc. -- Episode 1. Mr. CIO meets Mr. Executive ManagerTechnorati Tags: UXP, collaboration, enterprise 2.0, modern user experience, oracle, portals, webcenter, e20bunnies

    Read the article

  • Null check error message as "is null" or "was null"

    - by Timo Westkämper
    When doing null checks in Java code, and you throw IllegalArgumentExceptions for null values, what kind of message template do you use? We tend to use something like this public User getUser(String username){ if (username == null){ throw new IllegalArgumentException("username is null"); } // ... } What is better : "is null" or "was null", and why? For me "is null" feels more natural.

    Read the article

  • Mr Flibble: As Seen Through a Lens, Darkly

    - by Phil Factor
    One of the rewarding things about getting involved with Simple-Talk has been in meeting and working with some pretty daunting talents. I’d like to say that Dom Reed’s talents are at the end of the visible spectrum, but then there is Richard, who pops up on national radio occasionally, presenting intellectual programs, Andrew, master of the ukulele, with his pioneering local history work, and Tony with marathon running and his past as a university lecturer. However, Dom, who is Red Gate’s head of creative design and who did the preliminary design work for Simple-Talk, has taken the art photography to an extreme that was impossible before Photoshop. He’s not the first person to take a photograph of himself every day for two years, but he is definitely the first to weave the results into a frightening narrative that veers from comedy to pathos, using all the arts of Photoshop to create a fictional character, Mr Flibble.   Have a look at some of the Flickr pages. Uncle Spike The B-Men – Woolverine The 2011 BoyZ iN Sink reunion tour turned out to be their last Error 404 – Flibble not found Mr Flibble is not a normal type of alter-ego. We generally prefer to choose bronze age warriors of impossibly magnificent physique and stamina; superheroes who bestride the world, scorning the forces of evil and anarchy in a series noble and righteous quests. Not so Dom, whose Mr Flibble is vulnerable, and laid low by an addiction to toxic substances. His work has gained an international cult following and is used as course material by several courses in photography. Although his work was for a while ignored by the more conventional world of ‘art’ photography they became famous through the internet. His photos have received well over a million views on Flickr. It was definitely time to turn this work into a book, because the whole sequence of images has its maximum effect when seen in sequence. He has a Kickstarter project page, one of the first following the recent UK launch of the crowdfunding platform. The publication of the book should be a major event and the £45 I shall divvy up will be one of the securest investments I shall ever make. The local news in Cambridge picked up on the project and I can quote from the report by the excellent Cabume website , the source of Tech news from the ‘Cambridge cluster’ Put really simply Mr Flibble likes to dress up and take pictures of himself. One of the benefits of a split personality, however is that Mr Flibble is supported in his endeavour by Reed’s top notch photography skills, supreme mastery of Photoshop and unflinching dedication to the cause. The duo have collaborated to take a picture every day for the past 730-plus days. It is not a big surprise that neither Mr Flibble nor Reed watches any TV: In addition to his full-time role at Cambridge software house,Red Gate Software as head of creativity and the two to five hours a day he spends taking the Mr Flibble shots, Reed also helps organise the . And now Reed is using Kickstarter to see if the world is ready for a Mr Flibble coffee table book. Judging by the early response it is. At the time of writing, just a few days after it went live, ‘I Drink Lead Paint: An absurd photography book by Mr Flibble’ had raised £1,545 of the £10,000 target it needs to raise by the Friday 30 November deadline from 37 backers. Following the standard Kickstarter template, Reed is offering a series of rewards based on the amount pledged, ranging from a Mr Flibble desktop wallpaper for pledges of £5 or more to a signed copy of the book for pledges of £45 or more, right up to a starring role in the book for £1,500. Mr Flibble is unquestionably one of the more deranged Kickstarter hopefuls, but don’t think for a second that he doesn’t have a firm grasp on the challenges he faces on the road to immortalisation on 150 gsm stock. Under the section ‘risks and challenges’ on his Kickstarter page his statement begins: “An angry horde of telepathic iguanas discover the world’s last remaining stock of vintage lead paint and hold me to ransom. Gosh how I love to guzzle lead paint. Anyway… faced with such brazen bravado, I cower at the thought of taking on their combined might and die a sad and lonely Flibble deprived of my one and only true liquid love.” At which point, Reed manages to wrestle away the keyboard, giving him the opportunity to present slightly more cogent analysis of the obstacles the project must still overcome. We asked Reed a few questions about Mr Flibble’s Kickstarter adventure and felt that his responses were worth publishing in full: Firstly, how did you manage it – holding down a full time job and also conceiving and executing these ideas on a daily basis? I employed a small team of ferocious gerbils to feed me ideas on a daily basis. Whilst most of their ideas were incomprehensibly rubbish and usually revolved around food, just occasionally they’d give me an idea like my B-Men series. As a backup plan though, I found that the best way to generate ideas was to actually start taking photos. If I were to stand in front of the camera, pull a silly face, place a vegetable on my head or something else equally stupid, the resulting photo of that would typically spark an idea when I came to look at it. Sitting around idly trying to think of an idea was doomed to result in no ideas. I admit that I really struggled with time. I’m proud that I never missed a day, but it was definitely hard when you were late from work, tired or doing something socially on the same day. I don’t watch TV, which I guess really helps, because I’d frequently be spending 2-5 hours taking and processing the photos every day. Are there any overlaps between software development and creative thinking? Software is an inherently creative business and the speed that it moves ensures you always have to find solutions to new things. Everyone in the team needs to be a problem solver. Has it helped me specifically with my photography? Probably. Working within teams that continually need to figure out new stuff keeps the brain feisty I suppose, and I guess I’m continually exposed to a lot of possible sources of inspiration. How specifically will this Kickstarter project allow you to test the commercial appeal of your work and do you plan to get the book into shops? It’s taken a while to be confident saying it, but I know that people like the work that I do. I’ve had well over a million views of my pictures, many humbling comments and I know I’ve garnered some loyal fans out there who anticipate my next photo. For me, this Kickstarter is about seeing if there’s worth to my work beyond just making people smile. In an online world where there’s an abundance of freely available content, can you hope to receive anything from what you do, or would people just move onto the next piece of content if you happen to ask for some support? A book has been the single-most requested thing that people have asked me to produce and it’s something that I feel would showcase my work well. It’s just hard to convince people in the publishing industry just now to take any kind of risk – they’ve been hit hard. If I can show that people would like my work enough to buy a book, then it sends a pretty clear picture that publishers might hear, or it gives me the confidence enough to invest in myself a bit more – hard to do when you’re riddled with self-doubt! I’d love to see my work in the shops, yes. I could see it being the thing that someone flips through idly as they’re Christmas shopping and recognizing that it’d be just the perfect gift for their difficult to buy for friend or relative. That said, working in the software industry means I’m clearly aware of how I could use technology to distribute my work, but I can’t deny that there’s something very appealing to having a physical thing to hold in your hands. If the project is successful is there a chance that it could become a full-time job? At the moment that seems like a distant dream, as should this be successful, there are many more steps I’d need to take to reach any kind of business viability. Kickstarter seems exactly that – a way for people to help kick start me into something that could take off. If people like my work and want me to succeed with it, then taking a look at my Kickstarter page (and hopefully pledging a bit of support) would make my elbows blush considerably. So there is is. An opportunity to open the wallet just a bit to ensure that one of the more unusual talents sees the light in the format it deserves.  

    Read the article

  • So which null equals this null, that null? maybe this null, or is it this null?

    - by GrumpyOldDBA
    Tuning takes many routes and I get into some interesting situations and often make some exciting finds, see http://sqlblogcasts.com/blogs/grumpyolddba/archive/2010/05/17/just-when-you-thought-it-was-safe.aspx for an example. Today I encountered a multitude of Foreign Key constraints on a table, now FKs are often candidates for indexes and as none of the defined keys had an index it required a closer look. I view foreign key constraints as somewhat of a pain, excessive keys can cause excessive related...(read more)

    Read the article

  • Check parameters annotated with @Nonnull for null?

    - by David Harkness
    We've begun using FindBugs with and annotating our parameters with @Nonnull appropriately, and it works great to point out bugs early in the cycle. So far we have continued checking these arguments for null using Guava's checkNotNull, but I would prefer to check for null only at the edges--places where the value can come in without having been checked for null, e.g., a SOAP request. // service layer accessible from outside public Person createPerson(@CheckForNull String name) { return new Person(Preconditions.checkNotNull(name)); } ... // internal constructor accessed only by the service layer public Person(@Nonnull String name) { this.name = Preconditions.checkNotNull(name); // remove this check? } I understand that @Nonnull does not block null values itself. However, given that FindBugs will point out anywhere a value is transferred from an unmarked field to one marked @Nonnull, can't we depend on it to catch these cases (which it does) without having to check these values for null everywhere they get passed around in the system? Am I naive to want to trust the tool and avoid these verbose checks? Bottom line: While it seems safe to remove the second null check below, is it bad practice? This question is perhaps too similar to Should one check for null if he does not expect null, but I'm asking specifically in relation to the @Nonnull annotation.

    Read the article

  • MySql query optimization help

    - by rohitgu
    I have few queries and am not able to figure out how to optimize them, QUERY 1 select * from t_twitter_tracking where classified is null and tweetType='ENGLISH' order by id limit 500; QUERY 2 Select count(*) as cnt, DATE_FORMAT(CONVERT_TZ(wrdTrk.createdOnGMTDate,'+00:00','+05:30'),'%Y-%m-%d') as dat from t_twitter_tracking wrdTrk where wrdTrk.word like ('dell') and CONVERT_TZ(wrdTrk.createdOnGMTDate,'+00:00','+05:30') between '2010-12-12 00:00:00' and '2010-12-26 00:00:00' group by dat; Both these queries run on the same table, CREATE TABLE `t_twitter_tracking` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `word` VARCHAR(200) NOT NULL, `tweetId` BIGINT(100) NOT NULL, `twtText` VARCHAR(800) NULL DEFAULT NULL, `language` TEXT NULL, `links` TEXT NULL, `tweetType` VARCHAR(20) NULL DEFAULT NULL, `source` TEXT NULL, `sourceStripped` TEXT NULL, `isTruncated` VARCHAR(40) NULL DEFAULT NULL, `inReplyToStatusId` BIGINT(30) NULL DEFAULT NULL, `inReplyToUserId` INT(11) NULL DEFAULT NULL, `rtUsrProfilePicUrl` TEXT NULL, `isFavorited` VARCHAR(40) NULL DEFAULT NULL, `inReplyToScreenName` VARCHAR(40) NULL DEFAULT NULL, `latitude` BIGINT(100) NOT NULL, `longitude` BIGINT(100) NOT NULL, `retweetedStatus` VARCHAR(40) NULL DEFAULT NULL, `statusInReplyToStatusId` BIGINT(100) NOT NULL, `statusInReplyToUserId` BIGINT(100) NOT NULL, `statusFavorited` VARCHAR(40) NULL DEFAULT NULL, `statusInReplyToScreenName` TEXT NULL, `screenName` TEXT NULL, `profilePicUrl` TEXT NULL, `twitterId` BIGINT(100) NOT NULL, `name` TEXT NULL, `location` VARCHAR(100) NULL DEFAULT NULL, `bio` TEXT NULL, `url` TEXT NULL COLLATE 'latin1_swedish_ci', `utcOffset` INT(11) NULL DEFAULT NULL, `timeZone` VARCHAR(100) NULL DEFAULT NULL, `frenCnt` BIGINT(20) NULL DEFAULT '0', `createdAt` DATETIME NULL DEFAULT NULL, `createdOnGMT` VARCHAR(40) NULL DEFAULT NULL, `createdOnServerTime` DATETIME NULL DEFAULT NULL, `follCnt` BIGINT(20) NULL DEFAULT '0', `favCnt` BIGINT(20) NULL DEFAULT '0', `totStatusCnt` BIGINT(20) NULL DEFAULT NULL, `usrCrtDate` VARCHAR(200) NULL DEFAULT NULL, `humanSentiment` VARCHAR(30) NULL DEFAULT NULL, `replied` BIT(1) NULL DEFAULT NULL, `replyMsg` TEXT NULL, `classified` INT(32) NULL DEFAULT NULL, `createdOnGMTDate` DATETIME NULL DEFAULT NULL, `locationDetail` TEXT NULL, `geonameid` INT(11) NULL DEFAULT NULL, `country` VARCHAR(255) NULL DEFAULT NULL, `continent` CHAR(2) NULL DEFAULT NULL, `placeLongitude` FLOAT NULL DEFAULT NULL, `placeLatitude` FLOAT NULL DEFAULT NULL, PRIMARY KEY (`id`), INDEX `id` (`id`, `word`), INDEX `createdOnGMT_index` (`createdOnGMT`) USING BTREE, INDEX `word_index` (`word`) USING BTREE, INDEX `location_index` (`location`) USING BTREE, INDEX `classified_index` (`classified`) USING BTREE, INDEX `tweetType_index` (`tweetType`) USING BTREE, INDEX `getunclassified_index` (`classified`, `tweetType`) USING BTREE, INDEX `timeline_index` (`word`, `createdOnGMTDate`, `classified`) USING BTREE, INDEX `createdOnGMTDate_index` (`createdOnGMTDate`) USING BTREE, INDEX `locdetail_index` (`country`, `id`) USING BTREE, FULLTEXT INDEX `twtText_index` (`twtText`) ) COLLATE='utf8_general_ci' ENGINE=MyISAM ROW_FORMAT=DEFAULT AUTO_INCREMENT=12608048; The table has more than 10 million records. How can I optimize it?

    Read the article

  • PHP: why is this null different from the other null

    - by matthy
    hi i tried 2 things what should be the same however it my testing says different does anyone know why the only thing i do is put it in a variable... if ($_SESSION[$something] === null) echo("this is null"); $_SESSION[$something] does not exists so it indeed says: "this is null". now look at this $theSession = $_SESSION[$something]; if (theSession === null) echo("this is null"); now it does not say "this is null" while it should be exactly the same right?

    Read the article

  • Difference between null==object and object==null

    - by priyank.mp
    Hi I would like to know diff between the above comparisons? I am getting null pointer exception when I check object.getItems() == null. But if I change it to null == object.getItems(), it workes fine. I did look into this http://stackoverflow.com/questions/2938476/what-is-the-difference-between-null-object-and-objectnull-closed But I didnt get satisfactory answer.

    Read the article

  • "Null" is null or not an object error in IE javascript

    - by user89691
    The following code executes fine in Firefox and Chrome, but gives an error: 'null' is null or not an object when executed in Internet Explorer. if (xmlhttp.responseXML != null) { var xmlDoc = xmlhttp.responseXML.documentElement ; var ResultNodes = xmlDoc.getElementsByTagName ("Result") ; <---- error here if (ResultNodes != null) { (I would have thought the line after the one indicated would be more likely to return the error but the debugger says the run-time error is at the line indicated) Any ideas why?

    Read the article

  • "Null" is null or not an object error in IE javascript

    - by rossmcm
    The following code executes fine in Firefox and Chrome, but gives an error: 'null' is null or not an object when executed in Internet Explorer. if (xmlhttp.responseXML != null) { var xmlDoc = xmlhttp.responseXML.documentElement ; var ResultNodes = xmlDoc.getElementsByTagName ("Result") ; <---- error here if (ResultNodes != null) { (I would have thought the line after the one indicated would be more likely to return the error but the debugger says the run-time error is at the line indicated) Any ideas why?

    Read the article

  • Null object that is not null

    - by Guillaume
    Hello, I use 2 threads to act like a produce/consumer using double queue (http://www.codeproject.com/KB/threads/DoubleQueue.aspx). Sometimes in my 2nd thread, I get an object that is NULL but it should not be as I filled it in the first thread. I tried this: if(myObject.Data == null) { Console.WriteLine("Null Object") // <-- Breakpoint here } When I my break point hits, I can watch myObject.Data and indeed it's NULL, but when I hit F10 and then go to the next line (which is } ) myObject.Data is not NULL. I also added a lock on myObject before if .... to be sure that no one whould use this object. How is that possible and what can I do ?

    Read the article

  • Returning null vs Throwing exceptions

    - by Svish
    Is in a bit of disagreement with a more experienced developer on this issue, and was wondering what you guys here think about this. Environment is Java, EJB 3, services, etc. The code I wrote calls a service to get things and to create things. Problem was that I got null pointer exceptions in places that didn't make sense. For example when I asked the service to create an object, I got null back. And when I tried to look up an object with an id I knew existed, I still got null back. Was like it was ignoring me. Spent some time trying to figure out what was wrong in my code (since I'm less experienced I usually assume I have messed up). Turns out the reason was security. If the user principal using my service didn't have the right permissions to use the service I called from my service, then that service simply returned null. The services that are here already are usually not documented either, so this is just something you have to know... somehow... So here is the thing: I mean that this is rather confusing as a developer interacting with this service. To me it would make much more sense if that service thew an exception which would tell me that hey, you don't have the proper permissions to get info about this thing or to create this new thing. I would then immediately know why my service wasn't working as expected. However, he argued that asking is not wrong. Exceptions should only be thrown when there is an error and asking for a thing is not an error. Even if you don't have permission to "see" that the thing you asked for. The things are often looked up in a GUI by users and for those users not having the right permissions, these things simply "do not exist". So, in short: Asking is not wrong, hence no exception. Get methods return null because to those users those things "doesn't exist". Create methods return null because nothing was created, since the user wasn't allowed to create anything. So, what do you guys think? Is this normal and/or good practice? I prefer exceptions as I prefer throwing and catching exceptions because I find it much easier to know what's going on. So I would for example also prefer to throw a NotFoundException if you asked for an id which didn't exist, rather than returning null. Anyways, just curious to what others think about this as I'm not the most experienced developer yet.

    Read the article

  • MySQL Database Query Problem

    - by moustafa
    I need your help!!!. I need to query a table in my database that has record of goods sold. I want the query to detect a particular product and also calculate the quantity sold. The product are 300 now, but it would increase in the future. Below is a sample of my DB Table #---------------------------- # Table structure for litorder #---------------------------- CREATE TABLE `litorder` ( `id` int(10) NOT NULL auto_increment, `name` varchar(50) NOT NULL default '', `address` varchar(50) NOT NULL default '', `xdate` date NOT NULL default '0000-00-00', `ref` varchar(20) NOT NULL default '', `code1` varchar(50) NOT NULL default '', `code2` varchar(50) NOT NULL default '', `code3` varchar(50) NOT NULL default '', `code4` varchar(50) NOT NULL default '', `code5` varchar(50) NOT NULL default '', `code6` varchar(50) NOT NULL default '', `code7` varchar(50) NOT NULL default '', `code8` varchar(50) NOT NULL default '', `code9` varchar(50) NOT NULL default '', `code10` varchar(50) NOT NULL default '', `code11` varchar(50) character set latin1 collate latin1_bin NOT NULL default '', `code12` varchar(50) NOT NULL default '', `code13` varchar(50) NOT NULL default '', `code14` varchar(50) NOT NULL default '', `code15` varchar(50) NOT NULL default '', `product1` varchar(100) NOT NULL default '0', `product2` varchar(100) NOT NULL default '0', `product3` varchar(100) NOT NULL default '0', `product4` varchar(100) NOT NULL default '0', `product5` varchar(100) NOT NULL default '0', `product6` varchar(100) NOT NULL default '0', `product7` varchar(100) NOT NULL default '0', `product8` varchar(100) NOT NULL default '0', `product9` varchar(100) NOT NULL default '0', `product10` varchar(100) NOT NULL default '0', `product11` varchar(100) NOT NULL default '0', `product12` varchar(100) NOT NULL default '0', `product13` varchar(100) NOT NULL default '0', `product14` varchar(100) NOT NULL default '0', `product15` varchar(100) NOT NULL default '0', `price1` int(10) NOT NULL default '0', `price2` int(10) NOT NULL default '0', `price3` int(10) NOT NULL default '0', `price4` int(10) NOT NULL default '0', `price5` int(10) NOT NULL default '0', `price6` int(10) NOT NULL default '0', `price7` int(10) NOT NULL default '0', `price8` int(10) NOT NULL default '0', `price9` int(10) NOT NULL default '0', `price10` int(10) NOT NULL default '0', `price11` int(10) NOT NULL default '0', `price12` int(10) NOT NULL default '0', `price13` int(10) NOT NULL default '0', `price14` int(10) NOT NULL default '0', `price15` int(10) NOT NULL default '0', `quantity1` int(10) NOT NULL default '0', `quantity2` int(10) NOT NULL default '0', `quantity3` int(10) NOT NULL default '0', `quantity4` int(10) NOT NULL default '0', `quantity5` int(10) NOT NULL default '0', `quantity6` int(10) NOT NULL default '0', `quantity7` int(10) NOT NULL default '0', `quantity8` int(10) NOT NULL default '0', `quantity9` int(10) NOT NULL default '0', `quantity10` int(10) NOT NULL default '0', `quantity11` int(10) NOT NULL default '0', `quantity12` int(10) NOT NULL default '0', `quantity13` int(10) NOT NULL default '0', `quantity14` int(10) NOT NULL default '0', `quantity15` int(10) NOT NULL default '0', `amount1` int(10) NOT NULL default '0', `amount2` int(10) NOT NULL default '0', `amount3` int(10) NOT NULL default '0', `amount4` int(10) NOT NULL default '0', `amount5` int(10) NOT NULL default '0', `amount6` int(10) NOT NULL default '0', `amount7` int(10) NOT NULL default '0', `amount8` int(10) NOT NULL default '0', `amount9` int(10) NOT NULL default '0', `amount10` int(10) NOT NULL default '0', `amount11` int(10) NOT NULL default '0', `amount12` int(10) NOT NULL default '0', `amount13` int(10) NOT NULL default '0', `amount14` int(10) NOT NULL default '0', `amount15` int(10) NOT NULL default '0', `totalNaira` double(20,0) NOT NULL default '0', `totalDollar` int(20) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 4096 kB; InnoDB free: 4096 kB; InnoDB free: 409'; #---------------------------- # Records for table litorder #---------------------------- insert into litorder values (27, 'Sanyaolu Fisayo', '14 Adegboyega Street Palmgrove Lagos', '2010-05-31', '', 'DL 001', 'DL 002', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'AILMENT & PREVENTION DVD- HAUSA', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', 800, 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12800, 12800, 60000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '85600', 563), (28, 'Irenonse Esther', 'Lagos,Nigeria', '2010-06-01', '', 'DL 005', 'DL 008', 'FC 004', '', '', '', '', '', '', '', '', '', '', '', '', 'GET HEALTHY DVD', 'YOUR FUTURE DVD', 'FOREVER FACE CAP (YELLOW)', '', '', '', '', '', '', '', '', '', '', '', '', 1000, 900, 2000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 1800, 6000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '9800', 64), (29, 'Kalu Lekway', 'Lagos, Nigeria', '2010-06-01', '', 'DL 001', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', '', 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2400, 18000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '20400', 133), (30, 'Dele', 'Ilupeju', '2010-06-02', '', 'DL 001', 'DL 003', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AILMENT & PREVENTION DVD- ENGLISH', 'BEAUTY CD', '', '', '', '', '', '', '', '', '', '', '', '', '', 800, 3000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8000, 30000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '38000', 250);

    Read the article

  • null coalescing operator for javascript?

    - by Daniel Schaffer
    I assumed this question has already been asked here, but I couldn't find any, so here it goes: Is there a null coalescing operator in Javascript? For example, in C#, I can do this: String someString = null; var whatIWant = someString ?? "Cookies!"; The best approximation I can figure out for Javascript is using the conditional operator: var someString = null; var whatIWant = someString ? someString : 'Cookies!'; Which is sorta icky IMHO. Can I do better?

    Read the article

  • wcf web service in post method, object properties are null, although the object is not null

    - by Abdalhadi Kolayb
    i have this problem in post method when i send object parameter to the method, then the object is not null, but all its properties have the default values. here is data module: [DataContract] public class Products { [DataMember(Order = 1)] public int ProdID { get; set; } [DataMember(Order = 2)] public string ProdName { get; set; } [DataMember(Order = 3)] public float PrpdPrice { get; set; } } and here is the interface: [OperationContract] [WebInvoke( Method = "POST", UriTemplate = "AddProduct", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json)] string AddProduct([MessageParameter(Name = "prod")]Products prod); public string AddProduct(Products prod) { ProductsList.Add(prod); return "return string"; } here is the json request: Content-type:application/json {"prod":[{"ProdID": 111,"ProdName": "P111","PrpdPrice": 111}]} but in the server the object received: {"prod":[{"ProdID": 0,"ProdName": NULL,"PrpdPrice": 0}]}

    Read the article

  • Oral Tradition Check: Two Hundred Meanings for "NULL" in SQL

    - by Thomas L Holaday
    Two decades ago, the topic of "NULL" came up in conversation with a scholarly colleague. As I remember it, he said that C.J.Date, in an essay critical of commercial implementations of SQL, had listed over two hundred meanings for NULL. To my regret, I did not persist the details; but finding that list has since been on my Bucket List. Has anyone else heard this legend? Was it perhaps not Date, but another critic of commercial implementations of SQL?

    Read the article

  • Determining distribution of NULL values

    - by AaronBertrand
    Today on the twitter hash tag #sqlhelp, @leenux_tux asked: How can I figure out the percentage of fields that don't have data ? After further clarification, it turns out he is after what proportion of columns are NULL. Some folks suggested using a data profiling task in SSIS . There may be some validity to that, but I'm still a fan of sticking to T-SQL when I can, so here is how I would approach it: Create a #temp table or @table variable to store the results. Create a cursor that loops through all...(read more)

    Read the article

  • Much ado about NULL: Exploiting a kernel NULL dereference

    <b>Ksplice:</b> "We think that it&#8217;s important for developers and system administrators to be more knowledgeable about the attacks that black hats regularly use to take control of systems, and so, today, we&#8217;re going to start from where we left off and go all the way to a working exploit for a NULL pointer dereference in a toy kernel module."

    Read the article

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