- take() - Method in class communications.util.QueueResource
-
Receives all messages arriving from the network.
- take() - Method in class compose.Connection
-
- take() - Method in class compose.ReceivingActor
-
- take() - Method in class compose.SendingActor
-
- take() - Method in class compose.TransportingActor
-
- take() - Method in class protocols.TCPCommunication
-
- take() - Method in class protocols.ThreadProtocol
-
- take() - Method in class protocols.UDPCommunication
-
- tcp - package tcp
-
- TCPCommunication - Class in protocols
-
Socket flooding, hurray!
- TCPCommunication(int) - Constructor for class protocols.TCPCommunication
-
- test(TestableWithActor<A>) - Method in class dsl.Play.Character
-
Make the character run a set of actions whose outcome is a boolean.
- test(TestableWithActor<A>, String) - Method in class dsl.Play.Character
-
Make the character run a set of actions whose outcome is a boolean.
- test - Variable in class dsl.TestNode
-
- test(P) - Method in interface function.TestableWithActor
-
- TestableWithActor<P extends Actor<?>> - Interface in function
-
- testName - Variable in class dsl.TestNode
-
- TestNode<A extends Actor<?>> - Class in dsl
-
- TestNode(String, TestableWithActor<A>, String) - Constructor for class dsl.TestNode
-
- thread - package thread
-
- threadPool - Variable in class dsl.Server
-
The pool of threads in which actors are running (one Thread, one Actor).
- ThreadProtocol<P> - Class in protocols
-
- ThreadProtocol(Map<String, BlockingQueue<FullMessage<P>>>, String) - Constructor for class protocols.ThreadProtocol
-
Creates a new ThreadProtocol resource for a certain address, given as any
String, and a channel simulated by a BlockingQueue map.
- ThreadProtocol(Map<String, BlockingQueue<FullMessage<P>>>) - Constructor for class protocols.ThreadProtocol
-
Creates a new ThreadProtocol resource for a channel simulated by a
BlockingQueue map.
- timeout - package timeout
-
- timeout - Variable in class dsl.Play
-
The maximum amount time each participant will stay processing a run.
- timeout - Variable in class dsl.SendNode
-
- TimeoutException - Exception in communications
-
- TimeoutException(String, String, long) - Constructor for exception communications.TimeoutException
-
- Tip - Class in dsl
-
- Tip(String) - Constructor for class dsl.Tip
-
Builds new tip for character name.
- tipForNode - Variable in class dsl.Causality
-
- tips - Variable in class dsl.Causality
-
- tipsStack - Variable in class dsl.Play
-
The stack used to track tips configurations at every step.
- toInt(byte[]) - Static method in class segmentation.Util
-
- toMessage() - Method in class protocols.MyIQ
-
- toString(Function<PayloadT, String>) - Method in class communications.FullMessage
-
Gives the string representation of the message using a custom formatting
for the message content.
- toString() - Method in class communications.FullMessage
-
- toString(Function<PayloadT, String>) - Method in class communications.ShortMessage
-
Prints message to a String, with a custom formatting for the payload.
- toString() - Method in class communications.ShortMessage
-
- toString() - Method in class dsl.EnactNode
-
- toString() - Method in class dsl.EndNode
-
- toString() - Method in class dsl.Part
-
- toString() - Method in class dsl.RootNode
-
- toString() - Method in class dsl.RunNode
-
- toString() - Method in class dsl.SendNode
-
- toString() - Method in class dsl.TestNode
-
- toString() - Method in class dsl.Tip
-
- totalShare - Variable in class shares.SmartMeterActor
-
- TransportingActor<M,P> - Class in compose
-
- TransportingActor() - Constructor for class compose.TransportingActor
-
- TransportPlay<M,P> - Class in compose
-
- TransportPlay() - Constructor for class compose.TransportPlay
-
- type - Variable in class protocols.MyIQ
-


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/leanpkg.html ---
It is possible to specify git branches in leanpkg
?
[package] name = "my_awesome_pkg" version = "0.1" # no semantic significance currently lean_version = "3.3.0" # optional, prints a warning on mismatch with Lean executable path = "src" # hard-coded, will be removed in the future timeout = 100 # optional, passed to `lean` as `-T` parameter [dependencies] # local dependency demopkg = { path = "relative/path/to/demopkg" } # git dependency mathlib = { git = "https://github.com/leanprover/mathlib", rev = "62f7883d937861b618ae8bd645ee16ec137dd0bd" }
You should be able to specify a branch using the rev
field
When doing that, I keep getting something saying that that revision is not a part of the tree. It's odd
update: I managed to make it work. It might not be a leanpkg issue but I'm not sure. It seemed to be having a hard time cloning repositories for some reason. I wonder if it has anything to do that I wasn't pointing at the usual mathlib
repo
Can you reproduce it if you copy the toml to a fresh directory?
Actually, if you clone my repo, the problem should occur again:
git clone https://github.com/cipher1024/lean-pipes
Sorry, you asked for a naked toml file. Let's see
So, yes the problem occurs even if the toml file is left on its own
Okay, I'll try your repo
I don't see your leanpkg.toml referencing a branch
Here's the contents of leanpkg.toml
:
[package] name = "pipes" version = "0.1" lean_version = "master" path = "src" [dependencies] mathlib = {git = "https://github.com/cipher1024/mathlib", rev = "ce8da6ab07a68dca1743bd7d8f9768157d644736"}
It is on my fork of mathlib
and that commit is the head of my coinductive-types
branch
This is a really basic question, but what's the right way to start and maintain a new package that depends on mathlib?
I see mathlib's leanpkg.toml
specifies lean_version = "3.4.1"
, so I guess I should use Lean 3.4.1.
So let's say I run elan run --install 3.4.1 leanpkg new my_project
, as recommended by https://github.com/leanprover/mathlib/blob/master/docs/elan.md. Now I get a new project whose leanpkg.toml
also specifies lean_version = "3.4.1"
.
Continuing to follow those directions, I run leanpkg add leanprover/mathlib
. But now I end up with the lean-3.4.1
branch of mathlib, which hasn't been updated since June 20. I wanted the latest version. And leanpkg upgrade
makes no difference.
Is this behavior intentional? At best, it's confusing if following the instructions in that elan.md file doesn't give you the latest version of mathlib, I think.
Even though I should supposedly know how all of this works (e.g., I know there is a lean-3.4.1
branch of mathlib and leanpkg will select it), I still get caught by surprise since starting a new project is so infrequent--I just made a new project and built mathlib in it and then a half hour later discovered I had the June 20 version which didn't have the new features I wanted to use.
I once thought that editing the toml file and changing 3.4.1 to "master" would fix this, but maybe the issue is that you are using 3.4.1's leanpkg
?
It probably would fix it, especially since I am using elan (although I'm not sure whether it is the version of leanpkg that matters, or what you write in the lean_version
field of the toml file).
The elan.md instructions (I'm talking about "Scenario 1: Start a new package") suggest that you might see nightly-2018-04-06
as the Lean version, and I found that elan run --install nightly-2018-04-06 leanpkg new my_playground
does give you master mathlib, maybe because there is no branch corresponding to nightly-2018-04-06
.
But it seems strange that the way to get mathlib master is to tell elan/leanpkg to use any other Lean version than the one actually used by mathlib...
Presumably when those instructions were written, mathlib really did specify a version other than 3.4.1 and so the instructions worked
By the way I should say explicitly that I'm assuming the current behavior is incorrect and I'm not supposed to get what appears to me to be this random version from June 20, but maybe others (like perhaps you Kevin) think it's working as intended because you want a fixed version for all your students.
That is all over now. I wanted a fixed version for my summer students just so I could see the advantages and the disadvantages. One of the advantages is that they don't ever have to update mathlib. What happened in practice was that people generally wanted more recent mathlib stuff and they learnt how to upgrade anyway, because sufficiently many of them knew how to use git because they were on a joint maths/computer science degree, so it worked out fine in the end and everyone was using different mathlibs anyway, and there didn't seem to be a problem.
Okay, great. In that case I'm going to push for making it impossible to get this random old version of mathlib without asking for it, since I think that results in a potentially confusing experience for new users (e.g., one hears "mathlib has X" but then makes a project to try it out and X is missing).
Moved discussion to github: #365
Dang that's not a link to a mathlib issue.
https://github.com/leanprover/mathlib/issues/365
I think this is a really good idea. I've been confused by this, too.
I guess leanpkg and elan have been designed for reproducible builds, which is the popular option these days. Unfortunately the usual thing new lean/mathlib users want is master + master, which goes against this idea, and so the tools fight them on this.
I guess you could say they are being "too smart for their own good"
Is this something a switch could fix?
elan
in particular should strive for setting up users with the latest everything unless the user specifically asks for an old version
Well you still get reproducible builds because the mathlib commit hash is in the leanpkg.toml file. It's just a matter of where you want to start a new project.
Does elan
know that mathlib exists? Or does the default thing just get you lean on its own
I'm definitely happy that I can still build my lean-homotopy-theory project against the version of mathlib specified in the file, otherwise I would have no idea how any of the proofs that broke when building against master were supposed to work :)
I think elan only gets you Lean and the lean version in your toml file selects the tag of mathlib
elan doesn't know about mathlib. The process is elan run --install 3.4.1 leanpkg new myproject
, cd myproject
, leanpkg add leanprover/mathlib
.
Then leanpkg
picks the 3.4.1 branch of mathlib because that is what is specified in the leanpkg.toml
file that elan wrote. I think
Sorry--that leanpkg wrote
Right, and this is backwards since it says "get me the version of mathlib compatible with 3.4.1" rather than "get me the version of lean compatible with mathlib master"
Yes, that is definitely a bit weird.
I think you should be able to ask elan to target a particular version/branch of any lean project, not just lean itself
and then it derives the lean version from the toml file of that project
I think the current situation is a consequence of the fact that the "package manager" leanpkg is shipped/versioned with lean itself
that is, only leanpkg (not elan) knows about packages at all, but in order to get (any) leanpkg, you first must choose a lean version
I wonder how crazy it would be to just replace leanpkg with crate or some other language's tool
Note that elan
is some other language's tool (it is forked from Rust's cargo
)
I think you should be able to ask elan to target a particular version/branch of any lean project, not just lean itself
and then it derives the lean version from the toml file of that project
But that's exactly what it's doing :) . Check out a Lean project at some commit and elan sets up the right Lean version for you.
What you're asking for is for elan not to set up some existing project, but a _new_ project based on its intended _dependencies_, no? What I could imagine is a command elan new
that works like leanpkg new
, but also takes a list of initial dependencies and selects the new package's Lean version based on that
That sounds good to me. Is it currently possible to write stuff in a file to get the equivalent of elan new
using elan
?
Though that seems like much more work than documenting "active mathlib development is happening for Lean version $VERSION, so use elan +$VERSION leanpkg new
if you want to use it"
It also sounds like it might be possible for me to set up a "template" project that depends on mathlib but otherwise contains very little, as a target for users to download and make elan understand
Is it possible for a project like this to target the master branch of mathlib?
What does elan +$VERSION leanpkg new
mean here? Do you mean $VERSION = 3.4.1
?
the really important part is being able to tell elan "get mathlib master" without having to specify a commit
I'm fine with telling people to get 3.4.1, since it's basically going to stay that way until lean 4 and then everything will be different anyway, but mathlib won't stay still and elan has to be able to adapt to that
Okay, that leanpkg upgrade
doesn't allow you to customize which branch it uses is a related but separate issue (and specific to leanpkg, not elan)
So what is the current recommendation? Do users need to go into _target/deps/mathlib
and checkout master?
I guess we can agree that leanpkg using a separate branch per Lean version was a good idea but didn't work out in practice, since nobody wants to maintain code for multiple Lean versions. We could definitely change that in Lean 4, ie. when development on leanpkg continues
The problem isn't maintaining multiple lean versions, it's not allowing other kinds of branches
in particular master branches, which are going to be, ehm, rather common
If you use the master branch for development against a Lean version that is not master, it does look like you don't agree with leanpkg at all how branches should be handled
Given the current leanpkg, the only real solution would be to rename the master branch to lean-3.4.1
. If we don't want that, we'll have to change leanpkg... at some point
Is deleting the lean-3.4.1
branch not a solution, or merely not a "real solution"?
Then leanpkg upgrade
will simply do nothing except complain, afaik
When Lean 4 arrives we will be able to modify leanpkg at the same time, so is it reasonable to assume for now that there is only one version of Lean in existence?
Hmm, let me try.
I have a toy project here using nightly-2018-04-06
and I changed the mathlib commit to an older version and ran leanpkg configure and verified that it checked out the old version. Then I ran leanpkg upgrade
and it successfully upgraded to mathlib master:
rwbarton@bridge:~/lean/my_playground2$ leanpkg upgrade mathlib: trying to update _target/deps/mathlib to revision f53c776c2e09eff5358c5de6902e402c641a1673 > git checkout --detach f53c776c2e09eff5358c5de6902e402c641a1673 # in directory _target/deps/mathlib HEAD is now at f53c776... feat(analysis/topology): pi-spaces: topolopgy generation, prove second countability configuring my_playground2 0.1 mathlib: trying to update _target/deps/mathlib to revision ca7f118058342a2f077e836e643d26e0ad1f3ca6 > git checkout --detach ca7f118058342a2f077e836e643d26e0ad1f3ca6 # in directory _target/deps/mathlib Previous HEAD position was f53c776... feat(analysis/topology): pi-spaces: topolopgy generation, prove second countability HEAD is now at ca7f118... fix(docs/tactics.md): missing backquote, formatting rwbarton@bridge:~/lean/my_playground2$ echo $? 0 rwbarton@bridge:~/lean/my_playground2$ cat leanpkg.toml [package] name = "my_playground2" version = "0.1" lean_version = "nightly-2018-04-06" path = "src" [dependencies] mathlib = {git = "https://github.com/leanprover/mathlib", rev = "ca7f118058342a2f077e836e643d26e0ad1f3ca6"}
Is that something special about using nightly lean vs a stable version number?
Yes, see the link above
Ah...
When Lean 4 arrives we will be able to modify leanpkg at the same time, so is it reasonable to assume for now that there is only one version of Lean in existence?
I suppose that is a reasonable assumption right now. Even if we don't change the leanpkg semantics, it will just work if Lean 4 porting efforts happen on the mathlib master branch and development for Lean 3 on the lean-3.4.1
branch
If you use the master branch for development against a Lean version that is not master, it does look like you don't agree with leanpkg at all how branches should be handled
I think the master branch of lean is basically 3.4.1, so if this is what is needed then I'm okay with it. How do I sign up?
So before I incorrectly "realized" that we could just delete the lean-3.4.1 branch, options I was considering were:
git symbolic-ref
which might allow us to make lean-3.4.1 an alias to master, but it's not clear whether they would really work for us or whether they can be configured through github.Why don't people use the latest lean nightly? It's 3.4.1 with some broken stuff fixed.
6th April, 20th April -- why? I use the June version
Actually, there's an August version out now...
The fixes aren't so important to me. More important is whether switching back to nightlies will improve or exacerbate the leanpkg
situation
Is Kevin's blog post still the best option for installing lean + mathlib on windows?
As far as I can tell. We really need something like elan for windows.
elan works fine on Windows
the Windows specific issue I and a few others seem to run into is leanpkg failing with "failed to start child process", for which I have found no solution for
For which subcommands and under what precise circumstances does leanpkg fail on your machine? Does it output anything else?
any command that has to do with creating a project, adding dependencies etc. here is an example, where I have modified the leanpkg script (i.e. leanpkg.bat on Windows) to ignore the @ECHO OFF
directive so that the commands getting ran are printed:
PS C:\Users\Olli\Dev\Lean> leanpkg new playground C:\Users\Olli\Dev\Lean>SET LEANDIR=C:\Users\Olli\.elan\toolchains\stable\bin\../ C:\Users\Olli\Dev\Lean>SET LIBDIR=C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean C:\Users\Olli\Dev\Lean>IF NOT EXIST C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean SET LIBDIR=C:\Users\Olli\.ela n\toolchains\stable\bin\../ C:\Users\Olli\Dev\Lean>SET LEAN_PATH=C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean\library;C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean\leanpkg C:\Users\Olli\Dev\Lean>SET PATH=C:\Users\Olli\.elan\toolchains\stable\bin\../\bin;C:\Users\Olli\.elan\bin;C:\Users\Olli\.elan\toolchains\stable\bin;C:\Users\Olli\lean-3.4.1-windows\bin;;C:\Users\Olli\AppData\Local\Programs\Microsoft VS Code\bin C:\Users\Olli\Dev\Lean>lean --run C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean\leanpkg\leanpkg\main.lean new playground failed to start child process PS C:\Users\Olli\Dev\Lean>
I also tried modifying the script to get rid of the funny looking \../
part of the path, but I get the same result
This is what I have installed:
PS C:\Users\Olli\Dev\Lean> lean --version Lean (version 3.4.1, commit 17fe3decaf8a, Release) PS C:\Users\Olli\Dev\Lean> elan --version elan 0.7.0 (0dd8c5ce4 2018-09-16)
At your terminal what happens if you type test -f foo
this is PowerShell, so there is no such command
what are we trying to find out?
this is precisely the problem!
(and maybe other things)
leanpkg
attempts to spawn test
when it runs, and it fails, so you see that message
ah I see, so if I installed a version of that utility compiled for Windows, then that might be a workaround?
If you'd be willing to help diagnose, try opening C:\Users\Olli\.elan\toolchains\stable\bin\../\lib\lean\leanpkg\leanpkg\main.lean
in a text editor, and navigate to line 199
. You should see a line:
ex ← exists_file user_toml_fn,
Try replacing that line with
let ex := tt,
Does your command before work then?
Yes I suppose having a unix-like environment with coreutils would work, but it really shouldn't be necessary. leanpkg
should be better
If this works for you I can get you a less dodgy solution cooked up in a second, since you're using elan
Actually my line number is wrong.... But I still mean that line I quoted
Should be line 196
Like this?
let user_toml_fn := dot_lean_dir ++ "/" ++ leanpkg_toml_fn, ex := tt, when (¬ ex) $ write_manifest { name := "_user_local_packages", version := "1" } user_toml_fn,
I get:
C:\Users\Olli\.elan\toolchains\stable\lib\lean\leanpkg\leanpkg\main.lean:182:4: error: non-exhaustive match, the followi ng cases are missing: main "configure" list.nil ({data := _} :: _) main "configure" ({data := _} :: _) _ main "new" list.nil _ main "new" [_] ({data := _} :: _) main "new" (_ :: {data := _} :: _) _ main "init" list.nil _ main "init" [_] ({data := _} :: _) main "init" (_ :: {data := _} :: _) _ main "add" list.nil _ main "add" [_] ({data := _} :: _) main "add" (_ :: {data := _} :: _) _ main "upgrade" list.nil ({data := _} :: _) main "upgrade" ({data := _} :: _) _ main "install" list.nil _ main "install" [_] ({data := _} :: _) main "install" (_ :: {data := _} :: _) _ main _ _ _ C:\Users\Olli\.elan\toolchains\stable\lib\lean\leanpkg\leanpkg\main.lean:196:5: error: command expected failed to start child process
you need a let
in front of the ex
, but I'm reading more now and this won't solve your problem :(( (it will still be the same)
leanpkg
wants test
and (unix) mkdir
I should be able to cook something up which does help you, though! Let me dig in a for a sec
thanks, yeah I now see what the issue is, I have been meaning to install Lean in WSL but so far haven't had any need to use libraries yet so I didn't get around to it
Yeah there are very many pieces which assume a unix-y environment, even just down to the directory separator character
Setting something like WSL up sounds like your best bet :)
(at the moment)
if making leanpkg natively support Windows is too tall of a task, I would say the next best thing would be improving the error messages for this particular situation
I didn't write it, but the comments in there make sure to say the intention was to add windows support later
I didn't realise that it was just broken on windows
I might try to make a version that runs natively later this week
don't all the lean installation instructions assume a mingw installation?
I do have MinGW installed, but that does not include test
which is not an executable but rather a shell built-in as far as I can tell
ahh. I never noticed this issue, because a bash shell is required to compile lean
So I have no idea about MinGW anything, but for what its worth I've built coreutils before and it has a test
binary
Idk if it's in MinGW though
Yeah, on a normal unix system, test
is both a shell built-in (for speed) and an executable
I don't know how POSIX-like the MinGW shell is, but you can try which test
or command test
(if nothing happens, it worked)
it's not included with the installation of MinGW that I have, and I've tried googling if I can download it separately from somewhere but unfortunately test
is a rather tricky name when it comes to search engines
Yes, I found that as well...
does MinGW ship with a shell?
Are you using MSYS?
yes
doesn't msys have bash?
yes it does, I will try that next
The question is whether it has /usr/bin/test
though, right?
I'd be blown away if it didn't!
Well, yeah...
PS C:\MSYS\1.0\bin> ./bash.exe bash.exe"-3.1$ which test which: test: unknown command bash.exe"-3.1$ exit
classic!
Git bash for windows has it
and there it does work as expected
I have no idea whether this is useful, but I did find through Google some log https://gist.github.com/choco-bot/eec2966667c148959f417ca93995222e#file-install-txt-L523 where it installs something called msys2-base-x86_64-20180531.tar
and on line 1054 it installs a certain test.exe
a few windows people here seem to use MSYS2, maybe its less insane! (I dare say that's why they have been oblivious to these issues on windows)
you can't just run bash exe
the mingw bash script sets a bunch of environment variables
also, I use MSYS2 with no issues
I see, yeah I will try installing MSYS2, and I just confirmed that I was able to add mathlib to a new project and it appears to work fine from VSCode which is good
@Olli, so is your conclusion that leanpkg is not compatible with MSYS, but is compatible with MSYS2?
@Reid Barton yes that appears to be correct
MSYS2 contains test.exe
Is it also true that using the git-for-windows bash shell also works for you? I don't think I have msys2 on my windows 10 machine and I got leanpkg working there.
yes, I should probably have tried that first, but had totally forgot I even had it installed
That's great, thanks for being so patient and looking into it. Now we should look into editing these solutions into the various docs that are floating around out there...
I don't think git bash is fully usable for lean, although I forget why. I made some attempts to do this when I started and some necessary packages were missing with no clear way to get them
Certainly CMD and powershell won't work
I haven't tested Cygwin extensively, but it has its own issues to deal with and I found MSYS2 much easier
I'd be curious to see if anyone makes lean work with WSL
I've been using git bash up to now and haven't noticed anything wrong, but all I'm doing with regards to lean is just running leanpkg upgrade
and leanpkg build
occasionally. I did have to mess around with my console program to get unicode characters to print properly though.
Hi @Reid Barton, did you ever sort this out? Can we just delete the lean-3.4.1
branch of mathlib
? I see that Mario has been occasionally updating, but it still requires manual intervention.
No, we can't just delete it unfortunately--leanpkg requires a branch matching the lean version to exist, when that version is a stable version
I think the best "solution" we have for now is for somebody to figure out how to write a git hook that Mario can use to update the branch head automatically
I am also using git bash without obvious problems. I have msys2 installed but it is not in the path so that should not make a difference.
@Bryan Gin-ge Chen , what did you do to fix the unicode?
For me it was an issue with a setting in my console program, cmder
which seems to be a reskin or repackaging of conemu
. I had to add the setting chcp utf8
to the environment per this page.
Thanks. That suggestion doesn't seem immediately applicable to me as I am just using git bash in vscode (and git bash outside vscode seems to handle unicode correctly). I poked around a bit more and found this page https://github.com/Microsoft/vscode/issues/60330, but the suggestions there seemed to have no effect. I'll probably just leave it now as it is not really causing me any trouble, it's just untidy.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Frequently Asked Questions¶
Mining and XMR-Stak¶
General mining questions¶
Q: How do I get started mining?¶
A: You can check this guide
Q: I'm using a Mac, can I still mine?¶
A: Yes, of course! We're working on a guide.
Q: I've started mining, how can I view my stats?¶
A: Visit your pool's homepage. There should be a spot for you to put in your TRTL address, and you can then view your hashrate, pending balance, payouts, and more.
Q: Why is the hashrate on the pool website different to what is shown in my miner?¶
A: The values will always be slightly different as it is an estimate, but if there is a large difference, it is likely you have just started mining.
Your hashrate is calculated over time, and so it will slowly go up to the correct level.
Q: I've been mining for a while, but my pending balance hasn't gone up?¶
A: On your pool website, check the time that the last block was found on your pool, and the average time to find a block.
Your stats will only update when your pool finds a block and it matures, so if your pool doesn't find blocks very often, you will have slower updating stats.
Q: I've been mining, but the balance in my wallet hasn't gone up?¶
A: To save money on fees, the pools send payouts in chunks. Check your pool website for your pending balance.
Q: I got banned from my mining pool. Why?¶
A: If you submit lots of invalid shares, a pool might ban you. Possible reasons for invalid shares can be
-
your hardware getting overworked,
-
high ping to the pool,
-
or your difficulty being set too low.
Try lowering any overclocks, choosing a pool closer to you or setting a higher difficulty port.
You should get unbanned after approximately 20 minutes. This is a good time to setup some backup pools!
Q: Should I set up multiple pools?¶
A: Yes, in case you get banned, or a pool goes down for some time, you can keep mining. A good amount to have would be at least three.
Q: Where can I find a list of pools?¶
A: Here is a list. It also has other nifty stats like the pool's fee, minimum payout and server location.
Q: What does "pool weight" mean in XMR-Stak?¶
A: Pool weight determines what order pools are used in case another is unavailable.
Higher weighted pools are used first.
If all pools are the same weight, they will be used in the top to bottom order that they are listed in the config.txt
file.
Q: What pool should I choose?¶
A: There are a few factors to consider when choosing a pool.
-
One is your ping, you can find this out by pinging the server in a command prompt by typing
ping address.com
, whereaddress.com
is the pool address. -
Another is the hashrate of the pool. If you go on the pool's website, you can see how often they find blocks.
If the pool takes a long time to find a block, your stats will take a long time to update.

This is the amount you need to mine before you get paid. Most pools will list this under the "Payments" tab.
You can check this list of pools. It specifies each pool's minimum payout as well as server location.
Q: How many hashes per second is good for my hardware?¶
A: http://monerobenchmarks.info/ is a good source for this. You can look up your CPU and GPU.
Q: I can't get the miner working, is there an easier way to mine?¶
A: You can try the web miner here. You will get a lower hashrate than native mining, and it doesn't have GPU support, however it's very easy to setup. Thanks to @Mongboy for creating this.
Web miner currently isn't working. You can hop onto the Discord if you're having issues and we'll help you out.
Q: What is the miner executable / why isn't it working?¶
A: This is a solo miner, which is CPU only. This means to gain any TRTL, you have to find a block by yourself, which unless you have many powerful CPUs, is very unlikely.
We strongly recommend using a pool, and a miner such as XMR-Stak or xmrig.
Nevertheless, if you want to try it out, open a command prompt in the same directory, and run
miner.exe --address TRTL...
replacing TRTL...
with your full TRTL address.
You need to have SimpleWallet open and synced to use this miner, unlike conventional miners, where the pool hosts the daemon.
Q: Is there a calculator to see how much TRTL I'll mine per day?¶
A: Your pool's homepage should have one - enter your hashrate and it'll give an estimate of how much TRTL you'll mine per day.
XMR-Stak Issues¶
Q: How do I view my hashrate in XMR-Stak?¶
A: Press h
in the XMR-Stak window.
Q: My PC is laggy when I'm mining in XMR-Stak. Can I fix this?¶
A: This could be caused by multiple issues:
-
If you're using a Nvidia card, open up
nvidia.txt
, in the same directory asXMR-Stak.exe
. Try settingbfactor
to8
andbsleep
to100
, and then reload your miner after saving the file.If it's still laggy, try increasing both values slightly. This will cause you to get less hashes per second, but can let you use your PC more effectively. You can try tweaking the value to increase your hashrate.
Some people also achieve success by lowering the thread count.
-
If you're using an AMD card, lower the value of
intensity
inamd.txt
. -
If you're using just a CPU, you can delete the cores being used from
cpu.txt
.
Q: How can I use just my GPU/CPU to mine in XMR-Stak?¶
A: If you're using XMR-Stak, you can start the miner with a certain command. Check this out for more info.
Q: My XMR-Stak is crashing on startup, with an error about CUDA. What am I doing wrong?¶
A: If you are using a Nvidia card, try opening nvidia.txt
in the same directory as XMR-Stak.exe
, and lowering the value of threads
until it stops crashing.
Q: I get a socket error when connecting to a pool in XMR-Stak. What am I doing wrong?¶
A: Generally, this is due to an incorrectly configured config. In the directory where XMR-Stak.exe
is, there should be a file called config.txt
.
Open this up, and check that it looks similar to this:
{"pool_address" : "eu.turtlepool.space:3333", "wallet_address" : "TRTLv2Fyavy8CXG8BPEbNeCHFZ1fuDCYCZ3vW5H5LXN4K2M2MHUpTENip9bbavpHvvPwb4NDkBWrNgURAd5DB38FHXWZyoBh4wW", "pool_password" : "x", "use_nicehash" : false, "use_tls" : false, "tls_fingerprint" : "", "pool_weight" : 10 },
Your wallet address is the address starting with TRTL
, not your wallet filename.
This error can also occur if the pool is having issues - try another pool and see if the error continues.
Some users have experienced issues with their firewall or antivirus as well however, so perhaps try disabling these if you are experiencing this issue.
Q: Can I lower the 2% fee taken by XMR-Stak?¶
A: This is possible, however please note that these devs are independent from the TurtleCoin project and are doing some great work, so we would suggest leaving it as is.
If you do wish to change/remove the dev fee, you will have to compile XMR-Stak yourself, they have instructions to do this on their GitHub, or you can check out the Linux guide
Once you have downloaded the code, you need to change the file donate-level.hpp
in the XMR-Stak/XMR-Stak/
folder.
Q: I'm getting an error in XMR-Stak: MEMORY ALLOC FAILED: VirtualAlloc failed. Reboot might help
¶
A: This is nothing to worry about, and is because XMR-Stak failed to set up largepages.
This can slightly raise your hash rate, and XMR-Stak attempts to set it up, but it needs a reboot to apply.
Q: I'm missing the file vcruntime140.dll
. Where can I get this?¶
A: Try installing this: https://www.microsoft.com/en-us/download/details.aspx?id=52685
Q: When I run XMR-Stak I get an error: "The application was unable to start correctly (0x000007b)"¶
A: Try installing this: https://go.microsoft.com/fwlink/?LinkId=746572
TurtleCoind / SimpleWallet Issues¶
Q: I'm seeing an error in TurtleCoind Proof of work too weak for block...
and the syncing stopped.¶
A: This occurs because of the blockchain forking, generally when one mining pool has a very large hashrate.
This can be fixed by re-syncing the correct blockchain from scratch. See the question below.
Q: I'm getting a "corrupted blockchain" error like this?¶
2018-May-07 15:52:19.877323 INFO initializing core 2018-May-07 15:52:19.908530 INFO Importing blocks from blockchain storage 2018-May-07 15:52:19.908530 ERROR Corrupted blockchain. Block with index 428973 and hash aafa7fd33d476535188bdd9e86ba51bb5e058be8e52367b78e9c0c03e74299c5 has previous block hash 2c0cf6c07612b9e1ea19c6922a56746b83cb42c7b11edfc4b185572225bb0f20, but parent has hash 26189359b64d4bb357a04b102a42a01d2771a3f3d80db3ca1b7395a2aeaede4a. Resynchronize your daemon please. 2018-May-07 15:52:19.924135 INFO Closing DB.
Q: How can I re-sync the blockchain?¶
A: Close any TurtleCoin-related software, then go to %APPDATA%
, and delete the TurtleCoin
folder.
Reopen TurtleCoind/GUI and let it re-sync.
Alternatively, check this guide for instructions on how to bootstrap for a quicker sync.
Q: When I open TurtleCoind on a Mac, I get an error Illegal instruction: 4
. How can I fix it?¶
A: This is a known issue with older macs or un-updated macs.
Try entering this into a terminal -
curl -sL "https://raw.githubusercontent.com/turtlecoin/turtlecoin/master/multi_installer.sh" | bash
This automated script should compile the software itself, and place the binaries in ./src once done.
See here for more info.
If this fails, try instead following the instructions to compile manually
Q: I've opened the wallet, and I'm getting lots of red messages like "It looks like TurtleCoind isn't open!"...¶
It looks like TurtleCoind isn't open! Ensure TurtleCoind is open and has finished initializing. If it's still not working, try restarting TurtleCoind. The daemon sometimes gets stuck. Alternatively, perhaps TurtleCoind can't communicate with any peers. The wallet can't function until it can communicate with the network.
A: You need to also open up SimpleWallet and let it sync. TurtleCoind is your connection to the network, and needs to be open and synced whenever you want to use your wallet.
Q: I've opened the wallet, and I'm getting lots of messages like "Your TurtleCoind isn't fully synced yet!"..¶
Until you are fully synced, you won't be able to send transactions, and your balance may be missing or incorrect!
A: Your daemon hasn't finished syncing yet. Keep SimpleWallet open, and wait until you are 0 days behind the current block, and for the daemon to print out a green message saying Successfully synchronized with the TurtleCoin Network.
Q: I think I should have more money in my balance than it is showing, what should I do?¶
A: Re-sync your daemon from scratch(see here), bootstrap the blockchain or sync using checkpoints . If it still doesn't work, then update your wallet!
Q: I've tried resetting, but it isn't working. What should I do?¶
A:
-
In SimpleWallet, type
export_keys
, and save the view and spend key somewhere safe in case something goes wrong, if you haven't already. -
Then, close and reopen SimpleWallet and SimpleWallet.
- Type
reset
in SimpleWallet after reopening your wallet file. - It should start resetting your wallet, but the progress might not be immediately obvious - wait a while, and it should start counting up the blocks and printing out your transactions as it gets to them.
Q: How do I backup my wallet?¶
A: If SimpleWallet is open and synced, open it, and type export_keys
.
Save the view and spend key somewhere safe, and you can use them to reimport your wallet if you lose it.
Q: How do I send TRTL?¶
A: You can check this out for steps on how to send TRTL to someone.
Q: How do I send money to exchanges / use payment ID?¶
A: You can check this out for steps on how to send TRTL with the payment ID.
Q: What is mixin?¶
A: Mixin is how many times your transaction is "mixed" with others for obfuscation and privacy. Most people suggest a mixin of 5
or above.
Larger mixins will take longer to be confirmed unless a higher fee is used.
A mixin of 0
can be used to have a public transaction(though it is strongly recommended not to do so).
Q: How can I view my balance?¶
A: If SimpleWallet is fully synced, in SimpleWallet, simply type balance
.
Q: How long does it take to sync TurtleCoind.exe?¶
A: Currently it takes a couple of hours. This number will increase as more people use TRTL and the blockchain gets larger. If you'd like to speed up the process, check out the question below.
Q: Can I speed up the syncing of the blockchain?¶
A: You can grab a recent copy of the blockchain and incrementally sync from there. See here for instructions.
Q: Can I skip the syncing?¶
A: Yes, you can currently use a public node with SimpleWallet. The keys stay on your PC, so it's secure. Check this guide for more information.
Q: What does it mean if my balance is locked?¶
A: This is a transfer which hasn't been confirmed by the network yet. It will move into your main balance shortly, generally after 3 minutes.
Q: In simplewallet.exe, I get an error Error: failed to save new wallet: boost::filesystem::unique__path: Keyset as registered is invalid
. How can I fix it?¶
A: This is caused by some broken Windows crypto keys. In the address bar in Windows Explorer, type %AppData%/Microsoft/Crypto/RSA/
.
There should be a folder in there, with a long name, like S-1-5-21-1416222650-108526586-4052533318-1000
.
Go into this folder and delete the files in there. Then reboot, and try again.
GUI Wallet(s)¶
Q: Are there any GUI wallets?¶
A: Yes, there are currently 2 GUI wallets actively in development, along with some mobile wallets too. However, they may not be ready for full use yet, and may not work on your operating system.
To view a guide on using them, you can go here
Q: I'm using the GUI Xamarin wallet, and it fails to connect to the daemon.¶
A: There are multiple reasons this can occur. Try opening walletd.log
and scrolling to the bottom to determine what is occurring.
* A wrong password - check walletd.log
to check if this is occurring. If you are sure your password is correct, this link could be helpful.
-
You have another
walletd.exe
or SimpleWallet process running. Only one of these can be running at once, and the GUI launches its own. Check Task Manager and close down any of these processes and try again. -
walletd
is importing blocks from the DB, which takes a while and so the GUI thinks it has crashed. Check the solution here -
If all else fails, if you have your private keys then you can instead import your wallet into SimpleWallet.
-
If that is not a desirable option, come and ask for help over at the Discord
Paper Wallet / Cold Storage?¶
Q: Wait, What's Cold Storage?¶
A: The term "cold storage" refers to a wallet that has been created via an offline means.
The preferred way to do this is via a computer than has never ever been connected to the internet, commonly referred to as an air gapped device.
Why is this a thing? If done properly it means it is near impossible for the keys to be secretly intercepted since the data is never viewable by other compute devices.
You see above/elsewhere wallet files are being created via the wallet software, these files might be stored unencrypted, if unencypted then the keys can be read by malicious software and balance's of those wallets transferred.
Thus to protect against that scenario you could transfer any TRTL balance to one of these cold storage addresses. Please remember to keep secure/secret backups of your keys. If you lose the keys you lose any balance that was transferred to that wallet.
Q: Can I make a paper wallet?¶
A: Yes, you can view the guide here
Q: I made a paper wallet, how do I use it?¶
A: You can check out this guide for steps on how to import your paper wallet into a wallet of your choice(choose a wallet and import the keys).
Q: Can I view the balance of my wallet online?¶
A: Due to TurtleCoin being a cryptonote coin(private), this is not possible.
It should be possible in the future to allow users to give away just their Private View Key to view transactions, but this hasn't been implemented by anyone so far, and would allow that website to see every transaction that you make.
Other¶
Q: Why does TRTL have such a high amount of tokens/small amount of decimal places?¶
A: Read a great post about the justification for it here.
Q: How can I get some TRTL?¶
A: There are multiple ways to acquire TRTL, for example:
- Mining - see here
- Buying - TRTL is currently available on these exchanges: TradeOgre and TradeSatoshi
- Bounties - Bounties for developing TRTL software, spreading the word of TRTL, and many other things are often posted in the #bounties channel on discord. Check the pinned messages for current bounties.
- Tips - People will sometimes tip each other, especially if you make spicy memes in the
#memes
channel - Rain - Good active Turtles get rained on, check out what the RainBorg is to see how to use it.
- Faucet - Head over to the faucet and enter your TRTL address. The amount you can receive is limited(1 TRTL, thrice a day), to share the TRTL for all. Thanks to @madk for creating this.
Q: Are there any light wallets / mobile wallets?¶
A: None are ready for usage right now, but they are being worked on. Check the development channels in Discord to see how people are getting on, and feel free to join in if you're a programmer!
Q: What is RainBorg / how does it work?¶
A: There is an in depth, graphical explanation here
Q: How do I register my wallet on Discord?¶
A: You can check out this guide here.
Q: Where is the blockchain stored?¶
A: On Windows, it is in %AppData%/turtlecoin
. On Mac and Linux, it is in ~/.turtlecoin
.
Q: Is there a blockchain explorer?¶
A: Yes, there are currently a few-
Q: How do I make sure a pool isn't forked?¶
You can ask someone in the Discord with a coloured name to run /forked
for you, which will return with a list of pools which are possibly forked.
Q: I have a question which wasn't answered here, what should I do?¶
A: Join the Discord, and come to the #help
channel, we'll try and fix any issues.


In the year 2017 we are witnessing one of the biggest political crises that is remembered in recent democracy in Spain. In it the Catalan Government autonomously proclaimed the Catalan Republic but then retracted seeing the personal problems they might have. The response of the mechanisms of the state was slow and insufficient seeing today where we are. The only positive thing is that these mistakes can be learned in the future and above all from the mistakes that have been made in recent decades, giving competences that should not fall on any autonomous community.
And is that there are functions that can be delegated and there are others that should be the state and the whole of the Spanish who decide and not a few in their own way.
The error of the successive governments that Spain has had since the transition has been to leave the flute to people who were going to use it for tasks that had not been programmed and once they had performed acts that did not correspond not knowing how to return to retake the competences. Today there is a lot of talk about the plural society and coexistence, but you just have to see where Catalonia is today with a completely divided society and where other autonomous communities are in everything that has nothing to do with ideology, left or right, (taxes and more open or closed ideas about how society should be), are united. Communities such as the two Castiles, Andalusia or the northwest always agree on the time to establish their rights to the central state without skipping what is voted in the Constitution. If the constitution is changed, it should be with the agreement of all and when it touches, not when it interests them.
And it is that recently have met 6 autonomous communities to talk about depopulation. This is where the senate of dialogue between the communities should operate, but without a doubt Catalonia is being alone with the rest of the communities, because of the selfishness of a few and because of leaders who have stolen and managed according to their interests. Without counting on others who await a long judicial way or others who will not return to Spain in a long time and will serve as an example for those who want to break the law. In ancient times those who tried to ursurp power without legitimacy were banished . Nowadays it is not necessary because they themselves van, advantage of modern times.
In January the Catalan Parliament was constituted. The president of the Catalan parliament, Roger Torrent, tried to make a state criminal wanted by international justice president , to which the Spanish Constitutional Court unanimously decided to reject it.
In February, the one that should be president and that could not be due to corruption issues among others of his former government was released because in the end he withdrew his words and appealed that the declaration of independence was not as such and that lied.
In March prison is agreed on those who participated in the declaration of independence or as some say the Catalan coup. For me more than a blow is an uprising on the part of Catalan society against the other party, since Catalonia is divided into two parts and have a problem in which the most harmed will be them but because of their actions at the end it will be expensive to the rest of Spaniards. Also in March it would stop who supposedly led the Catalan uprising, in Germany, which is not Belgium or any pseudostate. Belgium, a country that has had a serious problem of division for years due to the fiscal issue in which they want to divide the country, is precisely those that give asylum to criminals from other states. Germany would finally make a fool of himself with this issue and would get into Spanish state competitions as judge him in his territory without delivering it.
In April the Catalan government would still not govern Catalonia, devoting itself to waste time with appointments or other issues.
In May they would finally appoint Quim Torra as president, someone who declares himself an enemy of Spain and who has a history of communiqués in which he appeals that his objectives are to weaken the Spanish state.
With this we can see that the dialogue is never sought here, but the opposite is true, and the one who tries to dialogue with someone who wants to impose the only thing they can do is give up or waste time. This can be compared like when you try to give something to a kidnapper to recover something that is legitimately yours. By granting something you are losing, among other things, dignity. It can be granted to pursue an end if then in the medium term you will go back to where you were. This in the different governments of Spain has never been like this. The famous vignette on the right of Miki and Duarte is a clear example of this .
In June the councilors of the Catalan Government would take possession. The motion of censure presented by the PSOE in which Pedro Sanchez would be elected as the new president of the Government would also flourish.
In summer, those responsible for inducing the uprising in Catalonia would be transferred to Catalan prisons under the mandate of the new Government of Spain. From there to see that they were gaining positions would begin to happen a continuation of own events over a fascist regime as the mark of people who have different ideas and the sabotage of elements that manages the Spanish state, apart as the use of public elements for how are the media or the buildings belonging to the autonomous community of Catalonia to carry out propaganda to their interests.
Any regime needs elements such as the control of information , the closest case the regime of North Korea or Venezuela . Another element is the militias of the regime, in this case they are called CDRs and attack anyone who is against their ideas . There have been numerous acts of vandalism against those who serve customers in Spanish or who know different ideas. Marking their premises with graffiti and encouraging social networks not to buy for being according to them complices of Spain. These facts go even beyond these current regimes having been reproduced in fascist regimes, be it Spanish with Franco or German with Hitler, with the Nazi boycott of Jewish businesses .
Fortunately, a means that is indispensable for any regime that wants to leave only a minority of the population is the army that is totally against its claims. Even so they count on a regional police that the only thing that does is give problems of head so much to the national police as to the civil guard. Feed them and they will tear off your hand, the autonomous police another invention as an example .
With all this, how has these events affected the labor market in Spain, the economic activity of Catalan companies and the Spanish stock market?
Well here we come to the mother of the lamb and that we are all interested more than knowing exactly what has happened.
If in all 2017 it lost almost 2000 companies in the first half of the year this number has already been matched as can be seen in the graph published by the ABC with data provided by the registrar's association.
And who is the community most benefited from all this. Even though it seems paradoxical in the end what is benefiting from the so-called "process" is the community of Madrid that in 2017 received 2,500 companies from the rest of Spain and that has absorbed another 1000 companies in Catalonia this year.
It is clear that those who produce wealth in Catalonia are not willing to have their taxes go to this band of brainless. And the fact is that most of the social agitators in Catalonia who enjoy this tension are people who neither work nor study. So they can afford to bother the days of the day, cut streets and highways or disturb people's businesses precisely so that they can have those services and payments they need to live.
And it seems paradoxical that after all this loss of money, and how is Catalan health and transport, politicians there raise salaries, starting with the current president of the Generalitat who charges almost twice as much as the president of the government as you can see in the following table.
| Cargo | Gobierno Central | Gobierno autonómico | Diferencia (%) | Presidente | 80.953 € | 146.926 € | 81,43 % | Ministros / Consejeros | 71.424 € | 110.760 € | 55,07 % | Secretarios generales | 70.788 € | 85.769 € | 21,16 % | Directores generales | 54.189 € | 82.210 € | 51,71 % |
|---|
If we try to take to paper all these situations that have possibly influenced the Spanish index and some value, the situation would be like that of the acontinuation graph.
It is reflected as when the European indices have had a rally in times of increases, January to May, the IBEX35 has been almost stagnant and values such as CaixaBank which are Catalan have behaved quite correlated with the IBEX35. This is because they are no longer influenced so much by the fact that last year they had been unmarked from the separatist paranoia and having changed their fiscal headquarters. This can be clearly seen if we compare 2017 and 2018 of Caixabank with a much more negative correlation last year than this one.
In addition, at present values that suffered a lot with the events have behaved much better when the IBEX35 did not arrive well. On the other hand, when the wind picked up in Catalonia as the appointment of Quim Torra, they fell suddenly and correlated with the IBEX. When on the other hand the wind raged in Madrid with the doubts of the new president of the Government these values have taken a greater respite than in the IBEX35.
© 2016 - All Rights Reserved - Diseñada por Sergio López Martínez
El sitio se mantiene gracias a la publicidad, por favor Desactiva Adblock para seguir navegando
He desactivado Adblock


The task lists
The task list will be your main tool to organize yourself. You start a task and time tracking for it by clicking on the play icon. There can only be one task tracked at a time.
You can order the tasks via drag and drop or move them up or down by pressing
or
There are also several other keyboard shortcuts available. Check them out in the
settings section.
Each tasks can have a number of
sub tasks. When a task has sub tasks it cannot be started by itself or have tracked time directly to it. This because time spent and time estimated are set by the sum of the sub tasks.
An interactive example task
Hover the different buttons, icons and sections to get the information what a thing does.
-
If shown, it means that the task was updated on Jira or GitHub
Starts time tracking for the task and marks it as the current active task. Will only appear on the work view.
Clicking on the task title will allow you to edit it
/
Time spent / time estimated
Opens a dialog for you to specify time spent and time estimated for the task
Adds a sub task for this task
Opens a note section for the task. Jira or GitHub comments are also shown here.
Link to the original issue on Jira or GitHub. Only shown for Jira or GitHub tasks.
Deletes the task and all its sub tasks
Marks task as done/undone
Shows remote changes made on Jira or Github, when there have been some made.
Changes since last update
Hide changes
Notes
Notes section. Click to edit.


A Dynamic Duo
X
Something Went Wrong...
Something Went Wrong...
Jonathan Miller
Learn More About Jon
Bruce Wayne
Learn More About Bruce


Capture legendary pokemon now!
Interested? Subscribe for more!
Email:
You might also be interested in...
Amazing item


All Files
(61.08%
covered at
1.6
hits/line)
18 files in total.
203 relevant lines.
124 lines covered and
79 lines missed
Controllers
(53.77%
covered at
0.82
hits/line)
6 files in total.
106 relevant lines.
57 lines covered and
49 lines missed
Models
(69.05%
covered at
1.22
hits/line)
5 files in total.
42 relevant lines.
29 lines covered and
13 lines missed
Mailers
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Helpers
(81.82%
covered at
1.6
hits/line)
5 files in total.
11 relevant lines.
9 lines covered and
2 lines missed
Libraries
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Plugins
(100.0%
covered at
0.0
hits/line)
0 files in total.
0.0 relevant lines.
0.0 lines covered and
0.0 lines missed
| File |
% covered |
Lines |
Relevant Lines |
Lines covered |
Lines missed |
Avg. Hits / Line |
Ungrouped
(65.91%
covered at
4.9
hits/line)
2 files in total.
44 relevant lines.
29 lines covered and
15 lines missed
-
1
class ApplicationController < ActionController::Base
-
1
protect_from_forgery
-
1
include Pundit
-
-
1
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
-
-
1
private
-
-
1
def user_not_authorized
-
flash[:error] = "You are not authorized to perform this action."
-
redirect_to request.headers["Referer"] || root_path
-
end
-
end
-
1
class CommentsController < ApplicationController
-
1
def create
-
@comment = Comment.new(comment_params)
-
if @comment.save
-
flash[:notice] = "Comment is awaiting moderation"
-
redirect_to<EMAIL_ADDRESS>-
else
-
@post =<EMAIL_ADDRESS>-
render template: "posts/show"
-
end
-
end
-
-
1
private
-
-
1
def comment_params
-
params.require(:comment).permit(:author,
-
:author_url,
-
:author_email,
-
:content,
-
:referrer,
-
:post_id)
-
end
-
end
-
1
class HomeController < ApplicationController
-
-
1
def index
-
end
-
-
end
-
1
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
-
1
def all
-
user = User.from_omniauth(request.env["omniauth.auth"])
-
if user.persisted?
-
flash.notice = "#{user.name}, you are signed in!"
-
sign_in_and_redirect user
-
else
-
session["devise.user_attributes"] = user.attributes
-
redirect_to new_user_registration_url
-
end
-
end
-
1
alias_method :twitter , :all
-
end
-
1
class PostsController < ApplicationController
-
1
before_filter :authenticate_user!, except: [:index, :show]
-
# GET /posts
-
# GET /posts.json
-
1
def index
-
10
@posts = Post.all
-
-
10
respond_to do |format|
-
10
format.html # index.html.erb
-
10
format.json { render json: @posts }
-
end
-
end
-
-
# GET /posts/1
-
# GET /posts/1.json
-
1
def show
-
@post = Post.find(params[:id])
-
@comment = Comment.new
-
respond_to do |format|
-
format.html # show.html.erb
-
format.json { render json: @post }
-
end
-
end
-
-
# GET /posts/new
-
# GET /posts/new.json
-
1
def new
-
@post = Post.new
-
-
respond_to do |format|
-
format.html # new.html.erb
-
format.json { render json: @post }
-
end
-
end
-
-
# GET /posts/1/edit
-
1
def edit
-
1
@post = Post.find(params[:id])
-
end
-
-
# POST /posts
-
# POST /posts.json
-
1
def create
-
@post = Post.new(params[:post])
-
authorize @post
-
respond_to do |format|
-
if @post.save
-
current_user.posts << @post
-
format.html { redirect_to @post, notice: 'Post was successfully created.' }
-
format.json { render json: @post, status: :created, location: @post }
-
-
else
-
format.html { render action: "new" }
-
format.json { render json: @post.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
# PUT /posts/1
-
# PUT /posts/1.json
-
1
def update
-
@post = Post.find(params[:id])
-
-
respond_to do |format|
-
if @post.update_attributes(params[:post])
-
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
-
format.json { head :no_content }
-
else
-
format.html { render action: "edit" }
-
format.json { render json: @post.errors, status: :unprocessable_entity }
-
end
-
end
-
end
-
-
1
def publish
-
@post = Post.find(params[:id])
-
authorize @post, :update?
-
@post.publish!
-
redirect_to @post
-
end
-
-
# DELETE /posts/1
-
# DELETE /posts/1.json
-
1
def destroy
-
@post = Post.find(params[:id])
-
@post.destroy
-
-
respond_to do |format|
-
format.html { redirect_to posts_url }
-
format.json { head :no_content }
-
end
-
end
-
end
-
1
class ProjectsController < ApplicationController
-
1
def index
-
4
@projects = Project.all
-
end
-
-
1
def new
-
2
@project = Project.new
-
end
-
-
1
def create
-
2
@project = Project.new(params[:project])
-
2
if @project.save
-
1
flash[:notice] = "Project has been created."
-
1
redirect_to @project
-
else
-
1
flash[:alert] = "Project could not be saved."
-
1
render action: "new"
-
end
-
end
-
-
1
def show
-
3
@project = Project.find(params[:id])
-
end
-
-
1
def edit
-
2
@project = Project.find(params[:id])
-
end
-
-
1
def update
-
2
@project = Project.find(params[:id])
-
2
if @project.update_attributes(params[:project])
-
1
flash[:notice] = "Project was successfully updated."
-
1
redirect_to @project
-
else
-
1
flash[:alert] = "Project could not be saved."
-
1
render action: "edit"
-
end
-
end
-
-
1
def destroy
-
1
@project = Project.find(params[:id])
-
1
@project.destroy
-
1
redirect_to action: "index"
-
-
end
-
end
-
1
module ApplicationHelper
-
-
# translate the rails flash levels to appropriate twitter bootstrap css classes
-
1
def flash_class(level)
-
13
case level
-
11
when :notice then "alert alert-info"
-
when :success then "alert alert-success"
-
when :error then "alert alert-error"
-
2
when :alert then "alert alert-error"
-
end
-
end
-
end
-
1
module CommentsHelper
-
end
-
1
module OmniauthCallbacksHelper
-
end
-
1
class Comment < ActiveRecord::Base
-
1
belongs_to :post
-
1
attr_accessible :approved, :author, :author_email, :author_url, :content, :referrer, :user_agent, :user_ip
-
end
-
1
class Name < ActiveRecord::Base
-
1
attr_accessible :technologies_used
-
end
-
1
class Post < ActiveRecord::Base
-
1
attr_accessible :content, :title, :published
-
1
validates_presence_of :title, :content
-
1
belongs_to :author, class_name: "User"
-
-
1
def publish!
-
published = true
-
save!
-
end
-
end
-
1
class Project < ActiveRecord::Base
-
1
attr_accessible :name, :technologies_used
-
-
1
validates :technologies_used, presence: true
-
-
1
validates :name, length: { in: 4..255 }
-
end
-
1
class User < ActiveRecord::Base
-
# Include default devise modules. Others available are:
-
# :token_authenticatable, :confirmable,
-
# :lockable, :timeoutable and :omniauthable
-
1
devise :database_authenticatable, :registerable,
-
:recoverable, :rememberable, :trackable, :validatable, :omniauthable
-
-
# Setup accessible (or protected) attributes for your model
-
1
attr_accessible :role, :published, :email, :password, :password_confirmation, :remember_me
-
# attr_accessible :title, :body
-
-
1
has_many :posts, foreign_key: "author_id"
-
-
1
def author?
-
6
role == 'author'
-
end
-
-
1
def editor?
-
18
role == 'editor'
-
end
-
-
-
1
def self.from_omniauth(auth)
-
where(auth.slice(:provider, :uid)).first_or_create do |user|
-
user.provider = auth.provider
-
user.uid = auth.uid
-
user.name = auth.info.nickname
-
user.email =<EMAIL_ADDRESS>-
end
-
end
-
-
1
def self.new_with_session(params, session)
-
8
if session["devise.user_attributes"]
-
new(session["devise.user_attributes"], without_protection: true) do |user|
-
user.attributes = params
-
user.valid?
-
end
-
else
-
8
super
-
end
-
end
-
-
1
def password_required?
-
12
super && provider.blank?
-
end
-
-
1
def update_with_password(params, *options)
-
if encrypted_password.blank?
-
update_attributes(params, *options)
-
else
-
super
-
end
-
end
-
end
-
1
class ApplicationPolicy
-
1
attr_reader :user, :record
-
-
1
def initialize(user, record)
-
@user = user
-
@record = record
-
end
-
-
1
def index?
-
false
-
end
-
-
1
def show?
-
scope.where(:id => record.id).exists?
-
end
-
-
1
def create?
-
false
-
end
-
-
1
def new?
-
create?
-
end
-
-
1
def update?
-
false
-
end
-
-
1
def edit?
-
update?
-
end
-
-
1
def destroy?
-
false
-
end
-
-
1
def scope
-
Pundit.policy_scope!(user, record.class)
-
end
-
end
-
1
class PostPolicy < ApplicationPolicy
-
1
attr_reader :user, :post
-
-
1
def initialize(user, post)
-
60
@user = user
-
60
@post = post
-
end
-
-
1
def create?
-
20
if user.present?
-
6
user.author? || user.editor?
-
end
-
end
-
1
alias_method :update?, :create?
-
-
1
def destroy?
-
20
if user.present?
-
6
return true if user.editor?
-
6
user.id == post.author_id
-
end
-
end
-
-
1
def publish?
-
20
if user.present?
-
6
user.editor?
-
end
-
end
-
-
1
class Scope < Struct.new(:user, :scope)
-
1
def resolve
-
if user.editor?
-
scope.all
-
elsif user.author?
-
scope.where(author_id: user.id)
-
else
-
scope.where(published: true)
-
end
-
end
-
end
-
end


Christie Brinkley Glows As She Poses With Lucky Santa At Age 65
December 9, 2019
Christie Brinkley Glows As She Poses With Lucky Santa At Age 65
The supermodel has a long history with St. Nick.
The supermodel has a long history with St. Nick.
Christie Brinkley gave Santa Claus a thrill this holiday season. One week after posing for a Thanksgiving photo with her family, the 65-year-old supermodel hammed it up with St. Nick at luxury New York City department store Bergdorf Goodman. Fans are just grateful she didn’t sit on his lap.
In new photos posted to Instagram, Christie is glowing in a cozy cable-knit sweater with a festive red and white plaid scarf draped around her neck. The modeling legend wears brown leather pants as she poses with her arm around the perfect department store Santa. A second photo shows the two giving the peace sign.
In the caption to the post, Christie joked that she and Santa have to “stop meeting like this.” And fans seemed to agree. In the comments section, Christie’s followers warned the sizzling superstar not to get too close to St. Nick for fear for his health.
One fan referenced Christie’s ex-husband Billy Joel’s 1977 hit song, “Movin’ Out” as he told the star to keep standing.
“Don’t sit on his lap, he’ll have a heart attack ack ack ack ack, you oughta know by now!” the fan joked of Santa.
“Don’t sit on his lap! It could be dangerous,” another added.
Others noted how “lucky” Santa Claus is.
“Christie I think you made Santa’s Christmas wish list. Very beautiful and breathtaking,” one fan wrote.
“It’s no wonder Santa has a smile on,” another added.
Loading...
Christie’s new Christmas photo comes on the same day that she posted a throwback holiday pic that had her posing with a different Santa. In the vintage snap posted to Instagram, Christie is wearing a billowing purple gown as a decidedly creepier looking Santa holds out his goodie bag. In the caption to the post, Christie reminded fans to keep the spirit of the holiday season with them year-round.
“Wouldn’t it be great if we would carry the wonderful spirit of Christmas in our hearts the whole year long? Love and joy, peace on earth, goodwill to all! That would really jingle my bells! Seasons Greetings Winter Spring Summer and Fall my Friends!” the mom of three wrote.
Of course, fans know that Christie Brinkley has some inside connections when it comes to Santa Claus. The Sports Illustrated icon has been known to accompany the famous Christmas figure to holiday events, most notably the Annual New York Stock Exchange Christmas Tree Lighting in New York City. Christie has been photographed multiple times with Santa over the years, so it’s a pretty good bet she’s not on his “naughty” list.


{% extends "base.html" %} {% block title %}
Medieval catalogues > HENRY DE KIRKESTEDE > Catalogus, c. 1360
{% endif %}61 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


Download This Plugin
Back To jQueryScript.Net
jQuery RefineSlide Plugin Demo
Transitions
TYPE
- supported by your browser
TYPE
- unsupported by your browser
Fade
CSS
Random
CSS
Slice horizontal
CSS
Slice vertical
CSS
Slide horizontal
CSS
Slide vertical
CSS
Scale
CSS
Fan
CSS
Block scale
CSS
Kaleidoscope
CSS
Blind horizontal
CSS
Blind Vertical
CSS
Cube horizontal
3D
Cube vertical
3D
Caption Area
Wood texture by
Matthew Skiles.
This image is wrapped in a link.
Adapted from
Glenn Van Bogaert


return self.sequence_index == other
// Otherwise it has to be the same object
else:
return id(other) == id(self)
// Allow equality checks to ints that are the sequence index
if isinstance(other, int):
return self.sequence_index == other
return super().__eq__(other)


Let's Play PIG!
Rules
First player to 100 wins.

Turn ends when player rolls a 1 or chooses to hold.
If player rolls a 1, they lose all points earned during the turn.
If player holds, points earned during the turn are added to their total.
Player 1
Score
Player 2
Score
's turn
Die
Total


Creates popup from passed HTML string
Popup contentLoad Login Screen from file via Ajax
Login Screen AjaxLoad Popup from component file
Popup ComponentUse async route to check if the user is logged in:
Secured PageCreates popup from passed HTML string
Popup contentLoad Login Screen from file via Ajax
Login Screen AjaxLoad Popup from component file
Popup ComponentUse async route to check if the user is logged in:
Secured Page


# File lib/vm_tools.rb, line 108 def self.ensure_keyname_not_in_use(keyname, infrastructure) describe_instances = CommonFunctions.shell("#{infrastructure}-describe-instances 2>&1") if describe_instances =~ %r\s#{keyname}\s/ raise InfrastructureException.new("The keyname you chose is " + "already in use. Please choose another keyname and try again.") end end
# File lib/vm_tools.rb, line 116 def self.ensure_min_vms_available(min_vms_needed, instance_type, infrastructure) puts "warn: this doesn't work on ec2 - euca only" availability_zones = CommonFunctions.shell("#{infrastructure}-describe-availability-zones verbose 2>&1") # check for errors from last command vms_str = availability_zones.scan(%r#{instance_type}\t([\d]+)/).flatten.to_s if vms_str.nil? or vms_str.empty? raise InfrastructureException.new("There was a problem seeing how many " + "virtual machines were available. We saw [#{availability_zones}].") end free_vms = Integer(vms_str) if free_vms < min_vms_needed raise InfrastructureException.new("Not enough VMs were free of the " + "type #{instance_type}. Needed #{min_vms_needed} but only #{free_vms}" + " were available.") end end
# File lib/vm_tools.rb, line 87 def self.ensure_tools_are_installed(infrastructure) commands = ["-add-group", "-authorize", "-describe-instances", "-run-instances", "-terminate-instances"] commands.each { |cmd| full_cmd = "#{infrastructure}#{cmd}" if !CommonFunctions.user_has_cmd?(full_cmd) raise BadConfigurationException.new("You do not appear to " + "have the command '#{full_cmd}'. Please put it in your PATH and " + "try again.") end } end
# File lib/vm_tools.rb, line 376 def self.get_cloud_creds(node_layout, val_hash) cloud_creds = { "machine" => "#{val_hash['machine']}", "instance_type" => "#{val_hash['instance_type']}", "infrastructure" => "#{val_hash['infrastructure']}", "min_images" => "#{node_layout.min_images}", "max_images" => "#{node_layout.max_images}" } cloud_creds.merge!(VMTools.get_creds_from_env) return cloud_creds end
# File lib/vm_tools.rb, line 65 def self.get_creds_from_env creds = {} optional = {"ec2_url" => "https://us-east-1.ec2.amazonaws.com"} required = ["ec2_access_key", "ec2_secret_key"] optional.each { |k, v| creds[k] = ENV[k.upcase] or v } required.each { |var| if ENV[var.upcase] creds[var] = ENV[var.upcase] else raise BadConfigurationException.new("The required " + "environment variable #{var.upcase} was not set. Please set it " + "and try running AppScale again.") end } return creds end
# File lib/vm_tools.rb, line 409 def self.get_hybrid_creds(node_layout, set_head_node_creds=false) cloud_creds = { "infrastructure" => "hybrid", "min_images" => "#{node_layout.min_images}", "max_images" => "#{node_layout.max_images}" } cloud_num = 1 loop { cloud_type = ENV["CLOUD#{cloud_num}_TYPE"] break if cloud_type.nil? if cloud_num == 1 and set_head_node_creds set_vars = true else set_vars = false end cloud_creds.merge!(self.get_hybrid_env_vars(cloud_type, cloud_num, set_vars)) cloud_num += 1 } return cloud_creds end
# File lib/vm_tools.rb, line 438 def self.get_hybrid_env_vars(cloud_type, cloud_num, set_vars=false) creds = {} if cloud_type == "euca" required = REQUIRED_EUCA_CREDS_FOR_HYBRID elsif cloud_type == "ec2" required = REQUIRED_EC2_CREDS_FOR_HYBRID else puts "Incorrect cloud type of #{cloud_type}" fail end required.each { |cred| key = "CLOUD#{cloud_num}_#{cred}" val = ENV[key] if val.nil? raise BadConfigurationException.new("The required " + "environment variable #{key} was not set. Please set it and " + "try again.") end if set_vars puts "Setting #{cred} to #{val}" ENV[cred] = val end creds[key] = val } return creds end
# File lib/vm_tools.rb, line 471 def self.get_hybrid_machine(infra, cloud_num) if infra == "euca" key = "CLOUD#{cloud_num}_EMI" elsif infra == "ec2" key = "CLOUD#{cloud_num}_AMI" else raise BadConfigurationException.new("infrastructure #{infra} " + "is not a supported value.") end return ENV[key] end
# File lib/vm_tools.rb, line 44 def self.get_initial_layout(head_node, separate, num_of_nodes, total_nodes) if head_node if separate raise NotImplementedError.new("haven't done head node, separate yet") else layout = "shadow:load_balancer:db_master" layout << ":appengine" if total_nodes == 1 end else raise NotImplementedError.new("haven't done slave nodes, separate yet") end return layout end
# File lib/vm_tools.rb, line 159 def self.get_ips(ips, verbose) if ips.length % 2 != 0 raise InfrastructureException.new("ips not even length array") end reported_public = [] reported_private = [] ips.each_index { |index| if index % 2 == 0 reported_public << ips[index] else reported_private << ips[index] end } if verbose puts "Reported Public IPs: [#{reported_public.join(', ')}]" puts "Reported Private IPs: [#{reported_private.join(', ')}]" end actual_public = [] actual_private = [] reported_public.each_index { |index| pub = reported_public[index] pri = reported_private[index] if pub != "<IP_ADDRESS>" and pri != "<IP_ADDRESS>" actual_public << pub actual_private << pri end } return actual_public, actual_private end
# File lib/vm_tools.rb, line 193 def self.get_public_ips(ips, verbose) if ips.length % 2 != 0 raise InfrastructureException.new("ips not even length array") end reported_public = [] reported_private = [] ips.each_index { |index| if index % 2 == 0 reported_public << ips[index] else reported_private << ips[index] end } puts "Reported Public IPs: [#{reported_public.join(', ')}]" if verbose puts "Reported Private IPs: [#{reported_private.join(', ')}]" if verbose public_ips = [] reported_public.each_index { |index| if reported_public[index] != "<IP_ADDRESS>" public_ips << reported_public[index] elsif reported_private[index] != "<IP_ADDRESS>" public_ips << reported_private[index] end } return public_ips.flatten end
# File lib/vm_tools.rb, line 388 def self.get_vmm_keys(val_hash) puts "Generating certificate and private key" key, cert = EncryptionHelper.generate_pem_files(val_hash['keyname']) key = File.expand_path("~/.appscale/#{val_hash['keyname']}-key.pem") cert = File.expand_path("~/.appscale/#{val_hash['keyname']}-cert.pem") return cert, key end
Code for ::local_ip taken from coderrr.wordpress.com/2008/05/28/get-your-local-ip-address/
# File lib/vm_tools.rb, line 61 def self.local_ip UDPSocket.open {|s| s.connect("<IP_ADDRESS>", 1); s.addr.last } end
# File lib/vm_tools.rb, line 397 def self.lookup_cloud_env(cloud) cloud_type_var = cloud.upcase + "_TYPE" cloud_type = ENV[cloud_type_var] if cloud_type.nil? raise BadConfigurationException.new("The environment variable " + "#{cloud_type_var} was not set. Please set it and try again.") end return cloud_type end
# File lib/vm_tools.rb, line 99 def self.open_ports_in_cloud(infrastructure, group, verbose) retn = CommonFunctions.shell("#{infrastructure}-authorize #{group} -p 1-65535 -s <IP_ADDRESS>/0 -P udp 2>&1") puts retn if verbose retn = CommonFunctions.shell("#{infrastructure}-authorize #{group} -p 1-65535 -s <IP_ADDRESS>/0 -P tcp 2>&1") puts retn if verbose retn = CommonFunctions.shell("#{infrastructure}-authorize #{group} -s <IP_ADDRESS>/0 -P icmp -t -1:-1 2>&1") puts retn if verbose end
# File lib/vm_tools.rb, line 434 def self.set_hybrid_creds(node_layout) return self.get_hybrid_creds(node_layout, set_head_node_creds=true) end
# File lib/vm_tools.rb, line 327 def self.spawn_head_node(head_node, infrastructure, keyname, ssh_key_location, ssh_keys, force, machine, instance_type, group, verbose) head_node_jobs = head_node.roles.join(":") if VALID_CLOUD_TYPES.include?(infrastructure) VMTools.spawn_head_node_via_cloud(infrastructure, keyname, ssh_key_location, ssh_keys, force, head_node_jobs, machine, instance_type, group, verbose) else VMTools.spawn_head_node_via_vmm(head_node, keyname, head_node_jobs) end end
# File lib/vm_tools.rb, line 340 def self.spawn_head_node_via_cloud(infrastructure, keyname, ssh_key_location, ssh_keys, force, head_node_jobs, machine, instance_type, group, verbose) VMTools.ensure_tools_are_installed(infrastructure) #VMTools.verify_ids(machine, infrastructure) VMTools.ensure_keyname_not_in_use(keyname, infrastructure) #VMTools.ensure_min_vms_available(min_images, instance_type, infrastructure) EncryptionHelper.generate_ssh_key(verbose, ssh_keys, keyname, infrastructure, force) locations = VMTools.spawn_vms(1, head_node_jobs, machine, instance_type, keyname, infrastructure, group, verbose) puts "Please wait for your instance to complete the bootup process." head_node_ip = locations[0].split(":")[0] CommonFunctions.sleep_until_port_is_open(head_node_ip, AppScaleTools::SSH_PORT) sleep(10) options = "-o StrictHostkeyChecking=no -o NumberOfPasswordPrompts=0" enable_root_login = "sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/" %xssh -i #{ssh_keys.join(" -i ")} #{options} 2>&1 ubuntu@#{head_node_ip} '#{enable_root_login}'` # kloogy ec2 fix CommonFunctions.scp_file(ssh_key_location, "/root/.ssh/id_dsa", head_node_ip, ssh_keys) # kloogy ec2 fix CommonFunctions.scp_file(ssh_key_location, "/root/.ssh/id_rsa", head_node_ip, ssh_keys) CommonFunctions.shell("scp -i #{ssh_keys.join(" -i ")} -o StrictHostkeyChecking=no 2>&1 root@#{head_node_ip}:/root/.ssh/authorized_keys /tmp/remote_keys") remote_keys = (File.open("/tmp/remote_keys") { |f| f.read }).chomp public_key_contents = remote_keys.scan(%rssh-rsa [\w+\/=]+ [\w@]+/).flatten.to_s File.open("/tmp/id_rsa.pub", "w+") { |file| file.write(public_key_contents) } CommonFunctions.scp_file("/tmp/id_rsa.pub", "/root/.ssh/id_rsa.pub", head_node_ip, ssh_keys) locations = locations.flatten.to_s return locations end
# File lib/vm_tools.rb, line 368 def self.spawn_head_node_via_vmm(node, keyname, head_node_jobs) # We don't care about the instance's ID if not using cloud-tools # and for Xen, public ip = private ip head_node = "#{node.id}:#{node.id}:#{head_node_jobs}:i-ZFOOBARZ:cloud1" locations = [head_node].flatten.to_s return locations end
# File lib/vm_tools.rb, line 223 def self.spawn_vms(num_of_vms_to_spawn, job, image_id, instance_type, keyname, infrastructure, group, verbose) #adding check first so that we don't do any of this if the infrastructure setting is wrong if !VALID_CLOUD_TYPES.include?(infrastructure) raise BadConfigurationException.new("Infrastructure must be " + "iaas, ec2, or euca, but instead was #{infrastructure}") end if infrastructure == "ec2" check_group = CommonFunctions.shell("#{infrastructure}-describe-group #{group} 2>&1") make_group = check_group.include? 'InvalidGroup.NotFound' elsif infrastructure == "euca" check_group = CommonFunctions.shell("#{infrastructure}-describe-groups #{group} 2>&1") make_group = check_group.empty? end if make_group puts "Creating security group #{group}" if verbose create_sec_group = CommonFunctions.shell("#{infrastructure}-add-group #{group} -d #{group} 2>&1") puts create_sec_group if verbose else # security group exists raise InfrastructureException.new("Security group #{group} exists, " + "delete this group via #{infrastructure}-delete-group #{group}, " + "prior to starting an AppScale cloud") end puts "Security group #{group} in place" if verbose VMTools.open_ports_in_cloud(infrastructure, group, verbose) puts "Ports set for security group #{group}" if verbose describe_instances = CommonFunctions.shell("#{infrastructure}-describe-instances 2>&1") puts describe_instances if verbose all_ip_addrs = describe_instances.scan(%r\s+(#{IP_OR_FQDN})\s+(#{IP_OR_FQDN})\s+running\s+#{keyname}\s/).flatten ips_up_already = VMTools.get_public_ips(all_ip_addrs, verbose) vms_up_already = ips_up_already.length command_to_run = "#{infrastructure}-run-instances -k #{keyname} -n #{num_of_vms_to_spawn} --instance-type #{instance_type} --group #{group} #{image_id}" puts command_to_run if verbose run_instances = "" loop { run_instances = CommonFunctions.shell("#{command_to_run} 2>&1") puts "run_instances: [#{run_instances}]" if verbose if run_instances =~ %rPlease try again later./ puts "Error with run_instances: #{run_instances}. Will try again in a moment." elsif run_instances =~ %rtry --addressing private/ puts "Need to retry with addressing private. Will try again in a moment." command_to_run << " --addressing private" elsif run_instances =~ %rPROBLEM/ raise InfrastructureException.new("Saw the following error message " + "from iaas tools. Please resolve the issue and try again:\n" + "#{run_instances}") else puts "Run instances message sent successfully. Waiting for the image to start up." break end } instance_ids = run_instances.scan(%rINSTANCE\s+(i-\w+)\s+[\w\-\s\.]+#{keyname}\s/).flatten end_time = Time.now + MAX_VM_CREATION_TIME while (now = Time.now) < end_time describe_instances = CommonFunctions.shell("#{infrastructure}-describe-instances 2>&1") puts "[#{Time.now}] #{end_time - now} seconds left until timeout..." puts describe_instances if verbose if describe_instances =~ %rterminated\s#{keyname}\s/ raise InfrastructureException.new("An instance was unexpectedly " + "terminated. Please contact your cloud administrator to determine " + "why and try again. \n#{describe_instances}") end all_ip_addrs = describe_instances.scan(%r\s+(#{IP_OR_FQDN})\s+(#{IP_OR_FQDN})\s+running\s+#{keyname}\s/).flatten instance_ids = describe_instances.scan(%rINSTANCE\s+(i-\w+)\s+[\w\-\s\.]+#{keyname}\s/).flatten public_ips, private_ips = VMTools.get_ips(all_ip_addrs, verbose) break if public_ips.length == num_of_vms_to_spawn + vms_up_already sleep(SLEEP_TIME) end if public_ips.length.zero? raise InfrastructureException.new("No public IPs were able to be " + "procured within the time limit.") end if public_ips.length != instance_ids.length puts "Public IPs: #{public_ips.join(', ')}, Instance ids: #{instance_ids.join(', ')}" raise InfrastructureException.new("Public IPs size didn't match " + "instance names size") end instances_created = [] public_ips.each_index { |index| instances_created << "#{public_ips[index]}:#{private_ips[index]}:#{job}:#{instance_ids[index]}:cloud1" } return instances_created end
# File lib/vm_tools.rb, line 319 def self.terminate_all_vms(keyname, infrastructure) desc_instances = CommonFunctions.shell("#{infrastructure}-describe-instances 2>&1") instances = desc_instances.scan(%rINSTANCE\s+(i-\w+)\s+[\w\-\s\.]+#{keyname}\s/).flatten return 0 if instances.length == 0 puts CommonFunctions.shell("#{infrastructure}-terminate-instances #{instances.join(' ')} 2>&1") return instances.length end
# File lib/vm_tools.rb, line 521 def self.terminate_infrastructure_machines(infrastructure, keyname) # TODO: if we know all the other ips in the system, contact one # of them instead if keyname == "appscale" # appscale keyname messes up the next command abort("Error seen trying to terminate your machines - please do so manually.") end # for now, just kill them the hard way desc = "#{infrastructure}-describe-instances" term = "#{infrastructure}-terminate-instances" cmd = "#{desc} | grep #{keyname} | awk '{print $2}' | xargs #{term}" puts "Unable to contact shadow node, shutting down via tools..." puts %x#{cmd}` cmd = "#{infrastructure}-delete-group appscale" puts %x#{cmd}` end
# File lib/vm_tools.rb, line 484 def self.verify_credentials_are_set_correctly(infrastructure) # In non-hybrid cloud environments, the user has to provide us with their # EC2 credentials. If they didn't, let them know and abort. EC2_ENVIRONMENT_VARIABLES.each { |var| if ENV[var].nil? raise BadConfigurationException.new("The required " + "environment variable #{var} was not set. Please set it and try " + "again.") end } VMTools.verify_credentials_exist() # The euca2ools default to using localhost as the EC2_URL and S3_URL if # it's not set, so make sure the user has explicitly set it. if infrastructure == "euca" ['EC2_URL', 'S3_URL'].each { |var| if ENV[var].nil? raise BadConfigurationException.new("When running over " + "Eucalyptus, the environment variable #{var} must be set.") end } end end
Validates that the private key and certificate for use with EC2 or Eucalyptus both refer to files that exist, aborting if either do not exist.
# File lib/vm_tools.rb, line 511 def self.verify_credentials_exist() ["EC2_PRIVATE_KEY", "EC2_CERT"].each { |var| file_path = File.expand_path(ENV[var]) if !File.exists?(file_path) raise BadConfigurationException.new("The environment variable" + " #{var} pointed to the file #{file_path}, which didn't exist.") end } end
# File lib/vm_tools.rb, line 134 def self.verify_ids(disk, infrastructure) ec2_images = CommonFunctions.shell("#{infrastructure}-describe-images 2>&1") if disk !~ %r[a|e]mi/ raise InfrastructureException.new("The disk image you specified was " + "not in the proper format. Please correct this and try again.") end # if the tools are not configured properly an error message will show up # be sure to catch it and die if so if ec2_images =~ %r\AServer:/ raise InfrastructureException.new("Problem with " + "#{infrastructure}-tools: " + ec2_images) end id = "disk" id_value = eval(id) if ec2_images !~ %rIMAGE\t#{id_value}/ raise InfrastructureException.new("The #{id} image you specified, " + "#{id_value}, was not found when querying " + "#{infrastructure}-describe-images. Please specify a #{id} image in " + "the database and try again.") end end


Introduction
Welcome to the BitroPay API! You can use our API to access BitroPay API endpoints.
We have language bindings in Shell and Javascript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
API V1
Authentication - V1
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl https://www.bitro-pay.com/api/v1 \
-X GET \
-H "Authorization: your.api.key"
Make sure to replace
your.api.key
with your API key.The above command returns JSON structured like this:
{
"result": "ok",
"resultCode": 200
}
BitroPay uses API keys to allow access to the API. You can register a new BitroPay API key at our website.
BitroPay expects for the API key to be included in all API requests to the server in a header that looks like the following:
Authorization: your.api.key
Create new invoice - V1
curl "https://www.bitro-pay.com/api/v1/invoice" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: your.api.key" \
--data '{ \
"productId": "your product id", \
"productName": "your product name", \
"productPrice": 10000, \
"productCurrency": "KRW", \
"redirectURL": "your shop url", \
"callbackURL": "call back url", \
"userData": {} \
}'
The above command returns JSON structured like this:
{
"result": "ok",
"resultCode": 200,
"data": {
"invoiceId": "ZiFztkEo6FHswocXw",
"no": "1520998774032",
"gatewayURL": "https://www.bitro-pay.com/gateway/invoice/ZiFztkEo6FHswocXw",
"productId": "your product id",
"productName": "your product name",
"productPrice": 10000,
"productCurrency": "KRW",
"userData": {},
"status": "wait",
"amount": 0.01
}
}
Callback JSON Request Data - POST callbackURL
{
"invoiceId": "ZiFztkEo6FHswocXw",
"no": "1520998774032",
"productId": "your product id",
"productName": "your product name",
"productPrice": 10000,
"productCurrency": "KRW",
"userData": {},
"status": "ok",
"amount": 0.01
}
Create an invoice
HTTP Request
POST https://www.bitro-pay.com/api/v1/invoice
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| productPrice | Y | Number | Your product price. |
| productCurrency | Y | String | Price currency (KRW) |
| redirectURL | Y | String | After user paid redirect to this url. |
| callbackURL | Y | String | Callback url for notify tx status update. |
| productId | N | String | Your product id. |
| productName | N | String | Your product name. |
| userData | N | Object | User defined data. We will send this data when we request your callbackURL. |
| N | String | Buyer email address. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| result | String | Result message |
| resultCode | Number | Result code. |
| data | Object | Result data |
| data.invoiceId | String | New invoice ID. |
| data.no | String | New invoice number. |
| data.gatewayURL | String | Gateway url for payment. |
| data.productId | String | Your product ID. |
| data.productName | String | Your product name. |
| data.productPrice | String | Your product price. |
| data.productCurrency | String | Price currency. |
| data.userData | String | User defined data. |
| data.status | String | Invoice status |
| data.amount | Number | BTC amount |
Callback Request Parameters
POST callbackURL
| Parameter | Type | Description |
|---|---|---|
| invoiceId | String | Invoice ID |
| no | String | Invoice number |
| productPrice | Number | Your product price. |
| productCurrency | String | Price currency (KRW) |
| productId | String | Your product id. |
| productName | String | Your product name. |
| userData | Object | User defined data. |
| status | String | Invoice status |
| amount | Number | Invoice BTC amount |
Invoice Status
| Code | Description |
|---|---|
| ok | Client paid |
| timeout | Timeout |
| wait | Waiting for pay |
| amountLow | Amount is lower than request amount |
| amountOver | Amount is higher than request amount |
| confirmFail | Confirmation is failed. |
| confirmed | Complete 2 confirmation. You can shipping your product. |
| confirmedLow | Complete 2 confirmation. But amount is lower than request amount. Run refund process. |
| confirmedOver | Complete 2 confirmation. But amount is higher than request amount. Run refund process. |
| refund | 환불이 완료된 경우 |
Errors
The BitroPay API uses the following error codes:
| BitroPay Error Code | Meaning |
|---|---|
| 4000 | Request data format error |
| 4010 | Authorization Header Missing - You need to add API Key to Authorization header. |
| 4011 | Authorization Header is malformed - Please check your Authorization header string. |
| 4012 | Token is expired - Use new token for authorization. |
| 4013 | User does not exists - API Key owner removed. |
| 4050 | Invoice request must be a POST. |
| 4100 | White Ip Error |
| 5000 | Server System Error |
| 5100 | BTC Amount calculation Error |
| 9999 | System maintenance |


Registers a background task for the mobile broadband operator messages. The background task runs whenever the system receives an operator message. This could be an SMS message or a USSD message.


FW's Pizza Store
For the pizza lovers!
Home
Create your own
salad
pizza
meat favourites
veggie favourites
soups
drinks
specials
gift cards
Are you hungry?