Posts

Can I Play Guitar Hero Or Rock Band On My PC?

Answer : Several of the Guitar Hero games have been released for Windows and Mac, including Guitar Hero III, Guitar Hero: World Tour and Guitar Hero: Aerosmith, and USB-based instruments should work natively with them. None of the Rock Band games have been released for PC, however, and intercompatibility is generally bad. Try Frets on Fire for a free and open source Guitar Hero-style game which works with all the console instruments. For full details, drivers, and the like, see the Frets on Fire Wiki page on using Guitar Hero and Rock Band controllers. Many of the Guitar Hero and Rock Band series songs have been converted for use with Frets on Fire, and there is an enormous base of user-created content: see the wiki for details on available song packs. Performous is a nice alternative for Guitar Hero/Rock Band on the PC. Open source, compatible with GH and RB instruments, most of console games' songs are available as packs on the net, some game features are already implemente...

Bundle Install Could Not Find Compatible Versions For Gem "bundler"

Answer : Alternatively, you can also remove bundler 2.x completely and only use Bundler 1.x: gem uninstall bundler -v ">= 2.0" gem install bundler -v "< 2.0" # Now you can use bundler as before bundle install Try to use gem install bundler -v 1.17.3 bundle _1.17.3_ install Your bundler gem is too big. You can downgrade for now by changing your gemfile to specify the lower version, and deleting the lock file again. gem 'bundler', '1.17.1' Then try these commands in the terminal gem install bundler -v 1.17.1 gem uninstall bundler -v 2.0.1 bundle update --bundler bundle install That last install command might be redundant. I'm on my phone so I can't test anything unfortunately. Best of luck! EDIT: This is now a Heroku issue. Got it. Heroku docs regarding Bundler Libraries The following libraries are used by the platform for managing and running >Ruby applications and cannot be specified. For application dependenc...

Building With Lombok's @Slf4j And Eclipse: Cannot Find Symbol Log

Answer : You also have to install Lombok into Eclipse. See also this answer on how to do that or check if Lombok is installed correctly. Full Disclosure: I am one of the Project Lombok developers. I got the same error even after Lombok was installed. For me the solution was to add another lombok annotation (i used @Data) to my class after which the eclipse errors went away. Perhaps this force refreshed some cache. Of course, I simply deleted the @Data annotation afterwards. I also faced the similar issue on log and @Slf4j on my STS environment. To resolve this, here is what I did on spring tool suite (sts-4.4.0.RELEASE) and lombok-1.18.10.jar (current latest version available in mavenrepository). If having maven project, ensure lombok dependency added to it. Else you need manually add the jar to your project classpath. <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifa...

Calculate Exponential Moving Average In Python

Answer : EDIT: It seems that mov_average_expw() function from scikits.timeseries.lib.moving_funcs submodule from SciKits (add-on toolkits that complement SciPy) better suits the wording of your question. To calculate an exponential smoothing of your data with a smoothing factor alpha (it is (1 - alpha) in Wikipedia's terms): >>> alpha = 0.5 >>> assert 0 < alpha <= 1.0 >>> av = sum(alpha**n.days * iq ... for n, iq in map(lambda (day, iq), today=max(days): (today-day, iq), ... sorted(zip(days, IQ), key=lambda p: p[0], reverse=True))) 95.0 The above is not pretty, so let's refactor it a bit: from collections import namedtuple from operator import itemgetter def smooth(iq_data, alpha=1, today=None): """Perform exponential smoothing with factor `alpha`. Time period is a day. Each time period the value of `iq` drops `alpha` times. The most recent data is the most valuable one. ...

Ant Design Responsive NavBar

Image
Answer : I was looking at this question in a decision to pick Ant design for a project. Responsive navbar is common scenario, but I was wondering why there is no such thing in Ant Design? Then I searched for issues in the repo and found the Ant Design Mobile as a comment to an issue. They have a separate package for mobile devices. Inside Ant Design Mobile there is separate section for web components. In that section you can find a Menu component which is suitable for mobile devices hamburger icon. Hope this will be helpful for future readers. I was looking for such functionality not long ago as well and in order to make Ant Menu responsive, I have written a simple React Component. This Component accepts Ant Menu markup as a prop and conditionally renders the Menu based on the viewport width, either as is (for desktop), or in a Popover component which will wrap passed menu markup (for mobile). I'm including screenshots of how it may look once the viewport is narrow en...

Absolute Value Matlab Code Example

Example: absolute value of a matix The absolute value sign in a matrix means the determinant (ad-bc)

20 Minutes Alarm Code Example

Example 1: 20 minute timer for good eyesight every 20 minutes look out the window at something 20 feet away for 20 seconds Example 2: 20 minute timer For the 20/20/20 rule you can also close your eyes for 20 seconds and get the same results because it relaxes the mucles in your eyes.

Adding A Delay Without Thread.sleep And A While Loop Doing Nothing

Answer : Something like the following should give you the delay you need without holding up the game thread: private final long PERIOD = 1000L; // Adjust to suit timing private long lastTime = System.currentTimeMillis() - PERIOD; public void onTick() {//Called every "Tick" long thisTime = System.currentTimeMillis(); if ((thisTime - lastTime) >= PERIOD) { lastTime = thisTime; if(variable) { //If my variable is true boolean = true; //Setting my boolean to true /** *Doing a bunch of things. **/ //I need a delay for about one second here. boolean = false; //Setting my boolean to false; } } } long start = new Date().getTime(); while(new Date().getTime() - start < 1000L){} is the simplest solution I can think about. Still, the heap might get polluted with a lot of unreferenced Date objects, which, depending on how often you get to create such a pseudo-dela...

Async Arrow Function Example

Example 1: async arrow function const foo = async ( ) => { // do something } Example 2: javascript async await arrow function Async arrow functions look like this : const foo = async ( ) => { // do something } Async arrow functions look like this for a single argument passed to it : const foo = async evt => { // do something with evt } Async arrow functions look like this for multiple arguments passed to it : const foo = async ( evt , callback ) => { // do something with evt // return response with callback } The anonymous form works as well : const foo = async function ( ) { // do something } An async function declaration looks like this : async function foo ( ) { // do something } Using async function in a callback : const foo = event . onCall ( async ( ) => { // do something } ) Example 3: async await arrow function YourAsyncFunctionName = async ( value ) ...

Arduino Uno Pinout Code Example

Example: arduino pinMode pinMode(Pin_number, State); ex: pinMode(2, HIGH);

Add Semantic Ui Cdn To React Code Example

Example: semantic-ui cdn < link rel = " stylesheet " href = " https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css " >

Bootstrap Font Awesome Info Icon Code Example

Example 1: fa fa-info-circle < i class = " fa fa-info-circle " > </ i > Example 2: font awsome circle info icon fa-info-circle

Autohotkey How To Loop Code Example

Example: loop autohotkey Loop, 4 { ;this loops 4 times MsgBox, This is a messagebox ;shows a messagebox } ;closes the loop

Check First Radio Button With JQuery

Answer : If your buttons are grouped by their name attribute, try: $("input:radio[name=groupName][disabled=false]:first").attr('checked', true); If they are grouped by a parent container, then: $("#parentId input:radio[disabled=false]:first").attr('checked', true); $("input:radio[name=groupX]:not(:disabled):first") This should give you the first non-disabled radio-button from a group... The below does what you want: $(document).ready( function(){ $('input:radio:first-child').attr('checked',true); } ); Demo at: JS Bin.

CircleCI - Different Value To Environment Variable According To The Branch

Answer : The question is almost 2 years now but recently I was looking for similar solution and I found it. It refers to CircleCI's feature called Contexts (https://circleci.com/docs/2.0/contexts/). Thanks to Contexts you can create multiple sets of environment variables which are available within entire organisation. Then you can dynamically load one of the sets depending of workflows' filters property. Let me demonstrate it with following example: Imagine you have two branches and you want each of them to be deployed into different server. What you have to do is: create two contexts (e.g. prod-ctx and dev-ctx ) and define SERVER_URL environment variable in each of them. You need to log into CircleCI dashboard and go to "Settings" -> "Contexts". in your .circleci/config.yml define job's template and call it deploy : deploy: &deploy steps: - ... define workflows: workflows: version: 2 deploy: jobs: - dep...

Access Auth In Blade Laravel Code Example

Example 1: laravel auth composer require laravel / ui php artisan ui vue -- auth npm install && npm run dev Example 2: get user auth in laravel Auth :: user ( ) ; Example 3: laravel auth composer require laravel / ui : ^ 2.4 php artisan ui vue -- auth