This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This converts the custom tab view we created and injects it into the tab widget | |
tab = inflater.inflate(R.layout.tab, getTabWidget(), false); | |
// Mainly used to set the weight on the tab so each is equally wide | |
tab.setLayoutParams(params); | |
// Add some text to the tab | |
label = (TextView) tab.findViewById(R.id.tabLabel); | |
label.setText("HOME"); | |
// Show a thick line under the selected tab (there are many ways to show | |
// which tab is selected, I chose this) | |
divider = (TextView) tab.findViewById(R.id.tabSelectedDivider); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add another tab | |
tab = inflater.inflate(R.layout.tab, getTabWidget(), false); | |
tab.setLayoutParams(params); | |
label = (TextView) tab.findViewById(R.id.tabLabel); | |
label.setText("USERS"); | |
intent = new Intent(TabTutorialActivity.this, TabContentActivity.class); | |
intent.putExtra("content", "Content for USERS"); | |
spec = tabHost.newTabSpec("users").setIndicator(tab).setContent(intent); | |
tabHost.addTab(spec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Listener to detect when a tab has changed. I added this just to show | |
// how you can change UI to emphasize the selected tab | |
tabHost.setOnTabChangedListener(new OnTabChangeListener() { | |
@Override | |
public void onTabChanged(String tag) { | |
// reset some styles | |
clearTabStyles(); | |
View tabView = null; | |
// Use the "tag" for the tab spec to determine which tab is selected | |
if (tag.equals("home")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ConnectionFactory factory = new ConnectionFactory(); | |
Connection connection = factory.newConnection(); | |
Channel channel = connection.createChannel(); | |
channel.queueDeclare("registered-users", false, false, false, null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String message = "Hello World!"; | |
channel.basicPublish("users", "registered-users", null, message.getBytes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QueueingConsumer consumer = new QueueingConsumer(channel); | |
channel.basicConsume("registered-users", true, consumer); | |
while (true) { | |
QueueingConsumer.Delivery delivery = consumer.nextDelivery(); | |
String message = new String(delivery.getBody()); | |
System.out.println(" [x] Received '" + message + "'"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#widget").turnandzoom(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#widget").turnandzoom({ | |
'width': 200, | |
'height': 200, | |
'slider': { | |
'height': 20 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install unixodbc unixodbc-dev unixodbc-bin | |
sudo apt-get install freetds-dev | |
sudo apt-get install tdsodbc | |
sudo gem install activerecord-sqlserver-adapter | |
sudo apt-get install sqsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/odbc.ini | |
/etc/odbcinst.ini | |
/etc/freetds/freetds.conf |