What is wrong with this code ? Why isn’t it working the way I hoped it would..?

Bear with me guys.. Im new to JavaScript AND StackOverflow…

Here is my problem :

I have created a simple piece of code, with 3 buttons that should change a text (innerHTML) when pressed… but it’s not working.. 🙁

What am I doing wrong ?

I have checked W3Schools for clues.. but no dice..

<head>   <title>JavaScript Table</title>   <style>     body{         text-align: center;         font-family: arial;     }   </style>         <script>             function red(){                 document.getElementById("tekst").innerHTML = "Red";             }             function green(){                 document.getElementById("tekst").innerHTML = "Green";             }             function blue(){                 document.getElementById("tekst").innerHTML = "Blue";             }         </script> </head> <body>         <h2 id="tekst">Color</h2>         <button onsubmit="red()">Red</button>         <button onsubmit="green()">Green</button>         <button onsubmit="blue()">Blue</button>      </body> </html>``` 

Why is isn’t the second if statement being ignored in favor of else?

Here is my code. In the first do while statement, everything runs perfectly, and if a1 doesnt equal 2, the do statement ends. In the second do while statement however, it seems that the nested if runs regardless of an input of ‘7’ the first time, displaying “incorrect”, and only the second time 7 is inputted is if ignored in favor of else, ending the do while statement.

 System.out.println("This is a quiz, you will have infinite attempts per question");         System.out.println("What's 10 minus 8?");         char a1;         char a2;         String a3;         do {          a1 = (char) System.in.read();          if(a1!= '2') {              a1 = (char) System.in.read();              System.out.println("incorrect");              a1 = (char) System.in.read();          }else a1 = '2';         }while(a1!='2'); System.out.println("Congrats, next question"); System.out.println("Whats 14 minus 7?");         do {             a2 = (char) System.in.read();             if(a2 != '7') {                 a2 = (char) System.in.read();                 System.out.println("incorrect");                 a2=(char) System.in.read();             }else a2 = '7';         }while(a2 != '7');         System.out.println("Good one, next question");         }         } 

How do we know $\neg \neg LEM$ isn’t provable in MLTT?

I’ve been trying (fruitlessly) to prove something which I now know is not provable. Take the following definitions: $ $ LEM \equiv \prod_{A : Type} \neg A \vee A$ $ $ $ DNE \equiv \prod_{A : Type} \neg \neg A \to A$ $ $ $ C(x) \equiv DNE \to x$ $ I wanted to prove $ \prod_{A : Type} C(A) \to \neg \neg A$ . In trying to prove it the key thing to prove seemed to be $ \neg \neg DNE$ . I couldn’t figure out how to prove this however. I thought it must be provabale however. Note that the above would be logically equivalent (implication goes both ways) to $ \neg \neg DNE$ because the formula trivially implies it.

But this simple formula proved tricky. It feels like $ \neg \neg DNE$ should hold because $ DNE$ is consistent with MLTT. At least I had it in my mind that it already held but I couldn’t seem to find a prove of it. Finally I started searching. I knew that $ \neg \neg LEM$ was equivalent and found this: https://ncatlab.org/nlab/show/excluded+middle#DoubleNegatedPEM

This states that $ \neg \neg LEM$ is not provable. This is the same as saying that $ \neg LEM$ is consistent, at least in MLTT and other such theories. I’m certainly aware that there exist statements for which both the statement and its negation are equivalent but I hadn’t realized that $ LEM$ and $ DNE$ were examples of this in MLTT. I’m kind of baffled that $ \neg \neg \neg A \to \neg A$ holds but $ \neg DNE$ is still consistent. That’s a subtle point about quantifier placement that I must of missed last time I thought about this sort of thing.

Normally in logic when we want to show that something isn’t provable we either show that a property that is preserved by all the inference rules (and holds for all axioms) is false for the given statement or we directly find a model for the logic and show that the given statement is false in the model. The only models I know for constructive logics are fairly complicated. For propositional logic we have Heyting algebra but the quantifier here leaves us no hope of using that. I vaguely recall that it is possible to extend these algebras to the quantifier case by doing something like taking the least upper bound or greatest lower bound of a set of instances of the algebra generated by substituting constants in the set being quantified over into the formula. I don’t remember exactly how this works nor am I really clear that I could extend a result from first order constrictive logic (the logic of constructive set theory).

How do we know this? Do we have a simple enough model that would explain this? Do we just know from trying to prove it that we get stuck? After trying to prove it myself I feel intuitively that we’ll always get stuck and I can explain it more or less as “you have a very limited number of ways to dig down and after digging down, you get stuck really quickly” but that’s quite informal. Is there a meaty formal explanation of why this isn’t provable?

How do I limit query results, when distinct isn’t distinct?

I have a bill of material file that I am trying to reduce to only the unique parts, and related data for the line. The problem I’m running into is multiple instances of a part number due to variations in the formatting or language in the part name from the system/s that a third party pulls the data from. pn123 part_name pn123 Part-name pn123 Part name pn123 German name

All other fields I select are equal, how do I limit this in the where clause to just one instance of the above for all different part numbers? Is there an equivalent to MAX() in a text string?

I am working around the issue in excel, by deleting the dupes.

select distinct  adhoc.ats_esh.Customs_Entry_Num [VIN]as [Qlickview VIN] ,[Build_Date] ,[BOM_Level] ,[9802].[Supplier] ,[Part_number] ,[Part_Name] *******THIS IS THE PROBLEM FIELD******* ,[Unit_Price] ,[Usage] ,[Extended_Price]  from    adhoc.IMFM_9802_EU_AP [9802] inner join ADHOC.ATS_ESL     ON [9802].VIN = ADHOC.ATS_ESL.Part_Num         inner join adhoc.ATS_ESH     ON ADHOC.ATS_ESH.Trans_SK = ADHOC.ATS_ESL.Trans_SK        where  adhoc.ats_esh.importer ='ACME_CO' and adhoc.ATS_ESH.ENTRY_SUMMARY_DATE >= '2/01/2018' And adhoc.ATS_ESH.ENTRY_SUMMARY_DATE < '3/01/2018' AND adhoc.ats_esl.Supplier in('supplier1','supplier2','supplier3')  --and adhoc.ats_esl.Part_Num like '%ABC%'  --and [BOM_Level] = '1' --**** use MAX() 

Why isn’t there any option of ‘undo’ in Android smartphones?

The question is pretty much self-explanatory. I don’t get why there’s no option of ‘undo’ in smartphones running on Android OS. By undo, I mean undoing text(CTRL+z), a very basic feature available in PCs/laptops.

I read somewhere on Apple iPhones, you can shake your phone to activate the undo feature in a text program.

Applications like Inputting+ are available on Google Play store which gives the feature of undoing text but why isn’t this an inbuilt feature in Android smartphones?

Add a Monitor (AL1716) which isn’t, correctly, supported to 18.04LTS

I’m ready to deploy my NUC8i3 running Ubuntu 18.04LST into it’s final location. Although I normally plan to connected to it remotely I still want to have a monitor where it will be located. I have an old Acer AL1716 but I’m having problems getting Ubuntu to correctly use the monitor. Everything comes up until I get to the Login screen at which point nothing works.

I think that the problem is the settings built into Ubuntu. Although it shows a 75 and 60 Hz settings, which the AL1716 supports, they are not ones that the AL1716 will use. It needs the settings that are just slightly different namely 60Hz should be 63.67Hz. Not sure about the 75Hz one since I’ve not tried it yet.

I’ve done through several steps and been able to get Ubuntu to get the monitor to work but only after losing in. I preformed the following.

$ cvt 1280 1024 60

1280×1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz Modeline “1280x1024_60.00” 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync

$ sudo xrandr –newmode “1280x1024_60.00” 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync

$ sudo xrandr –addmode DP-2 “1280x1024_60.00”

$ sudo xrandr –output DP-1 –mode 1280×1024 –rate 60

At this point the AL1716 will display correctly. The problem is that I can’t see this as a selection I can use using the normal display setup nor can I use this to see the login screen.

What I really want to do is add settings to the standard monitor tables, I assume that Ubuntu has such tables for each monitor it supports, so the AL1716 has the correct settings no matter which user I login with.

Can anyone help?

Why isn’t Magento 2 recognizing my library in requirejs-config.js?

Library location app\design\frontend\user\theme\web\js\owl.carousel.min.js

Inside app\design\frontend\user\theme\requirejs-config.js

var config = { deps: [     "js/main" ],  map: {     '*': {         owlCarousel:'js/owl.carousel.min'     } },  shim: {     jquery: {         exports: '$  '     },      'Magento_Catalog/js/price-box':         {             deps: ['jquery']         },      owlCarousel: ["jquery"] }  }; 

Inside app\design\frontend\user\theme\web\js\main.js

define([ "jquery", "owlCarousel" ],   function($  ) { "use strict";  if(typeof owlCarousel === 'function') {    console.log('owlCarousel is loaded'); }else{   console.log('owlCarousel is NOT loaded'); }  }); 

Inside phtml

require(['jquery', 'owlCarousel'],function($  , owlCarousel){     jQuery(document).ready(function() {         jQuery('.owl-carousel').owlCarousel({             margin:10,             nav:true,             mouseDrag:false,             navText : ["",""],             rewindNav : true,             responsive:{                 0:{                     items:3                 },                 600:{                     items:3                 },                 1000:{                     items:3                 }             }         });     }); }); 

Result

owlCarousel is NOT loaded

(index):1175 Uncaught TypeError: jQuery(…).owlCarousel is not a function

What can I do if my MacBook isn’t charging but already ran out?

My MacBook suddenly stopped charging and I tried SMC reset. However, the MacBook already ran out on the battery and thus I think even the SMC reset did not work since when I did it, it was just that the battery icon flashed yet it didn’t start at all.

Unfortunately I live in the city where there is no Genius Bar, and I stay here for a few more months. Is there anything I can do to make the charge work?

Ajax Exposed filter isn’t changing URL

There must be something obvious I’m missing as it seems from other posts that Exposed Filters in views should generate URLS from its results out of the box.

I’ve got some filter with ajax enabled and they work fine, but the url doesn’t change when using the filter.

How to I achieve this and become able to link to a specific setting on the filter?