I am using Visual Studio 2015 and the theme color extention (light color) and don't like the theme tab dark colors: I would like to have something more lighter tabs like this: How can I change it? Thanks in advance. 2 AnswersAnswers 1 Finally I found the cause of the colorized tags. It happend because of a Productivity Power Tools extension. All I need to do is to go to: Tool -> Opthions -> Productivity Power Tools...
Sunday, July 31, 2016
How to add a class to the corresponding popup
I have got two div's <div id="one"> and <div id="two"> Each div has got a button class named addonsBtn , when clicked on that it will open a popup and append data to the corresponding popup If clicked on First Addon , is it possible to add class by name 'foroneclass' so that it looks this way <div data-role="popup" id="addonsWrap789" class='foroneclass' data-theme="a"> </div> Similarly If clicked on Second Addon , is it possible to add class by name 'fortwolass' so that it looks this way...
Scikit-learn SVM digit recognition
I want to make a program to recognize the digit in an image. I follow the tutorial in scikit learn . I can train and fit the svm classifier like the following. First, I import the libraries and dataset from sklearn import datasets, svm, metrics digits = datasets.load_digits() n_samples = len(digits.images) data = digits.images.reshape((n_samples, -1)) Second, I create the SVM model and train it with the dataset. classifier =...
How to secure REST API for SPA and Mobile App using Cordova
I've done a lot of research on "best practices" surrounding this and have read blog post after blog post, SO question after SO question, and OWASP article after OWASP article. I've arrived at a few clear answers but some unknowns. First, the "Do's": Use JWT for authorizing users on my REST API [1] [2] Store the JWT in a HTTPOnly/Secure cookie and build in CSRF protection. Do NOT store in HTML5 local storage [3] [4] [5] (Actually, this point is debatable, is it easier to protect against XSS or CSRF? [6]) Verify the signing...
Stream audio from PC to smartphones?
For Christmas 2016, me and my dad want to do a Lightshow for our neighborhood with lights and music. We have the lights set up, but the music is a problem. We don't want to put huge speakers in our garden because that would be very annoying for our densely populated neighborhood. So, we came up with this concept: The computer (Windows 7) handles the lights with a sequencer from Light-o-rama. Now my question is: How can I stream...
Lifecycle events on ReactCSSTransitionGroup's component?
Is there a way to get notified of transition lifecycle events on a ReactCSSTransitionGroup's parent component? For example, if I have the following: <ReactCSSTransitionGroup transitionName={transitionNames} transitionEnterTimeout={250} transitionLeaveTimeout={250} component={MyParent}> ... </ReactCSSTransitionGroup> I'd like MyParent to accept either lifecycle events, or an isTransitioning-like prop, so that I can (for example) render a different className based on whether a transition...
Saturday, July 30, 2016
Angular2 - Fire event on Leaflet-Event
I am trying to impement Leaflet with Angular 2 TS for my Ionic 2 app. I want to emit my pinClicked-event when a Leaflet-pin was clicked. How to do this? In Angular1 $scope.$apply was the solution... private refreshMarkers() { L.marker([40.731253, -73.996139]) .addTo(this.map) .on('click', function() { alert('JA'); } ); } private pinWasClicked() { this.pinClicked.emit(''); } 0 Answe...
Android Expandable RecyclerView different Card height
I have a RecyclerView that contains a list of cards, each of which expand into child cards. Each card has different text. I want that when the user clicks on a child card, it will expand to show the text inside. The expansion height is based on how much text the card contains. I tried to measure the target height by using: view.Measure(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent); And then expanding the card to the Measured Height (see here). However, it gives the same Measured Height...
Link to street view URL using address?
Is it possible to link directly to street view from an URL using only the address (and not lat/lng)? For example, is there a way to do something like http://maps.google.com/maps?q=&layer=c&address=Street,number,state&cbp=11,0,0,0,0 Instead of http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=11,0,0,0,0 ? Lat/lng from geocoding tends to not be recognized by street view as being too far from a street, sometimes getting the wrong street altogether. I have looked everywhere...
Friday, July 29, 2016
Path in PartialView method ( to share them between applications)
I want to share some Partial View between some applications. I tried different solutions which are suggested in internet, but none of them not work! But I hope by using absolute or relation path in PartialView method it works but I don't know is it possible or no. So there are 2 questions here: If I create a common project in my solution as a sub domain, can I use a URL of it in other project's PartialView method? If I create common...
Error messages when trying to use the Facebook API
I am getting an error message when attempting to use the Facebook API. When I have Client OAuth Login enabled, Web OAuth Login enabled and a valid Oauth redirect URI set to http://localhost:8000/ the error I get is this when trying to log into Facebook with the correct App ID: URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are...
How to fade in an image that gets set dynamically with Angular?
I am using Anuglar to set an image that will be used as a background image for my page. Currently, the image loads from top to bottom and it doesn't look great. I'd like to fade in the image (or even load the image from a blurry view to the actual image). Anything other than loading from top to bottom. Any advice on how to do this? I see other posts that show to use javascript/jquery, but I'm not sure how to integrate it into my Angular code. Template <body ng-controller="MainCtrl" ng-style="heroImage"> //rest...
Thursday, July 28, 2016
Can I check devices location is open or close on React Native
Can I check devices location is open or close before using geolocation? I want to show alert message like App need to run your location, please open your devices location, when devices location is close. Can I navigate to go native location setting both IOS and Android? Like example - componentDidMount() { // Check condition device location is open or close. if( DevicesLocation === 'close' ) { alert('App need to run your location, please open your devices location'); // other process } else { navigator.geolocation.getCurrentPosition(...
Memory usage in LibGdx
I am in the middle of a huge application in a team of developers and the memory is something to consider early on. When I run the program as it is, it takes about 44 MB of memory (Found from the Task manager). I then create 10,000 bodies. The memory usage is now about 83 MB. I have a method to destroy the bodies when I click space, this is how it looks. public static void disposeAllBodies(){ Array<Body> bodies = new Array<Body>(); world.getBodies(bodies); int destroyCount = 0; System.out.println("Attempting...
Intellij Scala class definition formatting
How can I get Intellij format my Scala class definition like this: sealed class Traffic( private[this] val javaTraffic: Traffic.JavaTraffic, private[this] val sanitizer: Sanitizer) extends Serializable with Logger { Basically 4 indents for member declaration on each line, and 2 indents for class inheritance. 0 Answe...
Update Xcode build progress bar when using run script
In Xcode you can specify custom scripts to build your applications. I have a project which makes extensive use of these. For instance, one target builds the simulator versions (both 32bit and 64bit) and the ARM version as well as documentation and then bundles up the generated static library into a framework along with some other files Running the above code can take a couple of minutes. Normally when you build, Xcode has a progress...
Wednesday, July 27, 2016
viewcontroller using a NULL baseURL argument with the loadHTMLString baseURL method : data theorem
I am facing the problem "MyViewcontroller using a NULL baseURL argument with the loadHTMLString baseURL method : data theorem"- i have successfully completed my task and all are working fine. The Issue was in the OSWAP security scan for vulnerability it shows the above error. My code snippet:- NSString *aHtmlString = kEmptyString; // Getting the bool from configuration plist NSString *thePlistPath = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"plist"]; NSDictionary *theURLdata = [[NSDictionary...
How to use “Term of Use” in Popup
I want to customize the term of use in popup, when a user login for first time that page should appear in popup. 2 AnswersAnswers 1 To set the terms of use you will need to do 2 things. First you'll need to create a Web Content Article. Go to the Control Panel. Select "Web Content". Then Add > "Basic Content". Enter in your desired Terms of Use language. Write down the ID and the Group ID you've created the content. Note: The ID is available when you're viewing the content's page but the group ID is less obvious....
Tuesday, July 26, 2016
Amazon and multi customer support in shared multi-tenant model
Are there any ready services (by amazon or partners) that help you manage multi-customer aspects of a "pool" [1][2] type service - where all the multi-tenancy is handled by internal context switching, databases are shared, etc. AWS tools (marketplace, billing manager) seems to be geared toward "provision new service / host by customer" while what I'm looking for is the customer and license management, user association, authentication (including federated authentication integration with multiple customer portals) and perhaps...
OpenCV Matching Exposure across images
I was wondering if its possible to match the exposure across a set of images. For example, lets say you have 5 images that were taken at different angles. Images 1-3,5 are taken with the same exposure whilst the 4th image have a slightly darker exposure. When I then try to combine these into a cylindrical panorama using (seamFinder with: gc_color, surf detection, MULTI_BAND blending,Wave correction, etc.) the result turns out with a big shadow in the middle due to the darkness from image 4. I've also tried using exposureCompensator...
Monday, July 25, 2016
Async callback is called but not executed sometimes
Silverlight project. In my View code behind, I call a method in the View Model to get value. public MyViewModel ViewModel { get { if (this.viewModel == null) this.viewModel = new MyViewModel(); return this.viewModel; } set { if (this.viewModel != value) { this.viewModel = value; } } } However the async callback is not called. Sometimes it is called by delay. Thus I get...
Nginx location blocks factcgi php inheritance issue
I have a configuration file which reads a little like the below. I have a mediawiki installation under the subfolder /wiki/ represented by its location block. I then have a default location / which serves the main part of the site. I have an embedded .php catch in the /wiki/ location block which seems to work. However, I have a legacy requirement in the default .php block to auto_prepend a file. When making calls to /wiki/ this file is loaded. I presume because nginx is somehow falling into that block. Can someone explain...
Sunday, July 24, 2016
Share Authentication Across Secure and Nonsecure
I am in the situation where the site I am working on, the manager wants to allow the user to log in and not worry if they logged in through http or https. Based on another SO question (how can I share an asp.net session between http and https) I thought this would be possible if I set secure = false on the cookie. To add to this, we use a subdomain for the secure part of the site. So for http we use site.com, while https uses secure.site.com. So I tried setting the domain for the authentication in the web.config. <authentication...
Why async methods call sooner in Retrofit 2?
As you can see in the code below, I've call the getPostByPageId() method to get data from server and then check if the data was returned back, I do other jobs. private void recyclerViewJobs() { getPostByPageId(); if (pageDtoList.size() > 0) { emptyText.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); PagesAdapter adapter = new PagesAdapter(pageDtoList, context); recyclerView.setAdapter(adapter); recyclerView.setLayoutManager(new LinearLayoutManager(context));...
Saturday, July 23, 2016
Nice Drag and drop on a canvas HTML5
I try to implement a nice drag and drop on a canvas representing 3 disks. I would like to change with mouse the position of each mass. My main problem is that I am constrained by the length of axe for each of these 3 spheres. For the moment, I have implemented the following function when mouse is moving inside the canvas ( value of indexMass indicates which mass is moved : 1, 2 or 3 and t1, t2, t3 represents respectively the angle of mass 1, 2, 3 ) : // Happens when the mouse is moving inside the canvas function myMove(event)...