w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Why is a Maven plugin failing with error messages about 'API incompatibility', 'foreign imports' and the 'maven.api Class realm'?
It eventually occurred to me to look in the lib/ext directory of the JDK (on Mac, the equivalent directories are /Library/Java/Extensions and $HOME/Library/Java/Extensions) and, lo and behold, there was a version of SLF4J in there, along with a bunch of other stuff. Removing the SLF4J jars got my build working normally again. (Note: I have had the ATO's AUSKey software deposit things in the lib/ext directory before, which is why I thought to look there. I haven't yet checked to see whether AUSKey will still work after I removed SLF4J from the directory.)

Categories : Maven

Compile sass (via compass) in RoR-environement without "compass watch"
So after playing around a bit I actually found the solution :) I removed the compiled files from COMPASS (the CSS files), didn't compass watch anymore and made sure that all my import routes were correct. The only files now in my stylesheet-folder are .scss. Actually pretty simple and just the same as running SASS without COMPASS on rails. Just make sure you include the compass-rails gem in your gemfile :D

Categories : Ruby On Rails

Multiple transforms using Compass
You need to use the transform mixin rather than the shortcut mixins for each specific transformation: @include transform(translateY(-100%) scale(0.5)); It's pretty simple - just pass it the transforms you want, using the official css syntax.

Categories : CSS

Multiple imports in python as the same keyword
The comma divides up clauses of the import statement. That code is equivalent to: from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _

Categories : Python

Safe imports of libraries in multiple LESS or SASS stylesheets
Is including bootstrap into the less files an option for you, like you do in development? My approach in SCSS is like that: style.scss (doesnt have any own declarations) imports bootstrap.scss first then imports site specific .scss files, which may contain overrides. By doing that I can fully control the order of the files and therefore the order of declarations in the generated css file. Of course one has to decide to trade in the ability to let Bootstrap load via CDN when included, but in my case I use a very down narrowed version of Bootstrap anyway.

Categories : HTML

Allowing multiple AssertionErrors before failing a test
var found = ['Alice', 'Bob', 'John'].map(function (name) { return pageContent.indexOf(name) >= 0; }); assert.include(found, true); If I may opine that your desire for a wrapper library for fuzzy asserting sounds misguided. Your fuzzy rules and heuristics about what is a "soft" vs "hard" assertion failure seem like a much less sensible alternative than good old programming using the existing assertion paradigm. It's testing. It's supposed to be straightforward and easy to reason about. Keep in mind you can always take logic such as the above and wrap it in a function called includesOne(pageContent, needles) so it is conveniently reusable across tests.

Categories : Node Js

Why is Nokogiri failing on multiple pseudo element selectors?
Without sample HTML it's hard to tell what you're after, but I'll take a wild-shot starting with a replacement of: document.at_css(".link:not(.button):after") with: document.css(".link").reject{ |n| n['class'][/ button /ix] }.first.next_sibling I've read comments that some of the CSS isn't an exact match to jQuery's so workarounds are needed. Take a glance at: https://github.com/sparklemotion/nokogiri/issues/907 The doc.css("input:not([disabled])").count work around might be useful. https://github.com/sparklemotion/nokogiri/blob/master/ROADMAP.md

Categories : Ruby

@font-face .ttf files multiple, some working, some failing
I've been having the same problem with .ttf files working for some fonts but not others. My solution is a work around in that I converted the font to the woff file type: @font-face { font-family: "trade"; src: url(/static/common/fonts/trade-gothic-bold.ttf) format("truetype"), url(/static/common/fonts/trade-gothic-bold.eot) format("embedded-opentype"), url(/static/common/fonts/trade-gothic-bold.woff) format("woff"); } I know this doesn't solve the root problem and was hoping someone had a better answer. My .ttf file is not corrupt because I converted my .woff from it. My thinking is that there has to be something in these non-working .ttf files that make them uninterpretable to the browsers, but not corrupt.

Categories : Misc

Mercurial clone failing at 99.x% everytime from multiple sources
Please note that the answer was posted by @tim-pietzcker in the second comment and @Shane states that this worked - I am just adding this as an answer so that the question no longer appears as "Unanswered".

Categories : Python

create multiple movie thumbnails using ffmpeg (one at a time) failing
doh! really dumb on my part. I was using the same file name for each thumbnail and there was a dialog coming up in the command line asking if I wanted to overwrite my existing thumb image. when I changed the filename to be dynamically created, everything is peachy.

Categories : C#

Multiple Django Celery Tasks are trying to save to the same object and failing
I assume you're using django because you tagged it as such. If so, you can use select_for_update (documentation) to lock the objects. This will block the other workers until the transaction completes. If your tasks run a long time you could get timeouts so catch that exception and retry if necessary. from django.db import transaction from celery.task import task @task def mytask(mpk): with transaction.commit_on_success(): my_obj = MyModel.objects.select_for_update().get(pk=mpk) ... Note that this won't work with sqlite.

Categories : Python

Failing to install Jekyll gem native extension on Windows with "multiple target patterns"
Ok just a try. The Makefile on this line (and following) defines the target for .m.o. $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $< Everything looks ok if you're using mingw / cygwin, but INCFLAGS can make problems on window machines, if you've installed ruby in a directory with spaces. INCFLAG is defined as INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) and if you see my definition below there is no space in any path. topdir = /C/Ruby200-x64/include/ruby-2.0.0 hdrdir = $(topdir) arch_hdrdir = C:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32 If I change the ruby installation to a path with spaces I get invalid option error in native windows command line and in the mingw session. Maybe this is could help.

Categories : Ruby

Inserting multiple rows into a table with a 2 column index ignoring duplicates without query failing
Here's an implementation of using a temporary table, aggregates, and merge. I'm making the assumption that you want the max position value to be saved. Now looking at this you might think that you can skip the temp table and just use values as the source in the merge. While you can use the values as a source, on can only have 0 or 1 matches, multiple rows will result in an error message. You might think I'm being fancy with the indexes, but they'll speed up the aggregate and the join. Skip them if performance isn't an issue or space is a concern. You can remove AND ff.position < source.pos from MATCHED if you don't think that the position already in the table will ever be higher than the values you are insterting, or if you don't care if you end up with lower positions. IF OBJECT

Categories : Sql Server

IOS: compass in my app
//Try this - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { //[manager stopUpdatingHeading]; double rotation = newHeading.magneticHeading * 3.14159 / 180; [_compass_image setTransform:CGAffineTransformMakeRotation(-rotation)]; }

Categories : IOS

Codification in JSP Imports
The solution to this problem is to change the menu.html to menu.jsp and on the top of the new file add <%@page contentType="text/html" pageEncoding="UTF-8"%> and then include this jsp in your page <body> <%@include file="includes/menu.jsp"%> </body>

Categories : HTML

Can't get LESS to compile Imports
You should not only save your Less file, but compile them leveraging a Less compiler. See http://vswebessentials.com/features/less how to compile your Less files with Web essentials. You can set all the compiler settings from Tools -> Options. They include: Compile on save Compile on build Enable minification

Categories : Asp Net

symfony2.3 with compass
I ran into this problem myself while attempting to migrate our SF2.2 project to SF2.3, below is a comparison of the command line executed by assetic's CompassFilter in 2.2 and 2.3 versions of the Assetic bundle SF 2.2.2 AsseticBundle 2.1.3 "C:Ruby200in uby.exe" "C:Ruby200incompass" "compile" "C:UsersRickAppDataLocalTemp" "--boring" "--images-dir" "D:/Projects/cw3sf2/app/../web/bundles/cwmain/images/" "--config" "C:UsersRickAppDataLocalTempass8DCC.tmp" "--sass-dir" "" "--css-dir" "" "C:/Users/Rick/AppData/Local/Temp/ass8DCD.tmp.scss" SF 2.3 AsseticBundle 2.3.0 "C:Ruby200in uby.exe" "C:Ruby200incompass" "compile" "C:UsersRickAppDataLocalTemp" "--boring" "--images-dir" "D:/Projects/cw3sf2/app/../web/bundles/cwmain/images/" "--config" "C:UsersRickAppDataLocalTempassD29B.tmp" "--

Categories : Ruby

Validate XML Document with xsd that has imports
You wrote: When I run it I get: The http://www.w3.org/2000/09/xmldsig#:Signature element is not declared. Looks like it just cannot load that imported schema by that URL: http://www.w3.org/TR/2001/PR-xmldsig-core-20010820/xmldsig-core-schema.xsd I've checked that URL and the schema does exist there, as well as the element {http://www.w3.org/2000/09/xmldsig#}Signature is declared in it (globally). But it takes rather long time to load that schema, apparently because W3C discourages (and actually hinders) the huge traffic to their XML resources from numerous software around the globe. Concerning this: But receieve the error: For security reasons DTD is prohibited in this XML document. To enable DTD processing... I am not sure which programming system you use (Java, .NET etc)

Categories : C#

xsl:apply-imports to a variable?
One option is to prevent the identity template from overriding by changing mode="#all" to list all modes except cleanup: <xsl:template match="@*|node()" mode="#default not-cleanup1 not-cleanup2" priority="-1"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="#current"/> </xsl:copy> </xsl:template>

Categories : Xml

Confused about python imports
Module names are case-sensitive. Use: import Test.foo as foo (The as foo is so that you can call foo.bar in main.) You must also have ~/Development listed in PYTHONPATH. If using Unix and your login shell is bash, to add ~/Development to PYTHONPATH edit ~/.profile to include export PYTHONPATH=$PYTHONPATH:$HOME/Development Here are instructions for Windows. Further suggestions for debugging: Place import sys print(sys.path) import Test print(Test) import Test.foo at the top of test_foo.py. Please post the output.

Categories : Python

Python Circular Imports
The problem here is a bit harder than the usual circular import problems. To execute the class statement that defines object1, you need to already have defined object2, but to execute the class statement that defines object2, you need to already have defined object1. You can work around this: object1.py: class object1(object): pass import object2 object1.brother = object2.object2() object2.py: class object2(object): pass import object1 object2.sister = object1.object1() This defines enough of object1 or object2 to initialize the other class before importing the other module. However, I'd strongly recommend not doing this. Circular dependencies are a headache no matter what language you're working in, and when they depend subtly on initialization order like this, they onl

Categories : Python

Is there a way to call SQL before SQL*Loader imports?
In theory an after logon trigger can run code for you, but it would be difficult to switch functionality like that on and off on demand. Consider using an external table instead of SQL*Loader, and you can do just about whatever you like as part of the session.

Categories : Oracle

How to update function imports in MVC?
First, to understand your problem, what you need to know is that the EDMX file is just an XML file that contains 3 different sections: CSDL: Conceptual schema definition language SSDL: Store schema definition language MSL: Mapping specification language The CSDL contains the entities and relationships that make up your conceptual model. The SSDL describes your DB model and the MSL is the mapping between the 2. The “Update Model From DB” process will update the SSDL (change everything that is inconsistent with the current DB schema), it will only modify the CSDL in case you’ve added new things to your DB schema. This is quite a normal behavior since your Conceptual schema may/should differ from your DB schema (unless you want your Domain model to look exactly like a DB model whi

Categories : Function

Speeding up Python Imports
You can move the import statements to inside your functions to reduce initial startup. Another technique would be to copy your modules to a ramdisk or tmpfs for faster IO (these use RAM, which runs much faster).

Categories : Python

I'd like Python to look into a package first for imports
PEP 238 is about absolute and relatve imports. As I understood, from . import bar would import the right thing. Reading that PEP could help you understanding the different ways of importing modules. They point out, that absolut imports are the default, because it can be used for everything: import foo import bar.foo import sys In contrast to: import ..foo import .foo import sys #absolute

Categories : Python

Python Module Imports
Because you imported the CheckerBoardModule module object, not the CheckerBoard class. If you want to use just CheckerBoard, import that: from Boards.CheckerBoardModule import CheckerBoard All that importing does, apart from executing the module if that hasn't already happened, is bind the imported name in your own namespace. from foo import bar binds bar to whatever bar was bound to from foo. from foo import bar as baz lets you specify a new name.

Categories : Python

Long imports in Python
http://www.python.org/dev/peps/pep-0008/#maximum-line-length The preferred way of wrapping long lines is by using Python's implied line continuation inside parentheses, brackets and braces. Long lines can be broken over multiple lines by wrapping expressions in parentheses. These should be used in preference to using a backslash for line continuation. Make sure to indent the continued line appropriately. The preferred place to break around a binary operator is after the operator, not before it. So in your case this could be: from blqblq.lqlqlqlq.bla import ( fobarbazbarbarbazar as foo) from matplotlib.backends.backend_qt4agg import ( FigureCanvasQTAgg

Categories : Python

Relative imports in Python 3
unfortunately, this module needs to be inside the package, and it also needs to be runnable as a script, sometimes. Any idea how I could achieve that? It's quite common to have a layout like this... main.py mypackage/ __init__.py mymodule.py myothermodule.py ...with a mymodule.py like this... #!/usr/bin/env python3 # Exported function def as_int(a): return int(a) # Test function for module def _test(): assert as_int('1') == 1 if __name__ == '__main__': _test() ...a myothermodule.py like this... #!/usr/bin/env python3 from .mymodule import as_int # Exported function def add(a, b): return as_int(a) + as_int(b) # Test function for module def _test(): assert add('1', '1') == 2 if __name__ == '__main__': _test() ...and a main.py l

Categories : Python

Static Imports and Constructors
Does the constructor get called for SomeClass behind the scenes? Invoking a method doesn't call constructor. Constructor is called when you create an instance of a class. Here, you aren't instantiating the SomeClass, but simply accessing the static method directly on class name. So, there is no point of constructor being called. However, if you want to invoke an instance method, then first you would need an instance of the class containing that method. You can access an instance method only using an instance of class. But in this case also, calling the method doesn't call constructor behind the scene.

Categories : Java

opa (opalang) packages and imports
You can define dependencies of source files with packages and imports using an external file included directly by Opa (no need for make) with command: opa --conf opa.conf --conf-opa-files Syntax of the file (opa.conf in above example) is to be guessed from the opa create command. It looks like: your.package.name: import included.package.name import another.package.to.be.included path/to/the/file.opa

Categories : Misc

When are Property Imports Satisfied?
An object cannot be manipulated before its constructor is being called. MEF provides a solution for your problem though, with an interface called IPartImportsSatisfiedNotification public MyClass : IPartImportsSatisfiedNotification { [Import] public ImportedClass ImportedClass {get;set;} public MyClass() { //Imported Class is null at this point, so nothing can be done with it here. } public void OnImportsSatisfied() { //ImportedClass is set at this point. } } About the actions MEF takes to set your imports; it first calls the constructor, then sets any properties, then calls the notification method.

Categories : C#

Android compass issue
For Details look here Use a compination of TYPE_ACCELEROMETER and TYPE_MAGNETIC_FIELD. Sensor beschleunigung = sensor.getSensorList(Sensor.TYPE_ACCELEROMETER).get(0); Sensor magnetometer = sensor.getSensorList(Sensor.TYPE_MAGNETIC_FIELD).get(0); sensor.registerListener(handler, beschleunigung, SensorManager.SENSOR_DELAY_NORMAL, null); sensor.registerListener(handler, magnetometer, SensorManager.SENSOR_DELAY_NORMAL, null); and handler = new SensorEventListener() { float[] mGravity; float[] mGeomagnetic; @Override public void onSensorChanged( SensorEvent event ) { if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) mGravity = event.values; if (event.sensor.getType() == Sensor.T

Categories : Android

Compass Vertical Rhythm
The vertical-rhythms approach uses padding in combination with borders to keep the rhythm consistent. If you set the second argument (lines) to zero, there is no room for vertical-rhythms to work. The rhythm lines argument has to be greater than the border width.

Categories : CSS

Sass / Compass sprites
Do not set background positions manually. You can do that automatically without having Compass generate classes. Say, you have the following sprites: images/ social/ facebook.png twitter.png SASS updated according to @piouPiouM's suggestoin: $social-sprite-dimensions: true @import "social/*.png"; #my-semantic-selector { @include social-sprite(facebook); } #another .semantic > selector { @include social-sprite(twitter); } This results in the following clean CSS: .social-sprite, #my-semantic-selector, #another .semantic > selector { background: url('/images/social-sa75ff48010.png') no-repeat; } #my-semantic-selector { background-position: 0 -50px; width: 27px; height: 25px; } #another .semantic > selector { background-position: 0 -25px; width: 27px;

Categories : CSS

How to rotate a compass after the last one is finished?
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { // [manager stopUpdatingHeading]; double rotation = newHeading.magneticHeading * 3.14159 / 180; [_compass_image setTransform:CGAffineTransformMakeRotation(-rotation)]; }

Categories : Iphone

Make a compass iPhone 3GS
CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; locationManager.headingFilter = kCLHeadingFilterNone; [locationManager startUpdatingHeading]; [self.view bringSubviewToFront:_compass_image]; - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { // [manager stopUpdatingHeading]; double rotation = newHeading.magneticHeading * 3.14159 / 180; // CGPoint anchorPoint = CGPointMake(0, -23); // The anchor point for your pin //[mapView.map setTransform:CGAffineTransformMakeRotation(-rotation)]; [_compass_image setTransform:CGAffineTransformMakeRotation(-rotation)]; // [[mapView.map annotations] en

Categories : IOS

compass watch error - Mac OS X
It looks like you might have a version of SASS that doesn't work with this version of Compass I found the answer here: https://github.com/chriseppstein/compass/issues/1514 The following worked for me: Look at the version of SASS you have installed (you said Sass 3.3.0.alpha.253) sass --version Uninstall sass: sudo gem uninstall sass Reinstall sass - you should get the latest working version: sudo gem install sass Reinstall Compass (I did this and it kept my working version of SASS): sudo gem install compass

Categories : Ruby

Error with wp and sass/compass
You'll have to debug it. First, download your theme to a local drive and run compass compile on it. Then run Compass.App on it. Then run compass watch on the remote folder. On which step does the problem occur?

Categories : Wordpress

Zurb Foundation + Compass
That looks like Rails4 -- compass is not yet ready for Rails4. You could try your luck with version 2.0.alpha.0 on compass-rails -- it's been released for about 4 days now. gem 'compass-rails', '2.0.alpha.0'

Categories : Ruby On Rails

iOS Compass Heading Change Way
See Apple's Teslameter sample code: "This application implements a Teslameter, a magnetic field detector. It displays the raw x, y, and z magnetometer values, a plotted history of those values, and a computed magnitude (size or strength) of the magnetic field."

Categories : IOS



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