Math Genius: Question about boundary of super-level sets of a continuous function

Original Source Link

I want to prove the following statement.

Let $Omega$ be an open subset of $mathbb{R}^n$ and let $f in C^0
(Omega;mathbb{R})$
. Then, for every $r in mathbb{R}$ $$partial
left{ f > r right} subseteq left{ f =r right},$$
where
$partial$ denotes the topological boundary and $left{ f > r
right}=left{ x in Omega : f(x) > r right}$
.

My attempt: Suppose by absurd that there exists $bar{x} in partial left{ f > r right}$ such that $f (bar{x}) > r$. By continuity, there exists an open neighborhood $U_{bar{x}}$ of $bar{x}$ such that:
$$f (y) > r quad forall ; y in U_{bar{x}},$$
i.e. $U_{bar{x}} subseteq left{ f > r right}$ and then
$$U_{bar{x}} cap left{ f > r right}^c=emptyset,$$
and this is an absurd with the definition of $partial left{ f > r right}$. Similarly for the case $f(bar{x}) < r$ and then $$bar{x} in partial left{ f > r right} quad Rightarrow f(bar{x})=r.$$

Is it correct?
Thanks

You arguments are correct (provided the boundary is taken in $Omega$, but not in $Bbb R^n$,
otherwise the boundary can have points outside $Omega$, in which $f$ is undefined).

PS. Instead “by absurd” I usually write “to the contrary”.

Tagged : / / / /

Code Bug Fix: Eclipse – Unexpected error loading extension: org.eclipse.equinox.p2.metadata.repository.compositeRepository

Original Source Link

Suddenly I was not able to check for Eclipse updates and every connection to an online repository was failing do to the following error, visibile in ECLIPSE_WORKSPACE/.metadata/.log

    !ENTRY org.eclipse.equinox.p2.metadata.repository 4 0 2020-05-15 09:58:58.981
    !MESSAGE Unexpected error loading extension: org.eclipse.equinox.p2.metadata.repository.compositeRepository
    !STACK 0
    java.lang.LinkageError: loader constraint violation: loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @59ec6f70 wants to load interface org.apache.http.client.CredentialsProvider. A different interface with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @58c5820f. (org.apache.http.client.CredentialsProvider is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58c5820f, parent loader 'platform')

I found out that running Eclipse in clean mode was the key to solve this issue: here‘s there more info about using that mode.

Tagged :

Linux HowTo: Wine says “fixme:heap:HeapSetInformation” when trying to run command

Original Source Link

Fedora 21 x64 (LXDE spin)
wine-1.7.30 (Compholio)

Under Linux Wine I’m trying to execute this command:

$ wine "/home/user/.foobar2000/drive_c/Program Files/foobar2000/foobar2000.exe" /runcmd-playing="Tagging/Quick Tagger/Set <Rating> to/[Remove Field]"

Problem is that when I execute it I get this error

fixme:heap:HeapSetInformation (nil) 1 (nil) 0

Although i’m able to execute the code, i’m greeted with an error at every login.

This is because I have it in LXDE’s lxde-rc.xml config file. It says there is an error at the end of the very file but that’s due to this particular syntax, so the error message is irrelevant at this point.

In my experience this has something to do with trying to run a 32-bit program in a 64-bit wineprefix. To fix this, create a 32-bit wine prefix:

# This creates one at ~/.wine32 but it can be anywhere you own
# Note that it MUST NOT exist. winecfg MUST create it.
WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg

You also need to specify this wineprefix as an environment variable whenever you want to run a 32-bit app. This will set anything in the current shell session to run in the 32-bit wine prefix:

export WINEPREFIX=~/.wine32

Then run the foobar2k installer then run foobar2k with:

wine "/home/user/.wine32/drive_c/Program Files/foobar2000/foobar2000.exe" /runcmd-playing="Tagging/Quick Tagger/Set <Rating> to/[Remove Field]"

Tagged : /

Making Game: Visual Studio 2019 unable to locate .Net Core SDK

Original Source Link

I’m following this tutorial – Share Azure Spatial Anchors
across sessions and devices
– at Microsoft Docs.

It requires I open a project in VS,
but when I try to open it I get the following error:

error : The project file cannot be opened by the project system,
because it is missing some critical imports or the referenced SDK
cannot be found.

Detailed Information: Unable to locate the .NET Core SDK. Check that
it is installed and that the version specified in global.json (if any)
matches the installed version.

I have the SDK version specified in the JSON
and all the other tools specified in the tutorial, but still nada. 
I think I’m missing a step somewhere. Any help would be hugely appreciated.

Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko’s answer). Take note of the greatest version number.

enter image description here

Step 2) Create a global.json file at the root of the solution with the exact version number from step 1. it needs to contain all the digits otherwise it wont work. This is the my version at the time of writing

{
  "sdk": {
    "version": "3.1.101"
  }
}

Try running dotnet --list-sdks in the console.
According to the info on the pages that appear after downloading .NET Core SDKs from https://dotnet.microsoft.com/download, you need to have version v2.2.106 for VS2017 and v2.2.203 for VS2019.

With only the v2.2.203 installed projects didn’t load for me in VS2019.
I had to install v2.2.105 too.

I fixed it by installing the x86 version of the SDK.

It looks like each version of Visual Studio has it’s own corresponding dotnet version that it builds on. This is due to msbuild requirements.

If you are a Visual Studio user, there are MSBuild version requirements so use only the .NET Core SDK supported for each Visual Studio version. If you use other development environments, we recommend using the latest SDK release.

https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2.6/2.2.6.md

As detailed on that page, you’ll need the following versions of dotnet for each visual studio version:

  • Visual Studio 2017 (Windows): .NET Core SDK x86 2.2.108
  • Visual Studio 2019 version 16.0: .NET Core SDK x86 2.2.205
  • Visual Studio 2019 version 16.1: .NET Core SDK x86 2.2.301
  • Visual Studio 2019 version 16.2: .NET Core SDK x86 2.2.401

I had this problem because I uninstalled some older dotnet SDKs. Not only would VS2019 no longer load dotnet core projects, but dotnet was no longer available on my path and so not available on the command line as simply dotnet.

After installing multiple older versions of dotnet and reparing my VS2019 install, I was finally able to fix it by adding C:Program Filesdotnet to my path. Then VS2019 would load the project again.

Also, none of this affected VS2017, which could load and fully work with the project. And it worked on the command line when I specified the full path to the dotnet executable.

None of the above worked for me. I noticed that I was having the issue on every type of project, even non-netcore. I was able to use the global.json and get that working. Then I noticed that I had a global.json in a directory further up which was referencing an alpha build of .net core. Deleted that file and bingo no further issue.

tl;dr

Make sure that there are no global.json files further up in your directory structure that are screwing things up.

I had the same error a while back which caused my web api projects to fail during the solution loading process.

I solved it by reinstalling the following items from https://dotnet.microsoft.com/download

  • .Net Core Runtime (2.2.401 was the latest at the time)
  • .Net Core SDk (2.2.6 was the latest at the time)

I faced this problem in vs 2019 v16.3
I have uninstalled old versions of netcore 2.1 SDK except version 2.1.801.

I found a file global.json in the folder: c:Usersadmin (my login user is admin) that point to uninstalled version 2.1.602

Although netcore SDK version 2.1.801 is installed, it’s not used because it doesn’t match the Patch number.

from documentation:

The patch version is defined by the last two digits (yz) in the last portion of the number (xyz) for SDK versions 2.1.100 and higher. For example, if you specify 2.1.300 as the SDK version, SDK selection finds up to 2.1.399 but 2.1.400 isn’t considered a patch version for 2.1.300.

I modified the file to point to 2.1.801 and it’s working fine

In my case, remove program files(x86)dotnet in Environment path then restart visual studio and it worked.

I was able to fix the VS 2019 issue with the below steps

  1. Run dotnet --list-sdks to know the exact version of the SDK installed
  2. Modify the global.json file in the root folder of the project (In my case it was showing 2.2.100 but I had 2.2.401 installed, I edited the same to point to that version and I was able to reload the projects

I found the same issue. It was releated with this bug https://github.com/dotnet/core-setup/issues/4236

That seems to be a bug in dotnet x86 version.

I just changed x64 dotnet (C:Program Filesdotnet) to be before x86 dotnet (C:Program Files (x86)dotnet`) in the %PATH% environment variable and it worked just fine.

I tried everything listed in the answers with the same error in VS 2019 and ultimately the thing that wound up fixing it was following these steps:

Right-clicked on Solution and hit ‘Resolve Errors’

I spent a full day installing and uninstalling various .net packages and of all the things, that’s the one that got it to build.
…If Microsoft can tell where an error is, why doesn’t it just try to resolve it automatically?!

I ran into this today, where a solution has some (but not all) the projects using .net core; I had not been into this project in probably a month and had not intentionally done anything with the .net SDKs, so this was a mystery what the heck happened.

My project has no global.json at the root, creating one with the the latest (3.1.201) from dotnet --list-sdks didn’t help. WTF?

Then I found this: https://developercommunity.visualstudio.com/content/problem/896868/unable-to-locate-the-net-core-sdk-after-1650-previ.html

Visual Studio now removes previous .NET Core SDKs. If you encounter this problem, you can:

– Install .NET Core SDK from https://dotnet.microsoft.com/download.

  • Don’t use global.json. The latest version of the .NET Core SDK is the default and can build apps targeting earlier versions of the .NET Core Runtime.

  • Include a roll forward indicator (in global.json) such as the following which will ensure running with any SDK higher than 3.1.100 [see link for details]

A routine install of the latest .NET sdk (3.1.300) resolved this issue, but this feels like really poor behavior of Visual Studio – if it can’t find an SDK, maybe tell us which one it’s looking for? Ugh.

Tagged : /

Code Bug Fix: __init__() missing 1 required positional argument: ‘channel’

Original Source Link

I’m trying to use this from git: https://github.com/adafruit/Adafruit_CircuitPython_MPR121/blob/master/adafruit_mpr121.py

Inside the class it defines:

class MPR121_Channel:

def __init__(self, mpr121, channel):
    self._mpr121 = mpr121
    self._channel = channel

When I run an example code, based off: https://github.com/adafruit/Adafruit_CircuitPython_MPR121/blob/master/examples/mpr121_simpletest.py

But add the line

mpr121_channel = adafruit_mpr121.MPR121_Channel(i2c)

so that I can access the variables in that class, it gives the error:

__init__() missing 1 required positional argument: 'channel'

I’ve edited to be:

mpr121_channel = adafruit_mpr121.MPR121_Channel(i2c, channel)

But now name ‘channel’ is undefined.

Please could someone help me work out where (and how) to define channel?

Thank you!

did you try

mpr121 = adafruit_mpr121.MPR121_Channel(i2c)
make channel=None

Tagged : / /

Linux HowTo: Why downloads on site A are fast, but downloads from site B are slow, only on my network

Original Source Link

So, I have WiFi set up. Site A downloads really fast, but site B downloads really slow. Site B is slow only on my WiFi. If I switch to mobile data, its a blazing fast download. Why?

Could it be because my ISP has bad routing across the internet, and my mobile data ISP has better routing?

One reason this could occur is if Site B has a peering arrangement with your mobile provider. If so, once your packets reach your mobile network they can go straight to Site B, while packets might have to go over some slow route to reach.

Tagged : / /

Ubuntu HowTo: Alert! /dev/sda5 does not exist. Dropping to a shell

Original Source Link

I installed Ubuntu 20.04 on my laptop but when I start it’s shown this error

ALERT! /dev/sda5 does not exist. Dropping to a shell

BusyBox v1.30.1 (Ubuntu v1:1.30.1-4ubuntu6) built-in shell (ash)
Enter help for a list of built-in commands.

(initramfs)

I tried to fix following some steps like to restore grub and mount the correct ‘section’ but I have the same problem.

I also reinstalled the operational system but nothing changes.

Tagged : /

Making Game: With SSD do I need more RAM?

Original Source Link

We use Firefox and some other memory intensive applications and with i3 I tend to have 8-12 GB RAM( upgrade from 4GB to atleast 8GB RAM).

However with SSD laptop do I still need more of RAM? Laptop can use SSD as faster way to virtual memory. I’ve newly purchased 4GB RAM with SSD having good performance, I’m wondering should I upgrade it to 8-12 GB RAM as I would do normally?

An SSD can compensate for limited RAM, but is by no means a direct replacement.

Plenty of RAM means you can have more (and larger) programs open and still have the system switch between them immediately without perceptible delay.

Reducing the amount of RAM will mean that programs either get pushed out to the swap file or you have less of them open at once. An SSD might be faster than a HDD for switching back to paged out tasks, but by no means will it be as fast as having actual RAM.

An NVMe SSD might be able to read at up to 3GB/s, but modern RAM set up in dual channel on an up to date processor can do up to 30GB/s. A SATA SSD might manage up to 500MB/s. There are worlds of difference between the three things.

An SSD can make a memory starved system usable but it is still limiting what you can do by not being able to keep everything in RAM. It is better than running off an HDD at the very least.

You need to evaluate your machines and performance. Upgrading a machine to an SSD drive will not slow down a machine because of memory.

That said, 8 GB is a reasonable minimum on a 64-bit machine for an average office worker or personal machine. That will work fine. If needs are bigger, install more memory. We have lots of users running 8 GB and in no way hampered.

Tagged :

Math Genius: Show that $prod x_i ge 1$ is a convex set

Original Source Link

I’m trying to generalize this question to arbitrary $n$ dimensions, i.e. to show that $C = {xin mathbb R^n_{++} : prod_i^nx_i ge 1 }$ is convex.

At first I thought maybe through induction, but I reached a dead end there. Any suggestions?

The set can be expressed as
$$left{ x in mathbb{R}_{++}^n : sum_{i=1}^n log x_i geq 0 right},$$
which is convex as $g(x)=sum_{i=1}^n log x_i$ is a concave function.

By weighted AM GM,
for any $(x_i), (y_i) in C$ and $t in (0,1)$, we have

$$prod_{i=1}^n (tx_i + (1-t)y_i) ge
prod_{i=1}^n x_i^t y_i^{1-t} = left( prod_{i=1}^n x_iright)^t left(prod_{i=1}^n y_iright)^{1-t} ge 1^t 1^{1-t} = 1$$

Tagged :

Code Bug Fix: How to add dates to calender in the right way

Original Source Link

I have an ArrayList that contains date – [1, 5, 2020] // day|month|year

I am adding this to calendar in this way:

calendar.add(Calendar.DAY_OF_MONTH, dateList[0])
calendar.add(Calendar.MONTH, dateList[1])
calendar.add(Calendar.YEAR, dateList[2])

But when I try to assign this to my date picker, I am getting this date:

datePicker.maxDate = calendar
date picker Log: 16/10/4040

What could be the problem with my code?

That’s because you ADD those values (to the initial date when it was instantiated). Instead you should use set.

calendar.set(Calendar.DAY_OF_MONTH, dateList[0])
calendar.set(Calendar.MONTH, dateList[1])
calendar.set(Calendar.YEAR, dateList[2])

Modern answer. Valid in Java since 2014, I think it came to Android a few years later.

java.time and ThreeTenABP

I Java because this is what I can write.

    ArrayList<Integer> dateList = new ArrayList<>(Arrays.asList(1, 5, 2020));

    LocalDate date = LocalDate
            .of(dateList.get(2), dateList.get(1), dateList.get(0));

    System.out.println("Date: " + date);

Output is:

Date: 2020-05-01

LocalDate (opposite Calendar) numbers months sanely, so 5 is May. If you intended June, don’t use the literal 5, it would be very confusing. If you cannot use 6 for June, use the built-in constant Calendar.JUNE. And remember to add 1 when passing to LocalDate.of().

Since you need the date as a Calendar object for your date picker, we need to convert. A Calendar object includes time of day and time zone and more, so is really overkill, but we need to obey the date picker API, of course. It’s conventional to use the start of the day in the JVM’s time zone.

    ZonedDateTime startOfDay = date.atStartOfDay(ZoneId.systemDefault());
    Calendar oldfashionedCalendar = DateTimeUtils.toGregorianCalendar(startOfDay);

    System.out.println(oldfashionedCalendar.getTime());

Fri May 01 00:00:00 CEST 2020

Question: Doesn’t java.time require Android API level 26?

java.time works nicely on both older and newer Android devices. It just requires at least Java 6.

  • In Java 8 and later and on newer Android devices (from API level 26) the modern API comes built-in. Only in this case don’t use DateTimeUtils for the conversion, use the slightly simpler GregorianCalendar.from(startOfDay).
  • In non-Android Java 6 and 7 get the ThreeTen Backport, the backport of the modern classes (ThreeTen for JSR 310; see the links at the bottom).
  • On (older) Android use the Android edition of ThreeTen Backport. It’s called ThreeTenABP. And make sure you import the date and time classes from org.threeten.bp with subpackages.

Links

calender.add function makes addition with your current date use
calender.set it will set date.

Tagged : / / / /