How to add a custom payment gateway to Social Engine

I solved this by adding the payment code inside the Engine_Payment_Gateway_MyGateway class: Once the user confirms on the SocialEngine page that they want to pay, the method processTransaction() inside the mentioned class is called and the user is redirected to the PSP’s payment secure page. Once they are done with the payment, i.e. paid successfully … Read more

How to customize the tooltip of a Chart.js 2.0 Doughnut Chart?

You can customize the tooltips using the chart options tooltip configuration section, as explained here: http://www.chartjs.org/docs/latest/configuration/tooltip.html#tooltip-configuration As shown in the example code below, you can change things like color, sizing and styles. Check out the documentation linked above for a full list of configurable options. If you want to add the percentage to the tooltip … Read more

Android toggle button custom look

create toggle_selector.xml in res/drawable <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/toggle_on” android:state_checked=”true”/> <item android:drawable=”@drawable/toggle_off” android:state_checked=”false”/> </selector> apply the selector to your toggle button <ToggleButton android:id=”@+id/chkState” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:background=”@drawable/toggle_selector” android:textOff=”” android:textOn=””/> Note: for removing the text i used following in above code textOff=”” textOn=””

Customizing Keyboard Shortcuts in MySql Workbench

You can modify the main_menu.xml file (for me on Ubuntu 12.04 this was in /usr/share/mysql-workbench/data/). After you modify it, you’ll need to restart MySQL Workbench. It’ll look like this <value type=”object” struct-name=”app.MenuItem” id=”com.mysql.wb.menu.query.exec”> <link type=”object” key=”owner” struct-name=”app.MenuItem”>com.mysql.wb.menu.query</link> <value type=”string” key=”caption”>Execute (All or Selection)</value> <value type=”string” key=”name”>query.execute</value> <value type=”string” key=”command”>builtin:query.execute</value> <value type=”string” key=”itemType”>action</value> <value type=”string” key=”shortcut”>Modifier+E</value> … Read more

Jackson: How to add custom property to the JSON without modifying the POJO

Jackson 2.5 introduced the @JsonAppend annotation, which can be used to add “virtual” properties during serialization. It can be used with the mixin functionality to avoid modifying the original POJO. The following example adds an ApprovalState property during serialization: @JsonAppend( attrs = { @JsonAppend.Attr(value = “ApprovalState”) } ) public static class ApprovalMixin {} Register the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)