w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to merge css files (not .scss files) by sass or compass
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import @import takes a filename to import. By default, it looks for a Sass file to import directly, but there are a few circumstances under which it will compile to a CSS @import rule: If the file’s extension is .css. If the filename begins with http://. If the filename is a url(). If the @import has any media queries. If none of the above conditions are met and the extension is .scss or .sass, then the named Sass or SCSS file will be imported.

Categories : CSS

SASS - use variables across multiple files
You can do it like this: I have a folder named utilities and inside that I have a file named _variables.scss in that file i declare variables like so: $black: #000; $white: #fff; then I have the style.scss file in which i import all of my other scss files like this: // Utilities @import "utilities/variables"; // Base Rules @import "base/normalize"; @import "base/global"; then, within any of the files I have imported, I should be able to access the variables I have declared. Just make sure you import the variable file before any of the others you would like to use it in.

Categories : CSS

how to watch changes in whole directory/folder containing many sass files
You can create one sass file which includes the rest of the files, and then just watch this file. Alternately, look into Grunt and the very good grunt-contrib-compass plugin

Categories : CSS

SASS set variable depending on CSS class
I think a mixin is the answer. (As I wrote, variables won’t work.) @mixin content($color-default, $color-main) { background: $color-default; color: $color-main; } body.class-1 { @include content(#444, #555); } body.class-2 { @include content(#666, #777); } That SCSS compiles to this CSS: body.class-1 { background: #444444; color: #555555; } body.class-2 { background: #666666; color: #777777; } If you wanted to group the color values together in your SCSS file, you could use variables in conjunction with the mixin: $color-1: #444; $color-2: #555; $color-3: #666; $color-4: #777; body.class-1 { @include content($color-1, $color-2); } body.class-2 { @include content($color-3, $color-4); }

Categories : CSS

Bootstrap Custom Variable Rails SASS
While we are talking about variables, there's nothing related to CSS. Variables, in this case, are used by SASS/Compass a CSS preprocessor tool, used by Rails to make the use of CSS more easy (eg. by using variables). So when you insert your variables in a file, and let it be processed alone, it wont produce any CSS code unless you make any use of then in a valid CSS attribute. If you want to test it, add to your bootstrap_custom.css something like: body { background-color: $black; } And you will see your $black variable being used.

Categories : Ruby On Rails

Who knows which files should be included in a website?
It's all done by the client (which is usually a browser). When it sees <script>, <iframe>, <img>, <link>, etc. tags that reference other documents, it downloads them if necessary.

Categories : Apache

included files php do not appear in a browser
Do realy exist file "footer.html"? If no create them. Is file "footer.html" in the same directory as "index.php"? If no add it to the same directory. Do you have any content in your "footer.html" file? If no add any and check if it appears on page.

Categories : PHP

How to find included .h files if you're using vim?
If the file is a local included one, then you can type gf while having your cursor over the name of that file. This is the command to do a "go file", so you leave the current file and jump to the selected file.

Categories : Vim

Is it possible to use variables in seperate css files with sass/compass while still using shared mixins?
You can't include variables in your .css files. You can just do that in your .scss or .sass files. And you have to @import the file that has the variables into the file you want to use them. For example, in your general.scss you have: $blue = #00FFFF; And you need use it in another file, you need to import that file: @import 'general'; a { color: $blue; }

Categories : CSS

Legal characters for SASS and SCSS variable names
If you check out the source for the SASS lexer, you'll see: # A hash of regular expressions that are used for tokenizing. REGULAR_EXPRESSIONS = { :whitespace => /s+/, :comment => COMMENT, :single_line_comment => SINGLE_LINE_COMMENT, :variable => /($)(#{IDENT})/, :ident => /(#{IDENT})(()?/, :number => /(-)?(?:(d*.d+)|(d+))([a-zA-Z%]+)?/, :color => HEXCOLOR, :bool => /(true|false)/, :null => /null/, :ident_op => %r{(#{Regexp.union(*IDENT_OP_NAMES.map{|s| Regexp.new(Regexp.escape(s) + "(?!#{NMCHAR}|)")})})}, :op => %r{(#{Regexp.union(*OP_NAMES)})}, } Which references the IDENT character set defined in a separate file: s = if Sass::Util.ruby1_8? '200-377' elsif Sass::Util.macruby? 'u0080-uD7FFuE000-uFFFDU00010000-U00

Categories : CSS

What's the industry standard way to pass SASS variable to javascript?
Not sure about "industry standard", but it's a very handy technique and not too difficult. The content of pseudo elements is not available via text() though, you have to use getComputedStyle. Example using body:after: Sass (using the compass breakpoint extension): body:after { display: none; @include breakpoint($bp-wide) { content: "wide"; } @include breakpoint($bp-medium) { content: "medium"; } @include breakpoint($bp-small) { content: "small"; } } JavaScript: if (window.getComputedStyle) { var mq = window.getComputedStyle(document.body,':after').getPropertyValue('content'); } if (mq.indexOf('small') !== -1) { // do something } Credit: I first saw this technique here: https://coderwall.com/p/_ldtkg

Categories : Javascript

Javascript files are not included from manifest
Are you using Ruby v2.0? Try downgrading to 1.9. Symptom: The JavaScript manifest file does not compile, no errors are shown; however, a mysterious semi-colon ; appears at the end of the file after "preprocessing" the assets. Solution: Downgrade to Ruby v1.9.3! See two other posts on the same topic. My Rails Javascript manifest file doesn't compile nor include any required files Javascript manifest file "application.js" is not processed What a sorry mess it is to be programming in 2013!

Categories : Ruby On Rails

Files included from the default SolrConfig
contrib/extraction/lib solr-cell-* These are Solr Cell Libraries which integrates with Tika and helps you Index Rich documents e.g. Microsoft Word, Excel etc. contrib/clustering/lib solr-clustering- Solr clustering is for the Clustering support integrated with Carrot. Clustering would help you group documents, topic, entity extraction and much more. contrib/langid/lib/ solr-langid Solr Language Id for the Language detection. It adds the ability to detect the language of a document before indexing and then make appropriate decisions about analysis, etc. Just exclude the jars if you are not using any of the above features and be sure you remove the mappings from the Solr configuration files as well.

Categories : Solr

.NET 4.5 Web Forms Included Javascript - What are these files?
This blog about the Asp.Net scriptManager may help for your issue. ASP.NET 4.5 ScriptManager Improvements in WebForms

Categories : Javascript

What could cause qmake not to see files included by DEPENDPATH?
You have extra in the end of previous line. So DEPENDPATH line is expected to be part of previous directive. It's equivalent to: INCLUDEPATH += $$PWD/../somefolder/ DEPENDPATH += $$PWD/../somefolder/ which obviously doesn't make any sense. Remove ending from both lines.

Categories : Qt

error_log in the same directory as included files?
Based on hakre's suggestions above, I've created this script, to be included at the top of any php script: (also here is a gist I made of this file if you wish to fork/download it: view on github ) <? function custom_error_debug($errno, $errstr, $errfile, $errline, $errvars) { $message = ""; $message .= "[ " . date('Y-m-d h-i-s') . " ] Error: [$errno] $errstr on line $errline of $errfile "; //Dump all info to browser! //WARNING: Leave this commented except for extreme cases where you need to see all variables in use! //Using this will cause excessive processing time, and RAM. Use only as needed! /*if (!empty($errvars)) { echo $message . PHP_EOL . "Variables in use: <pre>";print_r($errvars); echo "</pre>"; //WARNING: not ending execution here may caus

Categories : PHP

PHP included variable scope
There are two ways this can be done The wrong way class test { public function __construct() { global $var; if($var == "string") { // do things } } } This will import var into the constuctors scope but violates the biggest benefit of object oriented programming which is to encapsulate functionality. This is the right way class test { public function __construct($var) { if($var == "string") { // do things } } } $test = new test($var);

Categories : PHP

Install prerelease gem of sass 3.3 failed (sass requires listen (~> 0.7))
No surprise that the pre-release has issues with it. That said, I managed to get it working using gem install sass --version=3.3.0.alpha.184. If you want compass, try using v0.12.2. Then you'd need to run SASS with compass, not SASS. Example: sass --compass --sourcemap styles.scss:styles.css Info from here: https://github.com/chriseppstein/compass/issues/1108

Categories : Ruby

For Android,will the unused class files in jar be (or not be) included in .apk?
Basically, the unused files will be still included in apk. But if you enabled ProGuard, they will be removed.

Categories : Android

macro expansion order with included files
VALUE is defined as SUBSTITUTE. The definition of VALUE is not aware at any point that SUBSTITUTE has also been defined. After VALUE is replaced, whatever it was replaced by will be scanned again, and potentially more replacements applied then. All defines exist in their own conceptual space, completely unaware of each other; they only interact with one another at the site of expansion in the main program text (defines are directives, and thus not part of the program proper). The rules for the preprocessor are specified alongside the rules for C proper in the language standard. The standard documents themselves cost money, but you can usually download the "final draft" for free; the latest (C11) can be found here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf For at-home use

Categories : Misc

Why can't you inherit PHP namespace aliases from included files?
Namespaces are supposed to show the dependencies of a particular class, the downside you get with inheriting, is a class can have use statements that are never used in the class. Yes, that would be a bad idea, eval() is a dirty dirty thing, that should be avoided at all costs You dont need a namespace in the rest of your files if the DB is already initialized, goes the same with any initialized class of your files if the DB is already initialized, goes the same with any initialized class

Categories : PHP

Creating Runnable Jar with external files included
Here's what you should do instead: Put that file back in your jar file. Use class.getResourceAsStream() to read it instead of File and FileReader. Here is an explanation of how to do that: How to really read text file from classpath in Java

Categories : Java

How to stop grunt compass task compiling sass files intended for include
Prepend them with underscore or use the specify option: Lets you specify which files you want to compile. Useful if you don't want to compile the whole folder. Globbing supported. Ignores filenames starting with underscore. Files must be in the directory you specified in sassDir.

Categories : CSS

PHP variable undefined in included file
When page.php is executed by the php processor, it knows nothing about the apache include - that just looks like an HTML comment to it. So it just executes the php code that it sees, and then writes out the rest as html, producing something like this: <body> <!--#include virtual="file.php" --> </body> In the next step apache, will see the #include and try to execute file.php. But at that stage the $text variable has long since gone. Since file.php is executed as a standalone file, it's obviously going to generate an error when you try to access the $text variable.

Categories : PHP

PHP Variables Lost in Files Included with Wordpress Functions
This issue has now been resolved. Instead of attaching my admin style sheet in the wp_admin_css_color() function, I attached a blank css file. This clears all old css without assigning any new ones. I then simply appended the admin style sheet to the admin_head hook, giving a nice little workaround: no problems so far, but I will update this if anything arises. Result: Admin theme works exactly as before, and PHP variable now work as well.

Categories : PHP

How to correct bind javascript/jquery to included php files
Because you are using a submit button for your live click you need to disable the form submission. There are two solutions: 1, Return false on the click event: $('#lookup_domain').live("click", function() { // all of your code return false; }) 2, add an onsubmit attribute to your form: <form action="#" method="get" class="domain_form" onsubmit="return false;"> </form>

Categories : PHP

Strange behavior of jar -C command: not all expected files included
The -C option will change into given folder before starting to tar the files. Should be: jar -cvf Test.jar -C src com/foo/bar/*.class to create a "runnable" jar.

Categories : Java

PHP class private variable set from different (included) file
Set them in the construct method __construct(), like this: private $languages; private $special; public function __construct() { $this->languages = $generated['languages']; $this->special = $generated['special']; }

Categories : PHP

Java: Adding included Jar files to a created Jar file in linux
Try this java -classpath ./db2jcc_license_cu.jar:./db2jcc4.jar:. CreateCoffees when you use -classpath it looses current directory from classpath so it needs . in classpath as well explicitly

Categories : Java

using sass color functions without sass engine
Update Now that I understand your problem better, why not just rewrite the functionality. require 'sass' class Rectangle include Sass::Script def color @color ||= Sass::Script::Color.new([0x82, 0x39, 0x06]) end def lighten(ammount) hsl = color.hsl.dup hsl[2] += ammount @color = Sass::Script::Color.new(hue: hsl[0], saturation: hsl[1], lightness: [2]) end end rec = Rectangle.new rec.lighten(20) Old Answer You aren't crazy, you've just included the wrong piece. This code runs as you expect it. Notice that I removed the ::Functions from the include. require 'sass' class Rectangle include Sass::Script def color color = Sass::Script::Color.new([0x82, 0x39, 0x06]) puts color.class end end rec = Rectangle.new rec.color

Categories : Ruby

Make header and footer files to be included in multiple html pages
You could do it with jquery. Put this code in index.html <html> <head> <title></title> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script> $(function(){ $("#header").load("header.html"); $("#footer").load("footer.html"); }); </script> </head> <body> <div id="header"></div> <!--Remaining section--> <div id="footer"></div> </body> </html> And put this code in header.html and footer.html at the same location as the index.html <a href="http://www.google.com">click here for google</a> Then visit the index.html, you should be able to click the link tags.

Categories : Javascript

C++CLI LNK Error 2019 & 2028 with Included .h and .lib (Linker finds those Files) [Wrapper]
#pragma once #pragma comment (lib, "CryptoLib.lib") #include "stdafx.h" This is wrong. The compiler will go looking for the stdafx.h #include directive and ignores anything it finds before that. So it will completely ignore your #pragma comment directive. The linker will therefore not link CryptoLib.lib and you'll indeed get this linker error. Using #pragma once in a .cpp file does not make sense. Another problem is that you appear to compile this code with /clr in effect, we can tell from the using statement. The compiler cannot tell that your function is a __cdecl function, it will assume the default and that's __clrcall when managed code compilation is enabled. You have to be explicit about it, like this: #include "stdafx.h" // First line in file! #pragma managed(p

Categories : C++

php global variable doesn't work inside included file
It may be an issue with a variable scope. Try to use $GLOBALS['available'] instead of $available in your client.php. So it will be defined in global scope. At the definition section also: $GLOBALS['available'] = "false"; and $GLOBALS['available'] = "true";

Categories : PHP

What's the efficient way to create a safe variable scope in a PHP file that is beeing included?
Instead of echo include('includes/form.php'); // Notice the unusual way of including echo $secret_var; use echo call_user_func(function(){ // secret var's scope is only valid in this block... // while the return '<form></form>'; is... returned. include('includes/form.php'); }); echo $secret_var; and see how it goes. PS: Don't echo include. It means echo bool;, not the return in it. PPS: And you're not using includes properly, as they're meant to... but I'm not even gonna start with that.

Categories : PHP

Rails 4 not adding fingerprint to included "extra" Asset Pipeline manifest files on Heroku
The solution is to either copy the config.assets.precompile setting into config/environments/staging.rb or move it up to config/application.rb. # Now in `config/application/rb` so it's loaded in both `production` AND `staging` environments config.assets.precompile += %w( www.js sessions.js embed.js www.css sessions.css embed.css ) It appears that this problem surfaced because my staging app on Heroku loads settings for the staging environment: # By running `heroku config` RACK_ENV: staging RAILS_ENV: staging Apparently, Rails 4 on Heroku runs rake assets:precompile for this staging environment (whereas Rails 3.2.14 loads from production no matter what). So the config.assets.precompile setting needs to be picked up in staging too.

Categories : Ruby On Rails

The maven assembly plugin moduleset sources instructions are not including any files and not matching the included modules
If module_assembly doesn't have a child reference to your module, it's not counted as a module. Note the content here refers to children only: http://maven.apache.org/plugins/maven-assembly-plugin/advanced-module-set-topics.html If you want to do this, you need to use a dependencySet rather than a moduleSet. PS - Thank you for the bounty!

Categories : Java

ClassNotFoundException even though the class is included in a jar file included in the buildpath
You need to add correspoinding jar to a Classpath as below for Eclipse plugins: Open you plugin.xml Goto Runtime tab Under classpath section click on "Add" and select the jar file which you have placed in folder under your project (say under lib). Now clean and build the project When you do that it will add corresponding entry to MANIFEST.MF as below: Bundle-ClassPath: lib/foobar.jar, . The way you add jars to classpath in eclipse plugins is different from ordinary java projects, since it's based on OSGi. You can learn more about classpath for eclipse plugins from this link. Hope this helps.

Categories : Java

Finding how many lines are different between two files
This should do what you want diff -U 0 file1 file2 | grep -c ^@ For example file1 contains aaa bbb ccc file2 contains aaa ccc ddd Result: diff -U 0 file1 file2 | grep -c ^@ 2

Categories : Shell

Finding different strings in two files - C++
Here is a simple but much more effective and idiomatic solution using std::set: std::ifstream file1("firstfile.txt"); std::set<std::string> str_in_file1; std::string s; while (std::getline(file1, s)) { str_in_file1.insert(s); } file1.close(); std::ifstream file2("secondfile.txt"); std::ofstream file_diff("diff.txt"); while (std::getline(file2, s)) { if (str_in_file1.find(s) == str_in_file1.end()) { file_diff << s << std::endl; } } file2.close(); file_diff.close(); Also, you might want to use a tool called diff. It does exactly what you are trying to do.

Categories : C++

Finding files in a directory
The Google entries you have found are quite right: you can't search a server with Javascript. You can, as you have demonstrated, find a file if you already know the name. The only way to search on the server is to implement a script on the server that does so. You might use PHP's scandir() or glob() functions, for example. There are many other ways. This question might give you some pointers.

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.