Search Results

Search found 1344 results on 54 pages for 'oh'.

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

  • sed/awk or other: increment a number by 1 keeping spacing characters

    - by WizardOfOdds
    I've got a string: (notice the spacing) eh oh 37 and I want it to become: eh oh 36 (so I want to keep the spacing) Using awk I don't find how to do it, so far I have: echo "eh oh 37" | awk '$3>=0&&$3<=99 {$3--} {print}' But this gives: eh oh 36 (the spacing characters where lost, because the field separator is ' ') Is there a way to ask awk something like "print the output using the exact same field separators as the input had"? Then I tried with sed, but got stuck after this: echo "eh oh 37" | sed -e 's/\([0-9][0-9]\)/.../' Can I do arithmetic from sed using a reference to the matching digits and have the output not modify the number of spacing characters? Note that it's related to my question concerning Emacs and how to apply this to some (big) Emacs region (using a replace region with Emacs's shell-command-on-region) but it's not an identical question: this one is specifically about how to "keep spaces" when working with awk/sed/etc.

    Read the article

  • Javascript :(….. Oh!! So its jquery? Now what?? I’m a C# Guy

    - by Shekhar_Pro
    Hi guys I want you to Guide me here. This other day I was working out some AJAX for my ASP.Net website and handling client side code in Java was taking the hell out of me. Then I got my hands on this Book jQuery In Action 2nd Edition and solved my problem with the help of Example code in the book. Now as I checked the contents I got an overview that whatever I had ever thought of doing can be done by this jQuery so easily and quite cleanly. I am actually pretty new to web development (say abt 4months ) and from C# world where we have cool libraries and Simple and Elegant coding style. (yeah including those generic, Ienumerable, lambadas, chained statements.. you got it…) and you know what you’re doing when writing some code. And we have so great IntelliSense to care., and above all we have everything Strongly Typed. But in Javascript everything is so messy.. . (and I don’t know why they are not properly indented.. see page source ) Now tell me what should I do, go straight with jQuery or should I first learn Javascript (like a disciplined boy…I even have a book for that too… got in gift :) …. ) I have seen Is it a good idea to learn JavaScript before learning jQuery? but remember I have already got a project on my hand…

    Read the article

  • sed/awk or other: one-liner to increment a number by 1 keeping spacing characters

    - by WizardOfOdds
    EDIT: I don't know in advance at which "column" my digits are going to be and I'd like to have a one-liner. Apparently sed doesn't do arithmetic, so maybe a one-liner solution based on awk? I've got a string: (notice the spacing) eh oh 37 and I want it to become: eh oh 36 (so I want to keep the spacing) Using awk I don't find how to do it, so far I have: echo "eh oh 37" | awk '$3>=0&&$3<=99 {$3--} {print}' But this gives: eh oh 36 (the spacing characters where lost, because the field separator is ' ') Is there a way to ask awk something like "print the output using the exact same field separators as the input had"? Then I tried yet something else, using awk's sub(..,..) method: ' sub(/[0-9][0-9]/, ...) {print}' but no cigar yet: I don't know how to reference the regexp and do arithmetic on it in the second argument (which I left with '...' for now). Then I tried with sed, but got stuck after this: echo "eh oh 37" | sed -e 's/\([0-9][0-9]\)/.../' Can I do arithmetic from sed using a reference to the matching digits and have the output not modify the number of spacing characters? Note that it's related to my question concerning Emacs and how to apply this to some (big) Emacs region (using a replace region with Emacs's shell-command-on-region) but it's not an identical question: this one is specifically about how to "keep spaces" when working with awk/sed/etc.

    Read the article

  • Java : method to to print relative pathname?

    - by HH
    I am hesitant just to look at some env.vars and try to replace things with regexes. So is there a ready method to print relative pathnames system-independently? $ echo ~ /u/user $ pwd /u/user/OH/one/src $ echo "Like relative pathnames ~/OH/one/src, not /u/user/OH/one/src."

    Read the article

  • jQuery featured content slider

    - by azz0r
    Hello, I have a content area that loops through divs and shows there content. I'm having trouble making it display the initial content, unfortunately it waits 5000 milliseconds before triggering the very first content area to display. Anyone spot an easy way to make it display the initial area, then slide to the next area and do them at 5000 milliseconds. JS Model.FeatureBar = { current:0, items:{}, init: function init(options){ var me = this; me.triggers = [] me.slides = [] this.container = jQuery('#features'); jQuery('.feature').each(function(i){ me.triggers[i] = {url: jQuery(this).children('.feature-title a').href, title: jQuery(this).children('.feature-title'),description:jQuery(this).children('.feature-description')} me.slides[i] = {image: jQuery(this).children('.feature-image')} }); for(var i in this.slides){ this.slides[i].image.hide(); this.triggers[i].description.hide(); } setInterval(function(){Model.FeatureBar.next()},5000); }, next: function next(){ var i = (this.current+1 < this.triggers.length) ? this.current+1 : 0; this.goToItem(i); }, previous: function previous(){ var i = (this.current-1 > 1) ? this.current-1 : this.triggers.length; this.goToItem(i); }, goToItem: function goToItem(i){ if(!this.slides[i]) throw 'Slide out of range'; this.triggers[this.current].description.slideUp(); this.triggers[i].description.slideDown(); this.slides[this.current].image.hide(); this.slides[i].image.show(); this.current = i; }, } html <div id="features"> <div class="feature current"> <div class="movie-cover"> <a href="/police/movie"><img title="" alt="" src="/design/images/four-oh-four.png"></a> </div> <div class="feature-image" style="display: none;"> <img src="/design/images/four-oh-four.png"> </div> <h2 class="feature-title"><a href="/police/movie">Police</a></h2> <p class="feature-description" style="overflow: hidden; display: block; height: 50.8604px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">DESCRIPTION</p> </div> <div class="feature"> <div class="movie-cover"> <a href="/rude/movie"><img title="" alt="" src="/design/images/four-oh-four.png"></a> </div> <div class="feature-image" style="display: none;"> <img src="/design/images/four-oh-four.png"> </div> <h2 class="feature-title"><a href="/rude/movie">Rude</a></h2> <p class="feature-description" style="overflow: hidden; display: block; height: 18.3475px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">DESCRIPTION</p> </div> <div class="feature"> <div class="movie-cover"> <a href="/brits/movie"><img title="" alt="" src="/design/images/four-oh-four.png"></a> </div> <div class="feature-image" style="display: block;"> <img src="/design/images/four-oh-four.png"> </div> <h2 class="feature-title"><a href="/brits/movie">Brits</a></h2> <p class="feature-description" style="overflow: hidden; display: block; height: 40.1549px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">DESCRIPTION</p> </div> <div class="feature"> <div class="movie-cover"> <a href="/indie/movie"><img title="" alt="" src="/design/images/four-oh-four.png"></a> </div> <div class="feature-image" style="display: none;"> <img src="/design/images/four-oh-four.png"> </div> <h2 class="feature-title"><a href="/indie/movie">Indie</a></h2> <p class="feature-description" style="overflow: hidden; display: block; height: 42.4247px; margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px;">DESCRIPTION</p> </div>

    Read the article

  • Linq query with Array in where clause?

    - by Matt Dell
    I have searched for this, but still can't seem to get this to work for me. I have an array of Id's associated with a user (their Organization Id). These are placed in an int[] as follows: int[] OrgIds = (from oh in this.Database.OrganizationsHierarchies join o in this.Database.Organizations on oh.OrganizationsId equals o.Id where (oh.Hierarchy.Contains(@OrgId)) || (oh.OrganizationsId == Id) select o.Id).ToArray(); The code there isn't very important, but it shows that I am getting an integer array from a Linq query. From this, though, I want to run another Linq query that gets a list of Personnel, that code is as follows: List<Personnel> query = (from p in this.Database.Personnels where (search the array) select p).ToList(); I want to add in the where clause a way to select only the users with the OrganizationId's in the array. So, in SQL where I would do something like "where OrganizationId = '12' or OrganizationId = '13' or OrganizatonId = '17'." Can I do this fairly easily in Linq / .NET?

    Read the article

  • Facebook Connect for iOS: dialogDidComplete response differentiation

    - by Oh Danny Boy
    I was wondering how to differentiate between the user tapping submit or skip in the inline post-to-stream FBDialog. Anyone know what to test for? I am using the latest iOS Facebook Connect in a iOS 4.2 environment. /** * Called when a UIServer Dialog successfully return. */ - (void)dialogDidComplete:(FBDialog *)dialog { if user tapped submit and post was successful alert user of successful post if user tapped "skip" (cancel equivalent) do not display alert }

    Read the article

  • iOS MapKit: Selected MKAnnotation coordinates.

    - by Oh Danny Boy
    Using the code at the following tutorial, http://www.zenbrains.com/blog/en/2010/05/detectar-cuando-se-selecciona-una-anotacion-mkannotation-en-mapa-mkmapview/, I was able to add an observer to each MKAnnotation and receive a notification of selected/deselected states. I am attempting to add a UIView on top of the selection annotation to display relevant information about the location. This information cannot be conveyed in the 2 lines allowed (Title/Subtitle) for the pin's callout. - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { Annotation *a = (Annotation *)object; // Alternatively attempted using: //Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; NSString *action = (NSString *)context; if ([action isEqualToString:ANNOTATION_SELECTED_DESELECTED]) { BOOL annotationSelected = [[change valueForKey:@"new"] boolValue]; if (annotationSelected) { // Actions when annotation selected CGPoint origin = a.frame.origin; NSLog(@"origin (%f, %f) ", origin.x, origin.y); // Test UIView *v = [[UIView alloc] init]; [v setBackgroundColor:[UIColor orangeColor]]; [v setFrame:CGRectMake(origin.x, origin.y , 300, 300)]; [self.view addSubview:v]; [v release]; }else { // Accions when annotation deselected } } } Results using Annotation *a = (Annotation *)object origin (154373.000000, 197135.000000) origin (154394.000000, 197152.000000) origin (154445.000000, 197011.000000) Results using Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; origin (0.000000, 0.000000) origin (0.000000, 0.000000) origin (0.000000, 0.000000) The numbers are large. They are not relative to the view (1024 x 768). I believe they are relative to the entire map. How would I be able to detect the exact coordinates relative to the entire view so that I can appropriately position my view?

    Read the article

  • MSVC enum debugging

    - by oh boy
    Is there a quick way of outputting the names of enumerated values? I suppose you know what I mean, and at all this isn't possible as of course all of this data becomes irrelevant during compile process, but I'm using MSVC in debugging mode, so is it possible?

    Read the article

  • C++: Short question regarding switch and break

    - by oh boy
    Example: switch( x ) { case y: if ( true ) { break; } cout << "Oops"; break; } If the switch statement selects y, will Oops be written to the standard output? - Is break in switch statements a dynamic keyword like continue which can be called under conditions or static like a closing bracket }?

    Read the article

  • Why the streams in C++?

    - by oh boy
    As you all know there are libraries using streams such as iostream and fstream. My question is: Why streams? Why didn't they stick with functions similar to print, fgets and so on (for example)? They require their own operators << and >> but all they do could be implemented in simple functions like above, also the function printf("Hello World!"); is a lot more readable and logical to me than cout << "Hello World"; I also think that all of those string abstractions in C++ all compile down to (less efficient) standard function calls in binary.

    Read the article

  • C++ STL: Array vs Vector: Raw element accessing performance

    - by oh boy
    I'm building an interpreter and as I'm aiming for raw speed this time, every clock cycle matters for me in this (raw) case. Do you have any experience or information what of the both is faster: Vector or Array? All what matters is the speed I can access an element (opcode receiving), I don't care about inserting, allocation, sorting, etc. I'm going to lean myself out of the window now and say: Arrays are at least a bit faster than vectors in terms of accessing an element i. It seems really logical for me. With vectors you have all those security and controlling overhead which doesn't exist for arrays. (Why) Am I wrong? No, I can't ignore the performance difference - even if it is so small - I have already optimized and minimized every other part of the VM which executes the opcodes :)

    Read the article

  • C++: Pointers and scope

    - by oh boy
    int* test( ) { int a = 5; int* b = &a; return b; } Will the result of test be a bad pointer? As far as I know a should be deleted and then b would become a messed up pointer, right? How about more complicated things, not an int pointer but the same with a class with 20 members or so?

    Read the article

  • C++ OOP: Which functions to put into the class?

    - by oh boy
    Assume I have a class a: class a { public: void load_data( ); private: void check_data( ); void work_data( ); void analyze_data( ); } Those functions all do something with the class or one of its members. However this function: bool validate_something( myType myData ) { if ( myData.blah > 0 && myData.blah < 100 ) { return true; } return false; } Is related to the class and will only be called by it, so it won't be needed anywhere else Doesn't do anything with the class or its members - just a small "utility" function Where to put validate_something? Inside or outside the class?

    Read the article

  • Another big year for the ADF EMG at OOW12

    - by Chris Muir
    Oracle Open World 2012 has only just started, but in one way it's just finished!  All the ADF EMG's OOW content is over for another year! The unique highlight this year for me was the first ever ADF EMG social night held on Saturday, where I finally had the chance to meet so many ADF community members who I've known over the internet, but never met in person.  What?  You didn't get an invite?  Oh well, better luck next year ;-) Seriously our budget was limited, so in the happy-dictatorship sort of way I had to limit RSVPs to just 40 people.  Hopefully next year we can do something bigger and better for the wider community. Following directly on from the Saturday social night the ADF EMG ran a full day of sessions at the user group Sunday.  I wont go over the content again, but to say thank you very much to all our presenters and helpers, including Gert Poel, Pitier Gillis, Aino Andriessen, Simon Haslam, Ken Mizuta, Lucas Jellema and the FMW roadshow team, Ronald van Luttikhuizen, Guido Schmutz, Luc Bors, Aino Andriessen and Lonneke Dikmans. Also special thanks must go to Doug Cockroft and Bambi Price for their time and effort in organizing the ADF EMG room behind the scenes via the APOUC. To be blunt Doug and Bambi really do deserve serious thanks because they had to wear a lot of Oracle politics behind the scenes to get the rooms organized (oh, and deal with me fretting too! ;-). Finally thanks to all the members and OOW delegates for turning up and supporting the group on the day.  In the end the ADF EMG exists for you, and I hope you found it worthwhile. Onto 2013 (oh, and the rest of OOW12 ;-) 

    Read the article

  • Can you use zero-width matching regex in String split?

    - by polygenelubricants
    System.out.println( Arrays.deepToString( "abc<def>ghi".split("(?:<)|(?:>)") ) ); This prints [abc, def, ghi], as if I had split on "<|>". I want it to print [abc, <def>, ghi]. Is there a way to work some regex magic to accomplish what I want here? Perhaps a simpler example: System.out.println( Arrays.deepToString( "Hello! Oh my!! Good bye!!".split("(?:!+)") ) ); This prints [Hello, Oh my, Good bye]. I want it to print [Hello!, Oh my!!, Good bye!!]. `.

    Read the article

  • Tuning Red Gate: #4 of Some

    - by Grant Fritchey
    First time connecting to these servers directly (keys to the kingdom, bwa-ha-ha-ha. oh, excuse me), so I'm going to take a look at the server properties, just to see if there are any issues there. Max memory is set, cool, first possible silly mistake clear. In fact, these look to be nicely set up. Oh, I'd like to see the ANSI Standards set by default, but it's not a big deal. The default location for database data is the F:\ drive, where I saw all the activity last time. Cool, the people maintaining the servers in our company listen, parallelism threshold is set to 35 and optimize for ad hoc is enabled. No shocks, no surprises. The basic setup is appropriate. On to the problem database. Nothing wrong in the properties. The database is in SIMPLE recovery, but I think it's a reporting system, so no worries there. Again, I'd prefer to see the ANSI settings for connections, but that's the worst thing I can see. Time to look at the queries, tables, indexes and statistics because all the information I've collected over the last several days suggests that we're not looking at a systemic problem (except possibly not enough memory), but at the traditional tuning issues. I just want to note that, I started looking at the system, not the queries. So should you when tuning your environment. I know, from the data collected through SQL Monitor, what my top poor performing queries are, and the most frequently called, etc. I'm starting with the most frequently called. I'm going to get the execution plan for this thing out of the cache (although, with the cache dumping constantly, I might not get it). And it's not there. Called 1.3 million times over the last 3 days, but it's not in cache. Wow. OK. I'll see what's in cache for this database: SELECT  deqs.creation_time,         deqs.execution_count,         deqs.max_logical_reads,         deqs.max_elapsed_time,         deqs.total_logical_reads,         deqs.total_elapsed_time,         deqp.query_plan,         SUBSTRING(dest.text, (deqs.statement_start_offset / 2) + 1,                   (deqs.statement_end_offset - deqs.statement_start_offset) / 2                   + 1) AS QueryStatement FROM    sys.dm_exec_query_stats AS deqs         CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest         CROSS APPLY sys.dm_exec_query_plan(deqs.plan_handle) AS deqp WHERE   dest.dbid = DB_ID('Warehouse') AND deqs.statement_end_offset > 0 AND deqs.statement_start_offset > 0 ORDER BY deqs.max_logical_reads DESC ; And looking at the most expensive operation, we have our first bad boy: Multiple table scans against very large sets of data and a sort operation. a sort operation? It's an insert. Oh, I see, the table is a heap, so it's doing an insert, then sorting the data and then inserting into the primary key. First question, why isn't this a clustered index? Let's look at some more of the queries. The next one is deceiving. Here's the query plan: You're thinking to yourself, what's the big deal? Well, what if I told you that this thing had 8036318 reads? I know, you're looking at skinny little pipes. Know why? Table variable. Estimated number of rows = 1. Actual number of rows. well, I'm betting several more than one considering it's read 8 MILLION pages off the disk in a single execution. We have a serious and real tuning candidate. Oh, and I missed this, it's loading the table variable from a user defined function. Let me check, let me check. YES! A multi-statement table valued user defined function. And another tuning opportunity. This one's a beauty, seriously. Did I also mention that they're doing a hash against all the columns in the physical table. I'm sure that won't lead to scans of a 500,000 row table, no, not at all. OK. I lied. Of course it is. At least it's on the top part of the Loop which means the scan is only executed once. I just did a cursory check on the next several poor performers. all calling the UDF. I think I found a big tuning opportunity. At this point, I'm typing up internal emails for the company. Someone just had their baby called ugly. In addition to a series of suggested changes that we need to implement, I'm also apologizing for being such an unkind monster as to question whether that third eye & those flippers belong on such an otherwise lovely child.

    Read the article

  • Poll: How long will you wait before using Solaris 11 on production systems?

    - by nospam(at)example.com (Joerg Moellenkamp)
    When Sun released Solaris 10, it was my first migration phase to a new Solaris major release while being part of Sun. At that time i heard a lot of comments between "Oh, we will install it on new systems on day 1" to "oh ... not that fast ... we will wait ... we are not that fast ... we will do it in a year". I would like to get some additional insight and so i set up the poll plugin for s9y to get the answer to the question "How long will you wait before using Solaris 11 on production system?". Thank you for your participation!

    Read the article

  • Terminal is not letting me make commands unless I hit enter a bunch of times

    - by ninja08
    Whenever I open terminal it normally allows me to immediately begin making commands. Only earlier today I did the setup for github here https://help.github.com/articles/set-up-git And then all of a sudden the thing where I give terminal commands won't allow me to give it commands unless I hit enter a few times. This is what it looks like: Last login: Fri Nov 9 11:43:28 on ttys001 mysql.save: Permission denied mysql.save: Permission denied /Users/Nick/.zshrc:32: command not found:  . ~ git: ? ~ git: ? ~ git: ? See the big space? That's because it simply will never show the ~ git: thing unless I hit enter 3-4 times. Also, it never used to say ~ git: before I did the git setup. I'm not sure what I changed. I've checked the zshrc file and commented everything out to find the line causing the problem. I've done that and it turns out it was the source $ZSH/oh-my-zsh.sh Within the oh-my-zsh.sh file I've commented out each block of code for the file starting at the top and I've found that this block is causing it: # Load the theme if [ "$ZSH_THEME" = "random" ] then themes=($ZSH/themes/*zsh-theme) N=${#themes[@]} ((N=(RANDOM%N)+1)) RANDOM_THEME=${themes[$N]} source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." else if [ ! "$ZSH_THEME" = "" ] then if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ] then source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" else source "$ZSH/themes/$ZSH_THEME.zsh-theme" fi fi fi

    Read the article

  • Big O and Little o

    - by hyperdude
    If algorithm A has complexity O(n) and algorithm B has complexity o(n^2), what, if anything, can we say about the relationship between A and B? Note: the complexity of A is expressed using big-Oh, and the complexity of B is expressed using little-Oh.

    Read the article

  • I'm a contract developer and I think I'm about to get screwed [closed]

    - by kagaku
    I do contract development on the side. You could say that I'm a contract developer? Considering I've only ever had one client I'd say that's not exactly the truth - more like I took a side job and needed some extra cash. It started out as a "rebuild our website and we'll pay you $10k" type project. Once that was complete (a bit over schedule, but certainly not over budget), the company hired me on as a "long term support" contractor. The contract is to go from March of this year, expiring on December 31st of this year - 10 months. Over which a payment is to be paid on the 30th of each month for a set amount. I've been fulfilling my end of the contract on all points - doing server maintenence, application and database changes, doing huge rush changes and pretty much just going above and beyond. Currently I'm in the middle of development of an iPhone mobile application (PhoneGap based) which is nearing completion (probably 3-4 weeks from submission). It has not been all peaches and flowers though. Each and every month when my paycheck comes due, there always seems to be an issue of sorts. These issues did not occur during the initial project, only during the support contract. The actual contract states that my check should be mailed out on the 30th of the month. I have received my check on time approximately once (on time being about 2-3 days within the 30th). I've received my paycheck as late as the 15th of the next month - over two weeks late. I've put up with it because I need the paycheck. There have been promises and promises of "we'll send it out on time next time! I promise" - only to receive it just as late the next month. When I ask about payment they give me a vibe like "why are you only worried about money?" - unfortunately I don't have the luxury of not worrying about money. The last straw was with my August payment, which should have been mailed on August 30th. I received it on September 12th. The reason for the delay? "USPS is delaying it man! we sent it out on the 1st!" is the reason I got. When I finally got the check in the mail, the postage on the envelope was marked September 10th - the date it was run through the postage machine. I've been outright lied to, at this point. I carry on working, because again - I need a paycheck. I orchestrated the move of our application to a new server, developed a bunch of new changes and continued work on the iPhone app. All told I probably went over my hourly allotment (I'm paid for 40 hours a month, I probably put in at least 50). On Saturday, the 1st, I gave the main contact at the company (a company of 3, by the way - this is not some big corporation) a ring and filled him in on the status of my work for the past two weeks. Unusually I hadn't heard from him since the middle of September. His response was "oh... well, that is nice and uh.. good job. well, we've been talking within the company about things and we've certainly got some decisions ahead of us..." - not verbatim but you get the idea (I hope?). I got out of this conversation that the site is not doing very well (which it's not) and they're considering pulling the plug. Crap, this contract is going to end early - there goes Christmas! Fine, that's alright, no problem. I'll get paid for the last months work and call it a day. Unfortunately I still haven't gotten last months check, and I'm getting dicked around now. "Oh.. we had problems transferring funds, we'll try and mail it out tomorrow" and "I left a VM with the finance guy, but I can't get ahold of him". So I'm getting the feeling I'm not getting paid for all the work I put in for September. This is obviously breach of contract, and I am pissed. Thinking irrationally, I considered changing all their passwords and holding their stuff hostage. Before I think it through (by the way, I am NOT going to do this, realized it would probably get me in trouble), I go and try some passwords for our various accounts. Google Apps? Oh, I'm no longer administrator here. Godaddy? Whoops, invalid password. Disqus? Nope, invalid password here too. Google Adsense / Analytics? Invalid password. Dedicated server account manager? Invalid password. Now, I have the servers root password - I just built the box last week and haven't had a chance to send the guy the root password. Wasn't in a rush, I manage the server and they never touch it. Now all of a sudden all the passwords except this one are changed; the writing is on the wall - I am out. Here's the conundrum. I have the root password, they do not. If I give them this password all the leverage I have is gone, out the door and out of my hands. During this argument of why am I not getting paid the guy sends me an email saying "oh by the way, what's the root username and password to the server?". Considering he knows absolutely nothing, I gave him an "admin" account which really has almost no rights. I still have exclusive access to the server, I just don't know where to go. I can hold their data hostage, but I'm almost positive this is the wrong thing to do. I'd consider it blackmail, regardless of whether or not I have gotten paid yet. I can "break" something on the server and give them the whole "well, if you were paying me I could fix it!" spiel. This works from a "well he's not holding their stuff hostage" point of view, but what stops them from hiring some one else to just fix the issue at hand? For all I know the guys nephew is a "l33t hax0r" and can figure it out for free. I can give in, document as much as I can and take him to small claims court. This is breach of contract, I'm not getting paid. I have a case, right? ???? Does anyone have any experience in this? What can I do? What are my options? I'm broke, I can't afford a lawyer and I can barely afford not getting this paycheck. My wife doesn't work (I work two jobs so she doesn't have to work - we have a 1 year old) and is already looking at getting a part time job to cover the bills. Long term we'll be fine, but this has pissed me off beyond belief! Help me out, I'm about to get screwed.

    Read the article

  • Mandatory look back at 2010

    - by Bertrand Le Roy
    Yeah, it's one of those posts, sorry. First, the mildly depressing: the most popular post on this blog this year with 47,000 hits was a post from last year about a fix to a bug in ASP.NET. A content-less post except for that link to the KB article that people should have found by going directly to the support site in the first place. Then, the really depressing: the second most popular post this year with 34,000 hits was a post from 2005 about how to display message boxes on a web page. I mean come on. This was kind of fun five years ago and it did solve one of the most common n00b mistakes VB programmers trying to move to the web were making. But come on, we've traveled about 4.7 billion miles around the Earth since then. Do people still do that kind of stuff? I should probably put a big red banner on top of this post. Oh [supernatural entity of your choice]. Hand me that gun, please. Third most popular post with 24,000 hits is from 2004. It's about how to set a session variable before redirecting. That problem has been fixed a long time ago. Oh well. Fourth most popular post. 21,000 hits. 2007. How to work around a stupid bug in ASP.NET Ajax 1.0. Fixed in ASP.NET 3.5? ASP.NET Ajax 1.0? Need I say more? The fifth one (20,000 hits) is an old post as well but I'm kind of fond of it: it's about that photo album handler I've been organically growing for a few years. It reminds me that I need to refresh it and make a new release. Good SEO title too. Back to insanity with the sixth one (16,000) that's about working around a bug in IE6. IE6. Please just refuse to pander to that browser any more. It's about time. Let's move on, please. Actually, the first post from 2010 is 15th in the list. We have a trio of these actually with server-side image resizing and FluentPath. So what happened? Well, I like the ad money, but not to the point that I'm going to write my stuff to inflate it. Actually I think if I tried I would fail miserably (I mean, I would fail worse). What really happened this year was new stuff: Orchard, FluentPath and the stuff with the Netduino. That stuff needs time to get off the ground but my hope is that it's going to be useful in the long run and that five years from now I'll be lamenting on how well those posts are still doing. So, no regret. 2010 was a good year. Oh, and I was on This Developer's Life this year! Yay! Anyways, thank you all for reading me. Please continue doing that. And happy 2011!

    Read the article

  • Web Application Integration Steps in OAM 11gR2 (High Level)

    - by Venkata Srikanth
    Install OAM, Webtier (OHS) and WebGate as per the standard installation steps. Create a WebGate instance (i.e deploy WebGate) A WebGate instance must be created that will copy required bits of agent from WEBGATE_HOME to WebGate instance location that shares the same INSTANCE_HOME with OHS ./deployWebGateInstance.sh –w /Oracle/Middleware/Oracle_WT1/instances/instance1/config/ohs1 –oh /Oracle/Middleware/Oracle_OAMWebGate1 Note: Here –w flag indicates OHS instance folder and –oh indicates the WebGate Oracle home Configure WebGate In the webgate configuration the EditHttpdConf utility will copy OUI instantiated apache_webgate.template from WEBGATE_HOME to webgate instance location (renamed to webgate.conf), and update httpd.conf with one additional line to include webgate.conf. export LD_LIBRARY_PATH=$ LD_LIBRARY_PATH:/Oracle/Middleware/Oracle_WT1/lib Navigate to /Oracle/Middleware/Oracle_OAMWebGate1/webgate/ohs/tools/setup/InstallTools ./EditHttpdConf –w /Oracle/Middleware/Oracle_WT1/instances/instace1/config/OHS/ohs1 –oh /Oracle/Middleware/Oracle_OAMWebGate1 –o webgate.conf Register WebGate Use RREG tool to register the OAM 11G WebGate Navigate to /Oracle/Middleware/Oracle_IDM1/oam/server/rreg/input Edit OAM11Grequest.xml. Change the specific xml content to include the weblogic admin URL, agentBaseURL, host identifier etc.. Navigate to /Oracle/Middleware/Oracle_IDM1/oam/server/rreg/bin Set permissions to oamreg.sh à chmod 777 oamreg.sh Edit oamreg.sh and set OAM_REG_HOME=/Oracle/Middleware/Oracle_IDM1/oam/server/rreg ./oamreg.sh inband input/OAM11Grequest.xml Enter the WebLogic admin credentials when prompted. After performing the above steps, there will be two artifcats created under Oracle/Middleware/Oracle_IDM1/oam/server/rreg/output, namely ObAccessClient.xml (Stroing webgate config parameters) and cwallet.sso (storing the agent key). These files must be copied to WebGate instance config folder (/Oracle/Middleware/Oracle_WT1/instances/instance1/config/ohs1/webgate/config) Restart OHS Deploy the web application (myApp) in WebLogic application server Proxy Configuration in OHS The mod_wl_ohs module enables requests to be proxied from Oracle HTTP Server 11g to Oracle WebLogic Server. Navigate to /Oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1 Edit mod_wl_ohs.conf file to include the following: <IfModule weblogic_module> WebLogicHost <WEBLOGIC_HOST> WebLogicPort <WEBLOGIC_PORT> # Debug ON # WLLogFile /tmp/weblogic.log MatchExpression *.jsp </IfModule> <Location /myApp> SetHandler weblogic-handler # PathTrim /weblogic # ErrorPage http:/WEBLOGIC_HOME:WEBLOGIC_PORT/ </Location> Note: Here WEBLOGIC_HOST and WEBLOGIC_PORT are the WebLogic admin server host and port respectively Restart OHS. Now if we access the web application URL with OHS host and port (Ex: http://OHS_HOST:<OHS_PORT>/myApp) so that the requests will be proxied to WebLogic server. Create a new application domain Login to OAM Admin Console Navigate to Shared Componentsà Authentication Schemesà Create Authentication Scheme (Ex: LDAP Auth Scheme. Here the scheme is assoicated with LDAP Authentication Module) Navigate to Policy Configuration à Application Domain à Create Application Domain Enter the Application Domain Name and Click Apply. Navigate to Resources tab and add the resource urls (Web Application URLs that needs to be protected) Navigate to Authentication Policy tab à Create a new authentication ploicy by providing the Resource URLs (The sample Web Application URLs) and Authentication Scheme. Navigate to Authorization Policy tab à Create a new authorization policy à Enter authorization policy name and navigate to Resource Tab à Attach the Reource URL, Host Identifiers here. Navigate to Conditions tab à Add the conditions like whom to allow and whom to deny access. Navigate to Rules tab à Crate the Allow Rule and Deny Rule with the available conditions from the previous step so that the Authorization Policy may authorize the logins. Navigate to Resources tab and attach the Authentication and Authorization plocies created in the above steps. Test the Web Application Integration.

    Read the article

  • Tuning Red Gate: #1 of Many

    - by Grant Fritchey
    Everyone runs into performance issues at some point. Same thing goes for Red Gate software. Some of our internal systems were running into some serious bottlenecks. It just so happens that we have this nice little SQL Server monitoring tool. What if I were to, oh, I don't know, use the monitoring tool to identify the bottlenecks, figure out the causes and then apply a fix (where possible) and then start the whole thing all over again? Just a crazy thought. OK, I was asked to. This is my first time looking through these servers, so here's how I'd go about using SQL Monitor to get a quick health check, sort of like checking the vitals on a patient. First time opening up our internal SQL Monitor instance and I was greeted with this: Oh my. Maybe I need to get our internal guys to read my blog. Anyway, I know that there are two servers where most of the load is. I'll drill down on the first. I'm selecting the server, not the instance, by clicking on the server name. That opens up the Global Overview page for the server. The information here much more applicable to the "oh my gosh, I have a problem now" type of monitoring. But, looking at this, I am seeing something immediately. There are four(4) drives on the system. The C:\ has an average read time of 16.9ms, more than double the others. Is that a problem? Not sure, but it's something I'll look at. It's write time is higher too. I'll keep drilling down, first, to the unclosed alerts on the server. Now things get interesting. SQL Monitor has a number of different types of alerts, some related to error states, others to service status, and then some related to performance. Guess what I'm seeing a bunch of right here: Long running queries and long job durations. If you check the dates, they're all recent, within the last 24 hours. If they had just been old, uncleared alerts, I wouldn't be that concerned. But with all these, all performance related, and all in the last 24 hours, yeah, I'm concerned. At this point, I could just start responding to the Alerts. If I click on one of the the Long-running query alerts, I'll get all kinds of cool data that can help me determine why the query ran long. But, I'm not in a reactive mode here yet. I'm still gathering data, trying to understand how the server works. I have the information that we're generating a lot of performance alerts, let's sock that away for the moment. Instead, I'm going to back up and look at the Global Overview for the SQL Instance. It shows all the databases on the server and their status. Then it shows a number of basic metrics about the SQL Server instance, again for that "what's happening now" view or things. Then, down at the bottom, there is the Top 10 expensive queries list: This is great stuff. And no, not because I can see the top queries for the last 5 minutes, but because I can adjust that out 3 days. Now I can see where some serious pain is occurring over the last few days. Databases have been blocked out to protect the guilty. That's it for the moment. I have enough knowledge of what's going on in the system that I can start to try to figure out why the system is running slowly. But, I want to look a little more at some historical data, to understand better how this server is behaving. More next time.

    Read the article

  • How I understood monads, part 1/2: sleepless and self-loathing in Seattle

    - by Bertrand Le Roy
    For some time now, I had been noticing some interest for monads, mostly in the form of unintelligible (to me) blog posts and comments saying “oh, yeah, that’s a monad” about random stuff as if it were absolutely obvious and if I didn’t know what they were talking about, I was probably an uneducated idiot, ignorant about the simplest and most fundamental concepts of functional programming. Fair enough, I am pretty much exactly that. Being the kind of guy who can spend eight years in college just to understand a few interesting concepts about the universe, I had to check it out and try to understand monads so that I too can say “oh, yeah, that’s a monad”. Man, was I hit hard in the face with the limitations of my own abstract thinking abilities. All the articles I could find about the subject seemed to be vaguely understandable at first but very quickly overloaded the very few concept slots I have available in my brain. They also seemed to be consistently using arcane notation that I was entirely unfamiliar with. It finally all clicked together one Friday afternoon during the team’s beer symposium when Louis was patient enough to break it down for me in a language I could understand (C#). I don’t know if being intoxicated helped. Feel free to read this with or without a drink in hand. So here it is in a nutshell: a monad allows you to manipulate stuff in interesting ways. Oh, OK, you might say. Yeah. Exactly. Let’s start with a trivial case: public static class Trivial { public static TResult Execute<T, TResult>( this T argument, Func<T, TResult> operation) { return operation(argument); } } This is not a monad. I removed most concepts here to start with something very simple. There is only one concept here: the idea of executing an operation on an object. This is of course trivial and it would actually be simpler to just apply that operation directly on the object. But please bear with me, this is our first baby step. Here’s how you use that thing: "some string" .Execute(s => s + " processed by trivial proto-monad.") .Execute(s => s + " And it's chainable!"); What we’re doing here is analogous to having an assembly chain in a factory: you can feed it raw material (the string here) and a number of machines that each implement a step in the manufacturing process and you can start building stuff. The Trivial class here represents the empty assembly chain, the conveyor belt if you will, but it doesn’t care what kind of raw material gets in, what gets out or what each machine is doing. It is pure process. A real monad will need a couple of additional concepts. Let’s say the conveyor belt needs the material to be processed to be contained in standardized boxes, just so that it can safely and efficiently be transported from machine to machine or so that tracking information can be attached to it. Each machine knows how to treat raw material or partly processed material, but it doesn’t know how to treat the boxes so the conveyor belt will have to extract the material from the box before feeding it into each machine, and it will have to box it back afterwards. This conveyor belt with boxes is essentially what a monad is. It has one method to box stuff, one to extract stuff from its box and one to feed stuff into a machine. So let’s reformulate the previous example but this time with the boxes, which will do nothing for the moment except containing stuff. public class Identity<T> { public Identity(T value) { Value = value; } public T Value { get; private set;} public static Identity<T> Unit(T value) { return new Identity<T>(value); } public static Identity<U> Bind<U>( Identity<T> argument, Func<T, Identity<U>> operation) { return operation(argument.Value); } } Now this is a true to the definition Monad, including the weird naming of the methods. It is the simplest monad, called the identity monad and of course it does nothing useful. Here’s how you use it: Identity<string>.Bind( Identity<string>.Unit("some string"), s => Identity<string>.Unit( s + " was processed by identity monad.")).Value That of course is seriously ugly. Note that the operation is responsible for re-boxing its result. That is a part of strict monads that I don’t quite get and I’ll take the liberty to lift that strange constraint in the next examples. To make this more readable and easier to use, let’s build a few extension methods: public static class IdentityExtensions { public static Identity<T> ToIdentity<T>(this T value) { return new Identity<T>(value); } public static Identity<U> Bind<T, U>( this Identity<T> argument, Func<T, U> operation) { return operation(argument.Value).ToIdentity(); } } With those, we can rewrite our code as follows: "some string".ToIdentity() .Bind(s => s + " was processed by monad extensions.") .Bind(s => s + " And it's chainable...") .Value; This is considerably simpler but still retains the qualities of a monad. But it is still pointless. Let’s look at a more useful example, the state monad, which is basically a monad where the boxes have a label. It’s useful to perform operations on arbitrary objects that have been enriched with an attached state object. public class Stateful<TValue, TState> { public Stateful(TValue value, TState state) { Value = value; State = state; } public TValue Value { get; private set; } public TState State { get; set; } } public static class StateExtensions { public static Stateful<TValue, TState> ToStateful<TValue, TState>( this TValue value, TState state) { return new Stateful<TValue, TState>(value, state); } public static Stateful<TResult, TState> Execute<TValue, TState, TResult>( this Stateful<TValue, TState> argument, Func<TValue, TResult> operation) { return operation(argument.Value) .ToStateful(argument.State); } } You can get a stateful version of any object by calling the ToStateful extension method, passing the state object in. You can then execute ordinary operations on the values while retaining the state: var statefulInt = 3.ToStateful("This is the state"); var processedStatefulInt = statefulInt .Execute(i => ++i) .Execute(i => i * 10) .Execute(i => i + 2); Console.WriteLine("Value: {0}; state: {1}", processedStatefulInt.Value, processedStatefulInt.State); This monad differs from the identity by enriching the boxes. There is another way to give value to the monad, which is to enrich the processing. An example of that is the writer monad, which can be typically used to log the operations that are being performed by the monad. Of course, the richest monads enrich both the boxes and the processing. That’s all for today. I hope with this you won’t have to go through the same process that I did to understand monads and that you haven’t gone into concept overload like I did. Next time, we’ll examine some examples that you already know but we will shine the monadic light, hopefully illuminating them in a whole new way. Realizing that this pattern is actually in many places but mostly unnoticed is what will enable the truly casual “oh, yes, that’s a monad” comments. Here’s the code for this article: http://weblogs.asp.net/blogs/bleroy/Samples/Monads.zip The Wikipedia article on monads: http://en.wikipedia.org/wiki/Monads_in_functional_programming This article was invaluable for me in understanding how to express the canonical monads in C# (interesting Linq stuff in there): http://blogs.msdn.com/b/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx

    Read the article

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