programmatically determine if a python package needs to compile C

I am building a system that will take a list of python packages (several hundred), generate wheels if none exist, and publish said wheels to our internal artifactory. This is being done for several reasons, two biggest is speed of install, and our system runs on some off beat platforms (namely BSD).

I have the process of pulling the sdist down, thats fairly easy. My problem is once I have the sdist down and using setup.py to generate the list of primary and transitive dependencies using pipdeptree, is there a way for me to determine if the package and its dependencies are pure python or if they require C compiling? I think I have counted about 5 different methods of wrapping a C library already, but all im really looking for is something that can answer this:

def requires_platform_build(module):   if test_module(module):     'send to platform build system'   else:     'send to docker container to compile ANY wheel' 

I know this is easier said than done with test requirements and such, but im not concerned with the test packages, only the runtime packages needed.

To display the webpage again, Internet Explorer needs to resend

I have the code from Here to my document library

The script basically opens the edit form when you Drag & Drop files into Document library.

The code seems to work fine, however I am getting this pop up from Internet Explorer

To display the webpage again, Internet Explorer needs to resend the information you’ve previously submitted. If you were making a purchase, you should click the Cancel to avoid a duplicate transaction. … Otherwise, click Retry to display the webpage again

Maybe it can be something related to the script?

“Flex fare” options for flight needs that may change last minute?

In June I will be heading to Cape Canaveral to attend a rocket launch. As you may know, rocket launches are given a “Launch window” and can be pushed back a day or two or three or… you get the idea.

I just found out the launch date for this mission I want to attend, and plan to book a flight! If all goes as planned, I fly in the day before launch, see it launch on a Saturday, and leave on Monday.

However I want to be sure that I am covered in two rather likely scenarios:

  1. Launch is delayed by a few weeks/months before I leave.
  2. Launch is delayed by a few days after I arrive in Florida.

I know flexible fares are a thing, but I don’t see any clear options on how to book them. Doing a Google search for “Book flexible fare” seems to mostly lead to travel aggregate websites that advertise “Flex” in the search results but when actually selecting flights give no indication that it is Flexable. The only exception to this is Southwest, which let’s you reuse your money on a different flight if there is a cancellation – but appears to be way more expensive than other airlines. Every other booking website and airline seem to make no mention of how to make a trip flexible.

So my question is how do I ensure my flight is “Flexible”? and what does “Flexible” actually entail (i.e. does it vary by airline?, does taking the departing flight allow me to still flex the return flight?, do I pay more if the new ticket is in higher demand or get a refund if it is cheaper?)

A java game where the user memorizes a list, gets given letters and needs to find a word that contains those letters

I wrote this java game where the user memorizes a list, gets given letters and needs to find a word that contains those letters. The player has only a few seconds to enter the word.

Example:

Program outputs: AN

Player can input: ANTILIBERALISM, HUMANITARIANISM, NANOTECHNOLOGY if those are in the memorized list file.

Other possible inputs for the player:

  • pause: Pauses the game until the player types something.
  • skip: Skips the current letters.
  • stop: Stops the game, prints the scores.

Code:

import org.awaitility.Awaitility; import org.awaitility.core.ConditionTimeoutException;  import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors;  class Game {     private static final String F_NAME = "LIST.txt";     private static final int TIME_PER_ANSWER = 10;     private Map<String, List<String>> answersMap;     private volatile String answer;     private final Map<String, String> COMMANDS_OUTPUT_MAP = Collections.unmodifiableMap(Map.of(         "STOP", "Game stopped manually.",         "PAUSE", "Game paused.",         "ANSWER_DOESNT_CONTAIN_SYLL", "Doesn't contain letters...",         "WORDSLIST_DOESNT_CONTAIN_WORD", "The word is not in the list...",         "ANSWER_ALREADY_TYPED", "Already put..."     ));     private final List<String> STOP_WAITING_FOR_ANSWER_COMMANDS = Collections.unmodifiableList(List.of(             "STOP",             "PAUSE",             "SKIP"     ));      class ReaderThread implements Runnable {         @Override         public synchronized void run() {             Scanner in = new Scanner(System.in);              while (!Thread.interrupted()) {                 answer = in.nextLine().toUpperCase();             }         }     }      public static void main(String[] args) {         new Game();     }      private Game() {         System.out.println("New game. Input file: " + F_NAME + ". Time per answer: " + TIME_PER_ANSWER + " seconds.");         System.out.println("Commands: " + STOP_WAITING_FOR_ANSWER_COMMANDS);          this.answersMap = new TreeMap<>();         Random rand = new Random();         int wordCounter = 0, lifeCounter = 0;          List<String> syllsList = Objects.requireNonNull(getSyllsList());         List<String> wordsList = Objects.requireNonNull(getWordsList());         Optional<List<String>> newWordsListOptional = getNewWordsListOptional(wordsList);         newWordsListOptional.ifPresent((list) -> System.out.println("New words: " + list));          Optional<List<String>> noSyllsMatchListOptional = getNoSyllsMatchListOptional(syllsList, wordsList);         noSyllsMatchListOptional.ifPresent(list -> {             System.out.println("WARNING: THESE LETTERS ARE IN NO WORDS: " + list);             syllsList.removeAll(list);         });         Optional<List<String>> noWordsMatchListOptional = getNoWordsMatchListOptional(syllsList, wordsList);         noWordsMatchListOptional.ifPresent(list -> {             System.out.println("WARNING: THESE WORDS CONTAIN NO INPUT LETTERS: " + list);             wordsList.removeAll(list);         });          Collections.shuffle(wordsList);         int syllsListTotal = syllsList.size();         String hint;         new Thread(new ReaderThread()).start();          while(syllsList.size() > 0) {             resetAnswer();             String syll = syllsList.get(rand.nextInt(syllsList.size()));             if(findMatchingWord(syll, wordsList) == null) {                 syllsList.remove(syll);                 printSyllChangeMessage(syll, syllsListTotal, syllsList);                 continue;             }             System.out.println(syll);              try {                 do {                     if(answer.equals("PAUSE"))                         Awaitility.await().forever().until(() -> !answer.equals("PAUSE"));                     Awaitility.await().atMost(TIME_PER_ANSWER, TimeUnit.SECONDS).until(() -> checkAnswer(syll, wordsList, newWordsListOptional));                 } while(answer.equals("PAUSE"));             } catch (ConditionTimeoutException ignore) { }              if(answer.equals("STOP")) break;             if (answer.equals("") || answer.equals("SKIP")) {                 hint = findMatchingWord(syll, wordsList);                 System.out.println("HINT: " + hint +".");                 lifeCounter++;             } else {                 answersMap.computeIfAbsent(syll, liste -> new ArrayList<>()).add(answer);                 wordCounter++;             }         }          for(String key : answersMap.keySet()) {             System.out.println(key + " : " + answersMap.get(key));         }         System.out.println("Number of words : " + wordCounter + " | Number of lifes lost : " + lifeCounter);         System.exit(0);     }      private LinkedList<String> getSyllsList() {         try {             return new LinkedList<>(Arrays.asList(Files.lines(Paths.get(F_NAME))                     .findFirst()                     .orElse("")                     .split("\|")));         } catch(IOException io) {             io.printStackTrace();             return null;         }     }      private List<String> getWordsList() {         try {             return Files.lines(Paths.get(F_NAME))                     .skip(1)                     .flatMap(line -> Arrays.stream(line.split("\n")))                     .collect(Collectors.toList());         } catch(IOException io) {             io.printStackTrace();             return null;         }     }      private Optional<List<String>> getNoSyllsMatchListOptional(List<String> syllsList, List<String> wordsList) {         final String wordsListString = wordsList.toString();         List<String> noSyllsMatchList = syllsList.stream()                 .filter(s -> !wordsListString.contains(s))                 .collect(Collectors.toList());         return Optional.ofNullable(noSyllsMatchList.isEmpty() ? null : noSyllsMatchList);     }      private Optional<List<String>> getNoWordsMatchListOptional(List<String> syllsList, List<String> wordsList) {         List<String> noWordsMatchList = wordsList.stream()                 .filter(word -> {                     for(String syll : syllsList)                         if(word.contains(syll)) return false;                     return true;                 })                 .collect(Collectors.toList());         return Optional.ofNullable(noWordsMatchList.isEmpty() ? null : noWordsMatchList);     }      private boolean checkAnswer(String syll, List<String> wordsList, Optional<List<String>> newWordsListOptional) {         if(answer.equals("")) return false;         if(answer.equals("NEW")) {             if(newWordsListOptional.isPresent())                 System.out.println("New words: " + newWordsListOptional.get());             else                 System.out.println("No new words.");             resetAnswer();             return false;         }          String command = answer;         if(!STOP_WAITING_FOR_ANSWER_COMMANDS.contains(command)) {             if (!answer.contains(syll)) command = "ANSWER_DOESNT_CONTAIN_SYLL";             else if (answerAlreadyTyped(answer)) command = "ANSWER_ALREADY_TYPED";             else if (!wordsList.contains(answer)) command = "WORDSLIST_DOESNT_CONTAIN_WORD";         }          final Optional<String> OUTPUT_MESSAGE = Optional.ofNullable(COMMANDS_OUTPUT_MAP.get(command));         if(OUTPUT_MESSAGE.isPresent()) {             System.out.println(OUTPUT_MESSAGE.get());              if (!STOP_WAITING_FOR_ANSWER_COMMANDS.contains(command)) {                 resetAnswer();                 return false;             }         }         return true;     }      private synchronized void resetAnswer() {         answer = "";     }      private boolean answerAlreadyTyped(String answer) {         return answersMap.values()             .stream()             .flatMap(List::stream)             .collect(Collectors.toList())             .contains(answer);     }      private String findMatchingWord(String syll, List<String> wordsList) {         return wordsList.stream()             .filter(word -> word.contains(syll))             .filter(word -> !answerAlreadyTyped(word))             .findAny()             .orElse(null);     }      private Optional<List<String>> getNewWordsListOptional (List<String> wordsList) {         Optional<String> newWordsSeparator = wordsList.stream()             .filter(word -> word.startsWith("-"))             .findFirst();          if(newWordsSeparator.isPresent()) {             int index = wordsList.indexOf(newWordsSeparator.get());             wordsList.remove(index);             return Optional.of(List.copyOf(wordsList.subList(index, wordsList.size())));         }         return Optional.empty();     }      private void printSyllChangeMessage(String syll, int syllsListTotal, List<String> syllsList) {         System.out.println("ALL WORDS HAVE BEEN PUT FOR LETTERS: " + syll + ". LETTERS REMOVED. " +                 "ALL LETTERS PUT FOR: " + (syllsListTotal - syllsList.size()) + " / " + (syllsListTotal));     } } 

Test with file LIST.txt:

BE|AN|IS|XY BENEDICTION BEAUTIFULLNESS ANTILIBERALISM RADIOLABELLING IMPRESSIONISTIC UNDISTINGUISHED HUMANITARIANISM AUTOTRANSFORMER INTELLIGENT -------------------------- MY NEW WORDS TO MEMORIZE ------------------------- FEATHERBEDDING BIOGEOCHEMISTRY CIRCUMSTANTIAL NANOTECHNOLOGY ANTIAPHRODISIAC ESSENTIALISM 

A few questions:

  • I use Awaibility (there was no tag for it…) to wait for the user input until his words is correct or time is running out, won’t work without it. If you want to test the code, download awaibility and awaibility-dependancies from there. Is there an easy alternative to it ?
  • I don’t think the code is optimized. How could I optimize it ?

bluetooth keyboard needs to pair after each startup

I am running ubuntu 18.04.02 on an asus t100 chi. I am having issues with the Bluetooth docking keyboard. It will pair successfully, however when I restart the device it will not automatically reconnect, and I will have to par the keyboard again. I have tired pairing both through the gui, and using bluetoothctl, with both having the same result.

Totally Noop needs help with AMD & Intel hybrid graphic

hello guys im new here… i decided to install KDE Neon (BASED ON UBUNTU 18.04 LTS) as my first Linux Distro i pretty much like it but i have a problem with GPUs and rendering seems like Intel is the ONLY graphic card in use (note that AMD Drivers Installed i mean the Open Source Default one!)

Now the question is how to enable the AMD GPU? and is it even possible to USE BOTH at the same time?

here’s the hardware info: HP Probook 450 G1 Chipest: Mobile Intel HM87 Express RAM: 8 GB GPUs: AMD Radeon HD 8750M Intel HD 4600

Versioning when pre-release feature-complete version needs more features

I have an app in the “Play Store” and “Testflight” that was feature-complete and in beta channel versioned as 1.0.0-beta. Now the client change his mind and wants to add more features to the app. So the app never goes to production channels, and never changes to 1.0.0.

So I need to add more features, what will be the corrent version number for new alpha and beta channels releases? 1.1.0-alpha, 1.1.0-beta or another versioning?

Can I go back to 0.x.y versioning? I don’t know if the App Store or Play Store allows goings back? Or I’m screw I will eventually need to release to production with a version above 1.0.0 ? :/

Guest session – Stop “Xcode needs to take control of another process for debugging to continue”

I am getting the same prompt as in Stop "developer tools access needs to take control of another process for debugging to continue" alert

In that question the answer is to just enable it, for which one needs the computer’s admin password.

I am in a computer using the Guest session and don’t have the password. I am just trying to use the Playground to test minor things.

Is there a way to stop this warning? Diable the debugging mode in the Playground, maybe? If so, how does that work?

Thanks!

Application needs access to files, but user is not allowed to access them

I have a requirement that my Windows GUI application writes log files. But for auditing purposes, certain users that run the application are not allowed access those files. Is there any way to handle the fact that the application needs different file permissions than the user running it? A couple suggestions have been made to me are to write a Windows service to manage the logging or write to the Windows Event Log. This would be a major change, as we’re already writing to files on disk, so I am hoping I can accomplish this by running the app as a different user.

I know I can do this by using runas with saved credentials, but this is a security risk. And I thought about using the Task Scheduler, but it seems this won’t display the UI for the logged in user.