Make Compass stop checking/compiling sprites - sprite

Is there any way to configure Compass such that it does not recompile or check my sprites on each change of a non-sprite file?
I am trying to make edits to the file lists.scss but I have to wait for compass to check (I believe its checking, maybe its compiling) one sprite file (multiple times) before compass overwrites my lists.css file. Waiting for compass to check these sprites is costing our team a lot of time.
➜ proj2 git:(tU8N) ✗ compass watch
>>> Compass is polling for changes. Press Ctrl-C to Stop.
>>> Change detected at 21:52:39 to: lists.scss
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
error static/sass/application.scss (Line 354 of static/sass/lists.scss: Invalid CSS after "": expected selector, was "")
overwrite application.css
error static/sass/lists.scss (Line 354: Invalid CSS after "": expected selector, was "")
overwrite lists.css
>>> Change detected at 21:52:48 to: lists.scss
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
WARNING: 'icon-ok-32.png' was not found (or cannot be read) in static/images
overwrite application.css
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
overwrite lists.css
>>> Change detected at 21:54:58 to: lists.scss
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
WARNING: 'icon-ok-32.png' was not found (or cannot be read) in static/images
overwrite application.css
unchanged static/images/sprite-icon-s18bb1f8a7d.png
unchanged static/images/sprite-icon-s18bb1f8a7d.png
overwrite lists.css
UPDATE
Sass 3.2.19 (Media Mark)
Compass 0.12.6 (Alnilam)

This is not expected behaviour for Compass, as far as I know. Compass detects changes in your sprite icons and only then it recompiles your sprite(s).
I notice you have an icon missing or unreadable, though ("WARNING: 'icon-ok-32.png' was not found (or cannot be read) in static/images"). Could you make sure you put this icon back or stop calling it in your CSS and see if this fixes your problem?

Related

How to ignore warnings - finding the actual warning / error

How can I ignore a Warning / Error in Android Studio?
Like the following, I can see the warning saying:
"warning: The left operand can't be null, so the right operand is never executed."
Now I can see from this and this, that I can do:
// ignore: unused_field
But how do I know the error / warning type from the warning.

node-sass module install script does not exit when npm install is launched by Ruby's popen3

UPDATE 3: This problem appears to be a part of the module installation of node-sass. The stranded process has a working directory of ./node_modules/node-sass, and its command-line scripts/install.js resolves to a file within the module. Furthermore, the last line of output that reaches the console matches a line output by node-sass' scripts/install.js:
if (cachedBinary) {
console.log('Cached binary found at', cachedBinary);
fs.createReadStream(cachedBinary).pipe(fs.createWriteStream(binaryPath));
return;
}
This code does not have any issues when run from the command-line (i.e., simply issuing npm install at the command prompt with a blank node_modules directory), but when npm install is launched via popen3, it appears that the stream .pipe call here blocks indefinitely.
This is a head scratcher for me at the moment...
If I ^C the terminal where Ruby has launched these child processes, the interrupt makes it to the rogue process and causes it to terminate. However, forcing all the pipes closed (or simply terminating the parent process) does not cause the rogue node.exe to exit.
I contemplated an alternative version of popen3 that explicitly waits on the child process instead of just implicitly waiting for the streams to all come to an end, but while this does permit the calling side to proceed properly, the rogue child process still hangs around, and would interfere with subsequent invocations by holding an open handle to the ./node_modules/node-sass directory.
UPDATE 4: I have opened this bug report with the node-sass project: https://github.com/sass/node-sass/issues/2459
UPDATE: I'm pretty sure this is actually a Node issue. I tracked down the root cause of the hang, and it is that through a complex tree of child processes, npm install ultimately leaves behind an instance of node.exe that just sits there, apparently indefinitely, doing nothing, keeping the stdout and stderr pipes it has inherited open.
So, this leaves new questions:
Is there a way to make Node not leave behind a straggler process after an npm install completes?
Is there a way to explicitly wait for the direct child process of popen3 to exit, instead of waiting for the streams to end, and then possibly close the streams from the listening side to terminate the threads pumping the output?
UPDATE 2: I have reproduced the problem with this minimalist code:
Open3::popen3 "npm install" do |stdin, stdout, stderr, thr|
stdin.close
stdout.each_line { |l| puts l }
end
With this code, the rogue node.exe process (command-line: scripts/install.js) hangs around after the npm install completes. Terminating the process unblocks the popen3 call (by causing stdout to come to an end, so the each_line loop terminates), and ^Cing the Ruby code (when running in an IRB window) causes the rogue node.exe to terminate (following a line in the console output: => #<IO:(closed)>).
This only happens when the process is run through popen3; the identical npm install from a CMD prompt exits normally.
Original question:
I'm having a problem with popen3 in a Ruby script. It's hanging, but I'm pretty sure it's not any of the usual candidates. I've updated my call to popen3 with tons of annotation so that I can see in the console output what's going on. Here is how I'm making the call:
command_output_lines = []
lock = Mutex.new
exit_code = nil
Logger.log("[MAIN] beginning popen3 block")
Open3.popen3(command_w_params) do |stdin, stdout, stderr, thr|
Logger.log("[MAIN] closing stdin stream")
stdin.close
Logger.log("[MAIN] starting [STDOUT]")
stdout_thread = Thread.new do
Logger.log("[STDOUT] started")
begin
stdout.each_line do |stdout_line|
Logger.log("[STDOUT] got a line, acquiring lock")
lock.synchronize do
command_output_lines <<= stdout_line
Logger.log(stdout_line)
end
Logger.log("[STDOUT] lock released")
end
rescue Exception => e
Logger.log("[STDOUT] exception: #{e}")
end
Logger.log("[STDOUT] exiting")
end
Logger.log("[MAIN] starting [STDERR]")
stderr_thread = Thread.new do
Logger.log("[STDERR] started")
begin
stderr.each_line do |stderr_line|
Logger.log("[STDERR] got a line, acquiring lock")
lock.synchronize do
command_output_lines <<= "[STDERR] " + stderr_line
Logger.warn(stderr_line)
end
Logger.log("[STDERR] lock released")
end
rescue Exception => e
Logger.log("[STDERR] exception: #{e}")
end
Logger.log("[STDERR] exiting")
end
Logger.log("[MAIN] joining to [STDOUT]")
stdout_thread.join
Logger.log("[MAIN] joining to [STDERR]")
stderr_thread.join
Logger.log("[MAIN] threads joined, reading exit status")
exit_code = thr.value.exitstatus
end
Logger.log("[MAIN] popen3 block completed")
(Never mind what exactly Logger.log is; just know that it sends output to the console.)
Where I'm seeing the problem, command_w_params is equal to npm install, and this code is running in the context of a bundle exec rake TaskName.
When it reaches this code, I see the following console output:
[MAIN] beginning popen3 block
[MAIN] closing stdin stream
[MAIN] starting [STDOUT]
[MAIN] starting [STDERR]
[MAIN] joining to [STDOUT]
[STDOUT] started
[STDERR] started
[STDOUT] got a line, acquiring lock
[STDOUT] lock released
[STDOUT] got a line, acquiring lock
> node-sass#4.9.2 install C:\Users\Jonathan Gilbert\RepositoryName\ProjectName\node_modules\node-sass
[STDOUT] lock released
[STDOUT] got a line, acquiring lock
> node scripts/install.js
[STDOUT] lock released
[STDOUT] got a line, acquiring lock
[STDOUT] lock released
[STDOUT] got a line, acquiring lock
Cached binary found at C:\Users\Jonathan Gilbert\AppData\Roaming\npm-cache\node- sass\4.9.2\win32-x64-57_binding.node
[STDOUT] lock released
...and then it just hangs. At this point, I can see in Process Explorer that the child process has exited. There is nothing left but ruby.exe, but it just sits there indefinitely until it is explicitly cancelled. The two threads are still running, indicating that the stdout and stderr streams haven't signalled end-of-stream yet.
Now, often when people have a problem with popen3, it's because they're not reading both stdout and stderr simultaneously, and one or the other fills up its pipe buffer while the parent process is only paying attention to the other. But my code is using separate threads and keeping the pipe buffers empty.
Another problem I've seen come up is that the child process may be sticking around waiting for stdin to be closed, but in this case:
stdin is being closed.
The child process doesn't even exist any more.
Does anybody recognize these symptoms? Why are the stdout and stderr streams not hitting end-of-stream when the child process exits??

How to install Material Design Lite Documentation Offline?

I have some problem while installing a documentation for Material Design Lite locally. I have following a command in this file:
git clone https://github.com/google/material-design-lite
cd material-design-lite
npm install && npm install -g gulp
gulp all && gulp serve
When run gulp all there is an error:
root#c54a089ac69c:/home/material-design-lite# gulp all
[21:18:38] Requiring external module babel-register
[21:18:42] Using gulpfile /home/material-design-lite/gulpfile.babel.js
[21:18:42] Starting 'clean'...
[21:18:42] Finished 'clean' after 106 ms
[21:18:42] Starting 'all'...
[21:18:42] Starting 'lint:aux'...
[21:18:45]
/home/material-design-lite/gulpfile.babel.js
136:1 warning Unexpected 'todo' comment no-warning-comments
807:3 warning Unexpected 'todo' comment no-warning-comments
✖ 2 problems (0 errors, 2 warnings)
[21:18:45] Finished 'lint:aux' after 2.39 s
[21:18:45] Starting 'styletemplates'...
[21:18:49] styles all files 1.07 MB
[21:18:49] Finished 'styletemplates' after 4.04 s
[21:18:49] Starting 'styles-grid'...
[21:18:49] Starting 'styles'...
[21:18:49] styles-grid all files 17.77 kB
[21:18:49] Finished 'styles-grid' after 187 ms
[21:18:50] styles all files 714.08 kB
[21:18:50] Finished 'styles' after 1.39 s
[21:18:50] Starting 'styles:gen'...
[21:18:52] Finished 'styles:gen' after 2.36 s
[21:18:52] Starting 'lint:sources'...
[21:18:56]
/home/material-design-lite/src/mdlComponentHandler.js
232:49 error Properties shouldn't be quoted as all quotes are redundant quote-props
366:51 error Properties shouldn't be quoted as all quotes are redundant quote-props
/home/material-design-lite/src/checkbox/checkbox.js
123:5 warning Unexpected 'todo' comment no-warning-comments
/home/material-design-lite/src/icon-toggle/icon-toggle.js
119:5 warning Unexpected 'todo' comment no-warning-comments
/home/material-design-lite/src/radio/radio.js
133:5 warning Unexpected 'todo' comment no-warning-comments
/home/material-design-lite/src/switch/switch.js
122:5 warning Unexpected 'todo' comment no-warning-comments
/home/material-design-lite/src/tabs/tabs.js
88:7 warning Do not use 'new' for side effects no-new
/home/material-design-lite/src/textfield/textfield.js
273:11 warning Unexpected 'todo' comment no-warning-comments
/home/material-design-lite/src/layout/layout.js
520:11 warning Do not use 'new' for side effects no-new
570:3 error Block must not be padded by blank lines padded-blocks
✖ 10 problems (3 errors, 7 warnings)
[21:18:56] 'lint:sources' errored after 3.59 s
[21:18:56] ESLintError in plugin 'gulp-eslint'
Message:
Failed with 3 errors
[21:18:56] 'all' errored after 14 s
[21:18:56] Error in plugin 'run-sequence'
Message:
An error occured in task 'lint:sources'.
But, when I serve it with gulp serve, it's run but just displaying this:
It's Just displaying the files! How to generate offline documentation for material-design-lite? Any ideas? Thanks.
Thank you;
PS:
I run this with on Docker with NodeJS Container.
Material Design Lite Website: https://getmdl.io
I have never try to clone the repo, but with this way i can get the offline docs. Only using wget tools.
wget -mkEpnp https://getmdl.io
And voila, you have the copies of website in your desktop.
As mentioned in the GitHub issue referenced here
You need to checkout with Unix style line endings. This process is detailed in the README.
Windows users, if you have trouble compiling due to line endings then make sure you configure git to checkout the repository with lf (unix) line endings. This can be achieved by setting core.eol.
git config core.eol lf
git config core.autocrlf input
git rm --cached -r .
git reset --hard
The other error
error Properties shouldn't be quoted as all quotes are redundant quote-props
has been fixed for the versions greater than mdl-1.1 as mentioned in the issues here
Hope it helps! Cheers !

Overtone & Vim (Repl doesn't seems to be connected)

I tried to play with overtone on ubuntu, but I can't eval some of overtone's codes in Vim.
:Eval works for the clojure code; I tried it in vim (a clj file in the lein project directory), ex: (+ 1 2 3) => :Eval => appeared on the bottom of the vim window => 6, so it's ok.
But, for example, I tried:
(demo(sin-osc)) => :Eval ;(:Require don't change nothing)
It returned:
java.lang.RuntimeException: Unable to resolve symbol: demo in this context, comp
iling:(NO_SOURCE_PATH:1:1)
So here's what I do:
jack is started
lein repl is started in the lein project (deps is ok)
in the first terminal where there is lein I start overtone (use 'overtone.live), here is the log; I've got 2 errors:
user=> (use 'overtone.live)
--> Loading Overtone...
--> Booting internal SuperCollider server...
* ERROR: dlsym load err '/home/axxon/workspace/overtone/tutorial/native/linux/x86_64/libscsynth.so: undefined symbol: load'
Found 10 LADSPA plugins
* ERROR: open directory failed '/home/axxon/.local/share/SuperCollider/synthdefs'
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 44100,000000, driver's block size = 1024
--> Connecting to internal SuperCollider server...
--> Connection established
JackDriver: max output latency 23,2 ms
here, in this window I tried (demo(sin-osc)). it works; I can hear it.
Great, but now I want to script with Vim, so I created a new file (mytest.clj) in the lein project directory (/overtone/tutorial), I opened it with Vim (in another window)
in this blank file, I wrote the same thing as I said before, (demo(sin-osc)) and tried to eval with first, :Require, it returned this:
(clojure.core/require 'user :reload)
java.io.FileNotFoundException: Could not locate user__init.class or user.clj on
classpath:
with Eval, it doesn't work either.
Thanks for your help because I really want to use overtone!
Ps: my vim bundles:
Bundle 'guns/vim-clojure-static'
Bundle 'tpope/vim-fireplace'
Bundle 'tpope/vim-classpath'
Edit: I forgot to use a correct namespace, and in overtone's google group, i seen that mytest.clj must be in the src directory of the project. I tried this code with :Require (i stopped overtone in the first window where i started lein):
(ns tutorial.foo
(:use [overtone.live]))
(definst saw-wave [freq 440 attack 0.01 sustain 0.4 release 0.1 vol 0.4]
(* (env-gen (lin-env attack sustain release) 1 1 0 1 FREE) (saw freq) vol))
(saw-wave)
, but it returned:
(clojure.core/require 'tutorial.foo :reload)
Erreur détectée en traitant function <SNR>17_Require..fireplace#session_eval..<S
NR>17_eval..7 :
ligne 38 :
E605: Exception non interceptée : Error running Clojure: *** ERROR: open directo
ry failed '/usr/java/packages/lib/amd64'^#*** ERROR: dlsym load err '/usr/lib/jn
i/libswt-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load err '/usr/l
ib/jni/libswt-glx-gtk-3836.so: undefined symbol: load'^#*** ERROR: dlsym load er
r '/usr/lib/jni/libswt-webkit-gtk-3836.so: undefined symbol: load'^#*** ERROR: d
lsym load err '/usr/lib/jni/libswt-atk-gtk-3836.so: undefined symbol: load'^#***
ERROR: dlsym load err '/usr/lib/jni/libswt-pi-gtk-3836.so: undefined symbol: lo
ad'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-cairo-gtk-3836.so: undefined
symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-awt-gtk-3836.so:
undefined symbol: load'^#*** ERROR: dlsym load err '/usr/lib/jni/libswt-gnome-gt
k-3836.so: undefined symbol: load'^##^## A fatal error has been detected by the
Java Runtime Environment:^##^## SIGSEGV (0xb) at pc=0x00007f5d261db671, pid=693
1, tid=140036632291072^##^## JRE version: 7.0_25-b30^## Java VM: OpenJDK 64-Bi
I was having the same problem. It turned out that the vim fireplace plugin was not connected to my bash repl session. I manually established the connection and everything worked just fine afterwards.
At the top of your lein session you should see the details about what port the repl session is running on
nREPL server started on port 35182 on host 127.0.0.1
So then you can connect vim-fireplace to that repl session by using
:Connect nrepl://localhost:35182
The reason why you can still evaluate code like (+ 1 2 3) even when vim-fireplace is not connected to the remote repl session is because vim-classpath will make it fall back to just spawning a new clojure runtime instance to evaluate that code. Once the fireplace repl connection is working you should notice that evaluating code becomes a lot faster since it doesn't need to load clojure from scratch.
Make sure that you use overtone.live in the namespace declaration of the file you are editing in vim, and that the REPL is running in a separate terminal instance. From vim, save the file (:w) and move your cursor into the ns declaration. Then hit gf to open the file for the namespace. Type cpR or :Require! and then cpp or :Eval the function you were trying to run. Hopefully this will work for you! Best of luck.

Cassandra 1.2 using symbolic link for /var/lib/cassandra/data

I thought this would be simple. I guess not.
I have an external hard drive mounted at /root/storage - OK
I moved the data directory from /var/lib/cassandra/ to /root/storage - OK
I then created a symbolic link out of /var/lib/cassandra pointing to where the directory is now.....so...... ln -s /root/storage/data /var/lib/cassandra - OK
Now I am unable to start cassandra. I am getting this error in /var/log/cassandra/system.log:
INFO [main] 2013-02-15 10:08:36,329 CacheService.java (line 166)
Scheduling row cache save to each 0 seconds (going to save all keys).
ERROR [main] 2013-02-15 10:08:36,366 FileUtils.java (line 373)
Stopping the gossiper and the RPC server ERROR [main] 2013-02-15
10:08:36,367 CassandraDaemon.java (line 387) Exception encountered
during startup java.lang.IllegalStateException: No configured daemon
at org.apache.cassandra.service.StorageService.stopRPCServer(StorageService.java:314)
at org.apache.cassandra.io.util.FileUtils.handleFSError(FileUtils.java:375)
at org.apache.cassandra.db.Directories.(Directories.java:113)
at org.apache.cassandra.db.Directories.create(Directories.java:91)
at org.apache.cassandra.db.ColumnFamilyStore.scrubDataDirectories(ColumnFamilyStore.java:403)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:174)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:370)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:413)
[root#cassandra-new6 storage]# vi
/usr/share/cassandra/default.conf/cassandra.yaml
The permissions are exactly the same on this directory. All file permissiosn are teh same too. Any ideas would be appreciated.
When I get rid of the sym link and move the data directory back, everything works again.
The symlink regression is fixed in Cassandra 1.2.2. https://issues.apache.org/jira/browse/CASSANDRA-5185
Instead of creating a sym link, you can change where Cassandra looks for the data directory in the cassandra.yaml file by changing the data_file_directories parameter.

Resources