What means Schemifier.schemify method in liftweb? - lift

I am updating a liftweb project and in Boot.scala, I have this line:
Schemifier.schemify(true, Log.infoF _, HistoricIndicator)
If I try to compile, this line has an error, because a field not found in postgresql
If I delete this line, compile ok and all seems to work fine.
my BD is in "public" schema...
What means this line? Can i delete this and all will works fine?
thanks

Related

Check for empty file and quit cakebuild

I am attempting to write a check in my Cake build script to pull in a file from BuildParameters and check if the file contents are empty -- if contents are empty, throw an exception and quit the build.
I am attempting to use FileReadText from the FileHelpers namespace but for some reason I cannot get my build to recognize the file command. I am following the syntax and documentation found here: https://cakebuild.net/api/Cake.FileHelpers/FileHelperAliases/97F5679A
Here is the code I am trying in build.cake:
var fileReadText= FileReadText(Parameters.TestParameters.TestListFP);
var fileText= fileReadText.ThrowIfNullOrEmpty(nameof(fileReadText));
The argument Parameters.TestParameters.TestListFP is set in my Parameters.cake file as such:
TestListFP = context.File("C:\Some\Path\some_file_name.txt");
Using the above code, I see this error:
error CS0103: The name 'FileReadText' does not exist in the current
context
Note that I do not have a ICakeContext in build.cake, just BuildParameters.
I tried to resolve the issue by adding using Cake.FileHelpers; at the top of my build.cake file, but then I see this error:
The type or namespace name 'FileHelpers' does not exist in the namespace 'Cake' (are you missing an assembly reference?)
The script works fine without my FileReadText code, so I know TestListFP is actually a valid file.
I think I am inherently misunderstanding how to use FileHelpers and FileReadText and I could not find any examples of usage in documentation or anywhere else. If anyone has guidance on how to use this method, or a better way to accomplish what I am trying to do, I would appreciate the help.
Have you added the #addin pre-processor directive, as mentioned here:
https://github.com/cake-contrib/Cake.FileHelpers/#cakefilehelpers
You can easily reference Cake.FileHelpers directly in your build script via a cake addin:
#addin "Cake.FileHelpers"

CoreML in Cocoapod (pod spec lint won't work)

I am attempting to update my cocoapod. Since the last update, I have added a .coreml file and not when I try pod spec lint, I am getting some errors. Things I've done:
Added s.resources = "JacquardToolkit/**/*.mlmodel" to my .podspec file
There was also a few name changes with my .coreml file. Ultimately I want to include only ForceTouch.coreml, so I also need help to get rid of the references to Forcetouch.coreml and ForceTouch2.coreml.
Here is the error message I get in terminal...
try this:
add the MLModel to your spec.source_files in your podspec:
spec.source_files = 'Classes/**/*.{swift,mlmodel,mlmodelc}'
You may also need this if it fails to compile because codegen language is not set:
spec.xcconfig = {'COREML_CODEGEN_LANGUAGE' => 'Swift', 'COREML_CODEGEN_SWIFT_GLOBAL_MODULE' => 'NO'}

fastlane sigh issue with input asking for more information

I'm trying to use sigh and I am a bit confused. When I type the below line:
sigh username:"me#example.com" app_identifier:"com.example"
It logs in with my user name but then gives me the prompt:
[21:19:44]: Successfully logged in
[21:19:44]: Fetching profiles...
[21:19:44]: To not be asked about this value, you can specify it using 'app_identifier'
The bundle identifier of your app:
When I type the below line:
sigh -a com.example -u me#example.com
I do not get the prompt. What am I doing wrong in the first one? The first one from what I understand is what I can use in the fastlane file for automation, which is why this is important. I read the below on this:
https://github.com/fastlane/fastlane/tree/master/sigh
as well as the sigh --help documentation.
My lane is defined as below:
desc "Get the provisioning profiles for the app"
lane :sign do |options|
apple_id = CredentialsManager::AppfileConfig.try_fetch_value(:apple_id)
team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
cert(username: apple_id, team_id: team_id)
sigh(app_identifier: options[:bundle_id], username: apple_id)
end
The part where sigh is I get the same prompt. Is there a way to remove it?
UPDATE
The following works:
sigh --username "me#example.com" --app_identifier "com.example"
But I want it to work in fastlane. What am I doing wrong there?
sigh username:"me#example.com" app_identifier:"com.example"
That syntax is not supported, instead try the following from the command line
sigh --username "me#example.com" --app_identifier "com.example"
To do the same from your Fastfile
sigh(username: "me#example.com", app_identifier: "com.example")
Turns out the reason was that I had some data in my Appfile that Fastlane didn't like. It didn't show proper error messaging, but I put one more variable that it didn't recognize and there for it failed.
One thing I learned about Fastlane is that it works well but sometimes errors are hard to debug. Make sure to read the documentation properly!

ipython notebook is not updating when I change my code

So, I ran into a weird issue using an ipython notebook and not sure what to do. Normally, when I run a part of the code, if there is an error, I would trace it back, fix it, and then re-run the code. I was doing a similar thing but even after making changes to the code, it looks like nothing is changing!
Here is the example... I am using Python 3.5 so xrange is gone. This then caused an error to be thrown:
XXXX
24 XXXX
25 XXXX
---> 26 for t in xrange(0,len(data),1):
27
28 XXXX
NameError: name 'xrange' is not defined
but after changing my code (which you can see below the difference in line 26), the same error pops up!
XXXX
24 XXXX
25 XXXX
---> 26 for t in range(0,len(data),1):
27
28 XXX
NameError: name 'xrange' is not defined
Any ideas on why this would be happening?
As Thomas K said, you're probably making a change in an external file that was not imported. There is a very useful command in ipython notebook for such cases, called autoreaload. With autoreaload, whenever you modify an external file you do not have to import it again because the extension takes care of it for you. For more information check: ipython autoreload.
Whenever using external files along with Ipython use autoreload. It will reload the external files every time before executing any code in IPython.
Add this at first cell of the IPython.
%load_ext autoreload
%autoreload 2
For me this was due to one of the following:
Cause 1: imported module not updated
Solution:
import importlib
importlib.reload(your_module)
Cause 2: other
Solution: restart the kernel, for jupyter notebook this is how
I have the same problem. I tried jupyter magic autoreload but it didn't work. Finally, I solved it in this way:
in the first cell, add
import My_Functions as my
import importlib
importlib.reload(my)
But notice if the module is imported in this way:
from My_Functions import *
I couldn't reload it properly.
I have the same issue sometimes. I think it has to do with memory - if I have a bunch of dataframes hanging around it seems to cause issues. If I restart the kernel using the Kernel > Restart option the problem goes away.
I have the same problem sometimes. I restarted the kernels but it didn't work.I try to run the cell (ctr+ enter) two or three times. then the result will be displayed according to the updated codes. I hope it helps.
insert new empty cell with + option, go to Kernel, choose Restart & Run All.
Then, fill in the new inserted cell and run again in Kernel, choose Restart & Run All.
It works with me.

capistrano upload! thinks ~ referenced local directory is on remote server

So every example I've looked up indicates this is how one is supposed to do it but I think I may have found a bug unless there's another way to do this.
I'm using upload! to upload assets to a remote list of servers. The task looks like this:
desc "Upload grunt compiled css/js."
task :upload_assets do
on roles(:all) do
%w{/htdocs/css /htdocs/js}.each do |asset|
upload! "#{fetch(:local_path) + asset}", "#{release_path.to_s + '/' + asset}", recursive: true
end
end
end
If local_path is defined as an absolute path such as:
set :local_path:, '/home/dcmbrown/projects/ABC'
This works fine. However if I do the following:
set :local_path:, '~/projects/ABC'
I end up getting the error:
The deploy has failed with an error: Exception while executing on ec2-54-23-88-125.us-west-2.compute.amazon.com: No such file or directory - ~/projects/ABC/htdocs/css
It's not a ' vs " issue as I've tried both (and I didn't think capistrano paid attention to that anyway).
Is this a bug? Is there a work around? Am I just doing it wrong?
I ended up discovering the best way to do this is to actually use path expansion! (headsmack)
irb> File.expand_path('~dcmbrown/projects/ABC')
=> "/home/dcmbrown/projects/ABC"
Of course what I'd like is to do automatic path expansion but you can't have everything. I think I was mostly dumbstruck that it didn't automatically; so much so I spent a couple of hours trying to figure out why it didn't work and ended up wasting time asking here. :(
I don't think the error is coming from the remote server, it just looks like it since it's running that upload command in the context of a deploy.
I just created a single cap task to just do an upload using the "~" character and it also fails with
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy#XXX: No such file or directory # rb_file_s_stat - ~/Projects/testapp/public/404.html
It appears to be a Ruby issue not Capistrano as this also fails in a Ruby console
~/Projects/testapp $ irb
2.2.2 :003 > File.stat('~/Projects/testapp/public/404.html')
Errno::ENOENT: No such file or directory # rb_file_s_stat - ~/Projects/testapp/public/404.html
from (irb):3:in `stat'
from (irb):3
from /Users/supairish/.rvm/rubies/ruby-2.2.2/bin/irb:11:in `<main>'