Search Results

Search found 1251 results on 51 pages for 'negative'.

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

  • perl negative look behind with groupings

    - by user1539348
    I have a problem trying to get a certain match to work with negative look behind example @list = qw( apple banana cherry); $comb_tlist = join ("|", @tlist); $string1 = "include $(dir)/apple"; $string2 = "#include $(dir)/apple"; if( string1 =~ /^(?<!#).*($comb_tlist)/) #matching regex I tried, works The array holds a set of variables that is matched against the string. I need the regex to match $string1, but not $string2. It matches $string1, but it ALSO matches $string2. Can anyone tell me what I am attempting wrong here. Thanks!

    Read the article

  • Multiply with negative integer just by shifting.

    - by stex
    Hi, I'm trying to find a way to multiply an integer value with negative value just with bit shifting. Usually I do this by shifting with the power of 2 which is closest to my factor and just adding / subtracting the rest, e.g. x * 7 = ((x << 3) - x) Let's say I'd want to calculate x * -112. The only way I can imagine is -((x << 7) - (x << 4), so to calculate x * 112 and negate it afterwards. Is there a "prettier" way to do this?

    Read the article

  • Negative ItemCount in SharePoint Document Library

    - by ccomet
    What can be done about negative numbers in library item counts? ItemCount is a read-only property, what are you supposed to do when it is drastically incorrect? Earlier last week, I was doing some testing involving the copying and moving of files and folders from one document library to another. I was transfering the items from our actual document library to a sandbox "Test" library that I used to run all sorts of object model and workflow testing in before migrating to the public lists and libraries. I noticed that with files, things worked correctly, but when I copied a folder that had a file inside it (using SPFolder.CopyTo()), the item count for the test library did not actually update. Since this testing was mostly playing around, I paid it little heed. Today I was back in the test library to test a different workflow (regarding PDF conversion). While I was there, I decided to delete the folder I left last week since I didn't need it anymore. And that's when I saw the item count for the list drop to -1 in the All Site Content View. When I deleted the new PDF I had just uploaded, it then dropped to -2! I even checked with the object model... getting an instance of the library I checked the ItemCount property... lo and behold it was also -2. Is there any process which runs in the background, kinda like the one that cleans up workflow history, which will correct this kind of issue? Or is a programmer expected to keep watch for this kind of situation and come up with calculations to compensate the "count penalty", as it were?

    Read the article

  • ntpd on Fedora Core 6 with high negative time rest values

    - by Mark White
    The basic problem is we have a FC6 server instance running on a virtual machine, and the system time seems to have been slowly varying until it is now causing a problem. The server runs 24/7 and has been up for 155 days. It has been changed to show GMT, and reports the time as (example) 00:15:15 GMT whereas the actual time is 00:00:00 GMT. This is an offset of 915 seconds. selinux has been changed to 'setenforce 0' for testing and I am running as root. I stop the ntpd service and change the time in System|Administration|Date & Time. The time still shows the same with 'date' in bash. There are no error logs. I change the date with 'date --set' in bash. The response confirms the changed date. I run 'date' and the incorrect date is shown. There are no error logs. I start the ntpd service and /var/log/messages shows success with 'time reset -915.720139s'. The date remains unchanged. ntpq -p shows three three time servers all have offsets of around -915 seconds. I stop ntpd service and try 'ntpd -gqx' and get the same result as above - success, but a large negative time reset. I've tried varying combinations of the above, and a few more settings in System|Administration|Date & Time - no change. I just need to reset the system time to GMT. No offset. But I can't wait for ntpd to slew the time over the next few weeks. Any advice is welcome, cheers! Sure this shouldn't be this difficult... Mark...

    Read the article

  • Flex ChangeWatcher bind to a negative condition

    - by bedwyr
    I have a bindable getter in a component which informs me when a [hidden] timer is running. I also have a context menu which, if this timer is running, should disable one of the menu items. Is it possible to create a ChangeWatcher which watches for the negative condition of a bindable property/getter and changes the enabled property of the menu item? Here are the basic methods I'm trying to bind together: Class A: [Bindable] public function get isPlaying():Boolean { return (_timer != null) ? _timer.running : false; } Class B: private var _playingWatcher:ChangeWatcher; public function createContextMenu():void { //...blah blah, creating context menu var newItem:ContextMenuItem = new ContextMenuItem(); _playingWatcher = BindingUtils.bindProperty(newItem, "enabled", _classA, "isPlaying"); } In the code above, I have the inverse case: when isPlaying() is true, the menu item is enabled; I want it to only be enabled when the condition is false. I could create a second getter (there are other bindings which rely on the current getter) to return the inverse condition, but that sounds ugly to me: [Bindable] public function get isNotPlaying():Boolean { return !isPlaying; } Is this possible, or is there another approach I'm completely missing?

    Read the article

  • SQL - .NET - SqlParameters - AddWithValue - Are there any negative performance implications when Par

    - by hamlin11
    http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlparametercollection.addwithvalue.aspx I'm used to adding sql parameters to a sqlCommand using the add() function. This allows me to specify the type of the sqlParameter, but it requires another line to set the value. It's nice to use the AddWithValue function, but it skips the "specify the parameter type" step. I'm guessing this causes the parameters to be sent over as strings contained within single quotes (''), but I'm not sure. Is this the case, and does this cause significantly slower performance of the stored procedures? Note: I understand that it is nice to validate user data on the .NET side of things by specifying the data type for params -- I'm only concerned about reflection-type overhead of AddWithValue either on the .NET or SQL side.

    Read the article

  • Double buffering with C# has negative effect

    - by Roland Illig
    I have written the following simple program, which draws lines on the screen every 100 milliseconds (triggered by timer1). I noticed that the drawing flickers a bit (that is, the window is not always completely blue, but some gray shines through). So my idea was to use double-buffering. But when I did that, it made things even worse. Now the screen was almost always gray, and only occasionally did the blue color come through (demonstrated by timer2, switching the DoubleBuffered property every 2000 milliseconds). What could be an explanation for this? using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = CreateGraphics(); Pen pen = new Pen(Color.Blue, 1.0f); Random rnd = new Random(); for (int i = 0; i < Height; i++) g.DrawLine(pen, 0, i, Width, i); } // every 100 ms private void timer1_Tick(object sender, EventArgs e) { Invalidate(); } // every 2000 ms private void timer2_Tick(object sender, EventArgs e) { DoubleBuffered = !DoubleBuffered; this.Text = DoubleBuffered ? "yes" : "no"; } } }

    Read the article

  • plot negative and positive values in same Y-axis in coreplot ios

    - by user3774439
    I have an issue in converting axis labels to int or float values. This is my Y-Axis. It contains temperature values contains -50, 33, 117, 200. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyNone; y.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(1); y.majorGridLineStyle = majorGridLineStyle; y.minorGridLineStyle = minorGridLineStyle; y.minorTicksPerInterval = 0.0; y.labelOffset = 0.0; y.title = @""; y.titleOffset = 0.0; NSMutableSet *yLabels = [NSMutableSet setWithCapacity:4]; NSMutableSet *yLocations = [NSMutableSet setWithCapacity:4]; NSArray *yAxisLabels = [NSArray arrayWithObjects:@"-50", @"33", @"117", @"200", nil]; NSNumberFormatter * nFormatter = [[NSNumberFormatter alloc] init]; [nFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; for ( NSUInteger i = 0; i < [yAxisLabels count]; i++ ) { NSLog(@"%@",[yAxisLabels objectAtIndex:i]); CPTAxisLabel *label = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"%@",[yAxisLabels objectAtIndex:i]] textStyle:axisTextStyle]; label.tickLocation = CPTDecimalFromUnsignedInteger(i); label.offset = y.majorTickLength; if (label) { [yLabels addObject:label]; [yLocations addObject:[NSDecimalNumber numberWithUnsignedInteger:i]]; } label = nil; } y.axisLabels = yLabels; y.majorTickLocations = yLocations; y.labelFormatter = nFormatter; Now, my issue is.. I am getting data from the BLE device as temperature values as strings like 50, 60.3, etc... Now I want plot these values from BLE device with the Y-axis values. i am unable convert these Y-axis labels to temperature values. Could you please help me guys...I have tried many time still no luck. Please help me UPDATE:: This is the way I am creating scatterplot: -(void)createScatterPlotsWithIdentifier:(NSString *)identifier color:(CPTColor *)color forGraph:(CPTGraph *)graph forXYPlotSpace:(CPTXYPlotSpace *)plotSpace{ CPTScatterPlot *scatterPlot = [[CPTScatterPlot alloc] init]; scatterPlot.dataSource = self; scatterPlot.identifier = identifier; //Plot a graph with in the plotspace [plotSpace scaleToFitPlots:[NSArray arrayWithObjects:scatterPlot, nil]]; plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(30)]; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(-50) length:CPTDecimalFromUnsignedInteger(250)]; CPTMutablePlotRange *xRange = [[self getCoreplotSpace].xRange mutableCopy]; [xRange expandRangeByFactor:CPTDecimalFromCGFloat(-1)]; [self getCoreplotSpace].xRange = xRange; CPTMutableLineStyle *scatterLineStyle = [scatterPlot.dataLineStyle mutableCopy]; scatterLineStyle.lineWidth = 1; scatterLineStyle.lineColor = color; scatterPlot.dataLineStyle = scatterLineStyle; CPTMutableLineStyle *scatterSymbolLineStyle = [CPTMutableLineStyle lineStyle]; scatterSymbolLineStyle.lineColor = color; CPTPlotSymbol *scatterSymbol = [CPTPlotSymbol ellipsePlotSymbol]; scatterSymbol.fill = [CPTFill fillWithColor:color]; scatterSymbol.lineStyle = scatterSymbolLineStyle; scatterSymbol.size = CGSizeMake(2.0f, 2.0f); scatterPlot.plotSymbol = scatterSymbol; [graph addPlot:scatterPlot toPlotSpace:plotSpace]; } Configuring the Y-axis like this: NSMutableSet *yLabels = [NSMutableSet setWithCapacity:4]; NSMutableSet *yLocations = [NSMutableSet setWithCapacity:4]; NSArray *yAxisLabels = [NSArray arrayWithObjects:@"-50", @"33", @"117", @"200", nil]; NSArray *customTickLocations = [NSArray arrayWithObjects:[NSDecimalNumber numberWithUnsignedInt:-50], [NSDecimalNumber numberWithInt:33], [NSDecimalNumber numberWithInt:117], [NSDecimalNumber numberWithInt:200],nil]; for ( NSUInteger i = 0; i < [yAxisLabels count]; i++ ) { NSLog(@"%@",[yAxisLabels objectAtIndex:i]); CPTAxisLabel *label = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"%@",[yAxisLabels objectAtIndex:i]] textStyle:axisTextStyle]; label.tickLocation = CPTDecimalFromInteger([[customTickLocations objectAtIndex:i] integerValue]); label.offset = y.majorTickLength; if (label) { [yLabels addObject:label]; [yLocations addObject:[NSString stringWithFormat:@"%d",[[customTickLocations objectAtIndex:i] integerValue]]]; } label = nil; } y.axisLabels = yLabels; y.majorTickLocations = [NSSet setWithArray:customTickLocations]; Eric, I set the range as you said in CreateSctterPlot method. But In horizontal line on graph are not coming. Could you please help me what I am wrong. Thanks

    Read the article

  • AJAX ModalPopup Pops Behind (Under) Page Content (Negative z-index)

    - by Aaron Hoffman
    I am having an issue with the AJAX ModalPopupExtender in version 40412 of the AJAX Control Toolkit (http://ajaxcontroltoolkit.codeplex.com/releases/view/43475). The first time the ModalPopup is made visible it works correctly. The z-index is set to 6001 (and the background Div's z-index is set to 6000) and the Popup appears above everything else. If the cancel button within the ModalPopup is clicked, it also has the correct functionality, the display is set to "none" and the ModalPopup is no longer visible. However, when the Popup is triggered again, the z-index is only set to 2000 which is still visible above everything else, but if it is canceled and triggered again it is set to -2000 which is not visible (the z-index is decreasing by 4000 each time). I'm not sure why this is happening. Any ideas how to fix it? Special circumstances: There are multiple ModalPopup's on the page. All ModalPopups are triggered in code-behind through partial-page postbacks (using the .Show() method) ModalPopupExtenders are within the same UpdatePanels that are displayed as popups

    Read the article

  • Negative execution time

    - by FinalArt2005
    Hello, I wrote a little program that solves 49151 sudoku's within an hour for an assignment, but we had to time it. I thought I'd just let it run and then check the execution time, but it says -1536.087 s. I'm guessing it has to do with the timer being some signed dataype or something, but I have no idea what datatype is used for the timer in the console (code::blocks console, I'm not sure if this is actually a separate console, or just a runner that runs the terminal from the local operating system), so I can't check what the real time was. I'd rather not run this again with some coded timer within my program, since I'd like to be able to use my pc again now. Anybody have any idea what this time could be? It should be somewhere between 40 and 50 minutes, so between 2400 and 3000 seconds. Regards, Erik

    Read the article

  • Android AlertDialog clicking Positive and Negative just dismiss

    - by timmyg13
    Trying to have a sharedpreference where you click on it to restore default values, then an alert dialog comes up to ask if you are sure, but it is not doing anything, just dismissing the alertdialog. public class SettingsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener { /** Called when the activity is first created. */ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); c = this; addPreferencesFromResource(R.xml.settings); SharedPreferences sp = PreferenceManager .getDefaultSharedPreferences(this); sp.registerOnSharedPreferenceChangeListener(this); datasource = new PhoneNumberDataSource(this); Preference restore = (Preference) findPreference("RESTORE"); restore.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { createDialog(); return false; } }); } void createDialog() { Log.v("createDialog", ""); FrameLayout fl = new FrameLayout(c); AlertDialog.Builder b = new AlertDialog.Builder(c).setView(fl); b.setTitle("Restore Defaults?"); b.setPositiveButton("Restore", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface d, int which) { Log.v("restore clicked:", ""); } }); b.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface d, int which) { Log.v("cancel clicked:", ""); d.dismiss(); } }).create(); b.show(); } } Neither the "cancel clicked" nor "restore clicked" show in the log. I do get a weird "W/InputManagerService(64): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@450317b8" in the log.

    Read the article

  • can bound negative space be used in SVG?

    - by Anthony
    If I have a map of three countries, and their borders form the outline of a sea, is their a way with SVG to give that bound area attributes and style? Another example might be three triangles which form a third triangle in the center (like the triforce). If someone wanted to make that middle empty area glow (or whatever)...

    Read the article

  • php: ip2long returning negative val

    - by andufo
    hi, function ip_address_to_number($IPaddress) { if(!$IPaddress) { return false; } else { $ips = split('\.',$IPaddress); return($ips[3] + $ips[2]*256 + $ips[1]*65536 + $ips[0]*16777216); } } that function executes the same code as the php bundled function ip2long. however, when i print these 2 values, i get 2 different returns. why? (im using php 5.2.10 on a wamp environment). ip2long('200.117.248.17'); //returns -931792879 ip_address_to_number('200.117.248.17'); // returns 3363174417

    Read the article

  • Android Bitmap.createBitmap returns negative mHeight

    - by Hai Bi
    Modifying the Snake example. An exception was created from the bitmap class. So I debug the original Snake, and found that in TileView there is a function loadTile, Bitmap bitmap = Bitmap.createBitmap(mTileSize, mTileSize, Bitmap.Config.ARGB_8888); after the above assignment, the bitmap had -1 for mHeight and mWidth. Then how does the Snake even work? I am just use the Eclipse and the virtual machine, not a real android phone.

    Read the article

  • Is there a negative for Courier new font?

    - by Biroka
    I want to make a text highlight in flex textArea but its htmlText doesn't support <font bgcolor='#FFFF00'> part of my text </font> so I'm searching for a font witch is the opposite of Courier new, when I embed it in flash, and write with that color I get this effect part of my text , as I type <font family="negativeOfCourier" color='#FFFF00'> part of my text </font>

    Read the article

  • ms access negative page numbers

    - by FrustratedWithFormsDesigner
    I have an access report that generates 36505 pages (un filtered, and about half of each page is taken up by group headers and page headers) , though the footer at the bottom of the report page says "36505 of -29031". This looks like an overflow problem maybe, though I'm confused how it got the current page number of the last page OK, but failed to get total page count. Has anyone dealt with this before?

    Read the article

  • Jquery animate negative top and back to 0 - starts messing up after 3rd click

    - by Daniel Takyi
    The site in question is this one: http://www.pickmixmagazine.com/wordpress/ When you click on one of the posts (any of the boxes) an iframe will slide down from the top with the content in it. Once the "Home" button in the top left hand corner of the iframe is clicked, the iframe slides back up. This works perfectly the first 2 times, on the 3rd click on of a post, the content will slide down, but when the home button is clicked, the content slides back up normally but once it has slid all the way up to the position it should be in, the iframe drops straight back down to where it was before the home button was clicked, I click it again and then it works. Here is the code I've used for both sliding up and sliding down functions: /* slide down function */ var $div = $('iframe.primary'); var height = $div.height(); var width = parseInt($div.width()); $div.css({ height : height }); $div.css('top', -($div.width())); $('.post').click(function () { $('iframe.primary').load(function(){ $div.animate({ top: 0 }, { duration: 1000 }); }) return false; }); /* slide Up function */ var elm = parent.document.getElementsByTagName('iframe')[0]; var jelm = $(elm);//convert to jQuery Element var htmlElm = jelm[0];//convert to HTML Element $('.homebtn').click(function(){ $(elm).animate({ top: -height }, { duration: 1000 }); return false; })

    Read the article

  • PHP returns a negative number?

    - by Legend
    I am trying to query a bittorrent tracker and am using unpack to get the list of IPs from the response. So, something like this: $ip = unpack("N", $peers); $ip_add = ($ip[1]>>24) . "." . (($ip[1]&0x00FF0000)>>16) . "." . (($ip[1]&0x0000FF00)>>8) . "." . ($ip[1]&0x000000FF); But, for some reason, I am getting the following IP addresses when I print $ip_add: 117.254.136.66 121.219.20.250 -43.7.52.163 Does anyone know what could be going wrong?

    Read the article

  • negative look ahead to exclude html tags

    - by Remoh
    I'm trying to come up with a validation expression to prevent users from entering html or javascript tags into a comment box on a web page. The following works fine for a single line of text: ^(?!.(<|)).$ ..but it won't allow any newline characters because of the dot(.). If I go with something like this: ^(?!.(<|))(.|\s)$ it will allow multiple lines but the expression only matches '<' and '' on the first line. I need it to match any line. This works fine: ^[-_\s\d\w"'.,:;#/&\$\%\?!@+*\()]{0,4000}$ but it's ugly and I'm concerned that it's going to break for some users because it's a multi-lingual application. Any ideas? Thanks!

    Read the article

  • How to prevent negative number in Mysql

    - by Jerry
    Hello guys.. I have data which is starting from 0 in my database. My php will add 1 or -1 to the data depending on the user's input. My problem is that if data is 0 and a user try to subtract 1. The data become 4294967295 which is the maximum value of INT data type. Are there anyways to make the data stays in 0 even when the user asks for -1? Thanks for the reply.. my sql command is like below update board set score=score-1 where team='TeamA' //this would generate 4294967295 if the score is 0.....

    Read the article

  • Is having a 'home' navigation item on the home page negative to your sites SEO?

    - by Brady
    My work colleague has recently had conversations with some SEO consultants and after those conversations she has come to the conclusion that having a link to the home page on the home page will have a negative effect on the websites SEO. And because of this we are now building websites that don't have a home link show until you are on any page other than the home page. If the above argument is true then surely then if we are on the about page of a website we shouldn't show a navigation item for the page we are on, and that would the case for any other page of the website... So my question is: Does having a home navigation item on the home page have a negative effect on the websites SEO? And if not: Why has my colleague come to the above conclusion? Could she be misunderstanding something more important about home links on the home page regarding SEO?

    Read the article

  • Weird Objective-C Mod Behavior

    - by coneybeare
    So I thought that negative numbers, when mod'ed should be put into positive space... I cant get this to happen in objective-c I expect this: -1 % 3 = 2 0 % 3 = 0 1 % 3 = 1 2 % 3 = 2 But get this -1 % 3 = -1 0 % 3 = 0 1 % 3 = 1 2 % 3 = 2 Why is this and is there a workaround?

    Read the article

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