WebStorm File Watcher HTML minify - webstorm

I'm trying to minify my HTML document using a File Watcher and it does nothing.
I tried googling my problem and found this Link from SO, I tried the solution that was in Russian but didn't work for me either.
Also, the working Dir is $FileDir$

What doesn't work for you namely? The settings from this SO link work fine for me with the most recent html-minifier version:
Arguments: $FileName$ --collapse-boolean-attributes --collapse-whitespace --html5 --remove-attribute-quotes --remove-comments --remove-empty-attributes --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-style-link-type-attributes --remove-tag-whitespace --sort-attributes --sort-class-name --trim-custom-fragments --use-short-doctype --minify-js -o $FileNameWithoutExtension$.min.html
Output paths to refresh: $FileNameWithoutExtension$.min.html
Working directory: $FileDir$

Related

Can't download json schema using gradlew command

I can't figure out how to use the gradlew command to convert my GraphQL schema into a JSON file as it is specified in the documentation.
I opened CMD in my project folder, ran the gradlew command once, and it gave me this error:
Project 'module' not found in root project gradlew
I created a module inside my project with the name "module" and now it's throwing the following error:
Task 'downloadApolloSchema' not found in project ':module'.
I've already added all the dependencies to the latest version (2.0.0 as of the time of posting) so I'm clueless as to why this is happening. I've already searched the web and found nothing about this...
This is the command I'm trying to issue in the CMD:
C:\Users\myuser\AndroidStudioProjects\GraphQLApp\app>..\gradlew :module:downloadApolloSchema -Pcom.apollographql.apollo.endpoint=https://graphql-udemy-android.herokuapp.com/graphql -Pcom.apollographql.apollo.schema=src/main/graphql/com/example/schema.json
I have to go up one directory (..\) since the gradlew command is in the above my app folder.
I'm on Windows, and my Gradle version is 6.4.
You just change ./gradlew to .\gradlew
Open the root terminal
Paste the code below and ENTER!
.\gradlew downloadApolloSchema --endpoint=https://Your Endpoint/graphql --schema=app/src/main/graphql/com/example/Your Path/schema.json
Have a good days!
Sorry about that, the module part was mostly a placeholder for the gradle module where you apply the com.apollographql.apollo plugin. You can ignore it and gradle will find the appropriate task:
./gradlew downloadApolloSchema
This has been updated in the project README as well.
For windows i used
.\gradlew downloadApolloSchema --endpoint="https://rickandmortyapi.com/graphql" --schema=app/src/main/graphql/GetRepositories.json
NOTICE I used:
.\ instead of ./

How to setup sdl 2.0 on commandline?

I am following the tutorial at:lazyfoo
Have unzipped the SDL2.0x path:
C:\mingw_dev_lib
and copied items in "i686-w64-mingw32" to the folder above!
Set Environment Variable path to:
C:\mingw_dev_lib\bin
Now running the code:
g++ 01_hello_SDL.cpp
01_hello_SDL.cpp:5: SDL.h: No such file or directory
You should use longer command than that. It is already explained in that page. Please read all of the page!

WebStorm. How to make IDE compile less files from src/less/... to dist/css/...?

By default the .less files are compiled into the same directory.
But I want IDE compile to .less only from src/less/ and save .css to dist/css/ folder.
How can I do that?
Maybe I can mark folders as Sources and Destination? And then use FileDirRelativeToSourcepath?
UPDATE.
In older versions there was a "Mark as Sources".
In current version there is no this mark.
Why current version haven't this mark?
To have only files from src/less/ watched for changes, please create a custom scope in Settings | Appearance & Behavior | Scopes with only files from src/less/ included, and set this scope to your file watcher
To save output to a different folder, you need to modify 'Output paths to refresh' option (and, optionally, Arguments field - if you don't like creating output from stdout).
With stdout:
Arguments: --no-color $FileName$
Working dir: $FileDir$
Output paths to refresh: $ProjectFileDir$/dist/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css
Create output from stdout: checked
Without stdout:
Arguments: --no-color $FileName$ $ProjectFileDir$/dist/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css
Working dir: $FileDir$
Output paths to refresh: $ProjectFileDir$/dist/css/$FileDirPathFromParent(less)$$FileNameWithoutExtension$.css
Create output from stdout: unchecked
Screenshot with settings:

Building PostgreSQL driver for Qt

I trying to build psql driver but have some unexpected messages.
maxim#maxim-VirtualBox:~/Downloads/distrib/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql$ qmake psql.pro
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_bootstrap_private.pri:
No such file or directory
...
Cannot read
/home/maxim/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/modules-inst/qt_lib_xml_private.pri:
No such file or directory
But all of these files exist. What is the problem?
The problem seems to be that you have "modules-inst" as the subfolder name, whereas it is only "modules" without the "-inst" suffix in reality.
See how it works fine on my end:
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $ qmake psql.pro
lpapp ~/Downloads/qt-everywhere-opensource-src-5.2.1/qtbase/src/plugins/sqldrivers/psql $
I found a problem. After install qt-libraries I created new folder 'distrib' and move sources in there. That's why I got this problem.
I should have checked the existence of the directory by cd command.

PyAIML not loading startup

I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.