I am new to Play and GWT and following the documentation given here. But I see the following errors:
bash-3.2$ play deps test-gwt
!! Error whileloading /opt/play-1.2.1/modules/gwt-1.0/commands.py: name 'play_command' is not defined
~
~ Resolving dependencies using /Users/Harit/Documents/personal/projects/test-gwt/conf/dependencies.yml,
~
~ play->gwt 1.0 (from playLocalModules)
~
~ Installing resolved dependencies,
~
~ modules/gwt-1.0 -> /opt/play-1.2.1/modules/gwt-1.0
~
~ Done!
I see that there is a corresponding bug here, and status is fix_commited, but I don't know what shall I do?
Isn't it just because play-gwt module is not compatible with play 1.2 ?
Apparently this module is quite old and not very active and command syntax has changed in version 1.1.x or something like that.
Before, you wrote commands.py like that:
...
if play_command.startswith('gwt:'):
...
and now, it is like that:
...
MODULE = "secure"
COMMANDS = ["secure:", "secure:ov", "secure:override"]
HELP = {
"secure:": "Show help for the secure module",
"secure:override": "Override the CSS, login or layout"
}
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app")
args = kargs.get("args")
env = kargs.get("env")
if command == 'secure:':
...
In my opinion, the modification is really light so you can either ask the module owner if he would accept to do it or even do it by yourself ;)
There is also a GWT2 module which seems much more active: http://www.playframework.org/modules/gwt2 (apparently no new version since last october but the github project shows very recent commits with play1.2 support)
Related
I want to compile a simple rust program using a third party library named warp:
[package]
name = "hello-world-warp"
version = "0.1.0"
[dependencies]
warp = "0.1.18"
In src/main.rs:
use warp::{self, path, Filter};
fn main() {
// GET /hello/warp => 200 OK with body "Hello, warp!"
let hello = warp::path!("hello" / String)
.map(|name| format!("Hello, {}!", name));
warp::serve(hello)
.run(([127, 0, 0, 1], 3030));
}
When I run cargo build I see it download warp and lots of transitive dependencies, then I get the errors:
Compiling hello-world-warp v0.1.0 (<path>) error[E0432]: unresolved import `warp`
--> src/main.rs:3:12
|
3 | use warp::{self, path, Filter};
| ^^^^ no `warp` in the root
error: cannot find macro `path!` in this scope
I've gone through various docs on modules and crates. What am I doing wrong in this simple scenario?
The example you copied uses a syntax that works in the most recent edition of Rust, but you've accidentally set your Rust to emulate an old "2015" version of the language.
You must add:
edition = "2018"
to your Cargo.toml's [package] section.
When starting new projects, always use cargo new. It will ensure the latest edition flag is set correctly.
I'm hunting a fun little bug in a tiny reprocessing test: reprocessing01.
The project builds just fine until I make a change and trigger refmt via vscode, and then the project will no longer compile.
Here's the code that compiles and runs just fine for me before making any changes.
open Reprocessing;
type stateT = {
image: imageT,
};
let setup = (env) => {
Env.size(~width=800, ~height=600, env);
let image = Draw.loadImage(
~filename="assets/Wave_pattern_by_inkelv1122_on_flickr_800w.jpg",
~isPixel=false, env);
{
image: image
}
};
let draw = ({image} as state, env) => {
Draw.background(Constants.white, env);
Draw.image(
image,
~pos=(0,0),
~width=Env.width(env),
~height=Env.height(env),
env
);
state
};
run(~setup, ~draw, ());
If I open the project in vscode, make a change such as adding let myvar = 42; at the top, and save to trigger refmt, that introduces this error:
/Users/myer/dev/react/reasonml-playground/reprocessing01/node_modules/bs-platform/lib/bsc.exe -pp "/Users/myer/dev/react/reasonml-playground/reprocessing01/node_modules/bs-platform/lib/refmt3.exe --print binary" -bs-super-errors -w -30-40+6+7+27+32..39+44+45+101 -bs-D BSB_BACKEND="bytecode" -nostdlib -I '/Users/myer/dev/react/reasonml-playground/reprocessing01/node_modules/bs-platform/lib/ocaml' -no-alias-deps -color always -c -o src/index.mlast -bs-syntax-only -bs-simple-binary-ast -bs-binary-ast -impl /Users/myer/dev/react/reasonml-playground/reprocessing01/src/index.re
File "/Users/myer/dev/react/reasonml-playground/reprocessing01/src/index.re", line 12, characters 4-5:
Error: 2817: <UNKNOWN SYNTAX ERROR>
The line in question is the last one of this code block:
Draw.loadImage(
~filename="assets/Wave_pattern_by_inkelv1122_on_flickr_800w.jpg",
~isPixel=false,
env,
);
After this, the only way out is to revert the code to before the changes introduced by refmt.
I suspect that my version of refmt is out of sync with the one required by bsb-native#2.1.1, but I'm not sure which one to install. I have:
$ refmt --version
Reason 3.0.0 # bee43b0
Is there a table that shows compatible versions between reason-cli and bs-platform?
Are there other ways I should investigate this issue or other potential root causes of this behavior?
UPDATE:
I was able to upgrade bsb-native to the master branch and it worked when building to native until I added some more code in reprocessing02
this issue is because bsb-native#2.1.1 comes with an old version of refmt (pre version 3) which can't read the code that your global refmt outputs (most likely because of the trailing commas). I'm working on making a new release 3.2.0 on all platforms, which comes with the latest refmt. If you're on OSX you can try it by just changing your dep to bsansouci/bsb-native#3.2.0, nuking node_modules and reinstalling.
Sorry for the inconvenience. I'm planning on making my release cycle tighly coupled with bsb's release cycle.
I am going mad on how could I make this podspec work.
I'm developing a swift framework, CommonCrypto is needed. After many problems to make it work for every for every teams (Cordova, React), this is how CommonCrypto is implemented :
I got an aggregate target CommonCryptoModuleMap with a run script in its build phase :
if [ -d "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap" ]; then
echo "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script."
exit 0
fi
mkdir -p "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap"
cat <<EOF > "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap"
module CommonCrypto [system] {
header "${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h"
export *
}
EOF
But now, the goal is to implement it as a dependence of another Framework in Swift. So I have to specified the target dependency in the podspec.
I got no problem to build or archive it from Xcode.
Here is my Podspec :
Pod::Spec.new do |s|
s.name = "AFrameworkHasNoName"
s.version = "0.1.5"
s.summary = "Foo bar"
s.homepage = "https://github.com/MyRepository_ios"
s.license = "License"
s.author = { "Veesla" => "valentin.cousien#gmail.com" }
s.source = { :git => "git#github.com:MyRepository_ios.git", :tag => "develop" }
s.swift_version = "4.0"
s.platform = :ios, "8.0"
s.requires_arc = true
s.exclude_files = "AFrameworkHasNoNameTests/*"
s.source_files = "AFrameworkHasNoName/**/*.{h,m,swift}"
s.module_name = "AFrameworkHasNoName"
end
Here is the error :
- WARN | source: The version should be included in the Git tag.
- WARN | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
- WARN | url: The URL (https://github.com/MyRepository_ios) is not reachable.
- WARN | [iOS] license: Unable to find a license file
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | [iOS] xcodebuild: MyFileImportingCommonCrypto.swift:10:8: error: no such module 'CommonCrypto'
Thanks for your responses
Nevermind, It seems like I'm not the only failing to include CommonCrypto in a SDK included in another SDK.
I just bypass the problem by including CryptoSwift (using only pure Swift). It works perfectly for me. It's a bit heavy but you don't have to deal with modulemap files and C library... Pretty easy to work with, nice implementation
Here the link of CryptoSwift : https://github.com/krzyzanowskim/CryptoSwift
Hope it will help one of you !
PS : can anyone explain me why did I get down voted ? :(
I'm trying to get vim set up as an IDE for Perl. I'm using generic, text-based vim, not gvim.
I installed the "vim-perl" addon at https://github.com/vim-perl/vim-perl using the vim addon manager per the suggestion of someone else. At least I think it's installed but I don't notice any difference in how the file is processed.
First I installed the vim-addon-manager with Debian's package manager. Then I put the following code in my .vimrc file and reloaded it:
" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on
fun! SetupVAM()
let c = get(g:, 'vim_addon_manager', {})
let g:vim_addon_manager = c
let c.plugin_root_dir = expand('$HOME', 1) . '/.vim/vim-addons'
" Force your ~/.vim/after directory to be last in &rtp always:
" let g:vim_addon_manager.rtp_list_hook = 'vam#ForceUsersAfterDirectoriesToBeLast'
" most used options you may want to use:
" let c.log_to_buf = 1
" let c.auto_install = 0
let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '
\ shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
endif
" This provides the VAMActivate command, you could be passing plugin names, too
call vam#ActivateAddons([], {})
endfun
all SetupVAM()
" ACTIVATING PLUGINS
" OPTION 1, use VAMActivate
VAMActivate github:vim-perl/vim-perl
" OPTION 2: use call vam#ActivateAddons
"call vam#ActivateAddons([vim-perl], {})
use <c-x><c-p> to complete plugin names
" OPTION 3: Create a file ~/.vim-srcipts putting a PLUGIN_NAME into each line
" See lazy loading plugins section in README.md for details
" call vam#Scripts('~/.vim-scripts', {'tag_regex': '.*'})
So what exactly is the vim-perl addon supposed to do for me? I can't find any good documenation anywhere.
At least parts of vim-perl are incorporated in the factory-default configuration of Vim; cp. $VIMRUNTIME/ftplugin/perl.vim and $VIMRUNTIME/syntax/perl.vim. By installing (and regularly upgrading) the plugin, you'll get:
a newer version of the scripts, with potential enhancements and bug fixes
some additional functionality (f.e. there's a syntax/mason.vim that's not yet in Vim itself)
If you regularly edit non-trivial Perl scripts, or use latest language features, installing vim-perl is worth contemplating. If you're just a casual programmer, I would wait until a real need arises.
I have Windows 7 with the latest XAMPP installation. I configured BASE to work, for the most part. My problem is that in BASE, when I click on the graph alerts button, I get this error:
Error loading the Graphing library:
Check your Pear::Image_Graph installation!
* Image_Graph can be found here:at http://pear.veggerby.dk/. Without this library no graphing operations can be performed.
* Make sure PEAR libraries can be found by php at all:
pear config-show | grep "PEAR directory"
PEAR directory php_dir /usr/share/pear
This path must be part of the include path of php (cf. /etc/php.ini):
php -i | grep "include_path"
include_path => .:/usr/share/pear:/usr/share/php => .:/usr/share/pear:/usr/share/php</code>
I think it may have to do with the include path of the php.ini so here is what it currently says:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".;C:\xampp\php\PEAR"
I am really at a loss as to how to resolve this. I searched for a while for some documentation but most referred to installing on ubuntu.
I don't know any pear or php, so if you know how to fix this please explain thoroughly. I am willing to supply as much information as needed.
Have you tried reading this?
pear.php.net
I solved my problem on Debian with that.