Git Product home page Git Product logo

levelmeup's People

Contributors

akihito-takeuchi avatar artskydj avatar dominictarr avatar eugeneware avatar geek avatar greenkeeperio-bot avatar heapwolf avatar ixkaito avatar jcollado avatar jedireza avatar jmorrell avatar jonahss avatar juliangruber avatar martinheidegger avatar ninabreznik avatar patrickjs avatar raboof avatar ralphtheninja avatar raynos avatar rizoom avatar robertkowalski avatar rvagg avatar trott avatar yoshuawuyts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

levelmeup's Issues

Some quick funnies needed for Hello World exercise

The new, first exercise is just a Hello World but with a slight twist. It was suggested that a very easy introductory exercise would be good just to get used to how the format works so I added one with this problem statement:


To get into the rhythm, let's do a simple hello world.

Write a Node program that accepts two command line arguments, X and Y and prints out to the console the following text:

ALL YOUR _X_ ARE BELONG TO _Y_

When you have completed your program, you can run it in the test
environment with:

levelmeup run program.js

And once you are happy that it is correct then run:

levelmeup verify program.js

And your submission will be verified for correctness. Once you have
a correct solution, run levelmeup again and select the next problem!


What I need is help coming up with some amusing X and Y values. It'd be nice if they could be somewhat relevant to Ireland, castles, Vikings, perhaps Node. Just edit setup.js (in your browser if you want) here: https://github.com/rvagg/levelmeup/blob/master/problems/all_your_base/setup.js

Thanks!

Error when installing levelmeup

When installing levelmeup, it complains about not having XCode installed (I have only the command-line tools)
All other nodeschool levels were installed correctly (without sudo)

Error when running npm install -g levelmeup (same issue when running with sudo)

> [email protected] install /Users/brunosanches/Dropbox/projects/nodejs/node_modules/levelmeup/node_modules/level/node_modules/leveldown
> node-gyp rebuild

npm http GET https://registry.npmjs.org/bl
npm http 304 https://registry.npmjs.org/bl
xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.

gyp: Error 2 running xcodebuild
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/brunosanches/Dropbox/projects/nodejs/node_modules/levelmeup/node_modules/level/node_modules/leveldown
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Exercises

Including a bunch of you in this private repo as you're either involved in LevelUP, NodeConf.eu or might have some useful input to this tool: @Raynos @dominictarr @maxogden @ralphtheninja @kesla @juliangruber @hij1nx @No9 @mcollina @pgte @mikeal @substack @brycebaril (have I missed anyone that might have good input?)

Please keep this private for now, it's intended for use initially at NodeConf.eu, beyond that you can go wild. It ought to be a good teaching tool for any workshoppy situation or just a good tool to point newbies at. I'm working under the assumption that nobody else is preparing for the NodeBase workshop section at NodeConf.eu, I was told that @hij1nx suggested a workshop but I don't believe anyone else has anything planned thus far (correct me if I'm wrong!).

A descendent of the great stream-adventure from NodeConf by @maxogden and @substack, this now builds on workshopper which is an evolution of the guts of stream-adventure, designed for use with learnyounode so while it can still deal with the original stream-adventure exercises it can do a bit more too, and there's more functionality being added to workshopper for this project too.

Exercises can be similar to those found in stream-adventure, here or learnyounode, here. The easiest exercises are stand-alone programs that print stuff to stdout, or can be made to print to stdout indirectly as this is how stream-adventure was designed. It's also possible to have a validation step after a solution is run to verify criteria that can't be munged nicely into a stdout print. Don't be constrained by what's currently possible when coming up with exercises though.

Initially what I need help with is an outline of the exercises, structured for the most optimal learning experience around foundational "NodeBase" concepts. So, even if you can't contribute code or documentation or anything else, a clear eye over the lesson progression would be greatly appreciated.

So far, this is what I have in mind:

Basics, really simple exercises just to cover the very basic operations in LevelUP:

  1. Basics: GET
  2. Basics: PUT
  3. Basics: BATCH
  4. Basics: READSTREAM

The first 2 are implemented, I'm considering how best to do the third without it just being a duplicate of the second (there are a couple of exercises in learnyounode that deal with sync vs async methods and it monkeypatches fs to watch the methods that the solution uses and fails you if you use the wrong one(s), I'm not sure how suitable that approach is here tho). ReadStream will just be a "here's a db with a bunch of random keys & values, print them in order to stdout" I think.

After that, I think the next step is to deal with range queries, so perhaps a couple of exercises that deal with existing dbs and structured keys that asks you to print out just a subset of the keys according to some criteria to be supplied as command line arguments and you have to create a ReadStream that'll pick those up. I'm also wondering if an exercise on bytewise would be good here. Some creative thinking required!

Then we can have some more advanced stuff, somehow pulling in sublevel, maybe even hooks and I also thought that coming up with something that uses multilevel would be fun. But I need some help thinking up exercises that lend themselves to being tested/verified.

@horse_js Count running is giving me this error

While trying to run @'horse_js' Count I'm getting this error even while running the given solution.

Using Node v6.2.1

Running "@horse_js Count"...

/usr/local/lib/node_modules/levelmeup/problems/horse_js_count/exec-wrap.js:42
  db = wrapped(db, methodUsed)
     ^

TypeError: Assignment to constant variable.
    at LevelUP.<anonymous> (/usr/local/lib/node_modules/levelmeup/problems/horse_js_count/exec-wrap.js:42:6)
    at emitNone (events.js:86:13)
    at LevelUP.emit (events.js:185:7)
    at /usr/local/lib/node_modules/levelmeup/node_modules/levelup/lib/levelup.js:127:12
    at /usr/local/lib/node_modules/levelmeup/node_modules/abstract-leveldown/abstract-leveldown.js:42:7

Unhandled 'error' event at "Basics: PUT"

I was running my code in "levelmeup run program.js" and it worked properly,
but in "levelmeup verify program.js" it was throwing this error:
`Verifying "Basics: PUT"...

events.js:85
throw er; // Unhandled 'error' event
^
OpenError: IO error: lock /tmp/~levelmeup_1_5093/LOCK: Resource temporarily unavailable
at /usr/local/lib/node_modules/levelmeup/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:119:34
at /usr/local/lib/node_modules/levelmeup/node_modules/level/node_modules/leveldown/node_modules/abstract-leveldown/abstract-leveldown.js:39:16`

I tried command with mine code, and the official solution from page, it always dumps this error

Nodejs - v6.3.0
Node - v0.12.7

Start/End options for readStreams are legacy ranges

start and end options are labelled as legacy ranges, suggesting the use of lte (less than or equal) and gte (greater than or equal) instead.

From the LevelUp README:

Additionally, you can supply an options object as the first parameter to createReadStream() with the following options:

'gt' (greater than), 'gte' (greater than or equal) define the lower bound of the range to be streamed. Only records where the key is greater than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the records streamed will be the same.

'lt' (less than), 'lte' (less than or equal) define the higher bound of the range to be streamed. Only key/value pairs where the key is less than (or equal to) this option will be included in the range. When reverse=true the order will be reversed, but the records streamed will be the same.

'start', 'end' legacy ranges - instead use 'gte', 'lte'

Exercises @horse_js Tweets, Keywise, and Short Scrabble Words all reference using start and end. Is it worthwhile to update these exercises? I can create a PR.

Get Your Level On! fails at verifying

I tested with my created data and it worked
but with the levelmeup it fails at verifying
this project its abandoned?
I tested with node v4.2.1 and its not worked (some module version mismatch)
and with node v0.12.0 I got this err
image

Cannot get passed exercise 3

Hey,

I cannot get passed exercise 3...
I installed you package locally and I am running it through ./node_modules/.bin/levelmeup
This has worked for other workshoppers like stream-adveenture, javascripting, learnyounode, how-to-npm,...

The first 2 exercises work fine, but for exercise 3 I get this error:

Could not run: Error: ENOENT: no such file or directory, lstat '/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/levelmeup/node_modules/level/'
    at Object.fs.lstatSync (fs.js:961:11)
    at feed (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/echomunge/dir2gibberish.js:8:17)
    at random (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/echomunge/dir2gibberish.js:33:5)
    at Object.init (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/levelmeup/exercises/basics_get/exercise.js:11:16)
    at Object.run (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/levelmeup/lib/exercise.js:89:21)
    at WA.executeExercise (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/workshopper-adventure/index.js:425:16)
    at WA.process (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/workshopper-adventure/index.js:317:17)
    at WA.run (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/workshopper-adventure/index.js:262:15)
    at Object.exports.handler (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/workshopper-adventure/lib/commands/run.js:12:21)
    at method.valid.$ (/media/Data/GoogleDrive/Programs/JS/Tutorials/levelmeup/node_modules/commandico/commandico.js:143:15)

level-sublevel version

level-sublevel is at version 6.x now and an error is thrown when running levelmeup run program.js stating that the key cannot be found.

I was able to run successfully by installing v5: npm i level-sublevel@5.

I'd submit a PR, but I'm not exactly sure if anything other than the version needs to be bumped in package.json

Possible move to the "workshopper" or "level" org

See workshopper/learnyounode#254 for context.

I'm moving learnyounode and my workshopper-* repos over to the workshopper org for better governance and collaboration and to help remove myself as the primary bottleneck to progress.

I'm unsure about whether to move this module or not since it's not in the same boat as learnyounode and there is also the "level" org that it could move to. This project hasn't been as active as I'd like and it hasn't been upgraded to the new workshopper and I don't know if there's even anyone else on here who's passionate enough about this project to put more effort in to it.

Any thoughts from collaborators?

I failed to install levelmeup

D:\NodeSchool>npm install levelmeup -g
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: no longer maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\bilal\AppData\Roaming\npm\node_modules\levelmeup\node_modules\string-to-stream\node_modules\readable-stream'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup\\node_modules\\string-to-stream\\node_modules\\readable-stream'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\bilal\AppData\Roaming\npm\node_modules\levelmeup\node_modules\string-to-stream\node_modules\readable-stream'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup\\node_modules\\string-to-stream\\node_modules\\readable-stream'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\bilal\AppData\Roaming\npm\node_modules\levelmeup\node_modules\leveldown
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.1 found at "C:\Users\bilal\AppData\Local\Programs\Python\Python312\python.exe"
npm ERR! gyp info find VS using VS2022 (17.8.34330.188) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\bilal\AppData\Local\Programs\Python\Python312\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup\\node_modules\\leveldown\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\bilal\\AppData\\Local\\node-gyp\\Cache\\21.1.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\bilal\\AppData\\Local\\node-gyp\\Cache\\21.1.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\bilal\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\21.1.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup\\node_modules\\leveldown',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\levelmeup\\node_modules\\leveldown\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Users\bilal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
npm ERR!     import gyp  # noqa: E402
npm ERR!     ^^^^^^^^^^
npm ERR!   File "C:\Users\bilal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
npm ERR!     import gyp.input
npm ERR!   File "C:\Users\bilal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
npm ERR!     from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\bilal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:515:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22631
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bilal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\bilal\AppData\Roaming\npm\node_modules\levelmeup\node_modules\leveldown
npm ERR! gyp ERR! node -v v21.1.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\bilal\AppData\Local\npm-cache\_logs\2023-12-22T20_17_58_030Z-debug-0.log

Having trouble installing—"fetch failed"

Hi, I'm interested in doing this workshop, but I can't get it to install! I've installed stream-adventure and other workshops with no issues. However, when installing levelmeup (even with sudo), I get this error:

screen shot 2015-07-14 at 7 42 39 pm

Tried on Node 0.12.4 and latest io.js

Installation failing

Seems like there's a problem building leveldown. I've installed node-levelup without a problem, it would seem to me that updating the levelup / leveldown packages could fix the problem.

At global scope:
cc1plus: warning: unrecognized command line option "-Wno-unused-local-typedefs" [enabled by default]
make: *** [Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory `/home/yoshua/.nvm/v0.11.12/lib/node_modules/levelmeup/node_modules/level/node_modules/leveldown/build'

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/yoshua/.nvm/v0.11.12/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:107:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
gyp ERR! System Linux 3.8.0-37-generic
gyp ERR! command "node" "/home/yoshua/.nvm/v0.11.12/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/yoshua/.nvm/v0.11.12/lib/node_modules/levelmeup/node_modules/level/node_modules/leveldown
gyp ERR! node -v v0.11.12
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm http GET https://registry.npmjs.org/bl
npm http 304 https://registry.npmjs.org/bl
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls leveldown
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.8.0-37-generic
npm ERR! command "/home/yoshua/.nvm/v0.11.12/bin/node" "/home/yoshua/.nvm/v0.11.12/bin/npm" "install" "-g" "levelmeup"
npm ERR! cwd /home/yoshua
npm ERR! node -v v0.11.12
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/yoshua/npm-debug.log
npm ERR! not ok code 0

~   23s

batch excercise

I implemented the batch excercise as

db.batch(lines.map(function (line) {
        var parts = line.split(",")

        parts[0] = parts[0] === "PUT" ? "put" :
            parts[0] === "DEL" ? "del" : parts[0]

        return { type: parts[0], key: parts[1], value: parts[2] }
    }))

It might be cleaner if the file container "put, ..." and "del, ..." so that I can pass parts[0] directly into the db.batch command

#11 (Sublevel): workshopper(?) not finding key.

Output is as follows:

josie@dignity:/var/www/javascript/dankify/levelmeup$ levelmeup verify 11sublevel.js
Verifying "Sublevel"...

ACTUAL:   "ERROR: NotFoundError: Key not found in database"
EXPECTED: "ERROR: NotFoundError: Key not found in database"

josie@dignity:/var/www/javascript/dankify/levelmeup$ 

"ACTUAL" line is in green, but as can be seen, no feedback on pass/fail. Subsequent run of levelmeup shows Sublevel still uncompleted.

npm WARN deprecated [email protected]: Please update to the latest object-keys

Not sure if you are aware of this, but I installed this using the following command:

npm install -g levelmeup

and what prints is something about a deprecated object-keys:

npm WARN deprecated [email protected]: Please update to the latest object-keys
> [email protected] install    /usr/local/lib/node_modules/levelmeup/node_modules/level/node_modules/leveldown
> node-gyp rebuild

  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/db_impl.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/db_iter.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/filename.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/dbformat.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/log_reader.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/log_writer.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/memtable.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/repair.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/table_cache.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/version_edit.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/version_set.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/db/write_batch.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/helpers/memenv/memenv.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/block.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/block_builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/filter_block.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/format.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/iterator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/merger.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/table.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/table_builder.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/table/two_level_iterator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/arena.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/bloom.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/cache.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/coding.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/comparator.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/crc32c.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/env.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/filter_policy.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/hash.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/logging.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/options.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/status.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/port/port_posix.o
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.14.0/util/env_posix.o
  LIBTOOL-STATIC Release/leveldb.a
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.1/snappy-sinksource.o
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.1/snappy-stubs-internal.o
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy-1.1.1/snappy.o
  LIBTOOL-STATIC Release/snappy.a
  CXX(target) Release/obj.target/leveldown/src/batch.o
  CXX(target) Release/obj.target/leveldown/src/batch_async.o
  CXX(target) Release/obj.target/leveldown/src/database.o
  CXX(target) Release/obj.target/leveldown/src/database_async.o
  CXX(target) Release/obj.target/leveldown/src/iterator.o
  CXX(target) Release/obj.target/leveldown/src/iterator_async.o
  CXX(target) Release/obj.target/leveldown/src/leveldown.o
  CXX(target) Release/obj.target/leveldown/src/leveldown_async.o
  SOLINK_MODULE(target) Release/leveldown.node
  SOLINK_MODULE(target) Release/leveldown.node: Finished
/usr/local/bin/levelmeup -> /usr/local/lib/node_modules/levelmeup/levelmeup.js [email protected] /usr/local/lib/node_modules/levelmeup
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected],, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected])

Thank you

Basics get

module.exports = function (databaseDir, callback) {  
       var result = []  
       // your code...  
       result.push()  
       // more code...  
       callback(result)  
     } 

Should be :

module.exports = function (databaseDir, callback) {  
       var result = []  
       // your code...  
       result.push()  
       // more code...  
       callback(err, result)  
     } 

For sake of clarity, I would also add

The store will contain up to 10 entries with keys in the form:
key[X]
Where '[X]' is an integer between 0 and 100.

The store will contain up to 10 entries with keys in the form:
key[X]
Where '[X]' is an integer between 0 and 100. Keys are key1, key2, key3, etc.

Took me a loooooong time to get it and I had to review solutions from past version...

But thanks for the work ! Interesting ;)

'Error: {error.mod.not_function}' on first level lesson

Hi,

Attempting the first lesson and i have this module defined as '01-level-module.js'

module.exports.someFunction = function someFunction(x,y,callback) {
  callback(null,"ALL YOUR "+x+" ARE BELONG TO "+y);
}

and my client code in '01-level.js' is

var levelme = require("./01-level-module.js");

levelme.someFunction(process.argv[2],process.argv[3],function(err,result) {
	if(err) {
		return console.error(err);
	}
	console.log(result);
});

When i run "levelmeup verify 01-level.js" using node v6.10.1, i get this error

# LEVEL ME UP SCOTTY!

## ALL YOUR BASE (Exercise 1 of 12)

ALL YOUR verify ARE BELONG TO 01-level.js
 # FAIL Your solution to ALL YOUR BASE didn't pass. Try again!


    Error while running run, cause: 
    
    Error: The module doesn't return a function
        at createErrorTemplate (/usr/lib/node_modules/levelmeup/node_modules/exec-module/lib/createErrorTemplate.js:16:15)
        at Timeout._onTimeout (/usr/lib/node_modules/levelmeup/node_modules/exec-module/lib/execAsync.js:32:19)
        at ontimeout (timers.js:380:14)
        at tryOnTimeout (timers.js:244:5)
        at Timer.listOnTimeout (timers.js:214:5)

─────────────────────────────────────────────────────────────────────────────

The full error is

Could not run: Error while running run, cause: 

Error: {error.mod.not_function}
    at createErrorTemplate (/usr/lib/node_modules/levelmeup/node_modules/exec-module/lib/createErrorTemplate.js:16:15)
    at Timeout._onTimeout (/usr/lib/node_modules/levelmeup/node_modules/exec-module/lib/execAsync.js:32:19)
    at ontimeout (timers.js:380:14)
    at tryOnTimeout (timers.js:244:5)
    at Timer.listOnTimeout (timers.js:214:5)`

Can anybody suggest what I'm doing wrong?

Wrong problem description for Exercise 12

Fetch the value from the data store with the key multilevelmeup and print
it to the console.

Description for exercise 12 asks to print value to the console, but it actually requires it to be passed into callback function.
Also nothing is said about IN parameters for this exercise module.

The debug text with some of the exercises make levelmeup run * confusing.

Eg. I get this code for the batch exercise. When you're trying to print your own debug code out too, it can throw you off:

 Σ levelmeuptest$ levelmeup run batch.js
batchable12 = Install with very commonly did twelve hours there will be slower than a specific LevelDB Logo]  phone : chunk[3] : First does splitting and the checksum is for example used for war propaganda buf buf return a native buffer to another log file are stored directly by user isn't root.
batchable13 = While keeping you sure there's a capturing groups.
batchable35 = check for that wage-earners would be written at the way they can be obtained by consuming them ------------------------------------------------- : output formatter by default fill the in-memory store rather than providing tastes which would have open at a paradise in which they are reserved for future wars or preparation for future wars still waiting for you: * the match filenames for which this formatter or writable but not enough for everybody and filters ------------------- *New BSD Licence].
batchable36 = createValueStream.
batchable42 = cc and highly paid.
batchable78 = forum/node-levelup/decompression library!
batchable86 = Good nature is now /tmp/important.
batchable87 = } }X{ /SiblingPage * lt;Your name aliases and vice-versa.

Wrong problem description for Exercise 3

This description is wrong:

Your module could look like:
module.exports = function (databaseDir, callback) {
    var result = []
    // your code...
    result.push()
    // more code...
    callback(result)
}

Original description, asks that callback(result) is invoked using one parameter, but it actually requires two callback(error, result)

Description should be:

Your module could look like:
module.exports = function (databaseDir, callback) {
    var result = []
    // your code...
    result.push()
    // more code...
    callback(error, result)
}

keywise should be more descriptive

/home/raynos/projects/nvm/v0.10.12/lib/node_modules/levelmeup/problems/keywise/setup.js:27
c.repos.forEach(function (repo) {
^
TypeError: Cannot call method 'forEach' of undefined
at /home/raynos/projects/nvm/v0.10.12/lib/node_modules/levelmeup/problems/keywise/setup.js:27:15
at ReadStream. (/home/raynos/projects/nvm/v0.10.12/lib/node_modules/levelmeup/problems/keywise/setup.js:47:32)
at ReadStream.EventEmitter.emit (events.js:92:17)
at _stream_readable.js:910:16
at process._tickCallback (node.js:415:13)
at process._tickFromSpinner (node.js:390:15)

I only inserted rvagg!repo and never instead the rvagg key therefore it messed up the code because it never ran https://github.com/rvagg/levelmeup/blob/master/problems/keywise/setup.js#L40

Deploy latest version

@workshopper/deploy It would be cool if we could publish the latest version of levelmeup, would you mind giving it a look?

Clarify (maybe in the workshop) the need for node_modules

Perhaps it's just that it's late at night.. but with the levelmeup run * and levelmeup verify * I was a little unsure of whether I need to npm install level or whether the levelmeup program was going to handle all this automatically for me.

It's probably a minor thing, but I had to stop and think for a minute.

Can't install levelmeup

Hello,
I can;t install levelmeup on either one of two macs I tried this on. one is running El Capitan, the other has Yosemite

I've installed the latest node/npm package on both from the node.js website (4.2.2)

npm install levelmeup -g
npm ERR! tar.unpack untar error /Users/karimnseir/.npm/levelmeup/0.1.11/package.tgz
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "levelmeup" "-g"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.7
npm ERR! path /usr/local/lib/node_modules/levelmeup
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/levelmeup'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/levelmeup']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/levelmeup',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/levelmeup',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53',
npm ERR!      'FSReqWrap.oncomplete (fs.js:82:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/karimnseir/Dropbox/FYP/Project/Android App/MotionData/npm-debug.log

Is it possible to make installation less painful for people on Windows?

I wanted to give this a try, since I'm new to node.

Well, to install this, since it depends on node-gyp, I needed to install Python, find out that I need the obsolete-since-6-years-ago Python 2.x instead, and go through a nightmare of installing and uninstalling Visual Studio and Windows SDKs (I have the 2013 version, but it seems I will have to uninstall that first).

This is an utter nightmare to install. I could name many bad things about PHP, but requiring everyone to install a lot of old Visual Studio stuff even if it was Windows Server or if they have the most recent version already? I can imagine many people have given up on Node just based on how ridiculous setting it up is.

Can't you guys just include binary packages for Windows or something? (Also, as someone who has a Raspberry Pi, I can imagine compiling database packages on it on-demand for each project would be loads of fun).

error installing in windows 10

This is the log generated when I tried to install levelmeup on windows 10
C:\Users\HP>npm install -g levelmeup
C:\Users\HP\AppData\Roaming\npm\levelmeup -> C:\Users\HP\AppData\Roaming\npm\node_modules\levelmeup\bin\levelmeup

[email protected] install C:\Users\HP\AppData\Roaming\npm\node_modules\levelmeup\node_modules\leveldown
prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.1.2
prebuild-install info looking for local prebuild @ prebuilds\leveldown-v1.6.0-node-v48-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\HP\AppData\Roaming\npm-cache_prebuilds\https-github.com-level-leveldown-releases-download-v1.6.0-leveldown-v1.6.0-node-v48-win32-x64.tar.gz
prebuild-install http request GET https://github.com/level/leveldown/releases/download/v1.6.0/leveldown-v1.6.0-node-v48-win32-x64.tar.gz
prebuild-install WARN install unable to verify the first certificate

C:\Users\HP\AppData\Roaming\npm\node_modules\levelmeup\node_modules\leveldown>if not defined npm_config_node_gyp (node "C:\Users\HP\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at Object.failNoPython (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:482:19)
gyp ERR! stack at Object. (C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\HP\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\HP\AppData\Roaming\npm\node_modules\levelmeup\node_modules\leveldown
gyp ERR! node -v v6.10.2
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
C:\Users\HP\AppData\Roaming\npm
`-- (empty)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'prebuild-install || node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the leveldown package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! prebuild-install || node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs leveldown
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache_logs\2017-04-30T19_22_02_836Z-debug.log

Is the latest "Basics: GET" exercise too complex?

Taking feedback from @timoxley and @dominictarr I've reworked the "Basics: GET" exercise. This is the first exercise after they have performed their first trial level operation in the second exercise; so it needs to be a little more complicated than a single get().

Is it too complex though? Read the problem statement here: https://github.com/rvagg/levelmeup/blob/master/problems/basics_get/problem.txt and solution here: https://github.com/rvagg/levelmeup/blob/master/problems/basics_get/solution.js

There's a couple of things going on here: The range is bounded, so it's not open-ended which @timoxley thought was a problem, but you still have to deal with NotFoundErrors so you get a basic understanding of dealing with entries that don't exist. Also, the keys are not ordered nicely for you to just do a ReadStream if you knew how (the talks prior to the workshop at nodeconf will introduce readstreams so even newbies may be tempted to use them to solve this). There will always be a key <10 along with keys >10 but your <10 entries need to come first in your ordering. Just an incentive to make the user do a get() to solve it. But have I overcomplicated or is this a nice introductory challenge?

Also, if you feel you can make the solution slightly more elegant without making it more complicated then go for it!

"OpenError: IO error: lock" Permissions issue?

Everything worked dandy for the first three exercises. I have simple code for the fourth PUT exercise:

var pathToDB = process.argv[2],
    toParse = process.argv[3],
    level = require('level');
    db = level(pathToDB);`

But running it gives me an error.

Running "Basics: PUT"...

events.js:72
        throw er; // Unhandled 'error' event
              ^
OpenError: IO error: lock /tmp/~levelmeup_1_20302/LOCK: Resource temporarily unavailable
    at /usr/lib/node_modules/levelmeup/node_modules/level/node_modules/level-packager/node_modules/levelup/lib/levelup.js:114:34

I saw this issue. The error might be related to permissions? In my working directory npm install level gives me a Error: EACCES, open so I run sudo npm install level

So two part question I suppose.

  1. how do I get rid of the OpenError: IO error: lock for the fourth exercise?
  2. If sudo npm install is the root of the problem (no pun intended), how do I install level db without the sudo?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.