Search Results

Search found 108 results on 5 pages for 'negate'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Is the Google Annotations Gallery useful in production code?

    - by cafe
    I could actually see a use for the Google Annotations Gallery in real code: Stumble across code that somehow works beyond all reason? Life's short. Mark it with @Magic and move on: @Magic public static int negate(int n) { return new Byte((byte) 0xFF).hashCode() / (int) (short) '\uFFFF' * ~0 * Character.digit ('0', 0) * n * (Integer.MAX_VALUE * 2 + 1) / (Byte.MIN_VALUE >> 7) * (~1 | 1); } This is a serious question. Could this be used in an actual code review?

    Read the article

  • ActionScript Negating a Number

    - by TheDarkIn1978
    i'd like to negate a number and would like to know if there's a built in method that will convert a negative number to a positive OR a positive into a negative, depending on the number. i know about Math.abs(), but that only seems to convert negative into positive. is there a method that will do both?

    Read the article

  • MongoDB using NOT and AND together

    - by Stankalank
    I'm trying to negate an $and clause with MongoDB and I'm getting a MongoError: invalid operator: $and message back. Basically what I want to achieve is the following: query = { $not: { $and: [{institution_type:'A'}, {type:'C'}] } } Is this possible to express in a mongo query? Here is a sample collection: { "institution_type" : "A", "type" : "C" } { "institution_type" : "A", "type" : "D" } { "institution_type" : "B", "type" : "C" } { "institution_type" : "B", "type" : "D" } What I want to get back is the following: { "institution_type" : "A", "type" : "D" } { "institution_type" : "B", "type" : "C" } { "institution_type" : "B", "type" : "D" }

    Read the article

  • URL Rewrite is adding HTTPS to my canonical redirects in IIS7

    - by Derek Hunziker
    Hello, I have the following rule defined in my Web.config: <rule name="Enforce canonical hostname" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTP_HOST}" negate="true" pattern="^www\.mydomain\.org$" /> </conditions> <action type="Redirect" url="http://www.mydomain.com/" redirectType="Permanent" /> </rule> What I am experiencing is strange... It appears that I am being redirected to https://www.mydomain.com/ which causes my browser to hang. I do not have SSL encryption turned on, nor do I have any special authorization rules. The web server in question is behind an F5 load balancer. Any ideas?

    Read the article

  • How can OpenGL graphics be displayed remotely using VNC?

    - by Jared Brown
    I am attempting to run a program that uses OpenGL to render a model in a viewport through VNC unsuccessfully. The error message I receive is - Xlib: extension "GLX" missing on display ":1.0". It was my understanding that VNC can be configured to render all graphics remotely and send a compressed screen grab from the display buffer to the local client. This would seem to negate the need for GLX extensions on the local client. Can VNC be configured this way and could you briefly describe how? Remote host: vncserver on RHEL 5 Local client: UltraVNC on Windows XP

    Read the article

  • RAID0 array of USB 2 disks, both connected to a single hub. Any benefit?

    - by Josh
    I have two unused USB 2 drives. I wanted to stripe them in a RAID0 configuration for fast disk access for virtual machines. (I find running a VMware virtual machine off a USB2 drive to be painfully slow. Especially Windows Vista) If I have both USB drives attached to the same USB2 hub, will that negate any benefit I gain by creating a RAID0 array? That is to say, is the speed of USB2 the limiting factor or is the speed of the drives? Would I get better performance by attaching one or both drives directly to my computer?

    Read the article

  • Convert a colored PDF into a white/black

    - by polslinux
    On Debian Sid, I have a PDF with a blue background and yellow font. I've searched a lot on Super User but i haven't found anything useful for me. I have tried to convert the PDF into a grayscale one with: gs -o grayscale.pdf -sDEVICE=pdfwrite -sColorConversionStrategy=Gray -sProcessColorModel=DeviceGray -dCompatibilityLevel=1.4 colored.pdf The problem is that I obtain a PDF whit white fonts and dark grey background so I cannot print it. After that I tried: convert -density 96x96 gs2.pdf -density 96x96 -negate -compress zip inv.pdf I got a PDF with black fonts (and this is okay) and grey background (and this is not okay). What can I do to obtain a PDF with white background and black fonts?

    Read the article

  • How do UEFI and virtual machines relate to each other?

    - by Iterator
    I am trying to get my head around UEFI (Unified Extensible Firmware Interface) and it's not entirely clear to me how this affects virtual machines. Thus, there are three parts to this question: Is UEFI an advance in hardware support for virtualization? All other things being equal, would a machine with UEFI be more likely to run a virtual machine more efficiently than one without, or does UEFI cause any performance hits that negate any speed improvements from a virtual machine? Would the difference in execution be visible to code running in a virtual machine? (In theory, it shouldn't, but in practice?)

    Read the article

  • IIS 7.5 Rewrite help needed

    - by Nolan Berry
    I am trying to do something extremely straightforward. I just need to force SSL and I am trying to use the URl Rewrite plugin. I am getting no results when I put the following rule into my conf. <rewrite> <rules> <rule name="Redirect to https" stopProcessing="true"> <match url="(.*)[^/])$" /> <conditions> <add input="{SERVER_PORT}" pattern="443" negate="true" /> </conditions> <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" /> </rule> </rules> </rewrite> Any thoughts on why this isn't catching?

    Read the article

  • Ignore subdomain rewrite rules

    - by user55745
    I'm having difficulty having a sub folder act differently to the main domain in my web.config for iss. I want to prevent the sub folder from rewriting to the baselevel index.php and instead re-write to /subfolder/index.php/ I've tried this <rule name="Remove index.php for quiz" enabled="true" stopProcessing="false"> <match url="^(gsoquiz/)(.*)$" ignoreCase="false" trackAllCaptures="false" /> <conditions logicalGrouping="MatchAll"> <add input="{R:1}" negate="true" pattern="^(index\.php|admin\.php)" /> </conditions> <action type="Rewrite" url="/gsoquiz/index.php/{R:1}" /> </rule> But all I get is The page cannot be displayed because an internal server error has occurred. Any help as to where I'm going wrong would be greatly appreciated. Going mad trying to figure this out :).

    Read the article

  • Using TrueCrypt (software encryption) with an SSD

    - by Shackrock
    I use full drive encryption (FDE) w/ TrueCrypt on my laptop. I have a 2nd gen I7 with AES instruction support, so honestly I can't even notice a speed change on the system with it on. My question, is for those who know about SSD's a lot. I previously (early 2011) read articles about how software encryption will negate the speed benefits that an SSD provides - because of the need for the SSD to send a delete command, then a write command, for every encrypted write - instead of just writing over data like a regular HDD would (or something like this...honestly I can't remember...ha!). Anyway, any improvements in this field? Is it pointless for me to grab an SSD if I'm using FDE? Thanks all.

    Read the article

  • Action button: only true once per press

    - by Sidar
    I'm using SFML2.0 and am trying to make a wrapper class for my controller/joystick. I read all the input data from my controller and send it off to my controllable object. I want to have two types of buttons per button press, one that is continues(true false state ) and one that is an action and is set to false after the next frame update. Here is an example of how I set my button A to true or false with the SFML api. Whereas data is my struct of buttons, and A holds my true/false state every update. data.A = sf::Joystick::isButtonPressed(i,st::input::A); But I've also added "data.actionA" which represents the one time action state. Basically what I want is for actionA to be set false after the update its been set to true. I'm trying to keep track of the previous state. But I seem to fall into this loop where it toggles between true and false every update. Anyone an idea? Edit: Since I can't answer my own question yet here is my solution: data.actionA = data.A = sf::Joystick::isButtonPressed(i,st::input::A); if(prev.A) data.actionA = false; First I always set the actionA to the value of the button state. Then I check if the previous state of A is true. If so we negate the value.

    Read the article

  • redirect an old URL using web.config

    - by Dog
    i'm still very new to using URL rewrites and redirects and i'm having some problems on something i thought was quite simple... i've just rebuilt a website and want to redirect the old URLs to the new ones... for example : http://www.mydomain.com/about.asp?lang=1 should now be http://www.mydomain.com/content.asp?id=100230&title=about&langid=1 unfortunately, everything i've tried is giving me errors or simply does nothing. here is one rule i tried : <rule name="redirectoldabout" enabled="true" stopProcessing="true"> <match url="( .*)" negate="true" /> <conditions> <add input="{HTTP_HOST}" pattern="^mydomain\.com/about\.asp\?lang=1$" /> </conditions> <action type="Redirect" url="http://www.mydomain.com/content.asp?id=100230&title=about&langid=1" redirectType="Permanent" /> but i get an error back : HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. any suggestions as to what i'm doing wrong? thanks dog

    Read the article

  • F# &ndash; Converting your C# brain to the F# way

    - by MarkPearl
    My brain still thinks in C#!!! I have been looking at F# and trying to figure out the basics of it, but all the time in the back of my mind I am going – what is the C# equivalent to this or that… It’s frustrating because I almost want a F# to C# dictionary the whole time – and simply translate my C# code to F# – which would negate the main motivation for learning F# – as I want learn functional programming - if I was simply doing C# code in a F# syntax I would be gaining nothing! So I am experiencing pain while my brain forms some new neural networks… but luckily I live in a country where we have 11 official spoken languages, and plenty more unofficial languages so I have gone through the pain of learning how to speak a new language before – and I am finding the process is almost identical in learning a programming language that promotes a different way of looking at problems (from Object Orientated to Functional). That beings said… the first thing to learn is the basic syntax… I have searched the web for appropriate places to get a translation – and have been quite disappointed with what is out there for F#. Luckily, OCaml came to the rescue. There are some really good tutorials on getting started with OCaml syntax, one in particular that stood out was the OCamal-Tutorial. What I particularly like about it is that it is doing comparisons between C based languages and OCaml. Give it a read sometime – it’s well worth it and has definitely helped me understand F# a little better.

    Read the article

  • There's Not an App for That (Yet)

    - by Mark Hesse
    With an earlier-than-normal departure this morning to avoid the stalemate known as traffic congestion, I suddenly realized what I had failed to grab on my way out the door...  my company ID badge.  Unfortunately, at the time of my epiphany, I was far enough into commuter no-man's land where turning back would completely negate my early departure and increase my overall drive time exponentially.  Not being one to retrace my steps, I decided to press on. Upon arrival at the office and with an hour to go before a security guard would be on duty, I started thinking about the number of times I had forgotten my ID vs. the number of times I had forgotten my phone.  While rare on both accounts, my ID was most likely the missing artifact. I then wondered why there isn't an app for my smartphone that allows me to verify my credentials with my employer and then, provided with a secure token for the day, have the ability to access my building's card entry system.  On many levels, this seems much more secure than an ID card which can be lost, stolen or even forged and then used simply by tailgating into and around buildings at facilities where card scanning can generally be avoided.   As it turns out, another building on the campus has 24 x 7 guard coverage, so I was able to gain access in a relatively short time and secure a temporary ID badge.  Once inside and online, a quick internet search on the subject of smartphone badge access shows that efforts are underway to do exactly what I was thinking needed to be done. Having not spent any time studying about the technology, I discovered that it relies on Near Field Communications (NFC) enabled smartphones (of which, mine does not provide).  The only other option would require modifications to the security infrastructure to support alternative authentication technologies, such as barcode readers, which would be extremely costly to implement. For now, my best option is to put my corporate ID under my car keys... 

    Read the article

  • Regex to match a whole string only if it lacks a given substring/suffix

    - by Ivan Krechetov
    I've searched for questions like this, but all the cases I found were solved in a problem-specific manner, like using !g in vi to negate the regex matches, or matching other things, without a regex negation. Thus, I'm interested in a “pure” solution to this: Having a set of strings I need to filter them with a regular expression matcher so that it only leaves (matches) the strings lacking a given substring. For example, filtering out "Foo" in: Boo Foo Bar FooBar BooFooBar Baz Would result in: Boo Bar Baz I tried constructing it with negative look aheads/behinds (?!regex)/(?<!regex), but couldn't figure it out. Is that even possible?

    Read the article

  • Getting into a technology which requires experience when you have no experience

    - by dotnetdev
    It seems that Sharepoint is a technology which is very hard to get into. All the jobs in this tech require experience in working with it (Eg 2 years development experience in MOSS). If I wanted to get into this - but had no job that used the tech, how can I get experience in it to get an experienced job? Jobs state you need "2 years professional experience in MOSS 2007" but then if you have never done it, you won't get the job. The only possible way is you will be doing this at home and not in a team, but if you work in the mean time, that will negate this (it's not like teamworking is tech specific). Many people think if you decide to make a project at home you're just going to play about aimlessly rather than work to specs (where as in my current situation it's vice versa) but if you're dedicated, like me, you would write them - just not with the same presentation. Would employers treat experience at home as professional experience? Biztalk is another prime example of this. Thanks

    Read the article

  • the carry flag issue!

    - by Zia ur Rahman
    Suppose AX =FFFE and BX=1234 now if we write cmp ax,bx (bx will be subtracted from ax and the approprite flages will be updated) now the binary representation of the numbers in ax and bx is given by AX = 1111 1111 1111 1110 BX= 0001 0010 0011 0100 As bx will be subtracted from ax so we have to negate bx (as Result= ax+(-bx)) so the negated bx (2's complement of bx ) is given by. BX= 1110 1101 1100 1100 Now we add both ax and bx (as subtraction is implemented by addition in computer) AX= 1111 1111 1111 1110 BX= 1110 1101 1100 1100 ------------------------------------ 1 1110 1101 1100 1010 Now as you can see the result is of 17 bits now the 17th bit should go into carry flage, but when i checked it the carry flag is 0 that is CF=0 why?

    Read the article

  • Using a Kanban board per developer

    - by grimus
    I have been trying to get our software department to adopt some kind development process methodolgy. We only have 9 developers, and about as many projects. Currently, we can only be described as chaotic. Or perhaps 'crisis driven development' as I've seen another SO user call it. Using Kanban seems like a it could be a good fit for us. So I've discussed it with everyone else, everyone thought it sounded good. But when we discussed how the board(s) should be arranged, everyone wanted to do one board per person. Now, I've never tried Kanban, or any methodology really, but it feels like having each person managed on their own board would negate the benefits a Kanban process is supposed to provide. This notion makes me sad, and want to say 'ho-hum let's scrap this whole idea.' Do you think implementing a Kanban board per developer can be worthwhile?

    Read the article

  • Problem Rewriting URL's from HTTPS to HTTP using IIS7 URL Rewriter, when using Webforms ReturnURL=

    - by theminesgreg
    I took Jeff's Re-write rules from this post and the HTTP to HTTPS conversion works great. However, going back to HTTP is giving me problems because of the ReturnUrl= in the URL (I'm using webforms). Here's an example of the url: https://localhost/Login.aspx?ReturnUrl=%2f Here's the rewrite rule I'm using: <rule name="HTTPS to HTTP redirect for all other pages" stopProcessing="true"> <match url="^login\.aspx$" ignoreCase="true" negate="true" /> <conditions> <add input="{SERVER_PORT}" pattern="^443$" /> </conditions> <action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}{REQUEST_URI}" /> </rule> Here's the resulting re-written URL: http://localhost/,/ Has anyone found a work around for this?

    Read the article

  • Bug in Programming Interviews Exposed?

    - by Sam
    Hi, I could not find an errata for the 2nd edition of this book. My question concerns the if-statement in the following piece of code. void removeHead (Node ** head) { Node * temp; if (!(*head)) { temp = (*head)->next; delete *head; *head = temp; } } So I understand that the point of the if-statement is to check if the Node is null. However by adding an additional "!" to the evaluation, wouldn't this negate the false value of null? Would it be correct to change it to something like: if (*head) { ... } Also if anyone knows where I can find an official errata for the 2nd edition that would be great. Thanks, Sam

    Read the article

  • Update 2 table values in one query in LINQ

    - by fireBand
    Hello, I have 2 tables Table1 with columns [BId,Name,Amount] Table2 with columns [CId,BId, ExpenseType,Expense]. BId Is the foreign key in Table2. The Amount field in Table1 is always higher than Expense in Table2. I need to update the values of Amount (increase or decrease) based on value of Expense and I want to do it in single query in LINQ. Eg If the Expense has to be updated with 200, I would decrease(negate) Amount value with 200. If Expense is reduce to 100 then the Amount is increased by a value of 100. Thanks in advance for any suggestions.

    Read the article

  • UIRotationGestureRecognizer changes with CGAffineTransformMakeScale

    - by user523234
    A view is flipped using this: self.transform = CGAffineTransformMakeScale(-1, 1); // self is an UIView To rotate this view: -(void)handleRotate:(UIRotationGestureRecognizer *)recognizer { recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation); recognizer.rotation = 0; } The issue is that after the view is flipped so is the rotation's direction. Any solution how to fix this? Edit: My current solution is using a boolean and negate the recognizer.rotation value in handleRotate method. But I am still looking for the technical solution.

    Read the article

  • Why is my regex so much slower compiled than interpreted ?

    - by miket2e
    I have a large and complex C# regex that runs OK when interpreted, but is a bit slow. I'm trying to speed this up by setting RegexOptions.Compiled, and this seems to take about 30 seconds for the first time and instantly after that. I'm trying to negate this by compiling the regex to an assembly first, so my app can be as fast as possible. My problem is when the compiling delay takes place: Regex myComplexRegex = new Regex(regexText, RegexOptions.Compiled); MatchCollection matches = myComplexRegex.Matches(searchText); foreach (Match match in matches) // <--- when the one-time long delay kicks in { } This is making compiling to an assembly basically useless, as I still get the delay on the first foreach call. What I want is for all the compiling delay to be done in advance when I compile to the assembly, not when the user runs the app. Where am I going wrong ? (The code I'm using to compile to an assembly is similar to http://www.dijksterhuis.org/regular-expressions-advanced/ , if that's relevant ).

    Read the article

  • PHP: Auto Updating subscriptions?

    - by Duncan Palmer
    Hey guys I am currently making a website and I am hopefully going to start a premium service for it. What I am currently looking into right now is how to make an "auto updating" shop which removes 1 day from how many days left the user has left on their premium status. so for example if the users purchases 30 days of premium, each day that 30 with negate 1 so.. 30, 29, 28, 27.. etc and then if the days gets to 0 in will remove premium status. The only way I can think of keeping track of this right now is by manually monitoring each persons premium status but that wouldnt be very practical. What would the best way for me to do this? (hopefully "automatically") Thanks.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >