Thursday, September 28, 2017
SwipeRefreshLayout work with RecyclerView
SwipeRefreshLayout work with RecyclerView

Last two post show "Simple example of using SwipeRefreshLayout" and "SwipeRefreshLayout, refresh in background thread", target to ListView.
This example show how SwipeRefreshLayout work with RecyclerView (reference: step-by-step of using RecyclerView).
To use RecyclerView in your Android Studio project, you have to Add Support Libraries of RecyclerView as dependencies.

Create layout/layout_item.xml, to define the layout of RecyclerView item.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_orientation="vertical">
<TextView
android_id="@+id/item_text"
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_textSize="28dp"/>
</LinearLayout>
Create a new class, RecyclerViewAdapter.java.
package com.blogspot.android_er.androidswiperefresh;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ItemHolder>{
private List<String> itemsList;
private OnItemClickListener onItemClickListener;
private LayoutInflater layoutInflater;
public RecyclerViewAdapter(Context context){
layoutInflater = LayoutInflater.from(context);
itemsList = new ArrayList<String>();
}
@Override
public ItemHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = layoutInflater.inflate(R.layout.layout_item, parent, false);
return new ItemHolder(itemView, this);
}
@Override
public void onBindViewHolder(ItemHolder holder, int position) {
holder.setItemText(itemsList.get(position));
}
@Override
public int getItemCount() {
return itemsList.size();
}
public void setOnItemClickListener(OnItemClickListener listener){
onItemClickListener = listener;
}
public OnItemClickListener getOnItemClickListener(){
return onItemClickListener;
}
public interface OnItemClickListener{
public void onItemClick(ItemHolder item, int position);
}
public void add(int location, String iString){
itemsList.add(location, iString);
notifyItemInserted(location);
}
public void set(int location, String iString){
itemsList.set(location, iString);
notifyItemChanged(location);
}
public void clear(){
itemsList.clear();
notifyDataSetChanged();
}
public static class ItemHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
private RecyclerViewAdapter parent;
TextView textItemText;
public ItemHolder(View itemView, RecyclerViewAdapter parent) {
super(itemView);
itemView.setOnClickListener(this);
this.parent = parent;
textItemText = (TextView) itemView.findViewById(R.id.item_text);
}
public void setItemText(CharSequence itemString){
textItemText.setText(itemString);
}
public CharSequence getItemText(){
return textItemText.getText();
}
@Override
public void onClick(View v) {
final OnItemClickListener listener = parent.getOnItemClickListener();
if(listener != null){
listener.onItemClick(this, getAdapterPosition());
}
}
}
}
Modify layout/activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_layout_width="match_parent"
android_layout_height="match_parent"
android_padding="16dp"
android_orientation="vertical"
tools_context="com.blogspot.android_er.androidswiperefresh.MainActivity">
<TextView
android_layout_width="wrap_content"
android_layout_height="wrap_content"
android_layout_gravity="center_horizontal"
android_autoLink="web"
android_text="http://android-er.blogspot.com/"
android_textStyle="bold" />
<Button
android_id="@+id/clearall"
android_layout_width="match_parent"
android_layout_height="wrap_content"
android_text="Clear All"/>
<android.support.v4.widget.SwipeRefreshLayout
android_id="@+id/swiperefreshlayout"
android_layout_height="match_parent"
android_layout_width="match_parent">
<android.support.v7.widget.RecyclerView
android_id="@+id/myrecyclerview"
android_layout_width="match_parent"
android_layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
MainActivity.java
package com.blogspot.android_er.androidswiperefresh;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import java.text.DateFormat;
import java.util.Date;
public class MainActivity extends AppCompatActivity implements RecyclerViewAdapter.OnItemClickListener{
SwipeRefreshLayout swipeRefreshLayout;
Button btnClearAll;
private RecyclerView myRecyclerView;
private LinearLayoutManager linearLayoutManager;
private RecyclerViewAdapter myRecyclerViewAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
swipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.swiperefreshlayout);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refresh();
}
});
btnClearAll = (Button)findViewById(R.id.clearall);
btnClearAll.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//In order to prevent the racing condition of updating removed item in refreshing,
//disable "Clear All" if refreshing
if(!swipeRefreshLayout.isRefreshing()){
myRecyclerViewAdapter.clear();
}
}
});
myRecyclerView = (RecyclerView)findViewById(R.id.myrecyclerview);
linearLayoutManager =
new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
myRecyclerViewAdapter = new RecyclerViewAdapter(this);
myRecyclerViewAdapter.setOnItemClickListener(this);
myRecyclerView.setAdapter(myRecyclerViewAdapter);
myRecyclerView.setLayoutManager(linearLayoutManager);
}
private void refresh(){
final int pos = myRecyclerViewAdapter.getItemCount();
myRecyclerViewAdapter.add(pos, "Refreshing...");
swipeRefreshLayout.setRefreshing(true);
//refresh long-time task in background thread
new Thread(new Runnable() {
@Override
public void run() {
try {
//dummy delay for 2 second
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//update ui on UI thread
runOnUiThread(new Runnable() {
@Override
public void run() {
String currentDateTime =
DateFormat.getDateTimeInstance().format(new Date());
myRecyclerViewAdapter.set(pos, pos + " - " + currentDateTime);
swipeRefreshLayout.setRefreshing(false);
}
});
}
}).start();
}
@Override
public void onItemClick(RecyclerViewAdapter.ItemHolder item, int position) {
Toast.makeText(this,
position + " : " + item.getItemText(),
Toast.LENGTH_SHORT).show();
}
}
download file now
Wednesday, September 27, 2017
Suspects Associated with Beach Hotel Attack Arrested by Tunisia
Suspects Associated with Beach Hotel Attack Arrested by Tunisia
Finally the hand of the Law have caught up with the Suspects Associated with Beach Hotel Attack in Tunisia
SOUSSE, Tunisian authorities have rounded up group of suspects associated with the gunman who killed
39 people, mainly British tourists, in an attack on a beach hotel, the interior Minister said on Monday.
Islamic State has claimed responsibility for last Friday s attack on the Imperial Marhaba hotel in the resort town of Sousse. The gunman, Saif Rezgui, was shot dead by police.
Interior Minister Najem Gharsalli did not give further details of the arrests. He said officials also were still verifying whether the attacker had been trained in neighboring Libya in jihadist camps.
The minister of Tunisia with Ministers from Britain, France, Germany have said that they will surely find all those involve whether logistical support or not
The number of Britons confirmed killed by the Islamist gunman in Friday s attack has risen to 18 from 15 and the final death toll of Britons is likely to increase to around 30 people, a British spokeswoman said.
Thousands of tourists have left Tunisia since Friday s attack, which has shocked a country that relies heavily on tourism for jobs and foreign currency revenues. To know the full detail of what happen previous click here
download file now
Tuesday, September 26, 2017
Stream MP3 with VLC
Stream MP3 with VLC
1. Download VLC 0.9.8a from http://www.videolan.org/. It can be used as both a server and a client.
2. On the server computer, lauch VLC. Go to Media->streaming.
- Pick up a MP3 file. It can contain Chinese characters.
- On the Stream Output page, check RTP in the Outputs section; fill address with the IP of the client computer
- Click Stream button at the bottom right.
3. On the client computer, lauch VLC. Go to Media->Open Network; select RTP for Protocol, fill Address with the IP of the client computer; click Play at the bottom right.
Note: WMA files cannot be streamed in this way.
download file now
Sunday, September 24, 2017
Stream Video with VLC
Stream Video with VLC
The procedure is the exactly same as MP3 except one point: in the Stream Output window, in the profile section, you need to select MPEG-TS.
If you can only hear the sound, try to select MPEG-4 from the Video Codec tag in the profile section.
Because of the big size of video files, wireless internet connection leads to choppy video and is thus not recommended. Use network cable.
download file now
Saturday, September 23, 2017
String extracts in Perl with split match and regular expressions
String extracts in Perl with split match and regular expressions
Lately I had to solve the following issue:
extract process id (pid) and program name from the header line of pmap.
The strings can take these forms from simple to complex:
123: cmd 123: cmd -x foo 123: /usr/bin/cmd 123: /usr/bin/cmd -x fooand more complex with more parameters which are trickier to parse
123: /usr/bin/cmd -x /home/foo 123: /usr/bin/cmd -x 456: -d /home/fooi.e. very genereally speaking there is a pid followed by a colon and then a more or less complex command line where the program name can be fully qualified and carry a number of parameters. The last example deliberately introduces the digit and colon again as parameters.
Here is a try to express the string more verbally as a sequence of
There a various solutions to this in Perl and here Ill show two.
# Example string $str = "123: /usr/bin/cmd -x /home/foo"; # ^ should be a tab here # First I split the string using an optional colon :* # and a sequence of white space s+ as field delimiters. # This will give me the pid and the program name and strip of the parameters ($pid,$cmd) = split /:*s+/,$str; # In case of a fully qualified program nane # everything up to the last slash needs to be removed $cmd =~ s/.*///; print "pid = $pid X cmd = $cmd ";
Always looking for more concise code I wondered whether these two lines couldnt be shortened. Here is a one liner which requires explanation of course.
# Example string $str = "123: /usr/bin/cmd -x /home/foo"; # ^ should be a tab here # I try to match the following reqular expression # a sequence of digits (d+) which will become $1 if successful # a colon and a tab # an optional sequence of characters ending in slash (S+/)* # which will become $2 # a sequence of characters (S+) which will become $3 # The remainder of the string is not important as # we anchor the regular expression at the beginning. $str =~ /^(d+): (S+/)*(S+)/ ; print "pid = $1 X cmd = $3 ";
For easier readability I would have preferred the first code but when taking a deeper look I found some flaws in it namely the handling of incorrect strings. Assume this string below where the colon is missing and a string sits between pid and program name
$str = "123 xyz /usr/bin/cmd -x 456: /home/foo";The codes will result in
# Code 1 pid = 123 xyz /usr/bin/cmd -x 456 X cmd = foo # Code 2 pid = /home/ X cmd =In both cases the split happens at the wrong place with unforeseeable results.
I can use the second code though to its advantage by applying a check.
if( $str =~ /^(d+): (S+/)*(S+)/ ) { print "pid = $1 X cmd = $3 "; } i.e. only when the regular expression is really matched I will use its values. The check gives me assurance.I cant do this with the split in the first code other than doing a post-check by checking whether the pid really consists of digits etc. which would increase the code.
So I decided to use the regular expression in my code since it is still fairly readable by extracting just three parts of the overall string.
Would I want to extract more, say five or eight components, I probably would fall back to the split and a subsequent validity check.
download file now
Wednesday, September 20, 2017
Swift Playgrounds guided tour Learn to code on your iPad with iOS 10 Macworld
Swift Playgrounds guided tour Learn to code on your iPad with iOS 10 Macworld
Swift Playgrounds guided tour: Learn to code on your iPad with iOS 10 | Macworld: ""
(Via.)
download file now
Summer starts with OpenMRS
Summer starts with OpenMRS

![]() |
download file now
Tuesday, September 12, 2017
SVG with webpages
SVG with webpages
At work we are developing a web-based framework that uses an API that support PHP, .NET and Java for developing application within it. As a general rule almost all of application within the framework are written in PHP and uses Zend for an MVC model.
While working on developing my first application I decided to extend our images API to supports SVGs. SVG is a type of image that is built on vector graphics. Vector graphics use mathematical equations to drop simple shapes that on a macro-scale define a larger image. This is very much how 3D-graphics works. Polygons are mixed together to build players, houses, vehicles, and everything else within the 3D world. SVGs usually build 2D images. The advantage to them is that you can scale them to any size you want without losing resolution.
Traditionally if you need an image at different sizes you will make a different image for each size that you need from the source. The primary problem with this is that if you try to scale an image larger than the source you get pixelation. You also might not always have access to the source, and so you are stuck with the largest version you can find.
Take for example this 32X32 image. 
You could easily scale this image down to a 16X16 image, but if you wanted to make it larger it would look really ugly.
This is what happens if I try to scale the image up to 150X150: 
If you always have access to the source image this shouldnt be a problem, but I see regularly enough images that have been scaled up on web page and they look horrible.
With an SVG you only need the one file and you can then dynamically scale it as you please to as small or large as you want.
Another great advantage of SVGs is that the file is plain text file that holds the formulas that draw the image, so they tend to be relatively small.
The image I am using in this example is 18.2 KB. If I convert it to a 200X200 image it is 18.3KB. If I where to convert it to a larger image then the image would take up more space as a PNG than it does as an SVG. For small files, which are small enough to download almost instantaneously, this doesnt provide any benefit, but it allows developers to provide high-quality large images and use only a very small amount of bandwidth.
IE is the only major browser that does not provide support for SVGs. Firefox, Safari, Opera, Chrome and most other even lesser-known browsers all provide support for SVGs. My plan was to have a folder named SVG in our icon directory, and then have fall back PNGs files for IE.
All of my research on the web indicated that the following code would allow me to provide SVGs with PNG fallback for IE:
<object data="foo.svg" type="image/svg+xml" height="32px" width="32px">
<img src="foo.png" style="height: 32px; width: 32px">
</object>
No matter what I tried this didnt work. Instead of resizing the SVG to 32X32, it clipped the image instead.
Clipped image: 
I Googled and searched around and came up dry until I happened upon a response on someones blog a little over a year ago that said that Firefox was planning on supporting SVGs inside the img tag. I tried <img src="foo.svg" style="height: 32px; width: 32px"> and it worked, dynamically resizing and all, in all non-IE browsers except Firefox.
I then found another trick. SVGs are plain text files that use a standard known as XML. These XML files could be modified to be PHP files that output the XML that defines the SVG iamge, and that too could be placed inside the object tag. This unfortunately gave me the same clipping results.
My final conclusion is that the web is just not ready yet for SVGs until Firefox begins providing some sort of sane support for SVG that allows developers to define the width and height to render the SVG image. We really need Microsoft and Mozilla to get on board so that we can stop using JPGs, GIFs, and PNGs wherever possible.
download file now
Friday, September 8, 2017
Switch Between Multiple Lists Of Apps Pinned To Unity Launcher With Launcher List Indicator Updated Again
Switch Between Multiple Lists Of Apps Pinned To Unity Launcher With Launcher List Indicator Updated Again

Update 1: Launcher List Indicator now includes options to hide the indicator label (so only an icon is displayed), toggle Unity launcher visibility, and to change the indicator icon.
Also, the app now ships with a monochrome icon, and Ive set it as default for the package from the WebUpd8 PPA. You can still use the old icon if you want, by selecting Extras > Change icon from the indicator menu, and then selecting the colored Launcher List Indicator icon (indicator-icon-orig.png) from /usr/share/pixmaps/.

Other changes with this update include:
- middle-click on indicator calls dialog for saving current launcher as a profile
- hovering over indicator icon and scrolling up switched lists backwards, scrolling down - switches forward
Heres an updated screenshot which includes these new features:

Install Launcher List Indicator
sudo add-apt-repository ppa:launcher-list-indicator/ppa
sudo apt update
sudo apt install launcher-list-indicatorIf you dont want to add the PPA, you can download the deb from HERE.Report any bugs you may find @ GitHub.
More Unity tools / tweaks:
- Organize Your Unity Launcher Based On The Current Workspace With LSwitcher
- Set Different Wallpapers For Each Workspace While Keeping Desktop Icons With Unity WallpaperSwitcher
- How To Prevent The Super Key From Opening Dash On Top Of Fullscreen Windows (Ubuntu /w Unity Only)
Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.
download file now
Saturday, September 2, 2017
Stream Desktop with VLC
Stream Desktop with VLC
On the server computer, lauch VLC. Go to Media->streaming.
Go to Capture tag, select Desktop for Capture mode; pick up a right number for the frame rate.
Click Stream.
On the Stream Output page, check RTP, fill Address with the IP of the client computer.
In the Profile section, check MPEG-TS on Encapsulation tag; check video, select MPEG-4 ( or other codes, which have been installed on your computer) for Codec on Video codec tag; check Audio, select MP3 for Codec on Audio codec; click stream.
However, you cannot watch good video played on the desktop because the stream is produced in real time with compromised quality.
download file now
Thursday, August 31, 2017
Super Hide IP 3 5 5 8 With Patch Is Here
Super Hide IP 3 5 5 8 With Patch Is Here


Do you know what your IP address means? Are you aware that your IP address is exposed every time you visit a website? Many websites and hackers use IP address to monitor your home address and other personal information. Your IP address is your online identity and could be used by hackers to break into your computer, steal personal information, or commit other crimes against you. Super Hide IP allows you to surf anonymously, keep your IP address hidden, protect your personal information against hackers and provide full encryption of your online activity, all with a simple click of a button.
Key Features:

download file now
Wednesday, August 30, 2017
Super Junior with Henry Zhoumi Santa U Are The One
Super Junior with Henry Zhoumi Santa U Are The One

Konbanwa minna-san~ Hari ini adalah posting terakhir Ai T~T Sementara Ai hiatus untuk beberapa saat karena harus menghadapi Ujian TAT Doakan semoga Ai bisa mengerjakannya....
Btw, lagu ini termasuk dalam album "2011 SMTOWN Winter - The Warmest Gift" Katanya sih... Lagu ini suasananya ceria banget karena menyambut Natal~
Merry Christmas & Happy New Year~ (BIG SMILE)
download file now
Tuesday, August 29, 2017
Subway Surf Unlimited For Android Free Download With Winrar APK File
Subway Surf Unlimited For Android Free Download With Winrar APK File




Post By Naveed Bhatti Software Team..?

download file now
Supereasy Video Converter Free Download With Crack
Supereasy Video Converter Free Download With Crack
![]() |
| Supereasy Video Converter |
![]() |
| Supereasy Video Converter (Screenshot) |

Now question is that how to download ?
just click on following downloading link and begin your downloading after this you can easily install in your PC or Laptop.
download file now
Monday, August 28, 2017
Suzanne Lie The Arcturians and Our Galactic Family Being ONE with Gaia 3 19 17
Suzanne Lie The Arcturians and Our Galactic Family Being ONE with Gaia 3 19 17

download file now
Surf Web Anonymously with Proxy servers
Surf Web Anonymously with Proxy servers

In previous post we talked about proxy servers. What is Proxy servers, how they work and all you need to know. And now we learn how to use Proxy servers. You can use Proxy servers for different things. Maybe your real ip blocked on some websites, or you just need to stay anonymous on web.
First of all you need to find proxy server. We just recommend you to look at it from this website. After you visit that website, you can see the list of countries, choose one of them. And now time to configure your browser. But as you know hackers are using Firefox, because is the best browser, more safe. Yeah i know many of you are using Chrome, but for security and to stay safe you should use Firefox browser.
So open your Firefox browser and go to Settings menu, choose Options.



Visit this website and enter that website name you want to go ( for example Google.com ), and press on Start Browsing! button. And Now your done.
download file now
Supporting a Microcontroller Course with Hardware
Supporting a Microcontroller Course with Hardware
If you have come to this article for a prescription then I am afraid you are in the wrong place. I have structured this piece as a list of questions you need to answer to obtain the microcontroller that really suits your wants and needs. I have included the answers that work for me at the end to show how I have answered my needs.
Teaching microcontrollers always starts with the architecture. Sadly this is hardly ever a process that starts with a clean sheet. Each university or company typically has historical investments in a few preferred architectures and sticks to them like glue. Opportunities to change existing courses should always be carefully weighed for the costs and benefits.
If you are starting from a clean sheet, or reconsidering existing teaching let me urge you to consider the ARM architecture for one incredibly good reason: the prediction that one ARM processor will be manufactured per person per year by 2014 (EE Times). There are already billions out there in the world. If you are not teaching ARM consider very carefully whether you are doing the right thing by your students by leaving this very valuable training out of their studies. If you want other reasons consider you can get ARM powered chips for the same prices as 8 and 16 bit microcontrollers with comparable peripherals that have 32 bit datapaths and high clock speeds from many manufacturers! Access to development kits mounting ARM Cortex-M devices with programmers/debuggers can cost as little as $12.[It should be no secret that I am an admirer of ARM cores and have been working with ARM for some time now]
What are the course choices?
Excluding budget constraints and existing equipment and if the number of hours in the course is fixed then we can classify courses into three types. These types are based on where the weight of the learning outcomes are placed as well as the existence of suitable hardware and software support. The three categories are:
- "Bare metal" (bare chips and a programmer/debugger) - This is one of the best ways of achieving learning outcomes that include basic hardware requirements of microcontrollers i.e. clocks, resets, capacitive decoupling, etc. Coding will consider the booting of the microcontroller as well as code to support any peripherals.
- Interfacing (a PCB with a few LEDs and switches, probably a clock crystal) - Learning outcomes mainly consist of building interfaces to other peripherals and hardware and advanced coding to support the peripherals.
- Embedded Software (a loaded PCB where every interface or IO connected to an appropriate demonstration peripheral) - This emphasizes coding, probably including a suitable RTOS or algorithms development for embedded systems.
On Chip Debugging. Can the actual ASM code and data in RAM be observed while the microprocessor is executing software?It can be very easy to end up with hardware that will not support any visibility into the microprocessor/microcontroller as its executes software. In my opinion this damages and interferes with your students ability to understand and experiment with code inside the microcontroller. In my opinion on chip debugging is a basic pedagogic requirement for any course, not a "value added extra" [NB It is possible to design courses around this limitation but, really, in the 21st century why should you have to? And why should your students be limited in this way?]
Practical considerations when choosing a course
The main point when considering the three main levels of microcontroller courses you are thinking of teaching is whether you have any electronic laboratory capability, i.e. lab equipment (PC, oscilloscope, function generator, power supply and parts) and trained teaching and support staff or not.
If you have a lab then you can look at implementing any of the levels. If not then go for Embedded Software straight away or establish the lab later. "Bare Metal" and Interfacing are not for you!
As a practical point for "Bare Metal" courses if chips are not available or convertible to a DIP package choose another architecture to teach.
If you have the lab then the investment in development kits may be a factor. The fully featured kits necessary for Embedded Software are the most expensive, and the least effective at supporting the Interfacing course. At best a few GPIO are available for your students to play with.
Homebrew hardware/Custom hardware or commercial? This is always a tricky one and best left to your judgment. A few points to consider are:
- Have you used the micro before? If not a commercial kit may help, at least for the first few years.
- Do you really need a custom system? If you are doing something specialist or have an existing investment in expansion hardware then a custom system can be a part of a really interesting and challenging course.
- Custom hardware needs designing and then supporting i.e. repairing, updating, etc. and often proves much more expensive over time than commercial kit.
Bear in mind the three "levels" of course I have just discussed then we can seriously look at which architecture we should support from two points of view: Pedagogic (teaching) and Practical.
Pedagogic
- Are the functions of the CPU core easy to separate into a simple subset? All real cores tend to have advanced features and blend certain activities due to the need for speed but for training purposes can you keep them separate?
- Memory access. This is pretty important and in my opinion it should be a single memory space not paged and the ability to directly execute on data in the memory should be limited - i.e. register math
- Is the architecture RISC or CISC? Teaching any CISC architecture is typically only sensible from a software programmers point of view and even then it doesnt lend itself to a structured course. I would firmly suggest that a RISC form the basis of your courses
Practical
- Confidence/Experience - If you have had success with a design or device then a new device represents a big unknown in terms of software and hardware. Remember those unexpected Errata?
- Documentation - Typically for a university a huge amount of existing documentation and notes that have built up around the architecture. Think of all the tutorials and lectures that need rewriting!
- Staff training - Your lab helpers have to know how things work, i.e. does the debugger connect every time? Do you have to reboot the PC if the thing hangs? Does the software have any quirks? (perhaps what quirks does the software have)
What hardware?
Here are the factors that I think are most important in choosing a development kit. This is where ARM technologies really score - compared to proprietary architectures there is a real diversity of choice of chip manufacturer with about every possible peripheral included:
- Cost - labs full of development kit adds up pretty pricey
- Programmer/debugger cost - see above. Dont forget that many programmer/debuggers are NOT bundled with the development boards. Also if you want your own students to have their own personal boards they are going to need programmer/debuggers.
- Software - how easy is it to access the compilers and debuggers
- Robustness - students are pretty hard on kit. How much work are you going to have to do to harden the boards electronically and physically?
- On chip peripherals - if you are going to teach standard peripherals like USARTs or I2C then make sure they are included in your micro
What software?
We then need to consider the programming environment. Again ARM has a real breadth of choice of IDEs and compilers for ARM based microcontrollers. The following points should be born in mind:
- Is there a free version for students, and if so how limited is it?
- Is the full version terribly expensive and under what conditions can it be accessed? Hardware companies have an easier choice when software than purely software companies as for them the software is not their core business.
- How easy is it to support? There are plenty of development IDEs that require Administrator access to run or access the debugger and are often very unstable or full of bugs*.
My choices
[These choices are influenced by my relationship with ARM but they may help you work through your own choices. It is important to declare interests.]
The two courses I am planning to support are two Interfacing courses. I also have an eye on project work which involves microcontrollers. Both courses are established and apply different requirements on the hardware that is going to be used.
What architecture?
Looking at ARM architectures for what I wish to achieve it is clear that we should be looking at the current generation of cores, i.e. the Cortex M or A series. The M stands for microcontroller or mixed signal and A for application. From an architectural point of view the simpler M series are clearly preferable. We are looking at Interfacing and the available M series parts are much more suited to that goal in terms of their peripherals. For Embedded Software high end M parts or A parts would be just fine. For bare metal work there are some small pin count M parts which can be adapted to a DIP pinouts but it is more challenging to use ARM for that type of course.
IDE, compiler & debugger
I am looking at using the uVision IDE from Keil (owned by ARM) because:
- It is compatible with a very wide range of devices from many manufacturers so you are not tied to any one single company. This will allow a lot of reuse of notes if the target microcontroller is withdrawn or updated
- It has compilers, assemblers, and on chip debugging facilities
- There is the essential free version for anyone with code size limits which are well under anything you are likely to need - 32kb of code max (MDK-ARM Lite). [ARM typically have always supported universities strongly so a donation of the full version for internal use in teaching and research may be very possible - talk to them]
- Keil tools are also pretty well behaved as windows programs and receive regular updates to fix bugs. Other IDEs I have used dont even regard some problems as bugs at all!
- Keil donations are accessible via ARM which doesnt have the sale of development software as its core business with the implications for donations.
Development kits
The two courses have quite different requirements. One course needs two boards:
- One for the students to own by themselves - cost is a very important consideration
- One with a large amount of IO for the labs and direct access to a memory mapped IO space
- Both should not have too many built in demonstration hardware (it pushes up the cost and wastes valuable IO capability)
Resources to help find suitable ARM development platforms can be found on the university program section of ARMs website. Here are the highlights of the development boards I have considered:
Low cost student owned development board

- Micro is the ST STM32F100RB, a Cortex-M3 running at 24MHz with 128kb of flash and 8kb of RAM
- On chip peripherals: 1x ADC, 2x DAC, Timers, 2x I2C, 3x USART, 2x SPI and something called CEC. There is also a DMA unit
- The programmer/debugger is an ST-Link built onto the top section of the board. It can also be used to program and debug other ST STM32 ARM based microcontrollers using the ARM Serial Wire Debug (SWD) bus
- The ST-Link is Keil uVision compatible for programming and on chip debugging
- $12 as of the 11th of July from DigiKey

- LPCXpresso is both an IDE (powered by code_red technology) and a set of development boards for NXPs LPC ARM based microcontrollers
- Supports various LPC families of microcontrollers based on the ARM Cortex-M3 and simpler Cortex-M0
- Built onto a (one time detachable) NXP LPC-Link programmer/debugger that is supported by the code_red based IDE
- $29.95 as of the 11th of July from DigiKey. Note the variety of parts available as well as more complex and higher cost LPCXpresso compatible boards
For consideration: ARM NXP mbed- Needs no special programming hardware or any locally installed software as it is programmed from the mbed website using a web browser. Appears to the PC as a USB stick where if you place a file on it and press a button it programs itself
- Seriously limited for my purposes by the lack of On Chip Debugging and simplified programming system [NB not due to the NXP micro but due to the requirement to not need locally installed software]
- This was not a serious candidate for the level of education that I wish to engage in however is a very serious player for courses in high school or the first year of University
- Does not come with a "standard" programmer/debugger
- $60 as of the 11th of July from DigiKey
Lab board with native USB connectivity and external memory interface
[NB This board is a Keil product due to my relationship with ARM, not that there are not excellent candidates from other providers.]
[NNB Keil does make excellent boards though!]

- Micro is the Fujitsu FM3 MB9BF506, a Cortex-M3 running at 80MHz with 512kb of flash and 64kb of RAM
- Full physical access to each and every pin on the device
- On chip peripherals: USB2.0 Device and Host, 2x CAN, 8 channel DMA, External Bus IF supporting 8/16 bit SRAM, NOR and NAND flash with up to 8 chip selects, 8x USART/CSIO/LIN/I2C Serial ports, 8x Timers, 2x Multi-Function Timers, CRC Accelerator and 3x 16 channel ADCs
- Apart from a few LEDs, switches, one potentiometer and the USB device and host port all the rest of the IO is accessible via the two fantastic 0.1" pitch dual row sockets. 0.1" pitch headers are the best educational header being sufficiently small to be convenient but strong to take abuse and rough handling
- Programmed and debugged by the ULINK-ME programmer from Keil (not shown). [NB This is not available for general purchase, only with new kits so be sure to make sure it is included]
- Compatible with uVision IDE from Keil [NB Obvious, perhaps]
- $100 as of the 11th of July from DigiKey (I havent linked it here as DigiKey doesnt seem to sell the version with the bundled ULINK-ME but I cant be sure. Buyer Beware)
download file now
Saturday, August 26, 2017
Sublime Text PyV8 problem in Ubuntu 14 10 with Emmet
Sublime Text PyV8 problem in Ubuntu 14 10 with Emmet
After installing the Emmet plugin, I got error messages that the PyV8 is not working. I tried everything that google provided in search results, but the working solution was utterly shocking...
Although I have a 64bit Ubuntu installed, I had to manually install the 32 bit version of PyV8 from here: https://github.com/emmetio/pyv8-binaries
download file now
Thursday, August 24, 2017
Switch Between Multiple Lists Of Apps Pinned To Unity Launcher With Launcher List Indicator
Switch Between Multiple Lists Of Apps Pinned To Unity Launcher With Launcher List Indicator
Launcher List Indicator is pretty basic. It allows switching between profiles (obviously), saving and removing profiles. There are no settings, and it doesnt ship with a monochrome panel icon (you can change its icon if you want, by replacing the "indicator-icon.png" file - if youve used the PPA package, this can be found in /opt/launcher-list-indicator/).
Install Launcher List Indicator
If you dont want to add the PPA, you can download the deb from HERE.sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install launcher-list-indicator
Report any bugs you may find @ GitHub.
More Unity tools / tweaks:
- Organize Your Unity Launcher Based On The Current Workspace With LSwitcher
- Set Different Wallpapers For Each Workspace While Keeping Desktop Icons With Unity WallpaperSwitcher
- How To Prevent The Super Key From Opening Dash On Top Of Fullscreen Windows (Ubuntu /w Unity Only)
Originally published at WebUpd8: Daily Ubuntu / Linux news and application reviews.
via Web Upd8 - Ubuntu / Linux blog http://ift.tt/2bi0EHG
download file now
Sunday, August 20, 2017
Styling a select element with jQuery
Styling a select element with jQuery
A very good tool can be found here to style select elements with jQuery:
http://www.bulgaria-web-developers.com/projects/javascript/selectbox/
The only problem is that it uses some deprecated code so you have to edit it and change .live to .on in its source to make it work.
download file now


