text:
Q: Storing settings inside DB can someone tell me what's the best way to store many different settings in a
database? Should I use one table with id,key,value?
Here is an example what i have to store:
PageNavigation.Font = "fontRegular";
PageNavigation.FontSize = 14;
PageNavigation.FontColor = 0x000000;
PageNavigation.SubFont = "fontRegular";
PageNavigation.SubFontSize = 12;
PageNavigation.SubFontColor = 0x000000;
PageNavigation.width = 200;
PageNavigation.height = 22;
PageNavigation.spacing = 5;
PageNavigation.LetterSpacing = 0;
PageNavigation.top = 250;
PageNavigation.rightMargin = 24;
PageNavigation.RollOverColor = 0xFF3300;
PageNavigation.ActiveColor = 0xCCCCCC;
PageNavigation.Icon = "/assets/images/arrow_default.png";
PageNavigation.IconLeft = 5;
PageNavigation.TextLeft = 5;
PageNavigation.SubIcon = "";
PageNavigation.SubIconLeft = 5;
PageNavigation.SubTextLeft = 22;

PageViewer.BackgroundColor = 0xe9edee;
PageViewer.ThumbSource = "";
PageViewer.maxVisible = 17;
PageViewer.ThumbWidth = 38;
PageViewer.ThumbHeight = 49;
PageViewer.ThumbActiveBorder = 2;
PageViewer.ThumbActiveBorderColor = 0xEE2233;
PageViewer.ThumbSpacing = 10;
PageViewer.ThumbLeft = 20;
PageViewer.ThumbBorderColor = 0xFF3300;
PageViewer.ThumbBorderSize = 1;
PageViewer.ThumbRollOverColor = 0xDDDDDD;
PageViewer.ThumbActiveColor = 0xCCCCCC;
PageViewer.ThumbSelectColor = 0xCCCCCC;
PageViewer.ThumbShadow = 1;
PageViewer.ThumbLayout = "Layout1";
PageViewer.ButtonLayout = "ButtonLayout1";

I'm  new to database design and don't know good resources to learn db-design
Cheers,
Dom

A: the best I think is to create a field for each type of setting. What does this do is,

*

*we can keep many user defined settings of many users in one table.

*we can create different sets of predefined setting which can be useful in several cases

ETC

A: Yes this would work but has the downside that settings values has no proper type. You would have to declare everything as VARCHAR, your application would have to check the validity of the values.
Sure it would be possible to create a table for each setting type, e.g.
create table Settings
(
  settings_id primary key int not null,
  name VARCHAR(255) not null,
);

create table DoubleValues
(
  value double not null
  fk_setting int not null;
);

create table ColorValues
(
  value char(8) not null
  fk_setting int not null;
);

..

Another way would be to create a table consisting of one row with a column for every setting. This way you have proper typing and can add check constraints at database level. But I consider this one as worse to maintain and to extend, so I would prefer the first one, but as always, it depends on your specific needs.
Another way would be to use a simple text file and read the settings into a hashtable which will be by far the fastest way. Maybe you can have a look at a noSQL database like MongoDb or CouchDb.
Think if your settings are mostly static or how often new settings keys are inserted or removed.


text:
I misteri della jungla nera – romanzo d'avventura scritto da Emilio Salgari.
I misteri della jungla nera  – film del 1954 diretto da Gian Paolo Callegari.
I misteri della giungla nera  – film del 1965 diretto da Luigi Capuano.
I misteri della giungla nera – miniserie TV del 1990 diretta da Kevin Connor.

redpajama_set_name: RedPajamaWikipedia


This page describes the validation of TSS sampling plans for variables by simulating TSS decisions in MS Excel .
Using Simulation to Validate TSS.
Results for TSS Unknown-Sigma Plans.
Results for TSS Known-Sigma Plans.
TSS is a method of developing sequential decision rules. The TSS application to situations with unknown standard deviation is different enough from the known-sigma technique to warrant separate analyses for the two.
RQL=0.12 (fraction nonconforming to LISL).
PROCEDURE: The decisions of the TSS sampling plan were compared to the decisions of the matched fixed-n plan. Both plans had the same LISL, alpha, beta, AQL, and RQL. Both types of sampling plan received the same samples.
The accept/reject decisions were carried out with populations at the AQL and RQL points. The Excel program made three runs of 10,000 decisions each at the AQL and three similar runs at the RQL.
Each accept/reject decision involved generating fixed-n=21 data points.
The probability of acceptance for each point (mean) on the oc curve was calculated as Pa = (number of acceptances)/(total decisions).
Table 1: The numbers in the body of the table represent measurements by simulation of the producers risk (alpha).
Discussion: in table 1, the TSS and Fixed-n probabilities are close to the specified producers risk of 0.05.
Table 2: The numbers in the body of the table represent measurements by simulation of the consumers risk (beta).
Discussion: In table 2, the TSS and Fixed-n probabilities are close to the specified consumers risk of 0.05.
The computer program SAS (Statistical Analysis System) was used by 3M Company to simulate known-sigma TSS sampling plans. The OC-Curve and the ASN-curve were simulated at eleven points (population means) each. At each point, the SAS program made 5,000 decisions for TSS sequential, Fixed-n, and SPR sequential sampling plans.
You can contact H & H Servicco Corp. for free summary the results of this study.
The report shows that known sigma TSS sequential sampling plans are more effective than either fixed-n or SPR sequential sampling plans.


text:
Sony PSV
Retro/Classic
Toys/Gifts
Board Games & Books
Bull Moose Exclusives
*Vinyl*
4K UHD - Upcoming Releases
Blu-ray - Upcoming Reissues
Video Games – Upcoming Releases
Books – Upcoming Releases
Bull Moose Points
Video Game Console Return Policy
This Week @ Bull Moose
Books >> Audiobooks
Judy Hall
Encyclopedia of Crystals, Revised and Expanded
LIST PRICE: $24.99 (you save $7.02)
Low stock - should ship Saturday
Biographical note:
Judy Hall is a successful Mind Body Spirit author with 42 books to her credit including the million-selling Crystal Bible (volumes 1 and 2). She recently appeared on the Watkins Review list of the 100 most spiritually influential authors. She has been a past-life therapist and karmic astrologer for more than forty years. An internationally known author, psychic, healer, broadcaster, and workshop leader, her books have been translated into fifteen languages. A trained healer and counselor, Judy has been psychic all her life and has a wide experience of many systems of divination and natural healing methods. Judy has a bachelor of education degree in religious studies with an extensive knowledge of world religions and mythology and a master of arts in cultural astronomy and astrology at Bath Spa University.
Main description:
The ultimate guide to crystals gets even better in this new edition of The Encyclopedia of Crystals!
Internationally bestselling author Judy Hall presents a comprehensive guide to more than 400 powerful healing crystals, plus information about 150 newly discovered stones in this new edition of The Encyclopedia of Crystals. Beautifully illustrated and effortless to navigate, The Encyclopedia of Crystals, 2nd Edition is organized by crystal color for easy reference, relates the colors of the crystals to the chakras, and lets you know how to cleanse and activate them. This book is also full of helpful authoritative advice on healing with crystals. This encyclopedia is an essential addition to the libraries of everyone working with crystals.
Bullmoose.com
Copyright © 2019 Bull Moose. All rights reserved.

redpajama_set_name: RedPajamaCommonCrawl


You still have the video game you rented.
Yes, as we explained to you the first two times, it's locked inside the console and we haven't had the time to endure an hour-long wait with customer service to figure out how to get it out.
You've had it for quite some time.
We know. I'm sorry about that.
Once we (the Pool Boy) finally gathered the energy, we did find out how to get it out, which involves taking the front panel off, poking around with a stretched out paper clip (very technical) until you hit a release mechanism and then it kind of sticks out far enough that you can pull it the rest of the way (that's what she said).
That didn't fix the problem however, it just meant we could get Roz off our case.
Nope, back to customer service we (the Pool Boy) went. And after much repetition of our very complicated address (CA-NA-DA) to what I gather was someone with a thick New Delhi accent (not that there's anything wrong with that) we were to expect the arrival of a box. We were then to package the wounded X-Box up in the box and send it along. We couldn't get warranty, but we did manage to negotiate down to a $30 charge — not too bad.
Anyway, the box arrived yesterday.
Can't you just hear the harps and the beating of angel wings while yearning X-boxes have their innermost wishes granted? It's enough to warm the cockles of your heart.
Poor things. Isn't that a terrible name for a department? I bet everyone suffers from malaise and low self-esteem in that office. I can assure you that the department lived up to the promise of its name. My hope is that a department named…Fulfillment Centre…(don't forget the sing-song) is full of optimism, good will, and a can-do attitude. Kind of like Santa's workshop.
Now you. What would you name the department for which you really work (you know, to give it an accurate description)? What would you name the department of your fantasy job?
This entry was posted in Aliens and uncharted planets, Comets of Kindness, Minor notes in the celestial chord and tagged business, customer service, language, life, technology. Bookmark the permalink.
Are you kidding??!! That is hysterical.
Good luck and god speed, X-Box 360.
Let's take some bets. I'm bet you 17 cents that you get your X-Box back before I get my shiny new video card from Gateway.


As an unregistered organization without a website, our project made it to the Semifinalist round of the Echoing Green Climate Fellowship Competition. (See all the semifinalists here). One month down the line, we are feeling a lot more confident as an organization, and have changed our name to "Kijani" (which means "green" in Kiswahili).
Our concept has developed, our website is being built, and we have an operational team structure that splits our global members into five teams: funding, promotion, community, forestation and management.
With the next application due on March 3rd, we are in the process of further consolidating our mission and defining key elements of our organization. This process will involve a trip to Marmanet in Central Kenya – where we will be planting trees – with a surveyor from the Kenya Forest Services on February 25th. The aim of this trip is to identify the 100 hectares of degraded forest we will rehabilitate, as well as ensuring that there is a stable water supply and the relevant mapping of the site is underway.
We will also hold in-person meetings with Urs Dietrich, our team member from Yale (pursuing a Masters of Environmental Management at the Yale School of Forestry and Environmental Studies) who will be visiting Nairobi, Kenya from February 23rd to March 3rd for a conference with the UN Forests Working Group. We hope to gain some clarity concerning our strategies for planting the trees, and engaging the local community as we do this.
We are also registering our organization in Kenya.
For now, we appreciate your support as we work towards getting into the next round of Echoing Green Climate Fellowship competition. Finalists will be flown to New York for in-person interviews.


text:
Georg Graeve, Kjell Nordeson, Jon Raskin Trio - Live at NIR Studios (Temescal Records, 2021) ****
By Flavio Zanuttini
Nowadays we are used to the streaming concerts. It was not so common before COVID-19, but now it seems like almost every musician on earth, professional or not, had to try this new way of performing. We can say it's a hybrid situation between the studio recording and the live concert: you don't know how many people will listen to your music (like in studio recordings), and you have just one take, like in live concerts. You don't have any feedback from the audience and you don't have the possibility to make a second or third take or to choose which track to publish.
Here is something quite close to this situation, but coming from the past (more precisely, 2009). Jon Raskin performed three live-streamed concerts at NIR Studios in Oakland for the internet radio sfSound curated by Matt Ingalls, and for the third show the line up was Jon Raskin, Georg Graewe and Kjell Nordeson, which was recently released in March 2021 on Jon Raskin bandcamp site.
The music of this trio is amazing, well balanced with a constant tension flowing throw a big range of dynamics. The five tracks show pretty well how the three musicians can respect other's space and silence but can also grow on dynamics, they are very reactive on what happens musically and this immerse the listener to a scenario that can change really fast but always in a natural way.
Graeve, Nordeson and Raskin explore all the possibilities of this ensemble giving space to solos, duos and, of course, a trio. They have different musicality that fits together in a complementary way: Raskin is the one who pushes more the tonal possibilities, Graeve on the other side is doing an intense work on piano expanding the conception of rhythm melody and harmony, and Nordeson is playing in a very respectful way pushing the direction of the music and emphasizing every little change.
A great record by a great trio, it would be nice to hear the same band play nowadays and see after 12 years how their feeling has grown.
Georg Graewe, Kjell Nordeson, Jon Raskin Trio Live at NIR Studios by Jon Raskin
Paul on Monday, October 18, 2021


text:
Tuxedo "Without Your Love"
Earlier this year, Tuxedo impressed with their self-titled debut album, and for fans who have been itching for a little more funk from producer Jake One and singer Mayer Hawthorne, the duo have shared a new bonus track.
"Without Your Love" was previously released as a Japan-only exclusive, and this is the first time it's been made available to the rest of the world. It's a characteristically grooving tune, as Hawthorne makes romantic declarations over a swaggering, synth-driven arrangement that's peppered with brassy horn breaks.
Scroll past Tuxedo's tour schedule to listen.
06/27 Las Vegas, NV - The Bunkhouse Saloon
06/28 Los Angeles, CA - Hollywood Bowl
06/30 San Francisco, CA - Bimbo's 365 Club
07/01 Portland, OR - Wonder Ballroom
07/02 Seattle, WA - The Crocodile
07/03 Vancouver BC - The Alexander (DJ Set)
07/17 Washington DC - U Street Music Hall (DJ Set)
07/18 Philadelphia - The Dolphin (DJ Set)
07/19 Montauk NY - The Surf Lodge
07/20 New York, NY - Poisson Rouge
07/21 Boston, MA - City Hall Plaza
More Tuxedo
Tuxedo Tuxedo III
They won't get props for the most original album titles (Tuxedo III is the followup to 2017's Tuxedo II) but man, can the Tuxedo duo ignite...
Tuxedo Tuxedo II
Tuxedo II is the conspicuous continuation of 2015's Tuxedo, the lauded then-side project of Mayer Hawthorne and producer Jake One that found...
Tuxedo "Right Time" (Kaytranada remix ft. BADBADNOTGOOD) (video)
Mayer Hawthorne and Jake One issued their self-titled debut album as Tuxedo back in the spring, but proving that it's never too late to do s...
Tuxedo "Right Time" (Kaytranada remix) (ft. BADBADNOTGOOD)
Mayer Hawthorne and Jake One recently teamed up to release their self-titled debut LP as Tuxedo, and now album cut "Right Time" has been giv...
Tuxedo Tattoo, Toronto ON, May 1
When some movie executives decide to inevitably reboot The Wedding Singer, they should get the members of Tuxedo to portray Adam Sandler's c...


text:
Q: Problem in positioning two row layouts one below each other with multiView RecyclerView? Screenshot included Here I use two viewHolders one for NoteViewHolder and another one for ChecklistViewHolder for a single adapter. I have two Lists with different data types in the recyclerView Adapter. I use SQLite Database and created two tables, one for notes and another one for checklists because I use different views for each row layout in the recyclerView. What I want is positioning notes and checklists according how they added.
That is what I get in RecyclerView.
Here if I add another note, it goes to note section for the yellow part, but I want it to go to after checklist for purple part.
I know how to bind these two views, I don't have problem with binding. My problem is with thee layout.
Adapter class
    public class AdapterClass extends RecyclerView.Adapter {

    List<NoteHelper> notesList;
    List<ChecklistHelper> checklistsList;
    public static final int LAYOUT_ONE = 0;
    public static final int LAYOUT_TWO = 1;

    public AdapterClass(List<NoteHelper> notesList, List<ChecklistHelper> checklistHelperList) {
        this.notesList = notesList;
        this.checklistsList = checklistHelperList;
    }

    @Override
    public int getItemViewType(int position) {
        if (position<notesList.size())
            return LAYOUT_ONE;

       else return  LAYOUT_TWO;

    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        if(viewType==LAYOUT_ONE){

            View view = layoutInflater.inflate(R.layout.layout_note, parent,false);
            NoteViewHolder noteViewHolder = new NoteViewHolder(view);
            return noteViewHolder;
        }

        if(viewType==LAYOUT_TWO){
            View view = layoutInflater.inflate(R.layout.layout_checklist, parent, false);
            return new ChecklistViewHolder(view);
        }
        return null;
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {

    }

    @Override
    public int getItemCount() {
        return notesList.size() + checklistsList.size();
    }

    class NoteViewHolder extends RecyclerView.ViewHolder{
        public NoteViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }

    class ChecklistViewHolder extends RecyclerView.ViewHolder{
        public ChecklistViewHolder(@NonNull View itemView) {
            super(itemView);
        }
   }}

Activity class
public class MainActivity extends AppCompatActivity {

    RecyclerView recyclerView;
    Button btnNote, btnChecklist;
    List<NoteHelper> listNotes;
    List<ChecklistHelper> checklistHelperList;
    DbHelper dbHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        recyclerView = findViewById(R.id.recycler_view);
        btnNote = findViewById(R.id.btn_add_note);
        btnChecklist = findViewById(R.id.btn_add_checklist);
        recyclerView = findViewById(R.id.recycler_view);
        dbHelper = new DbHelper(this);

        listNotes = dbHelper.getNotes();
        checklistHelperList = dbHelper.getChecklists();

        AdapterClass adapterClass = new AdapterClass(listNotes, checklistHelperList);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapterClass);
        listNotes = new ArrayList<>();

        btnNote.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,activity_add_note.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);

            }
        });

        btnChecklist.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, activity_add_checklist.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);

            }
        });
    }}

public class activity_add_note extends AppCompatActivity {
Button btnSaveNote;
EditText etNote;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_add_note);

    btnSaveNote = findViewById(R.id.btn_save_note);
    etNote = findViewById(R.id.et_note);

    btnSaveNote.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            DbHelper  dbHelper = new DbHelper(getApplicationContext());
            dbHelper.getWritableDatabase();
            String note = etNote.getText().toString();
            dbHelper.insertNote(note);

            Intent intent = new Intent(getApplicationContext(), MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
            startActivity(intent);
        }
    });
}}

    public class activity_add_checklist extends AppCompatActivity {
    Button btnSaveChecklist;
    EditText etChecklist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_checklist);

        btnSaveChecklist = findViewById(R.id.btn_save_checklist);
        etChecklist = findViewById(R.id.et_checklist);
        btnSaveChecklist.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String checklist = etChecklist.getText().toString();
                DbHelper dbHelper = new DbHelper(getApplicationContext());
                dbHelper.insertChecklist(checklist);

                Intent intent = new Intent(getApplicationContext(), MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
            }
        });
    }
}

A: Modified your code and made some improvements so that it gives us the expected results. Let's see what's changed and why step by step.
Item Design
The goal here is to combine two different classes into the one list. To make this possible we need to add a BaseItem class which will contain the all common properties and functions of the NoteHelper and ChecklistHelper classes so that we extend them from the BaseItem class.Note that it has an abstract method called getViewType so that the inherited classes can implement this method and provide us their view types.
BaseItem.java
public abstract class BaseItem {

    int id;
    String content;
    long date;

    public BaseItem() {
        content = "";
    }

    public BaseItem(int id, String content, long date) {
        this.id = id;
        this.content = content;
        this.date = date;
    }

    public abstract int getViewType();

    public int getId() {
        return id;
    }

    public String getContent() {
        return content;
    }
}

Now if we see the NoteHelper and ChecklistHelper classes; each class has its own definition of view type and implemets the getViewType class which we will use it for our convenience in the adaptor class.
NoteHelper.java
public class NoteHelper extends BaseItem {

    public static final int VIEW_TYPE = 0;

    public NoteHelper() {
    }

    public NoteHelper(int id, String content, long date) {
        super(id, content, date);
    }

    @Override
    public int getViewType() {
        return VIEW_TYPE;
    }
}

ChecklistHelper.java
public class ChecklistHelper extends BaseItem {

    public static final int VIEW_TYPE = 1;

    public ChecklistHelper(){

    }

    public ChecklistHelper(int id, String content, long date){
        super(id, content, date);
    }

    @Override
    public int getViewType() {
        return VIEW_TYPE;
    }

}

Combinating Two Items Into One List
The next step is design the combination logic. As an example I designed the combination based on creation date. But it can be done based on any criteria similar to this. In order to implement the date based combination logic we will need a long type comparator since we save the creation date as a time stamp using System.currentMillis().
ItemLongDateComparator.java
public class ItemLongDateComparator implements Comparator<BaseItem> {
    @Override
    public int compare(BaseItem baseItem, BaseItem t1) {
        return Long.compare(baseItem.date, t1.date);
    }
}

Redesigning the Databese Helper
Making database queries within the main thread is not a good practice since it can cause UI glitches as the data gets bigger. To prevent UI issues we execute the queries in a background thread using an executor service and deliver the result to the main thread. But before we deliver the result we combine the data in background thread by the creation timestamp criteria, then we send the result to main thread using an interface.
DbHelper.java
public class DbHelper extends SQLiteOpenHelper {

    // This background executor is only for database operations
    private final Executor dbexecutor;

    public static final String DATABASE_NAME = "NOTES.DB";
    public static final int DATABASE_VERSION = 1;

    public static final String NOTES_TABLE = "NOTES_TABLE";
    public static final String CHECKLIST_TABLE = "CHECKLIST_TABLE";

    public static final String COLUMN_ID = "ID";
    public static final String COLUMN_CONTENT = "CONTENT";
    public static final String COLUMN_DATE = "DATE";

    public DbHelper(@Nullable Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        dbexecutor = Executors.newSingleThreadExecutor();
    }

    @Override
    public void onCreate(SQLiteDatabase sqLiteDatabase) {

        String query = " CREATE TABLE " + NOTES_TABLE + " ( " + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"  +
                COLUMN_CONTENT + " TEXT, " + COLUMN_DATE + " DATE "  + " ) ";
            sqLiteDatabase.execSQL(query);

        String query2 = "CREATE TABLE " + CHECKLIST_TABLE + " ( " + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                COLUMN_CONTENT + " TEXT, " + COLUMN_DATE + " DATE " + " ) ";
            sqLiteDatabase.execSQL(query2);
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {

        if (oldVersion>newVersion) {

            sqLiteDatabase.execSQL(" DROP TABLE IF EXISTS " + NOTES_TABLE);
            sqLiteDatabase.execSQL(" DROP TABLE IF EXISTS " + CHECKLIST_TABLE);
        }
             onCreate(sqLiteDatabase);

    }

    public void insertNote(String content, long date){
        dbexecutor.execute(()-> {
            SQLiteDatabase sqLiteDatabase;
            sqLiteDatabase = getWritableDatabase();

            ContentValues c = new ContentValues();
            c.put(COLUMN_CONTENT, content);
            c.put(COLUMN_DATE, date);
            sqLiteDatabase.insert(NOTES_TABLE, null, c);
        });
    }

    public void insertChecklist(String content, long date){
        dbexecutor.execute(()-> {
            SQLiteDatabase sqLiteDatabase;
            sqLiteDatabase = getWritableDatabase();

            ContentValues c = new ContentValues();
            c.put(COLUMN_CONTENT, content);
            c.put(COLUMN_DATE, date);
            sqLiteDatabase.insert(CHECKLIST_TABLE, null, c);
        });
    }

    private List<NoteHelper>  getNotes() {
        List<NoteHelper> notesList = new ArrayList<>();
        SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();
        String query = " SELECT * FROM " + NOTES_TABLE;
        Cursor cursor = sqLiteDatabase.rawQuery(query, null);

        if (cursor.moveToFirst()) {

            do {
                int id = cursor.getInt(0);
                String content = cursor.getString(1);
                long date = cursor.getLong(2);
                NoteHelper noteHelper = new NoteHelper(id, content, date);
                notesList.add(noteHelper);
            }
            while (cursor.moveToNext());

        } else {
            sqLiteDatabase.close();
            cursor.close();
        }

        return notesList;
    }

    private List<ChecklistHelper> getChecklists(){
        List<ChecklistHelper> checklistsList = new ArrayList<>();
        SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();
        String query = "SELECT * FROM " +  CHECKLIST_TABLE;
        Cursor cursor = sqLiteDatabase.rawQuery(query, null);

        if (cursor.moveToFirst()){

            do{
                int id = cursor.getInt(0);
                String content = cursor.getString(1);
                long date = cursor.getLong(2);
                ChecklistHelper checklistHelper = new ChecklistHelper(id, content, date);
                checklistsList.add(checklistHelper);

            }
            while (cursor.moveToNext());

        }

        else {
            cursor.close();
            sqLiteDatabase.close();
        }
        return checklistsList;
    }

    public void getNotesAndChecklists(OnContentReadyListener listener) {
        if(listener == null) return; // Don't proceed if the listener is null
        dbexecutor.execute(()-> {
            List<NoteHelper> notes = getNotes();
            List<ChecklistHelper> checks = getChecklists();
            // Merge lists and sort items by creation date
            List<BaseItem> items = new ArrayList<>();
            items.addAll(notes);
            items.addAll(checks);
            Collections.sort(items, new ItemLongDateComparator());
            new Handler(Looper.getMainLooper()).post(()-> listener.onContentReady(items));
        });
    }

    @MainThread
    public interface OnContentReadyListener {
        void onContentReady(List<BaseItem> combinedItems);
    }

}

Connecting the Data to the UI
Now that we've done with the data organisation, we can adapt this design easily to the UI API. In the adapter class we simply use a list of BaseItem
class since this list will accept all derived classes from the BaseItem.
It will be easier to manage only one list instead of two.
AdapterClass.java
public class AdapterClass extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    List<BaseItem> itemsList;

    public AdapterClass() {
        itemsList = new ArrayList<>();
    }

    @Override
    public int getItemViewType(int position) {
        return itemsList.get(position).getViewType();
    }

    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
        if(viewType == NoteHelper.VIEW_TYPE){

            View view = layoutInflater.inflate(R.layout.layout_note, parent,false);
            return new NoteViewHolder(view);
        }

        if(viewType == ChecklistHelper.VIEW_TYPE){
            View view = layoutInflater.inflate(R.layout.layout_checklist, parent, false);
            return new ChecklistViewHolder(view);
        }
        return null;
    }

    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        int vtype = getItemViewType(position);
        BaseItem bi = itemsList.get(position);
        if(vtype == NoteHelper.VIEW_TYPE) {
            NoteViewHolder nvh = (NoteViewHolder) holder;
            TextView tv = nvh.itemView.findViewById(R.id.tv_note);
            tv.setText(bi.getContent());
        }
        else if(vtype == ChecklistHelper.VIEW_TYPE) {
            ChecklistViewHolder cvh = (ChecklistViewHolder) holder;
            TextView tv = cvh.itemView.findViewById(R.id.tv_checklist);
            tv.setText(bi.getContent());

        }
    }

    @Override
    public int getItemCount() {
        return itemsList.size();
    }

    public void update(List<BaseItem> combinedList) {
        itemsList.clear();
        itemsList.addAll(combinedList);
        notifyItemRangeChanged(0, itemsList.size());
    }

    static class NoteViewHolder extends RecyclerView.ViewHolder{
        public NoteViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }

    static class ChecklistViewHolder extends RecyclerView.ViewHolder{
        public ChecklistViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }
}

Reflecting the Data to the UI
Finally we can reflect the data to the UI parts. Remember when I mentioned about finishing activities instead of restarting the main activity again and again? Look at the adding activities how simple they are now.
activity_add_note.java
public class activity_add_note extends AppCompatActivity {
    Button btnSaveNote;
    EditText etNote;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_note);

        btnSaveNote = findViewById(R.id.btn_save_note);
        etNote = findViewById(R.id.et_note);

        btnSaveNote.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String note = etNote.getText().toString();
                DbHelper  dbHelper = new DbHelper(getApplicationContext());
                dbHelper.insertNote(note, System.currentTimeMillis());

                // Finish this activity
                new Handler(Looper.getMainLooper()).postDelayed(() -> finish(), 500);

            }
        });
    }
}

activity_add_checklist.java
public class activity_add_checklist extends AppCompatActivity {
    Button btnSaveChecklist;
    EditText etChecklist;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_checklist);

        btnSaveChecklist = findViewById(R.id.btn_save_checklist);
        etChecklist = findViewById(R.id.et_checklist);
        btnSaveChecklist.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String checklist = etChecklist.getText().toString();
                DbHelper dbHelper = new DbHelper(getApplicationContext());
                dbHelper.insertChecklist(checklist, System.currentTimeMillis());

                // Finish this activity
                new Handler(Looper.getMainLooper()).postDelayed(() -> finish(), 500);
            }
        });
    }
}

One important thing to note in the main activity is that we query the items every time it resumes. Thus when we return from other activities the newly added items will appear in the list.
MainActivity.java
public class MainActivity extends AppCompatActivity {

    private static final String TAG = "MainActivity";
    RecyclerView recyclerView;
    AdapterClass adapterClass;
    Button btnNote, btnChecklist;
    DbHelper dbHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        recyclerView = findViewById(R.id.recycler_view);
        btnNote = findViewById(R.id.btn_add_note);
        btnChecklist = findViewById(R.id.btn_add_checklist);
        recyclerView = findViewById(R.id.recycler_view);
        dbHelper = new DbHelper(this);

        adapterClass = new AdapterClass();
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(adapterClass);

        btnNote.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,activity_add_note.class);
                startActivity(intent);

            }
        });

        btnChecklist.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this, activity_add_checklist.class);
                startActivity(intent);

            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "onResume: ");
        if(dbHelper == null) {
            dbHelper = new DbHelper(this);
        }
        dbHelper.getNotesAndChecklists(new DbHelper.OnContentReadyListener() {
            @Override
            public void onContentReady(List<BaseItem> combinedItems) {
                adapterClass.update(combinedItems);
            }
        });
    }
}

Get the whole project: your app

redpajama_set_name: RedPajamaStackExchange


The Nepalese people are suffering greatly due to political problems in the South of Nepal and a blockade of fuel, medicine and other critical supplies by India. Life saving medicine for blood pressure, diabetes and many other conditions are in short supply in pharmacies, hospitals and clinics throughout the country. The remote western districts are particularly hard hit.
Project Coordinator Pawel Skawinski and Project Leader Sumana Shresta have organized a complex relief effort, coordinating with airlines, pharmaceutical companies, hospitals, doctors and government officials to deliver life saving medicine to 5 districts in the remote far west of Nepal. The districts are Doti, Accham, Darchula, Baitadi and Bajura.
WeHelpNepal has granted $12,500 towards this ongoing effort. Doctors, hospitals and clinics must agree to administer the medicine for free as part of the relief effort. Hats off to Sumana and the other volunteers who have filled a critical gap at a crucial time and saved lives in the process.


We are sorry, no promotional activity is available on this webpage.
Promotions are available on http://goin2win.com/(keyword) pages. Please double check the keyword for the promotion you are trying to access and re-enter the web address. Promotions are dated and time sensitive, there may be no current promotions available.


The site also contains links to other external web sites. PlayTherapy Africa is not responsible for the privacy practices or the content of such Web sites.
By the persons concerned writing in or sending an e-mail with the relevant information. Phoned-in information is also used on occasion.
2 The site runs an opt-in mailing list to keep visitors informed of the latest site news. Joining the list and supplying contact information is done solely at the origination of the user or by invitation, never without permission. The site also runs an information service for Members of PTA. You have a choice of whether or not to receive information from us. If you don't want to be contacted in the future, please tick the opt-out boxes provided and don't give us your email address on any forms.
3 Names, addresses and contact details are NEVER sold, distributed or passed on to third parties for financial profit by PTA for any reason whatsoever. Please note, however, there is nothing to stop a third party from copying publicly displayed information off the site for their own use.
This site does not operate discussion forums, chat rooms or message boards at present.
This site has the usual Service Provider security measures in place to protect the loss, misuse and alteration of the information on the site.
To the best of our knowledge we will NOT collect or post online or offline contact information from children. Information will only be used to respond directly to the child's request and will not be used for other purposes.
PTA tries to keep your personal data up to date and accurate. Please take great care when entering your email address since this a major source of error. We will amend or delete inaccurate data as soon as reasonably practical after a request from you to do so. Please keep us up to date with any changes of email or postal address.
We also collect information automatically about your visit to our web site. This data helps us to audit usage of our web site and improve the service provided for you. It is not released outside of PTA for any other purpose.


CANDLE ESSENCE, located in The Village, is a Yankee Candle Specialist stocking over 75 fragrances, as well as WoodWick, Candleberry, Ashleigh & Burwood to name a few.
We also offer a NEW Personalised Gift service where we design & make your products same day. From Candle Labels, Christmas Baubles, Cushions, Coasters & Mugs... to Keyrings, Money Boxes, Felt Cards, Plaques and much more.
Sorry, this no longer exists at intu Metrocentre. Please visit our directory to view the most recent list of stores and restaurants available in the centre.


text:
AGS Selects Luxury Brand Group for Public Relations Services
Jul 10, 2015 4:04 PM By Jeff Miller
RAPAPORT... American Gem Society (AGS) and AGS Laboratories appointed the Luxury Brand Group to serve its public relations and brand development needs. The Luxury Brand Group will work with AGS to build brand awareness with key consumer and trade targets through strategic public relations initiatives.
"American Gem Society is thrilled to begin our partnership with Luxury Brand Group and excited to move forward with the next step in our growth," said AGS' CEO and executive director, Ruth Batson. "We and Luxury Brand Group have known and worked alongside one another for many years now. They were the natural selection when considering an agency that would properly tell our history, cultivate our motives, and dispatch our new initiatives."
Frank Proctor, the president and CEO of Luxury Brand Group, said, "We are looking forward to working with the talented team at American Gem Society. We have worked in conjunction with the organization many times throughout the years and have continued to sustain an incredible relationship. We value the efforts of American Gem Society and feel that we understand its messaging, its ideals, and its target. The days to come will be a new and exciting journey for the society – we are eager to assist in their development."
Tags: AGS, gems, Jeff Miller, Labs, luxury brand group, marketing, pr
Tips for Promoting Ethical Credentials
When it comes to the jewelry industry's fut...
JA Campaign Successful with Consumers
Podcast: Why Bridal's Not Enough
DPA Creates New Public-Affairs Role
DPA Launches 'Diamond Journey' Campaign
The Diamond Producers Association (DPA) has...
Opinion: An Urgent Call to Invest in Marketing
DPA Seeks to Eradicate Diamond Misconceptions


text:
Q: How to save add button dynamically in android? The code should add a button dynamically when the user needs it.
When an users click on addService this code takes (a name for button and a value to use in the intent for this button) from a second Activity, then adds the  button dynamically in this Activity with the name and intent and the user can click it for service.
How to save  the button dynamically added by the user?
Button btn = new Button(MainActivity.this);
btn.setText(buttonName);
layout.addView(btn);
btn.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        String phone = serviceNum;
        Intent e = new Intent(Intent.ACTION_DIAL, Uri.fromParts("tel", phone, null));
        startActivity(e);
    }
});

A: Include the save button in your layout, then hide it before the view loads.  When the user performs the action, simply unhide the button.  The layout should handle it automatically for you.


A strong S shaped butcher's meat or game hook which has been hand made on the forge. The ends of the hook have been hammered to a point. The discreet size of these hooks makes them versatile around the home or work place.
With their traditional rustic look these meat hooks are perfect for hanging plants, a kitchen utensil rack, or just for decoration.


Last year SAINt JHN emerged on to the scene with his bouncy track "1999" and has been consistently dropping new music ever since. The Brooklyn MC spoke with Fuse at the Voodoo Music + Arts Experience about writing songs for other artists, performing live and his first upcoming project.
JHN is ready to release his debut project, Collection 1, January 2018 and gave us details behind the title. "That's my first project. I think of music as just an assortment. This is my first offering, so it's collection 1," he explains. "Like Alexander Wang you just go to see Alexander Wang AW18. This is Collection 1 by SAINt JHN."
When it comes to writing songs for other artists JHN describes it as "cool" especially when it's artists he grew up listening to. "Some of them are your heroes, people you grew up listening to... looking up to," he tells Fuse. "Then you go and write songs for them that are going to impact people the same way they impacted you."


text:
Aquaculture News
Aquaculture Directory
Feed and feed ingredients
Aquaculture Scoop
Seafood Roundup
First Young Fishmonger of the Year Revealed at Master Fishmonger Standard Awards Ceremony
2020 Events wall planner available to download now!
Aquaculture Directory 2019
Pure Salmon expands its reach in Europe, with a new land-based salmon farm in France
Animal nutrition and aquafeed leader Nutreco partners with cell-based protein companies
Alltech Coppens launches next-generation starter feeds
New Joint Venture Between Clearwater Seafoods and Quin-Sea Fisheries to Secure Future Processing in St. Anthony, NL Shrimp Plant
June 5, 2019 Aquaculture News,News-Europe
Jordan Keig from Robinson's Foods, Isle of Man, has been announced as the first winner of the Master Fishmonger Standard Young Fishmonger Award at a ceremony at Fishmongers' Hall, London, home of the historic Worshipful Company of Fishmongers.
Jordan was selected from a shortlist of four candidates by a combination of a public vote and a panel of certified Master Fishmongers. Open to fishmongers aged 25 and under, the award recognises exceptional knife skills as well as customer service and passion for the industry.
A slightly shell-shocked Jordan said: "It still doesn't feel real that I can now call myself MFS young fishmonger of the year 2019. I never thought I could achieve anything like this, so to go and win it is truly amazing. I would like to thank the MFS for providing such a brilliant award and for giving young people who love the seafood industry something to strive for".
Jordan got into the industry through his girlfriend who worked at the market.
The announcement of the winner concluded the second Master Fishmonger Standard awards ceremony which certified 18 fishmongers, covering the full range of career levels from new entrants in the industry up to the Master tier, that requires at least 10 years' experience in the trade.
The first female Master Fishmonger, Elaine Lorys from W Stevenson & Sons, Newlyn, also received her certification, as did John Watson of C Fayre Fishmongers, who is the first Master from Scotland. The tiers' lifetime achievement award, the Companion Fishmonger, also recognised four individuals, including Francis Coakley-Greene. Born into a family of fishmongers, Francis lead a delegation during 'The Cod Wars', for which he later gained recognition by becoming an Honorary Freeman of the City of London.
The ceremony was hosted by Alison Freeman, Programme Manager at the Fishmongers' Company, and included speeches from Giles Shaw, President of the National Federation of Fishmongers, who outlined the importance of accreditation in the sector, and CJ Jackson, CEO of the Seafood School at Billingsgate.
https://www.masterfishmonger.co.uk/
© Copyright 2017 - http://aquaculturedirectory.co.uk


Black Chamber of Commerce, 1950. First Row, left-right; Percy Howard, Dr. J. A. Johnson, Calvin Lewis, Scott Johnson, Miss Holloway, Iowa Jones, O. B. Toliver,K. H. Malone, Second row; Johnny Roberts, J. R. Powell, Alex Holt, ?, Ernest Grover, Sr. , Sapp Delaney, ?, George Oliphint, Aaron Curington, Herman Harper, Lucas Smith;Back row, Andrew Perkins, John Sowells, Earl Larue, Cecil Williams,Earnest McCowan, Carny Allen, Goree McGlothlin, Lucious Jackson.


text:
We hope you will enjoy this free article on York News-Times. You're entitled to view 12 free articles every 30 days, and you currently have 0 remaining. Then, if you enjoy our site and want full access, we'll ask you to purchase an affordable subscription.
We hope you will enjoy this free article on York News-Times. You're entitled to view 12 free articles every 30 days, and you currently have remaining. Then, if you enjoy our site and want full access, we'll ask you to purchase an affordable subscription.
Human trafficking, child pornography arrests linked to Northwest High School
17-year-old Northwest student, teacher arrested
By Jeff Bahr
The Grand Island Police Department, in conjunction with Homeland Security Investigations, today arrested a 17-year-old male and 37-year-old Brian Mohr of Grand Island. The 17-year-old is a student at Northwest High School, where Mohr is a teacher.
"The arrests are in relation to a case in which the 17-year-old male obtained illicit images of minors via a social media ruse, and used some of those images to coerce them into performing sexual acts," says a release from the Grand Island Police Department. "Those images were shared with Mohr. Numerous images have been identified as students at the school where Mohr is employed and the 17-year-old attends."
The 17-year-old suspect was arrested as a suspect in the investigation of first-degree sexual assault, human trafficking of a minor, unlawful intrusion, and multiple counts of distribution of sexually explicit material (child pornography).
Mohr was arrested as a suspect in multiple counts of possession of sexually explicit material (child pornography). All crimes listed are classified as felonies.
"This is an ongoing investigation, and is being worked with the full cooperation of the Northwest School District," the news release says. "If you, or someone you know is affected by this case or as a part of any online exploitation, it is important that you know you are not alone, and that you can contact the Grand Island Police Department at (308) 385-5400 or the HSI anonymous tip line at 866-DHS-2-ICE or https://www.ice.gov/tipline.
"It is important to know that potential victims in this activity are not alone. The Grand Island Police Department and HSI will continue to work toward keeping the youth of our community safe, and will have victim advocates in place to assist persons affected by this case."
Sign up for York News Times Email Alerts


Nature's Resort is located in historic Homosassa Florida home of many fresh-water springs, rivers, wildlife parks and the famous Homosassa Manatees. Nature's Resort is just 90 minutes North of Tampa and St. Petersburg directly off of U.S. HWY 19. Nature's Resorts secluded 97 acres scenic resort is a camper's dream. We are on the Halls River which allows direct access to The Gulf of Mexico.


text:
Q: How to prove that $f(x)$ is constant if $|f(x)-f(y)|^2 \le (x-y)^3$? Let $\mathbb R$ be the set of real numbers and $f:\mathbb R \to \mathbb R$ be such that for all $x$ and $y$ in $\mathbb R$ $|f(x)-f(y)|^2 \le (x-y)^3$. How can we prove that $f(x)$ is constant?
I have a feeling that this has something to do with first principles of differentiation but am not able to get it. I would prefer an intuition based approach!

A: For $y\ne x$, we have
$$
\varlimsup\limits_{y\to x}\dfrac{|f(x)−f(y)|^2}{|x-y|^2}\leqslant\varlimsup\limits_{y\to x}|x−y|=0
$$
So $|f'(x)|^2=0$ and $f'(x)=0$ for all $x\in\mathbb{R}$.
And thus $f(x)=c.$

A: The condition should be $|f(x) - f(y)|^2 \le \color{red}{|}x - y\color{red}{|}^3$ for all $x, y\in \Bbb R$. Fix $a,b \in \Bbb R$ with $b > a$. For every positive integer $n$,
\begin{align}
|f(b) - f(a)| &\le \sum_{k = 1}^n \left|f\left(a + k\frac{b-a}{n}\right) - f\left(a + (k-1)\frac{b-a}{n}\right)\right| \\
&\le \sum_{k = 1}^n \left(\frac{b-a}{n}\right)^{3/2}\\
&= \frac{(b-a)^{3/2}}{n^{1/2}}.
\end{align}
Taking the limit as $n\to \infty$, we deduce $|f(b) - f(a)| = 0$, i.e., $f(a) = f(b)$.

A: Take $x\neq y$ but near $y$, so you can divide lhs by $(x-y)^2$ and observe that the derivative of $f$ equals $0$ for all $x$. Than you have f constant.


text:
Q: Hiding mutual recursive functions in SML I have two functions that rely on each other heavily. Each one must use the other one in order to perform the desired task.
I used the and operator in SML when I used them.
The problem is that I am required to hide every single function that is not the main one. I was taught to use local in order to perform this but I never reached this situation, I can't understand how something like this will work syntax wise.
I am referring to something like this:
local
  f()
in
 g()
end;

Is there any way to do this?

A: You need a third "main" function to start things off – your local f can't be mutually recursive with g.
Like this:
local
    fun f x = something with g
    and g x = something with f
in
    fun h x = whatever
end


Today BitBean has reached the low, hitting 57 satoshis level. There it has rejected the 88.6% Fibonacci retracement level as well as reached the bottom of the descending channel , and rejected it.
The RSI oscilator shows the bullish divergence which could mean that the bottom has been reached and price could start to move upwards. While the support is holding the reversal probability remains extremely high, providing a strong buying opportunity with a very good risk/reward ratio.
BITB/BTC could reached one of the previous resistance levels, that correspond to the extended descending channel upper trendlines . First resistance is seen at 105 satoshis, and second at 158 satoshis. These are only nearest resistance levels and potentially price could go much higher producing a new all-time high.
Now BITB loooks good to buy! What are your thoughts?


text:
Tag Archives: social
461. 25 Deceptively Difficult Questions (with Amber, Paul & Sarah)
An episode about the tricky little questions that we use when socialising. What are the appropriate answers? What are the subtle differences? How do native speakers use these questions? Can you take the test and get all the right responses to my list of deceptively difficult questions?
http://traffic.libsyn.com/teacherluke/461._25_Deceptively_Difficult_Questions_with_Amber_Paul__Sarah.mp3
25 Deceptively Difficult Questions – Proper Introduction Transcript!
This is an episode about social English, the kind of English you use when you're socialising, particularly the little things you say when you greet someone or at the beginning of a conversation.
There are many ways to say "hi" and also lots of ways to say "how are you?" or "what are you doing?" The tricky thing is being able to judge the subtle differences in the questions with the presence of auxiliary verbs or modals which change the meaning slightly from the past, to the present to the future or with slightly different levels of formality.
I'd like to do a test in this episode today. I am going to test you, so get ready.
Here's what's going to happen.
I've prepared a list of 25 questions. I'm going to read them to you in a moment.
As I say each question, what I want you to do is to think really quickly and really naturally about the first thing you would normally say when you hear that question. What's the first answer that comes into your mind?
Let's see if you answer correctly.
To find out the proper answers we're going to listen to me directing those questions at Amber, Paul and Sarah. Then you can listen out for how they answer them and the comments we make afterwards, which should explain these tricky little bits of English.
Not only can you learn some essential social English in this episode, you can also hear plenty of humorous conversation between the four of us.
Sarah's baby is also there in the background. I'm sorry if this bothers anyone. I've removed some of those noises but a few are still there. I think it sounds fine and adds a bit of atmosphere and after all she is a very cute baby.
So, the test. Let's get started.
Are you ready? Just give the first answer that comes to mind.
Also, you should know that some of the questions are intentionally incorrect. So, if you hear a question which is grammatically wrong or just not used ever, you can say "wrong".
Ok, so, your quick answer to the question, or "wrong" if it's incorrect.
I'll say the question once quickly, once slowly and once again quickly.
Some of these questions may seem extremely simple – the point of this is the pragmatics of social English and how you should give certain stock answers to some questions. They get a bit harder as they go along.
Also, you can try to repeat the questions too.
They're going to come pretty quick, so use the pause button if you want.
Here we go. You might think these are easy, but that's why this is called 'deceptively' difficult questions.
*4 questions are intentionally incorrect. Can you spot them?
How are you going?
What's going down?
What's going up?
How have you been up to?
What are you up to?
Can I use your phone?
I can't use your phone, can I?
Do you mind if I open the window?
You don't mind if I open the window, do you?
What are your plans for later?
What are you up to later?
Can you tell me where is the best bar in town?
Do you know how long is it going to be?
Would you be prepared to give me a 5% discount?
Ta = thanks
You're now going to hear all those questions and how Amber, Paul and Sarah will respond to them. See if you got them right or wrong!
I'll go through them again quickly at the end.
Listen to the whole episode for all the correct answers and explanations.
Don't be a ninja! Let me know your thoughts in the comment section.
This entry was posted in American & British English, Culture, Entertainment, Grammar, Humour, Interview, language, Learning, Native Speaker, Podcast Information, Pronunciation, Social English, Vocabulary and tagged english, greetings, hello, questions, social, ways to say on June 24, 2017 by Luke Thompson.
264. Telling Jokes in English (Part 1)
This episode is all about telling jokes, not as a comedian on stage, just in your normal life. Telling jokes is something that everybody does, in countries and cultures all around the world. We all love to make jokes, hear jokes and have a bit of a laugh. For me, jokes are fun and fascinating but I know that for non-native speakers of English they are also notoriously difficult things to manage. If English isn't your first language, it can be difficult to understand jokes, find them funny, and also to be able to tell them effectively.
[DOWNLOAD] [PART 2] [PART 3]
Contents of this Episode
So, in this episode I'm going to tell you everything you need to know about jokes in English, and that includes these things:
What is a joke? (as if you didn't know)
When/why do we tell jokes?
How do we tell jokes? What are the golden rules for telling a joke properly?
What's the normal way to respond to a joke?
What are some the typical joke structures? (so you know how to identify a joke)
What are some jokes that you can remember and share with your friends?
So this is not just going to be a guide to jokes and the way they are told, you're also going to hear lots of jokes too – I'm going to read out loads of jokes, and explain them to you. So that means that you're also going to learn a lot of vocabulary during the episode – because often jokes are based on the specific meanings or double meanings of words.
Most of what I'm saying to you here is written on the page for this episode – that's right, there's a transcript for most of this, so if you want to read what I'm saying – you can. Just find the page for this episode at teacherluke.co.uk.
Not all of it is scripted because I expect I will go off script and say some spontaneous stuff too, but most of it is. That's nice isn't it? Yes it is. Mmm, very nice. I went to quite a lot of effort to prepare this episode in advance and I hope that's obvious. It should be full of genuine insights. If you find it useful, you could consider making a donation by just clicking one of the yellow 'donate' buttons on teacherluke.co.uk. That is entirely optional and completely up to you of course! No pressure!
I expect this will be more than just one episode because it's quite a big subject, and it's a subject which is close to my heart so, naturally I have loads of things to say about this!
It might be the case that I do this first episode as an introduction to the subject of jokes, and then in subsequent episodes I'll go through my list of jokes, and then explain them. That's right, I've prepared a list of jokes. It's quite a random list and hasn't been fully tested for quality. It's just a selection of jokes which I've managed to write down, or poach from other lists on the internet. I'll tell you all those jokes either in this episode, or in separate episodes, depending on how long this all takes.
So this could be another series of episodes of the podcast. There's so much to talk about and to share.
I'd also like to do an episode about telling jokes on stage and how to do stand up comedy, because stand-up is also a fascinating topic and one that more and more people are getting interested in. Telling jokes on stage is quite a different topic, so that's another episode for another time.
I love jokes
I really do. I love hearing them and I love telling them. I love the way jokes exploit double meanings in language. Often a joke is based on a word that means two things at the same time, or two phrases that sound exactly the same. Or a joke might be a little story with a surprise which is revealed at the end. So jokes allow us to have fun with the little holes and coincidences that exist in languages. They're like little language glitches – moments when your brain has to deal with a sudden change in meaning or something that has two meanings at the same time.
I love the surreal world of jokes – the way the normal rules can be broken – rules of language, but also the rules of physics, and behaviour too. Jokes often bend the rules of reality in order to make the punchline work. They lead you in one direction, and then suddenly surprise you with something completely different, and the only link is that the words sound the same.
What am I talking about? Here's an example of a joke in which the punchline has two meanings.
A hole has been found in a nudist camp wall. The police are looking into it.
To get this joke you need to know that the phrase 'to look into something' can mean "to investigate" and also to literally "look inside". So, someone found a hole in the wall of a nudist camp. A nudist camp is a place where people can enjoy spending time with no clothes on, in the nude. Someone found a hole in the wall and the police are investigating it, but they're also just looking into the hole.
A hole has been found in the nudist camp wall. The police are looking into it.
I've said it before and I've said it again – explaining a joke kills the magic.
"Explaining a joke is like dissecting a frog. You understand it better but the frog dies in the process."
― E.B. White
So, explaining a joke may allow you to understand it, but the joke dies in the process – you probably won't laugh after it's been explained. Jokes work best when they are instantly understood. It has to be instant. This is why jokes are often lost on non-native speakers, which is a pity.
However, here at Luke's English Podcast I have a mission – and that is to try and make you laugh while you learn, and if I can't make you laugh I'll certainly aim to teach you something. So even if you don't find all of the jokes I'm going to tell you (later) funny, then that doesn't matter, because in the end you'll learn some double meanings and you'll be more ready to laugh in the future, because I'm going to explain lots of jokes for you. I expect that many frogs will die during the recording of these episodes…
What was I saying? That's it – I love jokes!
Jokes can be stupid, brilliant, pointless, dangerous, harmless, disappointing, unexpected, light-hearted, dark, bizarre, rude, intellectual or even illegal.
Jokes can be just a bit of fun, or they can be used to make serious and critical points. They can be very complex things when you examine them but ultimately, jokes are about fun and laughter – and what is wrong with that?
There are all sorts of social rules that surround the telling of jokes.
They're little bits of language, wrapped up in culture, presented via small social rituals.
Jokes, and humour in general, are often the most difficult aspect of a language to appreciate. The ability to appreciate humour is one of the last things you gain as a language learner.
To get a joke you need to be able to hear the individual words spoken, identify them, understand them, spot the punchline, grasp the pun or word-play and then know how to react appropriately, and this all has to happen instantly. Perhaps most importantly – you need to have identified that it was a joke in the first place, and not just another couple of sentences that you didn't really understand. It can be even harder to deliver a joke – remembering the specific words, getting the timing right, emphasising the relevant words correctly using sentence stress and intonation. Oh my god! It's complicated.
Imagine this situation – I'm sure you've experienced something similar. You're in a group of people. They're all native speakers and you're not. One of them is speaking rather quickly but you can basically follow what's being said – even the complex words and bits of grammar. You feel quite proud of yourself "I'm understanding all of this!". Then the guy says something and everyone bursts out laughing, but to you it just sounded like another sentence. What's wrong with everyone? Then it becomes clear that he just told a joke, and apparently it was a good one. "Was that supposed to be funny?" You think to yourself. Someone explains the joke to you – you think about it, you get it, but it's just not that funny! It's not even clever! Why did everyone laugh so much? Is everyone else weird, or is it you?
The fact is, jokes can be hard to get, and after it's been explained to you the magic has probably gone. You've got to understand it 100%, and instantly. That's why non-native speakers of English are often not very impressed by humour in English. Jokes don't usually translate into other languages because they are based on specific sounds or similarities between words. Also the delay in understanding a joke can kill the enjoyment.
I'm not saying that non-native speakers don't get humour in English. I know they do. Sometimes I make my students laugh a lot, although this is matched by the number of times my student don't even identify that I've told a joke – is that their lack of English, or my bad jokes? A combination of the two I expect. So, even though non-native speakers clearly do laugh at a lot of things in English, I'm well aware that a lot of things are completely lost on them too.
I think that you (as learners of English) need to understand jokes – because it can help you socially, but also because you're missing out on a lot of fun. That's why I've decided to do this episode.
But don't expect this to be a particularly funny episode! There's nothing worse than high-expectations for a joke. If your expectations are too high, you won't laugh. It's like when someone says, "I've got a really great joke, you're going to love this!" then the joke is never that funny. So, don't get your hopes up. Despite the fact that this episode is all about jokes, it's probably best if you realise at this point that there will be no laughs and no fun in this episode at all. OK?
DO NOT EXPECT LAUGHTER!
What is a joke?
It's just anything said that is intended to produce laughter. It could be a traditional joke structure, or a comeback, a sarcastic comment or a small story or whatever. If it is intended to produce laughter, it's a joke.
There are a few words that you should know. They're all different types of joke, or just related to jokes in some way. Here they are:
*a pun = a word joke – a short joke that is based specifically on two words/phrases that have the same meaning or sound the same. For example, "Did you hear about the guy whose whole left side was cut off? He's all right now."
['All right' = okay, but also, 'all right' means 'only the right' – in this case, he only has a right side now because his whole left side was cut off. Yes it's ridiculous. Yes, I like it.]
*a gag = just another word for a joke
*a shaggy dog story = a longer joke with a stupid punchline at the end (e.g. The Pink Gorilla Story or The Prawn Story)
*a one liner = a simple one line joke. E.g. "Conjunctivitis.com – now that's a sight for sore eyes." [Don't get it? Don't feel bad. Conjunctivitis = a health condition in which your eyes are infected and painful, or 'sore'. The expression "a sight for sore eyes" = something which you are really glad to see, because you need it. e.g. "You're a sight for sore eyes" = I'm really glad to see you (maybe because you're attractive and nice, and I'm bored and surrounded by uninteresting people). Also "site" and "sight" sound the same. Here, 'conjunctivitis.com is a website for people who have sore eyes. It's literally a website for sore eyes, and I suppose it's something you're glad to see if you have conjunctivitis.] And if you're in any doubt about the funniness of that joke, it won the "Joke of the Year" award in 2012. That's an award which is given to the comedian who makes the best joke of the Edinburgh Fringe Festival which is one of the world's biggest comedy festivals. It was written by Tim Vine, one of the UK's top comedians. Click here to read more on this story.
*a wisecrack = a clever and funny response
*a comeback = a quick response to a criticism. Winston Churchill was famous for his comebacks. "Mr Churchill, you're drunk!" "Yes, I am. And you're ugly. But in the morning I shall be sober. But you will still be ugly."
or "Mr Churchill, if I was your wife I would put poison in your tea!" "And if I was your husband, I'd drink it!" etc.
*witty (adj) = to describe someone who is funny and able to make quick and spontaneous jokes.
*the setup = the first part of a joke which sets the situation and linguistic context
*the punchline = the funny part of the joke, which is delivered last. E.g. "I couldn't quite remember how to throw a boomerang" = the setup, "but eventually it came back to me." = the punchline. ['come back to me' literally means 'return to me' – like a boomerang does, but it also means 'remember']
*a dad joke = a stupid, safe and rather bad joke. The kind of thing your dad would tell you. To be honest, most of the jokes in this series on jokes are dad jokes. They're not very dangerous or cool. They're pretty disposable, but they're fun, and sweet.
Where do jokes come from?
Most jokes just seem to exist in people's consciousness and nobody knows who wrote them. They get shared orally (or maybe written in emails) and get passed around, but nobody really owns them. When I was a kid, my friends and I used to own joke books. They were compilations of jokes. You could buy these huge books filled with hundreds or thousands of 'knock knock' jokes. We used to go around telling them to each other. There were so many. Sometimes I heard some pretty rude jokes too – jokes that involved sexual things that as a child I just didn't understand. That was a weird way to be introduced to some aspects of sexual depravity – within the context of a joke told by a naughty kid at school. Only later would I understand what they actually meant.
Then there are jokes which have been made up by someone, like a professional comedian – like the conjunctivitis joke. Those ones are actually owned by those comedians and used in their stage performances, and when you tell one of those jokes it's customary to say whose joke it is – "That's a Peter Kay joke" or "That's a Tim Vine joke" for example. It's a surprisingly difficult skill to be able to write really good jokes. If you can do it well, it can make you quite rich. Some of the best comedians, writers and directors started out by writing jokes for other people. For example, Woody Allen, Steve Martin and David Letterman.
Then there are original jokes made up by people on the spot. If you're a clever you might be able to come up with jokes spontaneously – and people might consider you to be 'really witty' (positive) or perhaps just a 'smart aleck' (negative) depending on how well received your jokes or funny comments are.
Mainly in this episode we're talking about the first category of joke – ones that lots of people know, have no 'owner' and which get passed around by word of mouth. As I said, I'll be sharing loads of them with you later in this episode or perhaps in the next one.
A lot of these jokes which are shared by friends have typical structures, which most people know. Like "Knock knock" or "Doctor Doctor" jokes.
There are also social conventions around joke telling that you need to know, for example – how to tell a joke, how to react when someone tells you a joke, how to identify when someone is joking and how to respond to a joke.
For example, if someone says to you,
"What's the difference between a photocopier and the flu?"
You shouldn't try to guess the answer. "Err, well, one is a kind of machine and the other one is a virus. They're really different actually. Why?"
No – this is the wrong response. The person is clearly telling you a joke. You're supposed to say "I don't know" and then wait expectantly for the hilarious punchline.
– "I don't know"
One makes facsimiles; the other makes sick families.
"Haha, good one!" you say, even if it wasn't that good.
Telling and hearing a joke is like a little social interaction with its own specific rules and conventions that you have to know. We'll look at this more later.
What's the point of telling jokes? Why do we tell jokes?
It's all about laughter and how it makes us feel good. According to Helpguide.org – a trusted non-profit online service giving advice about mental and physical health, Laughter is good for your health. "Laughter is the best medicine".
According to them:
Laughter relaxes the whole body. A good, hearty laugh relieves physical tension and stress, leaving your muscles relaxed for up to 45 minutes after.
Laughter boosts the immune system.
Laughter decreases stress hormones and increases immune cells and infection-fighting antibodies, thus improving your resistance to disease.
Laughter triggers the release of endorphins, the body's natural feel-good chemicals. Endorphins promote an overall sense of well-being and can even temporarily relieve pain.
Laughter protects the heart. It improves the function of blood vessels and increases blood flow, which can help protect you against a heart attack and other cardiovascular problems.
The link between laughter and mental health
Laughter dissolves distressing emotions. You can't feel anxious, angry, or sad when you're laughing.
Laughter helps you relax and recharge. It reduces stress and increases energy, enabling you to stay focused and accomplish more.
Humor shifts perspective, allowing you to see situations in a more realistic, less threatening light. A humorous perspective creates psychological distance, which can help you avoid feeling overwhelmed.
Strengthens relationships
Attracts others to us
Enhances teamwork
Helps defuse conflict
Promotes group bonding
Jokes are crap, aren't they?
You might be thinking: "But jokes aren't funny. I sort of hate jokes. They're usually awful and I don't laugh."
Yes, true. They're often terrible – like the bad puns that your Dad tells you, or the awful jokes you get on lollipop sticks or inside christmas crackers, but that's part of the charm really. It's just a bit of fun – stop taking life too seriously! Kids like them of course, because kids don't like to take life too seriously, and because most jokes are brand new to children. Also, when you're a kid is when you are learning about the language and discovering any double meanings can be quite exciting. For me, it's all about having the right attitude and being ready to laugh and find things funny. If you want to laugh at jokes, you will.
When to tell jokes
I suppose the best jokes are the ones that are spontaneous (made up on the spot).
They are usually received best when they are shared in light-hearted joke telling sessions, when everyone is telling jokes. Sometimes that happens – someone tells a joke and then everyone chips in with a joke they know. Like, "I've got one" or "Have you heard this one?" That way you're not forcing your joke on someone who then feels pressure to laugh at a joke they might not find funny or understand.
Be careful of using them to impress people, break the ice or to charm people, like in a business meeting or on a date. They might have the opposite effect. You have to know when to tell jokes. Normally it's in a moment where there's no pressure.
The best results come from comments, or responses that happen spontaneously. If people feel that a joke is too planned or contrived – like you've planned it for days or weeks in advance, you'll look like a prat. So, the best jokes are just unplanned comments that happen in that moment.
So, because the funniest things are spontaneous, it's all about having the right attitude – being open, looking for the funny side of things, being self-deprecating (laughing at yourself), being sarcastic, joking about things that everybody experiences, not picking on anyone in particular, and wanting everyone to be happy and to enjoy themselves.
Jokes are often best told privately. For example, not announcing a joke to the whole room, but sneaking up on someone and sharing it just between you both, quietly.
Jokes can be risky
You might embarrass yourself or others if the joke is not funny or if you 'fluff it' – say it wrong.
Watch out for the content of jokes. A lot of them are pretty rude – and I don't just mean sexually. They often have victims, or could be very politically incorrect. You could offend people and get yourself into serious trouble, depending on the context and the joke of course.
Watch out for these things: jokes about nationalities, jokes about disability, jokes about blondes, jokes about race, sexist jokes or jokes with rude images. I realise that I've just deleted most of the best jokes – but the point is, don't underestimate how offensive a joke can be. Some people might laugh, some might not understand it, and some will take it seriously and be offended. Also, in some places, jokes are outlawed, especially if they are political in nature. So – be careful when joking.
The right joke at the right time makes everything ok.
The wrong joke, told at the wrong time in front of the wrong people could land you in serious trouble.
be spontaneous
don't pick on anyone in particular – don't victimise anyone
be prepared to make jokes about yourself
make jokes about things that everyone is experiencing/sharing
How do you tell jokes?
Perhaps the most common structure for a joke is the Question-Answer format. That means that a joke often begins with a question. It's quite normal to just ask someone that question, and if they're familiar with the culture of telling jokes, they will respond with "I don't know" and then you deliver the punchline.
"Hey, how does Bob Marley like his donuts?"
"Wi' jam in".
"Do you get it? 'With jam in' – 'we're jamming"
"Ha ha oh yeah, I get it! Nice one!" etc.
So, at the right moment you can just tell your joke by asking the question like that.
Sometimes you can say "I've got a joke for you" or "Do you want to hear a joke?" or "Have you heard the Bob Marley joke?"
Try not to say "I've got an absolutely hilarious joke – you're going to absolutely love this!" – because the person will expect too much and it's bound to be an anticlimax.
Timing is important. It also has to be really clear. It has to be comfortably and easily told.
Make sure you learn it properly! The set-up has to be exactly right, and the punchline too!
Make sure the set up is not too long. It has to give only the most crucial information for the punchline to work.
Make sure you know your joke well, because there's nothing worse than telling a joke wrong, or forgetting the punchline. It's the equivalent of a magic trick going wrong – you look like a fool.
Don't expect much of a response, and don't expect your joke to make you popular or anything. The chances are, people won't get it, and if they do laugh, they'll probably just forget about it, unless the person is a joke fan like you. In the right moment though, jokes can be a lot of fun. So, jokes are not worth a lot, unless you find other people who love them, and then you can share your favourite jokes together.
When telling a joke – remember it! Run the joke through your head before saying it. Don't get halfway through the joke and then start again because you forgot it.
Make it clear and be confident. People have to be able to hear and understand what you're saying.
Sentence stress is very important. Usually certain words must be stressed for emphasis.
Make it look quite casual. Don't be too desperate for a response or laughter.
The best jokes are completely improvised comments made in the moment. Sometimes there is nothing better than a very carefully worded quick response to a situation. It can make everyone burst out laughing quite magically. But again – watch out because jokes can backfire. People may find it offensive, inappropriate or just pathetic.
There are risks in joke telling. You risk losing respect from people, or offending people, but the rewards are high. If you make people laugh, they will like you, and ultimately everyone can enjoy a good laugh – and there's nothing wrong with that. In fact, sometimes it's the best, most honest feeling in the world – just letting yourself go and laughing uncontrollably. It's joyful and infections, and being able to create it is a bit like being a good wizard (not an evil one).
Choose to tell good jokes which have a proven track record. Don't tell jokes that don't make people laugh, even if you find them funny yourself.
Don't tell inappropriate jokes – ones that are sexual, racist or which have a victim. Instead try to tell jokes that are universal. Rude jokes can be very funny, but be aware that they are only appropriate in certain situations, and only funny for certain people.
Don't get all angry, upset and defensive if people didn't enjoy your joke. You can't bully people into enjoying themselves. Just shrug it off.
You need to make it clear when the joke has ended and when people are expected to laugh, although don't expect it to happen.
If you're going to make a joke, try to connect it to what's going on at that moment.
Often the best jokes are just one line responses to things happening around you.
Jokes are often best delivered with a straight face, with an understated style. Don't make a big song and dance out of it. In the UK we normally tell a joke quite straight. We don't laugh at our own jokes or slap our thigh when we tell the punchline. Laughing at your own joke too much is considered a bit unattractive.
Be prepared to carry on if the joke fails to make people laugh – people might not notice! Otherwise, it's probably worth admitting that you told a joke and nobody found it funny. Then people will feel less awkward. Sometimes when I tell jokes, nobody laughs. Then I say "that was a joke, by the way, just in case you are wondering" and that sometimes makes people laugh a little bit – maybe out of sympathy if nothing else!
I realise I'm sounding a bit modest here – it may look like I spend all my time embarrassing myself with dodgy jokes. Well, it does happen sometimes, but not all the time.
English people love humour and it's used a lot, for a lot of different purposes – including breaking the ice, as well as establishing power structures or social hierarchies, or breaking down social hierarchies.
I'm sure it's similar in your countries too. Kate Fox says that for the English there is no right or wrong time for humour. I know what she means, but I don't think it's strictly true. We love joking in many situations, and we're always ready for a joke or a funny/sarcastic comment, but of course there is a right or wrong place for it. If you just go around making crap jokes all the time, in every situation, you'll soon become unpopular. I suppose what Kate Fox means is that humour, rather than jokes, pervades all aspects of British life and I agree with that.
The main thing is the intention you have behind your jokes – are you doing it to make people feel happy, to bond your team, to put people at ease, or are you doing it just to draw attention to yourself at the expense of other people's comfort? If it's the latter reason, then it's probably better to curb your enthusiasm a bit.
Really, being funny is more about having the right attitude – being ready, prepared and confident enough to find the funniness in anything.
It's also about being generous – just wanting to make people laugh without spoiling the situation.
It's not about cruelty – bullying or targeting people with humour. It's not picking on other people too much. It is about being willing to take a joke yourself. That's the first step.
Some people just don't want to be a person who jokes – they'd rather be serious and expect people to take them seriously too. That's fine of course. Personally, I think that many of us take life too seriously – and a good sense of humour and the ability to take a joke are admirable, positive qualities. It's hard to be a genuinely arrogant person while taking a joke about yourself. It's a good leveler. It makes people equal in status.
Really, it's just about having an attitude for laughter and jokes. For me it's best when it's sort of selfless.
There's also a love of language involved. Sometimes jokes come out of picking the right words, or playing with language.
One advantage of a good joke is that people's guard goes down when you make them laugh. You can say some outrageous things and get away with it. Also, people will warm to you if you make them laugh. It's charming. Good jokes are harmless (and should be).
Also, there are all the benefits of laughter.
How do you react to a joke?
The worst thing you can do is not recognise it is a joke.
It's also bad if you don't acknowledge that a joke has been told. You have to show that you identified it as a joke, at the very least.
Some acknowledgement is good.
Ideally you'll laugh naturally. You could fake a chuckle but don't go over the top. You could say "good one", or even "that's a good joke!" (without laughing)
If you don't understand it you say: "I don't get it."
If you've heard it before: "I've heard it before."
If you understand the joke, but don't find it funny: You can make a noise, like you're suffering. "Ooohhh!" or even something like "Oh my god what are you like?"
If you understand it and find it funny: laughter!
It may be appropriate then to share a joke that you have too.
What's the culture of jokes in your country?
This entry was posted in Advice, Comedy, Cross Cultural Understanding, Culture, Entertainment, Humour, Idioms, Learning, Native Speaker, Personal, Social English, Transcripts, Vocabulary and tagged humour, joke structures, jokes, rules, social, socialising, telling jokes, types on April 20, 2015 by Luke Thompson.


If you have any request to alter your reproduction of The Madonna and Child with the infant Saint John the Baptist, a wooded river landscape with an imaginary palace beyond, you must email us after placing your order and we'll have an artist contact you. If you have another image of The Madonna and Child with the infant Saint John the Baptist, a wooded river landscape with an imaginary palace beyond that you would like the artist to work from, please include it as an attachment. Otherwise, we will reproduce the above image for you exactly as it is.


text:
Q: excessive memory use by java In a project of mine I constantly compress little blocks of data.
Now I find out that the jvm then grows to 6GB of ram (resident (RES) RAM, not shared or virtual or so) and then die because of out of memory.
It is as if the garbage collector never runs or so.
I've pulled out the relevant code and pasted it below. When I run it (java6, 32 bit linux) it grows to 1GB of ram.
Anyone got an idea how to reduce the memory usage?
import java.util.Random;
import java.util.zip.Deflater;
import java.util.zip.Inflater;

class test  {
    int blockSize = 4096;
    Random r = new Random();

    public test() throws Exception {
        blockSize = 4096;
        byte [] data = new byte[blockSize];
        for(int index=0; index<blockSize; index++)
            data[index] = (byte)r.nextInt();

        for(long cnt=0; cnt<1000000; cnt++) {
            byte [] result = compress(data);
            if (result != null)
                data[0] = result[0];
        }
    }

    byte [] compress(byte [] in) {
        assert in.length == blockSize;

        Deflater compresser = new Deflater();
        compresser.setInput(in);
        compresser.finish();
        byte [] out = new byte[in.length];
        int outLen = compresser.deflate(out);

        if (outLen < blockSize) {
            byte [] finalOut = new byte[outLen];
            System.arraycopy(out, 0, finalOut, 0, outLen);
            return finalOut;
        }

        return null;
    }

    public static void main(String [] args) throws Exception {
        new test();
    }
}

A: Well, Folkert van Heusden solved his own problem, but to summarize:
Early in the compress(byte [] in)-method, we create a java.util.zip.Deflater.
We use the Deflater to do some stuff, and then we leave the compress()-method. We loose our reference to the deflater-variable. At this point, the Deflater is no longer in use, and is waiting to be killed by the garbage collector.
Deflater allocates both Java heap memory and C/C++/native heap memory. The native heap memory that are allocated by a Deflater, will be held until Deflater.finalize-method is called by the garbage collector. If the garbage collector doesn't run fast enough (there might be plenty free java heap memory), we can run out of C/C++ heap memory. If this happen, we will get "Out of memory"-errors.
The Oracle bug report JDK-4797189 is probably related. It contains a code snippet that illustrates and reproduces the problem:
public class Bug {
    public static void main( String args[] ) {
        while ( true ) {
            /* If ANY of these two lines is not commented, the JVM
             runs out of memory */
            final Deflater deflater = new Deflater( 9, true );
            final Inflater inflater = new Inflater( true );
        }
    }
}

The solution is to free the resources when you are finished by calling the Deflater.end()-method (or Inflater.end()).

A: Well, It seems to me that there is no memory leak in the code, so it actually seems the VM is not GC-ing byte arrays.
"Anyone got an idea how to reduce the memory usage?"
Well, I would try with
byte firstByteOfDataWhichIsCompressedAndThenUncompressed(byte [] in) { ... }

which specifically returns the first byte of the uncompressed array, rather than the whole array. I know, it's a horrible method name, and I hope you will find a better one.
The following code
    for(long cnt=0; cnt<1000000; cnt++) {
        byte [] result = compress(data);
        if (result != null)
            data[0] = result[0];
    }

would become
    for(long cnt=0; cnt<1000000; cnt++)
        data[0] = firstByteOfDataWhichIsCompressedAndThenUncompressed(data);


the chord you are on.
x  y x y    x  y x y   Sim.
we're just one big family.
Jason Mraz - Im Yours Tab :: indexed at Ultimate Guitar.
Show us your talent, perform Im Yours Tab!
Here you can post a video of you playing the Im Yours Tab, so your fellow guitarists will be able to see you and rate you.


text:
We spent all day at the British Museum, mostly looking at mummies and other antiquities that were stolen from other countries. This idea had never bothered me before, but it does now, especially after the Hobby Lobby scandal. The museum had renovations done since I was last here (in the 1980's). The inner courtyard was enclosed with what is basically a glass dome. See photo below. There's a new building in the middle which houses the massive gift shop which sits on top of the bathrooms which are down a long spiral stairway in the basement. These are the only toilets in the museum, so plan accordingly. The British Museum is the oldest public museum in the world, but the Victoria and Albert Museum has the world's oldest cafe in a museum. More about that later.
Here's a lovely woman who I met while queueing for the toilets. She comes here (to the museum, not just the toilets) every year on holiday and because holidays are special, she comes in fancy dress! Don't you just love her to pieces?
If you are a woman, you already know this, but I'll say it anyway. This is one of those places that still has gendered toilets so there aren't nearly enough toilets for women. The other problem is, the whole thing was badly designed in terms of traffic flow. The only way in (down and around the long spiral staircase) is also the only way out. The same is true once you get inside the women's toilets. You have to queue down a hallway of sinks on either side which means that the women coming out of the toilets can't get to the sinks because you are all standing in front of them, waiting to get into the toilets. And remember, these are the ONLY toilets in the ENTIRE MUSEUM.
The highlights for me were the Rosetta Stone, the Sutton Hoo artifacts, and of course, the mummies. There are no paintings in the British Museum, those are in the National Gallery and the National Portrait Gallery (two different museums which I only realized after reading an essay by Neil Gaiman in which he said he didn't realize it either and he's from there). We did the Egyptian galleries first, then the Asian galleries, We bought lunch for $7 from a cart inside the museum, then took it outside to eat in the fresh air. It was a baguette with meat and cheese, a bag of crisps, and a bottle of water. The museum lacks proper Texas air-conditioning and there were entirely too many people all crowded in there, so we needed to de-stress outside for awhile. After lunch,  we went to the European galleries for Sutton Hoo, and then the Asian Galleries and finally the Classical Galleries.
Egyptian Gallery
Sutton Hoo Gallery
Classical Gallery
Mesopotamian gallery
It was a half a mile walk to the British Museum from our hotel. On the way we discovered our favorite tea shop, Drury, which was right across the street from our hotel. On the way home from the museum, we stopped in for tea for the first time and then went back every chance we could.


A map of all the steps between today and tomorrow (no guessing or hoping allowed).
Your organization is only prepared for today, not tomorrow.
You're nervous that new administrations or political climates will jeopardize your funding streams.
Your strategic planning process feels is overwhelming—or worse, you don't even have a strategic plan.
Your communications are reactionary and you're spending a lot of time developing single-use materials.
Your plan should shift your day-to-day operations away from churning out an assembly line of services back toward achieving your mission. Your plan should include diversified funding streams that keep your organization on solid ground.
Plans shouldn't be complicated—our innovative perspective and hands-on workshops can help you develop an actionable, flexible, and transcendent strategy.


Leading Wholesale Trader of ss bolt, gi bolt and hexagonal brass bolt from Ahmedabad.
We introduce ourselves as the most trustworthy wholesaler, trader and supplier of huge assortment of SS Bolt.
We are the most prominent name in this domain, engaged in wholesaling, trading and supplying an acoustic range of GI Bolt.
We take pleasure to introduce ourselves as the leading wholesaler, trader and supplier of an excellent quality Hexagonal Brass Bolt.


text:
MARCH 08, 2013 12:00 AM (EST)
A.M. Best Upgrades Ratings of Mississippi Farm Bureau Casualty Insurance Company
Neil Das Gupta
neil.dasgupta@ambest.com
Joseph A. Burtone
joseph.burtone@ambest.com	 Rachelle Morrow
OLDWICK, N.J. - MARCH 08, 2013 12:00 AM (EST)
A.M. Best Co. has upgraded the financial strength rating to A- (Excellent) from B++ (Good) and issuer credit rating to "a-" from "bbb+" of Mississippi Farm Bureau Casualty Insurance Company (Mississippi Farm Bureau) (Jackson, MS). The outlook for both ratings has been revised to stable from positive.
Mississippi Farm Bureau's ratings reflect its solid risk-adjusted capitalization and generally favorable underwriting and operating performance in years when it has benefited from milder weather patterns. Management also has taken numerous steps in recent years to improve earnings through re-underwriting initiatives, including rate adjustments and increased monitoring and management of risk exposures along both coastal and inland areas. Additionally, its comprehensive reinsurance program, which includes catastrophe reinsurance coverage, has helped to mitigate surplus declines in years with frequent and severe weather-related losses.
Mississippi Farm Bureau's ratings also recognize the support it receives from its ultimate parent, Southern Farm Bureau Casualty Insurance Company. Explicit support has taken the form of capital contributions including long-term surplus notes, as well as a provision of infrastructure, technology, back office operations and risk management resources. While the company is well positioned at its current rating level, as a property writer in a single state with coastal exposures, it remains susceptible to frequent and severe weather events that could adversely impact its operating results and surplus position, thereby placing potential negative pressure on the ratings.
The methodology used in determining these ratings is Best's Credit Rating Methodology, which provides a comprehensive explanation of A.M. Best's rating process and contains the different rating criteria employed in the rating process. Key criteria utilized include: "Understanding BCAR for Property/Casualty Insurers"; "Risk Management and the Rating Process for Insurance Companies"; "Catastrophe Analysis in A.M. Best Ratings"; and "Equity Credit for Hybrid Securities." Best's Credit Rating Methodology can be found at www.ambest.com/ratings/methodology.
Founded in 1899, A.M. Best Company is the world's oldest and most authoritative insurance rating and information source.
000513 Mississippi Farm Bureau Casualty Ins Co
000844 Southern Farm Bureau Casualty Ins Co