Search Results

Search found 2076 results on 84 pages for 'as keyword'.

Page 11/84 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Why do memory-managed languages retain the `new` keyword?

    - by Channel72
    The new keyword in languages like Java, Javascript, and C# creates a new instance of a class. This syntax seems to have been inherited from C++, where new is used specifically to allocate a new instance of a class on the heap, and return a pointer to the new instance. In C++, this is not the only way to construct an object. You can also construct an object on the stack, without using new - and in fact, this way of constructing objects is much more common in C++. So, coming from a C++ background, the new keyword in languages like Java, Javascript, and C# seemed natural and obvious to me. Then I started to learn Python, which doesn't have the new keyword. In Python, an instance is constructed simply by calling the constructor, like: f = Foo() At first, this seemed a bit off to me, until it occurred to me that there's no reason for Python to have new, because everything is an object so there's no need to disambiguate between various constructor syntaxes. But then I thought - what's really the point of new in Java? Why should we say Object o = new Object();? Why not just Object o = Object();? In C++ there's definitely a need for new, since we need to distinguish between allocating on the heap and allocating on the stack, but in Java all objects are constructed on the heap, so why even have the new keyword? The same question could be asked for Javascript. In C#, which I'm much less familiar with, I think new may have some purpose in terms of distinguishing between object types and value types, but I'm not sure. Regardless, it seems to me that many languages which came after C++ simply "inherited" the new keyword - without really needing it. It's almost like a vestigial keyword. We don't seem to need it for any reason, and yet it's there. Question: Am I correct about this? Or is there some compelling reason that new needs to be in C++-inspired memory-managed languages like Java, Javascript and C#?

    Read the article

  • Formatting Keywords to UPPERCASE In Oracle SQL Developer

    - by thatjeffsmith
    I received this question from a customer today, and it took me more than a few minutes to remember where this preference was located in SQL Developer. This tells me that the topic is ripe for blogging How do I go FROM: select * from scott.emp where ename like '%JEFF%' TO SELECT * FROM scott.emp WHERE ename LIKE '%JEFF%' It’s all in the formatting You need to access the formatting preferences under the Tools menu. It takes a bit of navigating to get there, so bear with me: Tools Database SQL Formatter Oracle Formatting Click ‘Edit’ on the profile Other Case change: ‘Keywords Uppercase’ It’s easy to find once you know where to look? You can tell it to leave the case alone, upper everything, upper only the keywords, lower everything. Accessing the Formatter Options We allow separate formatting options for different RDBMS. You need to make sure you’re accessing the ‘Oracle Formatting’ page in the preferences. You can then choose to edit the default options OR you can do what I have done – save the defaults as a new set of options. I’ve called my profile ‘JeffCustom.’ I can now switch back and forth now through different sets of formatting options. You need to hit the ‘Edit’ button to get to the formatting options editor. A good number of people seem to miss this. Select your profile, then hit the ‘Edit’ button

    Read the article

  • Don't Use "Static" in C#?

    - by Joshiatto
    I submitted an application I wrote to some other architects for code review. One of them almost immediately wrote me back and said "Don't use "static". You can't write automated tests with static classes and methods. "Static" is to be avoided." I checked and fully 1/4 of my classes are marked "static". I use static when I am not going to create an instance of a class because the class is a single global class used throughout the code. He went on to mention something involving mocking, IOC/DI techniques that can't be used with static code. He says it is unfortunate when 3rd party libraries are static because of their un-testability. Is this other architect correct? update: here is an example: APIManager - this class keeps dictionaries of 3rd party APIs I am calling along with the next allowed time. It enforces API usage limits that a lot of 3rd parties have in their terms of service. I use it anywhere I am calling a 3rd party service by calling Thread.Sleep(APIManager.GetWait("ProviderXYZ")); before making the call. Everything in here is thread safe and it works great with the TPL in C#.

    Read the article

  • How to utilise a newly acquired keyword domain to contribute to an already existing healthy website?

    - by vDog
    My client's website has just reached spot 1 for the most valuable keyword. We acquired the domain that was at #1 spot. It's a keyword domain (targetkeyword.tld). Just wondering what would be the best way to make use of it. A permanent redirect or a single page that hyperlinks to the brand website? Should I be concerned about anything negative associated to this keyword domain (poor backlinks and the fact that this website was down for about one month)?

    Read the article

  • When you should and should not use the 'new' keyword?

    - by skizeey
    I watched a Google Tech Talk presentation on Unit Testing, given by Misko Hevery, and he said to avoid using the new keyword in business logic code. I wrote a program, and I did end up using the new keyword here and there, but they were mostly for instantiating objects that hold data (ie, they didn't have any functions or methods). I'm wondering, did I do something wrong when I used the new keyword for my program. And where can we break that 'rule'?

    Read the article

  • We have a 200% increase of "organic" search traffic - how to figure out which keyword is causing this?

    - by Robert Grezan
    So our Google Analytics are showing us that 200% increase of "organic" search traffic. Analytics are saying that search keyword is "(not provided)". We are wondering how to find out which keyword is causing this? We are monitoring all important keywords for our website. None of keyword is in first 5, so our "organic" serach traffic is modest. However, today we received 200% increase of "organic" search traffic but none of keywords we can think of moved a bit. We also did not change anything related to SEO. And what is interesting Google Webmaster shows no changes - ~2500 impressions and ~200 clicks. How to find out which "keyword" might be causing this spike?

    Read the article

  • How come a keyword with 46 local monthly searches get 150 local monthly impressions?

    - by Geno Thampi
    I am doing a keyword analysis by correlating data between Google ANalytics and Google Adwords Keyword tool. So here is the confusion I check the local monthly searches (Sweden) for "SEO Packages" using the adwords keyword tool and it shows: 46 monthly searches Now I come back to GA and check the impressions for "SEO Packages" that we got from Sweden and the value is: 150 impressions. So basically: Local monthly searches in Sweden: 46 Monthly impression we got from Sweden: 150 How come we get 150 impressions out of only 150 searches?

    Read the article

  • Linking competitor with the same keyword i am targeting : Good or Bad for Seo?

    - by Badal Surana
    i am linking one of my competitors from my site for the same keyword which is i am targeting for my site.(My competitor is paying me for that) For Example: Me and my competitor both are targeting on keyword "foo" and my competitor paying me for linking his site from my site with keyword "foo" What i want to know is if i do that will my site's position go down in Google search results? or it will make no difference??

    Read the article

  • Use of @keyword in C# -- bad idea?

    - by Robert Fraser
    In my naming convention, I use _name for private member variables. I noticed that if I auto-generate a constructor with ReSharper, if the member is a keyword, it will generate an escaped keyword. For example: class IntrinsicFunctionCall { private Parameter[] _params; public IntrinsicFunctionCall(Parameter[] @params) { _params = @params; } } Is this generally considered bad practice or is it OK? It happens quite frequently with @params and @interface.

    Read the article

  • Should I use Call keyword in VB/VBA?

    - by Fred Loyant
    I use the Call keyword used when calling subs in VB/VBA. I know it's optional, but is it better to use it or leave it off? I've always thought it was more explicit, but maybe it's just noise. Also, I read this on another forum: Using the Call keyword is faster because it knows that it is not going to return any values, so it doesn't need to set up any stackspace to make room for the return value.

    Read the article

  • resharper "cleanup code" vs. 'var' keyword

    - by bitbonk
    I have an odd behavior with code clean up for c# in visual studio 2008 Team Developer Edition. Whenever I clean up my code using "Full Cleanup" it replaces all var declaration with explicit type declarations. But I have set the appropriate settings under "Inspection Severity" "Use var keyword when initializer explictly declares type" and "use var keyword when possible" to "Show as Error" Is there any other setting I need to set or is this a known bug?

    Read the article

  • Keyword Implementation in C#

    - by j-t-s
    Hi All Is there a way, and how would I go about implementing my own keyword such as in, and as (etc), to be used in my code? Here is what I had in mind. I want to (just for my own personal reasons, I guess) add a few keywords of my own, one of which would be the "was" keyword: if(Control was Clicked) { // etc etc }

    Read the article

  • Find keyword values from PDF [closed]

    - by JukkaA
    I have a lot of PDF reports I'd need to index. They're mostly "text-based PDFs", not images. I know they all have account number in certain format, 123456AAAAA and some other keyword info like addresses, customer names etc. needed in indexing these files. Basically if the file is ab.pdf, I need to create ab.txt that contains: ACC=123456AAAA Customer=John Doe Date=20120808 What would be the best software/solution to generate indexing information for these? I know there's pdftotext, but piping it to different grep/awk commands is a hack... It would be nice to specify an area in PDF to search for the account number, and specify the format it is in.

    Read the article

  • grep with after-context that does not contain a keyword

    - by ukasz
    I want to grep through logs, and gather a certain exception stacktrace but I want to only see those that do not contain certain keywords in --after-context. I do not know in which line in after-context the keyword is. Simple example - given this shell code: grep -A 2 A <<EOF A B C R A Z Z X EOF the output is: A B C -- A Z Z I'd like the output to be: A Z Z I want to exclude any match that has 'B' in after-context How do I do this? Using grep is not a requirement, though I only have access to coreutils and perl.

    Read the article

  • how to google a symbol keyword like "$?"

    - by ZhengZhiren
    i saw a trick in a book: in a linux shell, we can use &? to get the return value of a command. For example,we run a command,if it exit normally, the return value is 0. And then we type $?,we will get 0 in the screen. i want to google this kind of usage, so i have to type these two symbol $? in the search blank.But the search engine just return nothing to me... i have looked at the google help page, but still can't find a solution. so my question is: how can i search with this kind of keyword. or if you can give me some advise of the usage of $? or sort of thing, that will be also appreciated.

    Read the article

  • Strange behaviour of keywords within macros in Clojure

    - by mikera
    I'm a little confused by how keyword accesses seem to behave in Clojure when they are evaluated at macro expansion time. The following works as I expect: (def m {:a 1}) (:a m) => 1 However the same keyword access doesn't seem to work within a macro: (def m {:a 1}) (defmacro get-a [x] (:a x)) (get-a m) => nil Any idea what is going on here?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >