How do type classes make ad-hoc polymorphism less ad-hoc?

The title of the paper that introduced type classes is "How to make ad-hoc polymorphism less ad-hoc".

It seems the type classes approach is being compared to how OOP does ad-hoc polymorphism.

As far as I can tell, the paper never explains how type classes are less ad-hoc than OOP techniques like V-tables or prototype chains, or even has any comparison at all of the trade-offs between the two approaches.

What is non-ad-hoc about ad-hoc polymorphism via type classes?

Note: this is a somewhat objective question, as "ad-hoc" is here a technical term. From the paper, "Ad-hoc polymorphism occurs when a function is defined over several different types, acting in a different way for each type."

No internet connection after configuring ad-hoc interface

Using Ubuntu 19.04 I am trying to connect to an ad-hoc network with my Wi-Fi card (wlo1) and use ethernet (eno2) for access to the internet. The ethernet internet connection works fine on it’s own. In order to connect to the Ad-Hoc network my /etc/network/interfaces file is as follows:

# interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback  auto wlo1 iface wlo1 inet static     wireless-mode ad-hoc     wireless-channel 1     wireless-essid AdhocSSID     address 192.168.1.2     netmask 255.255.255.0 

Now with the interfaces file like this I can access the Ad-Hoc network correctly, but I can no longer access the internet with ethernet. This is the output of ifconfig for the interfaces file above, which suggests to me that the ethernet connection still works somewhat:

eno2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.129  netmask 255.255.255.0  broadcast 192.168.1.255         inet6 fe80::9035:712a:baa8:687f  prefixlen 64  scopeid 0x20<link>         ether b4:2e:99:39:dc:57  txqueuelen 1000  (Ethernet)         RX packets 30  bytes 7760 (7.7 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 51  bytes 6147 (6.1 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0         device interrupt 16  memory 0x55300000-55320000  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 1000  (Local Loopback)         RX packets 174  bytes 14210 (14.2 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 174  bytes 14210 (14.2 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255         inet6 fe80::aa6d:aaff:fefd:661e  prefixlen 64  scopeid 0x20<link>         ether a8:6d:aa:fd:66:1e  txqueuelen 1000  (Ethernet)         RX packets 8  bytes 336 (336.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 53  bytes 6469 (6.4 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

Any suggestions?

iOS create ad-hoc network

Is it possible (with or without jailbreak) to create a wireless access point from iOS 12 to serve as a ‘router’? I don’t want to share iOS internet connection, the phone will be located in a place where there is no data connection, and Personal Hotspot feature on iOS only is available when mobile data is ON, I’m just using it to act as a router between two android devices: First device will be streaming video through http (with IP webcam app) and second device will display it in a web browser.

So for this I need to have a DHCP server on iOS which assigns addresses to the devices, a discoverable service, and a router service which routes packages. I’m guessing there is already an app/tweak which covers all of this but been searching for a while and all I could find was about using iOS Personal Hotspot feature, or outdated Tethering apps on Cydia. Thanks!

Connection to ad-hoc network fails constantly with driver error

I want to connect my Lenovo Thinkpad 13, with Ubuntu 18.04, to a Raspberry Pi using an ad-hoc wifi network. The ad-hoc network on the Pi works fine and I can connect to it with a different laptop. However I don’t have always access to this laptop and need to connect to the Pi with my laptop. I know there are easier methods to connect to a Raspberry Pi, but I need to use an ad-hoc network for a project at work.

I have tried to connect the Thinkpad to the network using either the nm-connection-editor or iwconfig.

If I configure the ad-hoc network using the nm-connection editor it fails to connect to the network with the following stack trace:

May  3 12:42:37 Schwalbe wpa_supplicant[787]: wlp3s0: Trying to associate with SSID 'MyAdHoc' May  3 12:42:37 Schwalbe wpa_supplicant[787]: Could not set interface wlp3s0 flags (UP): Device or resource busy May  3 12:42:37 Schwalbe wpa_supplicant[787]: nl80211: Failed to set interface into IBSS mode May  3 12:42:37 Schwalbe wpa_supplicant[787]: wlp3s0: Association request to the driver failed May  3 12:42:37 Schwalbe wpa_supplicant[787]: wlp3s0: Trying to associate with SSID 'MyAdHoc' May  3 12:42:37 Schwalbe wpa_supplicant[787]: wlp3s0: Association request to the driver failed May  3 12:42:38 Schwalbe wpa_supplicant[787]: wlp3s0: Trying to associate with SSID 'MyAdHoc' May  3 12:42:38 Schwalbe wpa_supplicant[787]: wlp3s0: Association request to the driver failed May  3 12:42:39 Schwalbe wpa_supplicant[787]: wlp3s0: Trying to associate with SSID 'MyAdHoc' May  3 12:42:39 Schwalbe wpa_supplicant[787]: wlp3s0: Association request to the driver failed May  3 12:42:39 Schwalbe wpa_supplicant[787]: wlp3s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyAdHoc" auth_failures=1 duration=10 reason=CONN_FAILED May  3 12:42:44 Schwalbe wpa_supplicant[787]: wlp3s0: Trying to associate with SSID 'MyAdHoc' May  3 12:42:44 Schwalbe wpa_supplicant[787]: wlp3s0: Association request to the driver failed May  3 12:42:44 Schwalbe wpa_supplicant[787]: wlp3s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyAdHoc" auth_failures=2 duration=20 reason=CONN_FAILED` 

I used the following configuration for the ad-hoc network:
– Network type: Wi-Fi
– SSID: Ad-hoc
– Band: B/G (2.4GHz)
– Channel 1
– IPv4 Method: Shared to other computers
– IPv4 Address: 10.0.3.2
– IPv4 Netmask: 16
All other configurations were left as default values.

As the Wi-Fi interface seemed busy I tried to configure the ad-hoc network without the network-manager using iwconfig, using the following commands:

sudo service network-manager stop sudo ip link set wlp3s0 down sudo iwconfig wlp3s0 mode ad-hoc sudo iwconfig wlp3s0 essid "MyAdHoc" sudo iwconfig wlp3s0 channel 1 sudo iwconfig wlp3s0 key off sudo ifconfig wlp3s0 10.0.3.2 netmask 255.255.0.0 sudo ip link set wlp3s0 up 

After executing these commands my computer seems to be connected to the network for a few moments, with ifconfig producing the following output for my wi-fi adapter:

wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         inet 10.0.3.2  netmask 255.255.0.0  broadcast 10.0.255.255         ether 90:61:ae:36:c7:ed  txqueuelen 1000  (Ethernet)         RX packets 82352  bytes 19052413 (19.0 MB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 17410  bytes 3533379 (3.5 MB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

running iwconfig I get the following output:

wlp3s0    IEEE 802.11  ESSID:"MyAdHoc"             Mode:Ad-Hoc  Frequency:2.412 GHz  Cell: E6:FD:05:CE:BF:32              Tx-Power=22 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:on 

So here it looks fine to me. However I cannot ping the Raspberry Pi, which is connected to the same network and after a few moments the mode of my adapter is switched to managed again. If I look into my syslog I find the following:

May  3 13:00:39 Schwalbe kernel: [10958.337956] iwlwifi 0000:03:00.0: Failed to remove station. Id=2 May  3 13:00:39 Schwalbe kernel: [10958.337962] iwlwifi 0000:03:00.0: Failed sending remove station May  3 13:00:39 Schwalbe kernel: [10958.337966] iwlwifi 0000:03:00.0: Failed to send flush command (-5) May  3 13:00:39 Schwalbe kernel: [10958.338010] WARNING: CPU: 3 PID: 9466 at /build/linux-fkZVDM/linux-4.15.0/drivers/net/wireless/intel/iwlwifi/mvm/utils.c:826 iwl_mvm_disable_txq+0x39e/0x3c0 [iwlmvm] May  3 13:00:39 Schwalbe kernel: [10958.338011] Modules linked in: rfcomm ip6table_filter ip6_tables iptable_filter pci_stub vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) ccm bnep snd_hda_codec_hd mi snd_hda_codec_realtek snd_hda_codec_generic nls_iso8859_1 wmi_bmof intel_wmi_thunderbolt intel_rapl uvcvideo x86_pkg_temp_thermal intel_powerclamp coretemp videobuf2_vmalloc videobuf2_memops videobuf2_ v4l2 videobuf2_core kvm_intel arc4 videodev kvm irqbypass media crct10dif_pclmul snd_seq_midi snd_seq_midi_event crc32_pclmul ghash_clmulni_intel snd_rawmidi pcbc btusb btrtl btbcm btintel bluetooth snd_s oc_skl ecdh_generic snd_soc_skl_ipc snd_hda_ext_core aesni_intel snd_soc_sst_dsp aes_x86_64 crypto_simd snd_soc_sst_ipc i915 glue_helper iwlmvm snd_soc_acpi cryptd intel_cstate mac80211 snd_soc_core intel _rapl_perf snd_compress ac97_bus May  3 13:00:39 Schwalbe kernel: [10958.338080]  snd_pcm_dmaengine snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_pcm drm_kms_helper input_leds snd_seq_device iwlwifi joydev serio_raw drm thinkpad_acpi cfg80211 i2c_algo_bit snd_timer idma64 nvram virt_dma fb_sys_fops syscopyarea sysfillrect sysimgblt ucsi_acpi intel_pch_thermal intel_lpss_pci intel_lpss typec_ucsi mei_me shpchp mei typec w mi snd video soundcore mac_hid acpi_pad sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 hid_logitech_hidpp hid_logitech_dj usbhid hid nvme e1000e psmouse ptp nvme_core pps_core pinctrl_sunrisepoint May  3 13:00:39 Schwalbe kernel: [10958.338145] CPU: 3 PID: 9466 Comm: ip Tainted: G        W  OE    4.15.0-48-generic #51-Ubuntu May  3 13:00:39 Schwalbe kernel: [10958.338147] Hardware name: LENOVO 20J2S00G00/20J2S00G00, BIOS R0JET26W (1.11 ) 05/11/2017 May  3 13:00:39 Schwalbe kernel: [10958.338160] RIP: 0010:iwl_mvm_disable_txq+0x39e/0x3c0 [iwlmvm] May  3 13:00:39 Schwalbe kernel: [10958.338163] RSP: 0018:ffffb200880df310 EFLAGS: 00010246 May  3 13:00:39 Schwalbe kernel: [10958.338166] RAX: 0000000000000021 RBX: 0000000000000003 RCX: 0000000000000000 May  3 13:00:39 Schwalbe kernel: [10958.338168] RDX: ffff8966908f9630 RSI: 0000000000000000 RDI: ffff8966908fa6a8 May  3 13:00:39 Schwalbe kernel: [10958.338170] RBP: ffffb200880df3b0 R08: 0000000000000000 R09: 0000000000009d09 May  3 13:00:39 Schwalbe kernel: [10958.338172] R10: ffffb200880df3d0 R11: ffffffffbf95380d R12: 0000000000000003 May  3 13:00:39 Schwalbe kernel: [10958.338174] R13: 0000000000000003 R14: ffff8966908f9528 R15: 0000000000000001 May  3 13:00:39 Schwalbe kernel: [10958.338178] FS:  00007fcb626500c0(0000) GS:ffff89669f580000(0000) knlGS:0000000000000000 May  3 13:00:39 Schwalbe kernel: [10958.338180] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 May  3 13:00:39 Schwalbe kernel: [10958.338182] CR2: 00000a9619672008 CR3: 00000000b1934006 CR4: 00000000003606e0 May  3 13:00:39 Schwalbe kernel: [10958.338184] Call Trace: May  3 13:00:39 Schwalbe kernel: [10958.338202]  iwl_mvm_rm_mcast_sta+0x57/0x90 [iwlmvm] May  3 13:00:39 Schwalbe kernel: [10958.338215]  ? iwl_mvm_rm_mcast_sta+0x57/0x90 [iwlmvm] May  3 13:00:39 Schwalbe kernel: [10958.338228]  iwl_mvm_stop_ap_ibss+0xf9/0x190 [iwlmvm] May  3 13:00:39 Schwalbe kernel: [10958.338261]  ieee80211_ibss_disconnect+0x178/0x2d0 [mac80211] May  3 13:00:39 Schwalbe kernel: [10958.338290]  ieee80211_ibss_leave+0x14/0xc0 [mac80211] May  3 13:00:39 Schwalbe kernel: [10958.338320]  ieee80211_leave_ibss+0x15/0x20 [mac80211] May  3 13:00:39 Schwalbe kernel: [10958.338362]  __cfg80211_leave_ibss+0x50/0x110 [cfg80211] May  3 13:00:39 Schwalbe kernel: [10958.338404]  __cfg80211_leave+0x7b/0x170 [cfg80211] May  3 13:00:39 Schwalbe kernel: [10958.338445]  cfg80211_leave+0x2b/0x40 [cfg80211] May  3 13:00:39 Schwalbe kernel: [10958.338483]  cfg80211_netdev_notifier_call+0x340/0x610 [cfg80211] May  3 13:00:39 Schwalbe kernel: [10958.338498]  ? ttwu_do_activate+0x77/0x80 May  3 13:00:39 Schwalbe kernel: [10958.338511]  ? try_to_wake_up+0x59/0x4a0 May  3 13:00:39 Schwalbe kernel: [10958.338525]  ? addrconf_notify+0x77/0xa40 May  3 13:00:39 Schwalbe kernel: [10958.338537]  ? inetdev_event+0x76/0x4d0 May  3 13:00:39 Schwalbe kernel: [10958.338549]  ? skb_dequeue+0x59/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338562]  notifier_call_chain+0x4c/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338575]  raw_notifier_call_chain+0x16/0x20 May  3 13:00:39 Schwalbe kernel: [10958.338590]  call_netdevice_notifiers_info+0x2d/0x60 May  3 13:00:39 Schwalbe kernel: [10958.338604]  __dev_close_many+0x63/0x110 May  3 13:00:39 Schwalbe kernel: [10958.338617]  __dev_change_flags+0xc8/0x1c0 May  3 13:00:39 Schwalbe kernel: [10958.338630]  dev_change_flags+0x29/0x60 May  3 13:00:39 Schwalbe kernel: [10958.338643]  do_setlink+0x337/0xed0 May  3 13:00:39 Schwalbe kernel: [10958.338660]  ? nla_parse+0x35/0x110 May  3 13:00:39 Schwalbe kernel: [10958.338671]  rtnl_newlink+0x5f3/0x930 May  3 13:00:39 Schwalbe kernel: [10958.338684]  ? __switch_to_asm+0x40/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338696]  ? __switch_to_asm+0x34/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338706]  ? __switch_to_asm+0x40/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338725]  ? security_capable+0x40/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338737]  rtnetlink_rcv_msg+0x223/0x2b0 May  3 13:00:39 Schwalbe kernel: [10958.338751]  ? _cond_resched+0x19/0x40 May  3 13:00:39 Schwalbe kernel: [10958.338765]  ? rtnl_calcit.isra.28+0x110/0x110 May  3 13:00:39 Schwalbe kernel: [10958.338780]  netlink_rcv_skb+0x54/0x130 May  3 13:00:39 Schwalbe kernel: [10958.338794]  rtnetlink_rcv+0x15/0x20 May  3 13:00:39 Schwalbe kernel: [10958.338810]  netlink_unicast+0x19e/0x240 May  3 13:00:39 Schwalbe kernel: [10958.338826]  netlink_sendmsg+0x2d1/0x3d0 May  3 13:00:39 Schwalbe kernel: [10958.338842]  sock_sendmsg+0x3e/0x50 May  3 13:00:39 Schwalbe kernel: [10958.338860]  ___sys_sendmsg+0x2a0/0x2f0 May  3 13:00:39 Schwalbe kernel: [10958.338875]  ? __inode_wait_for_writeback+0x7e/0xf0 May  3 13:00:39 Schwalbe kernel: [10958.338890]  ? sock_destroy_inode+0x2f/0x40 May  3 13:00:39 Schwalbe kernel: [10958.338904]  ? destroy_inode+0x3e/0x60 May  3 13:00:39 Schwalbe kernel: [10958.338918]  ? evict+0x139/0x1a0 May  3 13:00:39 Schwalbe kernel: [10958.338924]  ? iput+0x156/0x220 May  3 13:00:39 Schwalbe kernel: [10958.338930]  ? dentry_free+0x49/0x70 May  3 13:00:39 Schwalbe kernel: [10958.338935]  ? __dentry_kill+0x129/0x170 May  3 13:00:39 Schwalbe kernel: [10958.338940]  ? dput.part.23+0x1a4/0x1e0 May  3 13:00:39 Schwalbe kernel: [10958.338948]  __sys_sendmsg+0x54/0x90 May  3 13:00:39 Schwalbe kernel: [10958.338955]  ? __sys_sendmsg+0x54/0x90 May  3 13:00:39 Schwalbe kernel: [10958.338964]  SyS_sendmsg+0x12/0x20 May  3 13:00:39 Schwalbe kernel: [10958.338970]  do_syscall_64+0x73/0x130 May  3 13:00:39 Schwalbe kernel: [10958.338975]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2 May  3 13:00:39 Schwalbe kernel: [10958.338980] RIP: 0033:0x7fcb61b4dd04 May  3 13:00:39 Schwalbe kernel: [10958.338983] RSP: 002b:00007ffd36e0db28 EFLAGS: 00000246 ORIG_RAX: 000000000000002e May  3 13:00:39 Schwalbe kernel: [10958.338989] RAX: ffffffffffffffda RBX: 000000005ccc1f55 RCX: 00007fcb61b4dd04 May  3 13:00:39 Schwalbe kernel: [10958.338992] RDX: 0000000000000000 RSI: 00007ffd36e0db80 RDI: 0000000000000003 May  3 13:00:39 Schwalbe kernel: [10958.338995] RBP: 0000000000000000 R08: 0000000000000010 R09: 00007ffd36e0dc20 May  3 13:00:39 Schwalbe kernel: [10958.338998] R10: 0000000000000014 R11: 0000000000000246 R12: 0000000000000000 May  3 13:00:39 Schwalbe kernel: [10958.339001] R13: 000055a6fc5ab020 R14: 00007ffd36e0e350 R15: 00007ffd36e0dc08 May  3 13:00:39 Schwalbe kernel: [10958.339005] Code: 07 89 c2 7e c4 e9 72 fd ff ff 66 85 c9 0f 84 4b fe ff ff e9 36 fe ff ff 48 8b bd 70 ff ff ff e8 59 35 03 fe 31 c0 e9 3a ff ff ff <0f> 0b 48 8b bd 70 ff ff ff e8 44 35 03 fe 31 c0 e9 25 ff ff ff  May  3 13:00:39 Schwalbe kernel: [10958.339107] ---[ end trace 8597b748d5a96ac7 ]--- May  3 13:00:39 Schwalbe kernel: [10958.339174] iwlwifi 0000:03:00.0: Failed to remove station. Id=3 May  3 13:00:39 Schwalbe kernel: [10958.339191] iwlwifi 0000:03:00.0: Failed sending remove station May  3 13:00:39 Schwalbe kernel: [10958.339206] iwlwifi 0000:03:00.0: Failed to send binding (action:3): -5 May  3 13:00:39 Schwalbe avahi-daemon[765]: Interface wlp3s0.IPv6 no longer relevant for mDNS. May  3 13:00:39 Schwalbe avahi-daemon[765]: Leaving mDNS multicast group on interface wlp3s0.IPv6 with address fe80::9261:aeff:fe36:c7ed. May  3 13:00:39 Schwalbe avahi-daemon[765]: Interface wlp3s0.IPv4 no longer relevant for mDNS. May  3 13:00:39 Schwalbe avahi-daemon[765]: Leaving mDNS multicast group on interface wlp3s0.IPv4 with address 10.0.3.2. May  3 13:00:39 Schwalbe avahi-daemon[765]: Withdrawing address record for fe80::9261:aeff:fe36:c7ed on wlp3s0. 

If I create an ad-hoc network without any other participants the laptop stays connected to it, but as soon as any other computer joins it is disconnected.

I also tried to connect to the ad-hoc network using wpa-supplicant, however I did not work either. I don’t have a stack-trace of this and I don’t want to reproduce it as I could not connect to my Ethernet adapter afterwards and had to install a fresh Ubuntu image.

My laptop should be able to connect to an ad-hoc network, because if I run iw list I get the following:

Supported interface modes:      * IBSS      * managed      * AP      * AP/VLAN      * monitor      * P2P-client      * P2P-GO      * P2P-device 

I also tried to connect to the ad-hoc network using Ubuntu 16.04 and received the same errors.

I think my problem I related to my wi-fi/network driver, however I don’t know how to solve it. I would be very happy for any suggestions.