Livecode: resolving “could not compile service support class”

I’m not going to tell you how long I’ve spent figuring out why LiveCode wouldn’t compile to Adroid, throwing “could not compile service support class” errors. Apparently this is one of the more common errors when compiling to Android, but typically this indicates a problem with the “mobile setup” (Android Studio, Java).

This was different. I had LiveCode (9.0.3) setup on a Windows machine, Android Studio installed and properly setup. The “mobile” preferences looked OK (path to Android SDK and Java were present and correct), and most crucially, using this setup I had compiled stacks successfully. Now I had a very simply stack and suddenly I got this error. Shockingly, the stack that had compiled an hour earlier wouldn’t compile anymore. I tried many things, and sometimes the stack that was ‘good’ before would still compile, but sometimes it wouldn’t.

It turns out that although LiveCode generally is not case sensitive, it actually can be. I had this one line in my code (this code actually doesn’t work on Android, but I wanted to test whether it works):

set the defaultFolder to specialFolderPath("Documents")

it should have been:

set the defaultFolder to specialFolderPath("documents")

Yes, really, that was all. So in this instance, LiveCode was case sensitive, and quite atypically it didn’t detect the error during coding (LiveCode’s errors when compiling for mobile can be quite cryptic/useless).

Now, I also found that once I got this error, LiveCode would fail to compile anything (yes, even an empty stack) — until I restart the program. So I learned two things here: first, LiveCode can be case sensitive, second, when LiveCode throws this error, I need to re-start the program before trying to compile again.

New paper on exposure in the job and attitudes to immigrants

I have the pleasure to announce our new paper on attitudes to foreigners. Marco and I wanted to move beyond the share of foreigners in geographically defined areas: We examined the share of foreigners in one’s job and how this is linked to attitudes. A key motivation for doing this was that many contributions on attitudes to immigrants seem to dismiss competitive threat in the labour market despite not providing a realistic test of such competition. Just think a moment: I’m not competing with (foreignany) workers in the construction sector, and I’m not competing with many of the highly educated immigrants workers either. We have segmented labour markets, and we should account for them in our analyses.

We find that a higher share of foreigners in one’s occupation correlates with more negative attitudes to immigrants. This suggests that workers react to competition with foreigners. When we dig deeper, we find that objective pressures in the labour market (we use the unemployment rate in each occupation) matter, just like contact with foreigners at work seem to alleviate negative attitudes. In fact, it turns out that sorting on job quality can probably account for these factors, especially objective pressures in the labour market.

Where does this leave us? It appears that workers react to immigrants at work in a differentiated manner. On the one hand, they dislike workers competing with them, on the other hand, they welcome them when they help overcome labour market shortages.

Pecoraro, Marco, and Didier Ruedin. 2019. “Occupational Exposure to Foreigners and Attitudes towards Equal Opportunities.” Migration Studies. https://doi.org/10.1093/migration/mnz006.

Causal Inference: The Mixtape

Here’s a nice overview of causal inference by Scott Cunningham. Yes, you get an entire book as a free download, and it’s got you covered from probability to Pearl’s directed acyclical graphs, from instrumental variables to synthetic control. It comes across quite friendly, but has enough econometrics to scare many off. I quite enjoyed the historical bits thrown in here and there to explain where the methods came from.

http://scunning.com/mixtape.html

LiveCode: The package appears to be corrupt on Android

I’ve spent a while figuring out why my LiveCode app on Android wouldn’t install. It was quite odd given that I have compiled and installed other apps from the same machine on the same tablet, but I couldn’t even get an empty card to work. Several pages on the web pointed out that “The package appears to be corrupt” cannot be the case for LiveCode, and I did allow external apps to be installed (otherwise I wouldn’t even get this far).

It turns out that I forgot to set the right key! Of course, once I figured this out, it seemed to obvious, but I needed the setting under “Standalone Application Settings…” to look like this:

I’m putting this out there because none of the pages discussing the “The package appears to be corrupt” error on Android and LiveCode seem to mention this.

National Study on Ethnic Discrimination in the Housing Market

Today I’m giving you the first national field experiment on ethnic discrimination in the housing market. Financed by the Swiss Office for Housing and the NCCR on the move, we examined to what extent one’s name affects the likelihood to be invited to view an apartment. We covered the entire country, across language regions and across urban and rural areas.

Between March and October 2018, our diligent research assistants sent more than 11,000 enquiries to over 5,700 landlords in all parts of Switzerland. We varied the name of the person sending an enquiry (stimulus sampling) along with other features such as politeness or the family situation. Overall over 70% of the enquiries were answered positively in the sense of an invitation to view the apartment or steps in this direction.

We find no clear differences between commercial and private landlords. The response rate for women was around 1 percent higher, while highly qualified people had a 2 percent higher response rate, especially academics who use their doctoral title (we dind’t expect this to make such a big difference when we designed the study). As previous field experiments have shown, the quality of the message we sent affected the probability of a response: Compared to a standard text, the response rate for friendlier queries is about 5 percent higher, while queries with the default text from online portals show a 10 percent lower response rate.

We find evidence of ethnic discrimination in the sense of unequal treatment based on the name. Enquiries with names from neighbouring countries (Germany, Italy, France) were even invited somewhat more frequently to view apartments than those from Switzerland, but people with Kosovar (response rate just under 3 percent lower) or Turkish names (response rate about 5 percent lower) have significantly fewer chances of being invited for a viewing. Whether those interested were naturalised with foreign-sounding names or stated that they had a permanent residence permit was hardly a factor. The rate of discrimination we observe is similar in order of magnitude to that found in comparable studies in other Western countries.

With the national coverage, we can also observe variation in responses by local context where the property is located. In municipalities with higher rental prices, the positive response rate is higher for everyone, and a higher vacancy rate in the municipality is associated with a higher response rate, except for people with Kosovar names. In urban areas the probability of discriminating against people with foreign names is lower. We also find that people with foreign-sounding names are less likely to be invited in municipalities with restrictive political attitudes towards immigration (as measured in the results of popular initiatives and referendums).

Auer, Daniel, Julie Lacroix, Didier Ruedin, and Eva Zschirnt. 2019. ‘Ethnische Diskriminierung auf dem Schweizer Wohnungsmarkt’. Grenchen: BWO. https://www.bwo.admin.ch/bwo/de/home/Wohnungsmarkt/studien-und-publikationen/diskriminierung-auf-der-schweizer-wohnungsmarkt.html.