w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
LocationManager region monitor is not what I expected. The region boundary looks bigger than my settings
My experience is that this is normal behavior. I've been using region monitoring for about 2.5 years now and since iOS 6, the -didExitRegion delegate takes much longer to trigger than the -didEnterRegion. I also had this behavior confirmed by an Apple Engineer during WWDC 2013. It doesn't sound as if they plan to improve the accuracy, rather delay, in the exit events. According to the engineer, the OS takes a lot longer to decipher that you've left because it has to completely get out of range of known Wifi networks and to new cell towers. It is much easier to determine you've arrived than it is to determine you've left. If it is only taking 300M or so to trigger your geofence (outside the 300M radius), I'd say you are probably within the operating limits of the geofence. If you need prec

Categories : IOS

How to disable a region when a child window pops up in another region in prism mef wpf
You can bind your viewModel's main content's attribute IsEnabled to a boolean property IsPopupGone. In the constructor of your toolbar subscribe EventAggregator to an event PopupWindowStateChanged and payload as a boolean. Then when your popup window(s) display, publish this event with True, and when closed publish as False. private bool isPopupGone = true; // default/original state assumed to be no childs showing public bool IsPopupGone { get { return isPopupGone; } set { isPopupGone = value; /* implement notifypropertychanged */ } } public ToolbarViewModel(IEventAggregator eventAggregator) { EventAggregator = eventAggregator; EventAggregator.GetEvent<PopupWindowStateChanged>().Subscribe(UpdateEnabledState); } public void UpdateEnabledState(bool isPopupShowing

Categories : Wpf

Emacs: select a region and type to delete the region
I don't think it does it out of the box, it looks like you have to turn on delete-selection-mode as per this article on EmacsWiki. So, basically put the following line into your .emacs: (delete-selection-mode 1)

Categories : Emacs

HBase region over region servers load not balanced
Are you using sequential rowkeys, like timestamp?If that is the case you might end up with RegionServer Hotspotting, putting uneven load on the servers. Avoid using sequential keys, if you can. If it is not possible create pre-splitted tables.

Categories : Hadoop

How can I get the country and region code using geolocation instead of full country and region names
You should use the short_name value for the country, which is the two-digit country code. These are ISO standard codes and should be the basis for your database lookup, not the localized country name.

Categories : Javascript

Will deploying Rails using Torquebox on Openshift present any advantages over deploying Rails directly?
Yes, TorqueBox is much faster than the original Ruby. Not only the interpreter (JRuby) is faster, simply because it runs on JVM and uses JIT and JVM's fine-tuned garbage collector, but also it uses additional features available in JVM, like parallel threading etc. More, with TorqueBox, you have JBoss AS services at hand when you decide to use them, which I guess you will, if your app grows. Reference: http://torquebox.org/news/2011/10/06/torquebox-2x-performance/

Categories : Ruby On Rails

Does Java thread-safety apply to all instances of a class or just shared instances?
Your assumptions about thread safety are correct. It boils down to fields/state on the same instance being modified by multiple threads. In your first question the threads all manipulate their own instance of Dog so the approach is thread safe. In the second question the instance is passed into the static method so once again your working with different instances of the class. If the Dog class contained static fields and the static method manipulated those fields that would not be thread safe, but non final static fields are really never thread safe.

Categories : Java

Use reflection to get instances of static instances of derived class
It's important to understand that it's the field which is static - not the instance. You can easily find readonly static fields though, and fetch their values. For example: var someAssembly = typeof(Foo).Assembly; // Or whatever var values = from type in someAssembly.GetTypes() from field in type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) where field.IsInitOnly && field.FieldType == typeof(LocalisationToken) select (LocalisationToken) field.GetValue(null);

Categories : C#

Reasoner returns no instances of owl:Thing, but Abox contains instances
I'm not much of an OWL API user, but I suspect that what's happening is that the ABox axioms that you're including in the second case don't include the individual declarations for the individuals that the axioms talk about, and that as a result, the ABox axioms are getting ignored. From the OWLAPI source, the ABoxAxiomTypes are defined as: public static final Set<AxiomType<?>> ABoxAxiomTypes = new HashSet<AxiomType<?>>( Arrays.asList(CLASS_ASSERTION, SAME_INDIVIDUAL, DIFFERENT_INDIVIDUALS, OBJECT_PROPERTY_ASSERTION, NEGATIVE_OBJECT_PROPERTY_ASSERTION, DATA_PROPERTY_ASSERTION, NEGATIVE_DATA_PROPERTY_ASSERTION, DATATYPE_DEFINITION)); I expect that if you add photo1's OWLDeclarationAxioms firs

Categories : Misc

Are AWS reserved EC2 instances applied to free marketplace instances?
For the CentOS AMI you would want to select Linux/Unix or Linux/Unix (VPC), depending on whether you are running in EC2 classic or in a VPC. The reason the other platform types are present in the list is because there is an accompanying additional licensing fee that is baked into the per hour server usage cost for those types of servers. SUSE, Redhat Enterprise Linux, Microsoft Windows Server, Microsoft Windows Server + SQL Server all require a paid-for license (which Amazon bakes into the usage cost). This does not apply to CentOS; the "platform" in this case is just "Linux/Unix" (or Linux/Unix (VPC)).

Categories : Amazon

Multiple video.js instances - Stop all playing instances
Try using: $('.menulink').click(function ShowDivs() { var divname= this.name; $("#"+divname).show().siblings().hide().each(function () { _V_($(this).children('video').attr('id')).pause(); }; }); EDIT: Or, more likely, this: $('.menulink').click(function ShowDivs() { var divname= this.name; $("#"+divname).show().siblings().hide().each(function () { _V_(this).pause(); }; });

Categories : Jquery

AWS instances patch updates for multiple instances
For this situation you might be more or less forced to do this by hand, but in the future a design makeover would be in order to make your life easier for dealing with stuff like this. I would recommend that you look into puppet or Chef as they enable you to script your infrastructure and when you have updates/changes that need to occur, you apply them to the systems in question or just rebuild the system over again. For this scenario if you were to use Chef, you would just update your scripts and tell chef to update all of your systems. Granted, I know that this bit of information doesn't help your current predicament, but it's a recommendation for future environments to alleviate issues like these.

Categories : Amazon

how to create five instances of an object in java such that when there is reference to that object, those five instances should be like object pool?
That's basically the definition of an enum: public enum MyEnum { ONE, TWO, THREE, FOUR, FIVE } ONE, TWO, etc. are the only five possible instances of MyEnum.

Categories : Java

Accessing instances in GUI file while instances are declared in another file
For example in the User.java class you can create a static verctor with all users created (add each user there in the constructor): import java.util.Vector; public class User { private String userId; private String surname; private String name; public static Vector<User> users=new Vector<User>(); public User(String userId, String surname, String name){ this.userId=userId; this.surname=surname; this.name=name; User.users.add(this); } } then you can access any created user in any class like this: User.users.get(i).getname(); depending on your problem, you should note the index somehow. the first created user will be 0: users.get(0), second one will be 1, and so on for example if

Categories : Java

#pragma region in c#
It is simply #region CmdLineStuff ...... #endregion CmdLineStuff The docs could be found here and here there is the full documentation for the C# Preprocessor directives

Categories : C#

What does MkCoordinateRegion region = {{0,0}, {0,0}};
A MKCoordinateRegion has two fields: 1) center, 2) span. You should use the MKCoordinateRegionMake macro for this: CLLocationCoordinate2D center = CLLocationCoordinate2DMake(35, -90); // pick desired values MKCoordinateSpan span = MKCoordinateSpanMake(100, 100); // pick desired values MKCoordinateRegion region = MKCoordinateRegionMake(center, span); The syntax: MKCoordinateRegion region = { { 0, 0 }, { 0, 0 } }; is a shortcut from C for initializing the struct values. The first pair is for the center field and the second pair is for the span field.

Categories : Misc

how to startMonitoringForRegion for more then 20 region
You just can't monitor more than 20 regions. Maybe you could stop monitoring some regions depending on user location and start some others (depending on your use case). Discussion You must call this method once for each region you want to monitor. If an existing region with the same identifier is already being monitored by the application, the old region is replaced by the new one. The regions you add using this method are shared by all location manager objects in your application and stored in the monitoredRegions property. Region events are delivered to the locationManager:didEnterRegion: and locationManager:didExitRegion: methods of your delegate. If there is an error, the location manager calls the locationManager:monitoringDidFailForRegion:withError: method o

Categories : IOS

MKMapView Region
First, you'll need to make sure you set the region on the map view after the view has been displayed. If you set it before the map has loaded, it probably won't center on that region. Once you've done that, just set self.mapView.zoomEnabled = NO; and self.mapView.scrollEnabled = NO; and it will prevent the user from moving the map around. If you want to lock the maximum bounds the user can view but still allow scrolling and zooming, you will have to use -mapView:regionDidChangeAnimated: and 'bump' the user back inside your bounds if they leave it. Note that the user experience for this will probably suck - they'll pan around, let go, and then the map will suddenly move back to the region you defined. You could try using -mapView:regionWillChangeAnimated: and modify the map region if they

Categories : IOS

how to get a region out of an image?
Rather than use an image, try rendering the piano keys yourself, and check if input is in the black key regions you render, rather than using an image. If you really want to use the image, define the black regions within the image by hand. Detecting regions in an image is a difficult problem, one you probably don't want to get into for such a simple purpose. If you had many images, or had to do this frequently it might be worth the headache but as you presumably don't... don't worry about it.

Categories : Java

Double map region
You may use LatLngBounds.including: LatLngBounds biggerRegion = region.including(new LatLng(...));

Categories : Android

kinect region Use it on popup
You could try a different binding method: //.. Bind the sensor to your KinectRegion - kurs var regionSensorBinding = new Binding("Kinect") { Source = kurs }; BindingOperations.SetBinding(kurs, KinectRegion.KinectSensorProperty, regionSensorBinding); This would be done in your code behind section. Should you want to clear this binding: //.. Clear your region binding BindingOperations.ClearBinding(kurs, KinectRegion.KinectSensorProperty); Just some advice, bind to your region after you have determined that the current sensor is not null.

Categories : C#

How can I know when text overflows from one CSS region to another?
If you are using jQuery you can compare the scroll width with the divs width and then create more divs. if ($('.region')[0].scrollWidth > $('.region').width()) { //Text has over-flowed, create another div }

Categories : CSS

Resize an Image's Particular Region
Try adding a div around the image area like so (with what ever class you want, i called it white_background: <div class="white_background"> <div class="center" id="portholes"> <div class="redband" id="portholes_band"></div> <img class="center" id="cutout" src="/css/images/phole_opaque.png" width="960" height="165" style="margin-left: auto; margin-right: auto;"> </div> </div> Then just define that class as: .white_background{ width:100%; padding:0px; margin:0px; background:#FFFFFF; }

Categories : Javascript

findoverlap region with some condition
Here's your data a <- read.csv(textConnection( "Sample, start, stop, event, probe, length, length/probe, region CNV1234, 2000, 3000, CN gain, 23, 235, 9, intron CNV1534, 1200, 1800, CN loss, 60, 600 10, exon")) b <- read.csv(textConnection( "Sample, start, stop, event, probe, length, length/probe, region CNV234, 2500, 3500, CN gain, 23, 235, 9, exon CNV34, 1200, 1800, CN loss, 60, 600 10, intron")) Load the GenomicRanges package (I'm assuming that your data actually come from several chromosomes, and you'd like to do this across all; "A" is a chromosome name) library(GenomicRanges) gr1 <- with(a, GRanges("A", IRanges(start, stop - 1L), Sample=Sample, event=event)) gr2 <- with(b, GRanges("A", IRanges(

Categories : R

Does region.contains() include the boundaries?
You should just follow WarrenFaith's comment. But anyways, the Region created will contain the boundary points. As the reference reads if the region contains the point. The boundary is part of the point. Also you can see how the other methods and constructors work to make sure that this is true. https://android.googlesource.com/platform/frameworks/base/+/master/graphics/java/android/graphics/Region.java

Categories : Java

My confusion with region of interest
gca is a function which returns the handle to the current axes. Similarly, h_im is a handle to the image object created by imshow. You can read more about working with handles from Mathworks here. The number you see when examining handles is not related to the properties (size, etc) of the image - the value might have to do with type of object, but basically they're identifiers used by Matlab to keep track of open graphics objects. So when you call imellipse you're passing in a handle to the axes where the ellipse will appear, and returning another handle in e. e = imellipse(gca,[55 10 120 120]); Alternatively in place of gca you could use another handle pointing to a different axes. For example, if you had: a1 = subplot(1,2,1), h1 = imshow(img1) a2 = subplot(1,2,2), h2 = imshow(

Categories : Matlab

matrix region sum function
Range is function which iterates a sequence (low,high) exclusive of the 'high' element. If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates lists containing arithmetic progressions, e.g.: >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(5, 10) >[5, 6, 7, 8, 9] So, when you say range(A[0],D[0]+1) the lower limit is A[0] and the higher limit is D[0] in essence. So coming to the logic, its simple math. Area = integral ydx. A[0] and D[0] are the x coordinates of the top-left and the bottom-right coordinates respectively. A[1] and D[1] are the y coordinates. So, you are iterating the matrix from D[0]+1 to A[0] (which is dx) along the strip represented by (D[1]+1 to A[1]) which evalu

Categories : Python

Get HostControl from region in PRISM
Are you adding the RegionBehavior manually or do you register it in the bootstrapper in ConfigureDefaultRegionBehaviors? It seems that if you add a behavior manually like this: IRegion region = regionManager.Regions["MyRegion"]; region.Behaviors.Add("MyBehaviorKey", new MyBehavior()); the IHostAwareRegionBehavior interface has no effect. If you look at the PRISM source code in RegionBehaviorCollection.cs (Prism.Dektop.Regions) you'll clearly see that the Add method does not do anything related to the IHostAwareRegionBehavior interface. However in RegionAdapterBase.cs, the interface is checked for in AttachDefaultBehaviors. I ended up registering my RegionBehavior in the bootstrapper and checking the region name to see if there is work to be performed. Not very clean, but it works.

Categories : C#

Marionette View and Region
In backbone, you typically render your views to display information and react to the environment. What you're looking to do seems like progressive enhancement: reuse the HTML rendered by the server, and attach Backbone event handlers, etc. to the exisiting DOM. Take a look at this blog post series covering this topic: http://lostechies.com/derickbailey/2011/09/26/seo-and-accessibility-with-html5-pushstate-part-1-introducing-pushstate/ Part 2 contains the code snippets you're looking for: http://lostechies.com/derickbailey/2011/09/26/seo-and-accessibility-with-html5-pushstate-part-2-progressive-enhancement-with-backbone-js/

Categories : Javascript

error: can't allocate region in iOS
You should really not make date calculation based on some assumption that a month is 28 days or even that a minute is 60 seconds. Instead of dateByAddingTimeInterval: use NSCalendar's dateByAddingComponents:toDate:options: NSDateComponents *sixMonthComponents = [[NSDateComponents alloc] init]; sixMonthComponents.month = 6; NSCalendar *currentCalendar = [NSCalendar currentCalendar]; NSDate* scheduleEndDate = [currentCalendar dateByAddingComponents:sixMonthComponents toDate:scheduleStartDate options:0]; EDIT: From what I understand, you want to add a time interval to your array for every ~14 days (a half month as you defined a month to be 28 days). To be more robust, I'd do something like this (not tested but should work, let me know): // We increment i with the total interval between

Categories : Iphone

Getting different javascript date in different region
If you're in another region, then perhaps the default format in the second region isn't yyyy/MM/dd but yyyy/dd/MM. To avoid this problem, try this: var date = new Date(2012, 11, 1); alert(date); Hope this helps. [EDIT] The Month parameter should be from 0 to 11 (0 is January and 11 is December), according to the Date() specification.

Categories : Javascript

replace a region with whitespace
you could try: ver- to replace selected part with - same, if you want to replace / fill the "region" with space, you do: verspace

Categories : Vim

Find My Instance Region in AWS
This should work for you: REGION=`curl http://169.254.169.254/latest/dynamic/instance-identity/document|grep region|awk -F" '{print $4}'` echo $REGION It's from this thread: Find region from within EC2 instance

Categories : PHP

Can the S3 SDK figure out a bucket's region on its own?
As stated in the documentation, The path-style syntax, however, requires that you use the region-specific endpoint when attempting to access a bucket. In other words, with path style access, you've to tell to the SDK in which region is the bucket, it doesn't try to determine it on its own. Performance wise, there should not be a difference.

Categories : Java

How can I get the GPS traces within a region from OpenStreetMap (OSM)?
The (editing) API supports a query for retrieving GPS traces in a given area. Each page returns a maximum of 5,000 points so you may have to make several calls for retrieving all of them. Don't forget to read the terms of use and the usage policy. This API is not suited for running bulk queries! If you don't know the bounding box of the city you want to query, you can use Nominatim to geolocate it.

Categories : Misc

aws s3 sdk for iOS putObjectRegquest to "new" region not working
I am one of the maintainers of the AWS SDK for iOS. I'm sorry you're encountering difficulties. If your bucket name contains non alpha numeric characters you may need to set the endpoint of the Amazon S3 client to the region of your bucket. AmazonS3Client *s3 = [[AmazonS3Client alloc] initWithCredentialsProvider:provider]; s3.endpoint = [AmazonEndpoints s3Endpoint:AP_SOUTHEAST_1]; You can also turn on verbose logging in your application to see the raw responses from the service while using the SDK. If you do see errors coming back that are not being captured, please let us know. [AmazonLogger verboseLogging]; A couple things I will note about your code that you may also want to consider: Once the bucket is created, you no longer need to call create bucket. You may want to consi

Categories : IOS

Java impassable region
I think you just need to clarify to yourself what the behaviour of a mouse hitting a wall would be, in terms of coordinates. Hopefully this terrible image helps; Whenever the mouse moves, you want to check if it's in the forbidden region (the region beyond the wall; the no man's land). To do this, just check if the x coordinate (assuming a horizontal wall in this example) of the mouse is beyond its limit (the x coordinate of the wall). If it is, move the mouse back to the wall, preserving its y value (set its x coordinate to that of the wall) FOR A CAGE: The case of having a surrounding, square wall is a little bit more complicated, in terms of where to place the mouse when breaching the wall. Observe that there are 8 different regions to consider where the mouse could enter the 'forb

Categories : Java

C++11 3.3.1p4 - Declarations in same declarative region?
They are not in the same single declarative region. The declarative region of the inner i is limited to within the innermost braces. In fact 3.3.1/2 has code remarkably similar to your own: int j = 24; int main() { int i = j, j; j = 42; } In that, the j used to set i is the 24 one but the scope of that outer j stops after the , and restarts at the }. Those two j variables are distinct despite the fact they're in the file declarative region for the same reasons as your example: the re are two declarative regions. Since there is not a single declarative region, scope takes control. C++11 3.3.1/1 states (my bold): Every name is introduced in some portion of program text called a declarative region, which is the largest part of the program in which that name is valid, that is,

Categories : C++

Get Phone region name programatically
Try Telephony Service. TelephonyManager telman=(TelephonyManager) getSystemService(TELEPHONY_SERVICE); a lot of info can retrieve as, telman.getNetworkOperatorName(); telman.getSimSerialNumber(); telman.getLine1Number(); telman.getSubscriberId(); etc. There is a method, telman.getCellLocation(); . I didn't try it yet, may be you can try.

Categories : Android

How do i edit the region setting in Azure
If you're asking how to edit your existing Cloud Service, Database, and Storage accounts currently in 'South East Asia' so that they're in another region, for example 'East US', then you can't do that by a simple edit. You would need to create the services and deploy the relevant code and data to the new region.

Categories : Asp Net



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.