Monday, January 29, 2018

Noise cancelling headphones (2)

After my original post on the subject, I did more searching on the net and eventually decided to purchase a pair of Sony MDR-ZX770BN headphones; these have received good reviews and are not too expensive.  I could have bought a pair from an Israeli supplier at what appeared to be a slightly higher price than the British supplier from whom I bought, but once other factors such as shipping and customs charges were taken into account, it looks like I made a poor decision regarding the vendor.

As these are proper headphones made by a very reputable manufacturer, the packaging was extensive: not just a plastic bag, but a box which fits inside a box which fits inside another box! There are also legible instructions in about fifteen languages (although Hebrew does not appear to be one of those). 

As seems to be the norm with such headphones, they receive their music via Bluetooth or via a cable. For the time being, I'll have to connect the headphones to my old (but good!) mp3 player via the cable; it might be possible to tape the player to the headphones. I have ordered a Bluetooth mp3 player which accepts a memory card, so I won't have the cable problem in the future. These are not the outcomes which I wanted but they are acceptable.

I used the accompanying USB cable (the same as my Kindle cable) to charge the headphones. A red light did come on to show that the headphones were charging; presumably it turned itself off when the battery was fully charged (I'm not sure about this). A press of a few seconds on the power button turns the headphones on; I think that a press on the 'nc' button turns the noise cancelling function on. I can't hear any difference at the moment but then I'm sitting in a quiet place.

The real test will be in two days' time when I travel to Karmiel. Will I hear extraneous noise? Will I hear my music at a reasonable level? All will soon be answered.

Monday, January 22, 2018

Braised beef

I don't normally cook beef, for several reasons: I don't like the taste or texture, it costs much more than chicken, and I've only rarely cooked beef to the satisfaction of my wife. On Friday night, however, things changed.

I get some of my recipes from this site, which is in Hebrew and sometimes in French; the recipe which I followed is here. I asked my wife to buy 1.5kg beef which we call 'number 8'; I don't know what it's called in English, but one can see from the accompanying diagram that it comes from the upper part of the cow's front legs. This is the cut which I use sometimes for cholent; as I wrote there, this cut is ideal for stews as it contains a large amount of collagen which is broken down to gelatin during the cooking process.

On Thursday night, I placed the two large pieces of meat into a pot, covered them with water and added two quartered onions. I then cooked the meat on the gas for an hour and a half; afterwards, I stored the meat and the liquid separately in the fridge.

On Friday afternoon, I prepared an evil mixture of soy sauce, salt, pepper, parsley, paprika, soup powder and garlic; the recipe says to mix these ingredients together, then press them into the flesh of the cooked meat. I put them directly into the same container which held the beef, but I should have mixed them first in a separate bowl before pouring the mixture onto the beef and massaging it. I sliced sufficient raw potatoes to cover the cooking pan, then placed the beef and the marinade on top of the potatoes, as well as the original cooking liquid (plus onions). Finally, I covered the pan with aluminium foil. Cooking time was one hour at 200°C and a further two hours at 175°C.

All the carnivores of the family were very appreciative of the dish. I think that I got a lump of unmixed soup powder on my plate, as the meat was too heavily spiced for my liking. I received approval to cook this dish again in the future, but to reduce the quantity of the marinade. The dish is maybe twice as expensive as chicken dishes, so maybe I'll cook it once every six or eight weeks (my daughter, son-in-law and grand-daughter eat with us on alternate weeks).

I'm adding  a new tag to these posts: SO will mean that the post includes my 'scores' from Stack Overflow and Music Practice and Performance.

[SO: 4662;  5, 22, 44
MPP: 1105; 1, 6, 7]

Sunday, January 21, 2018

Art turns into reality

Many of the story lines of tv series "Madam Secretary" seem to have no connection with reality. Thus it comes as quite a shock when two story lines seem to have been influenced by reality, or possibly the story lines have influenced reality.

A few weeks ago, there was an episode (S4E4) which had in its background a government shutdown. As a result, most of the State Department employees were sent on unpaid leave. The same thing is happening today in real life.

Even more disturbing was the episode that I saw yesterday - S4E12, aka 'Sound and fury': this episode has the president acting more like a dictator, ignoring the advice of his National Security team and firing the Defense Secretary who refused to carry out an immoral order. The highlight of this was the statement which I paraphrase as "I am the strongest man in the world. This is what I want and you will do it". Eventually the cabinet held what might be termed a mutiny (mutiny is for enlisted personnel, barratry is for offices), insisting that the president stand down until his medical condition is evaluated. It transpires that the president has a growth which is pressing down on his frontal cortex, causing his personality and decision making functions to change. A short course of anti-steroids and he's back to normal! (Although he will have to undergo surgery to remove the growth.)

Does this sound familiar - except for the absence of a growth (the real-life US president had a medical check about a week ago)?

Fortunately I am not an American, so I can view these events in an objective manner.

I wonder whether real-life Americans talk about the constitution as much as their fictional counterparts do.

Saturday, January 20, 2018

Noise cancelling headphones

When I travel by train, which I do about one and a half times a week, I listen to music via headphones. This is partially to mask the sounds of the train itself and partially to mask the sounds of other passengers - Israelis are not the type to sit quietly! I have noted that I really have to crank the volume up, to listen at a much higher volume than I would prefer.

As a result, I have started to suffer from tinnitus, which manifests itself as a wash of white noise at a high frequency. Fortunately, it comes and goes; it's barely present on the days when I don't travel. I would like to reduce the volume in my headphones when travelling, which is what leads me to noise cancelling headphones. These should allow me to listen at a much lower volume whilst shutting out all the extraneous noise.

Being slightly old-fashioned (these days, this means a year or two behind the times), I prefer to store my music on a TF card as opposed to storing the music on my telephone and transmitting to the headphones via Bluetooth. After searching on Ebay for noise cancelling headphones which can accept a TF card, I ordered one such device for the princely cost of about $25. The headphones arrived very quickly, but before I could use them, I had to photocopy and enlarge by 50% the very small user instructions. Thus armed, I could understand what I needed to do in order to play music stored on the memory card.

The initial volume was extremely loud; after pressing on the correct button to reduce the volume, I tested the noise cancelling functionality ... which did not seem to be present. I got in contact with the suppliers, who very quickly responded that another purchaser had asked the same question recently. It turns out that there is no noise cancelling, which is why some of their advertising material does not mention this (but their headline does). In other words, these headphones are functionally the same as the ones I already use. The new headphones have bluetooth and make announcements, but the controls are harder to access and I couldn't see how to fold them (the picture on the left is not of the model which I purchased).

In other words, I was duped. I will keep these headphones in reserve for the day when my main headphones cease working, but otherwise I'm back where I started. Looking again at Ebay listings, it would seem that any decent pair of noise cancelling headphones is going to cost over $100 and will be made by a respectable manufacturer, eg Bose or Sennheiser. None of the models which I have found accept TF cards (I wonder why), but all have either Bluetooth or the ability to connect to an external mp3 player. I shall continue looking ....

Friday, January 05, 2018

Business rules in Priority which do not apply to specific users/2

In my previous post on this subject, I wrote at the end The only problem with this is that the above uses one of the business rule's three conditions, and there may not be a condition to spare. A simple solution to this problem occurred to me today.

Let's say that a rule has all three possible conditions defined, and that one of them is "branchname = 400" (I have several rules like this). All I need do is leave the "branchname = ', part and define the expression
(SQL.USER IN (1, 205) ? 'A' : '400')
This condition kills two birds with one stone: if the user number is 205 (me), then the expression will return 'A' which means that the condition and thus the rule will fail. For a regular user, the value 400 will be returned; if this value matches that of 'branchname', then the rule will execute (preventing the user from doing something), but if the branchname is not 400, then the rule will fail. Which is exactly what happens now.

At the moment, I can't see how I can use this technique if the condition is something like 'order type <= 007', but I'm sure that at least one condition out of the three per rule will be testing equality. One only has to choose the most suitable condition for this technique.

[Edit from 07/01/18]
One rule which I needed to change had a condition 'and order.branchname not equal to 200'. I was stumped at first how to change this condition so that it doesn't affect me, but after a few minutes cogitation, I found this solution:
(SQL.USER IN (1, 205) ? :$$.BRANCHNAME : '200')
Or in English, if the current user is either 1 or 205, return the value of 'order.branchname', else return 200. For me, the condition then becomes 'and order.branchname not equal to order.branchname', so of course the condition fails and the rule does not apply to me.

[SO: 4632; 5, 22, 44
MPP: 1065; 1, 6, 7]

Thursday, January 04, 2018

Business rules in Priority which do not apply to specific users

I've written a few times about business rules in Priority, and it seems that thinking about these rules has opened up a few possibilities. A business rule is inclusive: one defines for which users (or groups) the rule is effective. This sometimes means that the same rule has to be defined several times, once for each group of users. There is no way of defining a business rule to be exclusive, i.e. it applies to everyone except a few users.

... Or is there? After a little creative thinking, I realised that I could define an exclusive rule. The way to do this is to define one of the three conditions that business rules allow in the following manner: the document's date is equal to the following function:
(SQL.USER IN (1, 205) ? 'A' : :$.CURDATE)
This piece of gibberish, when translated in English, means that if the current user's number is 1 or 205 (1 is the system manager, 205 is my user number), then return the value 'A', else return the document's date. If the current user's number is 6, then the condition will be true (document date = document date) and so the business rule applies to this user. If the current user's number is 205 (i.e. me) then the condition will be false, and so the business rule will not apply to me.

Convoluted logic, but it works. The only problem with this is that the above uses one of the business rule's three conditions, and there may not be a condition to spare. It might be possible to chain the above logic, but I suspect that it won't work.