Slow Gradle build time in Android Studio when using libGDX

Follow the SO answer: http://stackoverflow.com/a/35859572/5539403

In Android Studio go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle

Check the ‘Offline work’ under ‘Global Gradle settings’

However, if it Gradle needs to get libraries from the Internet, turn off ‘Offline work’ and run it for first time, then turn the option on to speed up build process.

Creating additional series from same table column for Line graphs in SSRS

I spent quite a lot of time experimenting to be able to do this.

Say you have a table like so

KPI        Value    Date

Temp      34        …

Press      12         …

 

And you would like to have 2 lines in the line graph, one for temperature, one for pressure, the series for pressure may use the secondary y axis. The series for pressure may use a totally different chart type(column).

To do this, don’t add KPI as a series group, add Date as a category group and add Value twice as values.

for the first Value, use IIf(Fields!KPI.Value = “Temp”, sum(Fields!Value.Value, Nothing).

for the second Value, use IIf(Fields!KPI.Value = “Temp”, sum(Fields!Value.Value, Nothing).

Configure the second value to use secondary y axis and you’re done.

Using Ext JS proxy ajax writer

The default behaviour of Ext JS proxy ajax writer seems to be to always use POST. Whenever trying to create/update/delete a record, a JSON object will be sent to the server in the request payload through POST.

It might be possible to configure the proxy and writer to use other HTTP methods like PUT and DELETE, but I haven’t seen any documentation on this yet.

The Id field is always included. So there are 3 cases

  • When the request is to create/update the record, the fields with data will be included. Example: {“Id”:1, “Name”:”Tom”}. Using the Id the server can determine whether it’s a update or create request if a record with same Id already exists.
  • When deleting a record, only the Id is included in the JSON object. Example: {“Id”: 1}. The server can determine that it’s a delete request by checking the number of properties the JSON object has.

If the server is written in ASP.NET Web API, it’s important to read the request body and process it manually instead of using a parameter in the method and let the framework do the deserialization automatically, because then it will not be possible to count the number of properties the object original has, the deserialized object has all properties with default values for missing ones.

Differences between JSONP and JSON

Today I learned how Jsonp work, it basically makes use of HTML’s script tag to retrieve the JSON data from a different domain/origin.

The returned data is in the form of func({…}) where func is any function that can be defined before hand in the client. A script element will be added to the DOM that loads the data and execute it like any normal JavaScript file. Since there is no restriction imposed in the script element, it can load from any server in different domains/ports, unlike Ajax.

Basically it’s a hack. More details in the Stackoverflow answer: http://stackoverflow.com/a/2887218/5539403

Install Visual Basic 6 in Windows 7

Follow the StackOverflow answer here: http://stackoverflow.com/a/10501908/5539403

The steps are copied here in case link is dead

  • Before proceeding with the installation process below, create a zero-byte file in C:\Windowscalled MSJAVA.DLL. The setup process will look for this file, and if it doesn’t find it, will force an installation of old, old Java, and require a reboot. By creating the zero-byte file, the installation of moldy Java is bypassed, and no reboot will be required.
  • Turn off UAC.
  • Insert Visual Studio 6 CD.
  • Exit from the Autorun setup.
  • Browse to the root folder of the VS6 CD.
  • Right-click SETUP.EXE, select Run As Administrator.
  • On this and other Program Compatibility Assistant warnings, click Run Program.
  • Click Next.
  • Click “I accept agreement”, then Next.
  • Enter name and company information, click Next.
  • Select Custom Setup, click Next.
  • Click Continue, then Ok.
  • Setup will “think to itself” for about 2 minutes. Processing can be verified by starting Task Manager, and checking the CPU usage of ACMSETUP.EXE.
  • On the options list, select the following:
    • Microsoft Visual Basic 6.0
    • ActiveX
    • Data Access
    • Graphics
    • All other options should be unchecked.
  • Click Continue, setup will continue.
  • Finally, a successful completion dialog will appear, at which click Ok. At this point, Visual Basic 6 is installed.
  • If you do not have the MSDN CD, clear the checkbox on the next dialog, and click next. You’ll be warned of the lack of MSDN, but just click Yes to accept.
  • Click Next to skip the installation of Installshield. This is a really old version you don’t want anyway.
  • Click Next again to skip the installation of BackOffice, VSS, and SNA Server. Not needed!
  • On the next dialog, clear the checkbox for “Register Now”, and click Finish.
  • The wizard will exit, and you’re done. You can find VB6 under Start, All Programs, Microsoft Visual Studio 6. Enjoy!
  • Turn On UAC again

  • You might notice after successfully installing VB6 on Windows 7 that working in the IDE is a bit, well, sluggish. For example, resizing objects on a form is a real pain.
  • After installing VB6, you’ll want to change the compatibility settings for the IDE executable.
  • Using Windows Explorer, browse the location where you installed VB6. By default, the path is C:\Program Files\Microsoft Visual Studio\VB98\
  • Right click the VB6.exe program file, and select properties from the context menu.
  • Click on the Compatibility tab.
  • Place a check in each of these checkboxes:
  • Run this program in compatibility mode for Windows XP (Service Pack 3)
    • Disable Visual Themes
    • Disable Desktop Composition
    • Disable display scaling on high DPI settings
    • If you have UAC turned on, it is probably advisable to check the ‘Run this program as an Administrator’ box

After changing these settings, fire up the IDE, and things should be back to normal, and the IDE is no longer sluggish.