I've been trying to write a typescript application in visual studio using node.js to store and access data in an azure table store.
I've been having some trouble with the tutorials I've found. I've yet to get one to work properly.
I have Node installed on my machine and a tablestore set up in azure.
I'm not exactly sure what needs to be done in visual studio to get all the necessary packages/modules/whatever installed correctly.
Many of the tutorials I've read have used express.js and or have "npm install"ed things and while I have no issue running the commands I don't really understand what I'm installing.
tl;dr I want to make an html page where I can submit and display items to/from azure table store using node.js, typescript, and visual studio
Also: I'd be willing to drop the typescript in favor of javascript if need be.
That tutorial looks like it might be based on the old Node storage package. We have recently posted a new storage library for node - which can be found here: https://www.npmjs.org/package/azure-storage. Also take a look at the following Getting Started to help get you up and running: Store structured data with Table storage.
I will follow up tomorrow to see what we can do to either remove the old tutorial or get it updated. Let me know if anyone wants to volunteer to update the old tutorial!
Jason
I followed this one (I'm assuming you probably tried this as well)
http://azure.microsoft.com/en-us/documentation/articles/storage-nodejs-use-table-storage-web-site/
To boil it down to just what you need in javascript ...
1.Create the table in Azure portal with appropriate data/partition key.
2.NPM necessary packages: azure, async
3.Add the following to app.js (change table_Users to whatever you want to name your table):
var azure = require('azure');
var storageClient = azure.createTableService("<accountname>", "<accountkey>");
storageClient.createTableIfNotExists("table_Users", function tableCreated(error) {
if(error) {
throw error;
}
});
var query = azure.TableQuery
.select()
.from("<tablename>");
//.where('completed eq ?', false); put criteria here.
storageClient.queryEntities(query, function entitiesQueried(error, result) {
// do what you want with result
});
Related
How can I detect if, for example, a browser is currently open?
I need this in my electron-application.
ty :)
I've found nothing like this online.
I've only found how I can check which window is open from the windows I have in my own application, but I need to know, what else is opened.
It should be something like this:
if(Application.isOpen('Google Chrome'){}
Unless someone has built a specific electron api to do this (which I can't find), then from electron...no. However, the beauty of electron being built with node.js, means that any node module should be able to do the job for you.
For example, ps-list should be able to get you all currently running processes.
psList().then(processes => {
console.log(processes)
})
Which gives a list for me, including:
Just be aware that you need node access from the electron thread attempting to use this lib.
This can easily be abstracted to do a name search in the list for you to get your desired functionality.
You can use find-process in case you need to search by given name, name pattern or pid.
I wanted to ask that for security reasons - we should be able to remove the meteor version information from the meteor_runtime_config section from the page source section and other headless browser/curl requests like below:
__meteor_runtime_config__ = {"meteorRelease":"METEOR#1.0.3.1"...
Especially so that known vulnerabilities are not exploited. This gives developers the some what time to catch to the new version especially with breaking changes to the code.
Here from a blog post back in 2014, 31 apps were reported to have removed the version number, so it is possible to do so.
A trick is to empty __meteor_runtime_config__.meteorRelease at the startup phase.
Meteor.startup( function() {
__meteor_runtime_config__.meteorRelease = undefined;
});
You can also remove the string assigned to meteorRelease in <application>/bundle/programs/server/config.json before you deploy your application. The information is extracted from that config file, which is generated by Meteor when it builds applications.
Can anyone tell me what GitHub APIs I should use for retrieving GitHub showcases? Thanks.
In order to get the list of GitHub showcases, what exact GitHub API should I use?
After I select a topic, to retrieve the repos under the topic (e.g. Made in Africa), what exact API should I use?
There's no API to list or GET a showcase.
I've taken a look and the closest you could get (which is still quite a bit far from your request) is to use the GitHub Search API. However, a list like the one you suggested, Made in Africa is completely curated and the parameters to get such results are not part of the search syntax, e.g. country of origin.
I'll keep an eye on this, and make sure to come back and correct the answer if anything changes.
While Github does not yet offer a showcase API, there is a node package available at https://www.npmjs.com/package/gh-explore that you can use to GET a showcase.
Get the module using npm
npm install --save gh-explore
Query for the showcase
const ghExplore = require('gh-explore');
ghExplore.showcases.get({ showcase: 'made-in-africa' }, function (err, showcase) {
console.log(showcase);
});
Although the question is marked with javascript and node tags specifically I thought it pertinent to mention that I am developing a similar library to achieve this in python 3. You can refer to the repo here https://github.com/victorbordo/gh-showcases
There's a javascript module/library for Apache Storm, but I don't recall seeing any examples using it. Looking at the library, I'm not sure how to implement an example BasicBolt that emits stuff. We have a custom Storm topology builder and manager, so I'm integrating and running a node.js bolt with that. I was able to get one running with the storm-node modules (https://www.npmjs.com/package/storm-node => https://github.com/STRML/storm-node, https://github.com/Lazyshot/storm-node). But I'd prefer to use the barebones main Apache Storm library if possible. I got as far as follows below. Am able to log a message to storm, but not able to emit data to the next bolt in the topology to consume. I'm thinking I am not calling the emit() function correctly. With storm-node, it was much easier to emit what I wanted. Any ideas what I'm doing wrong or missing?
var ExampleBolt = require("./storm.js").BasicBolt;
ExampleBolt.prototype.process = function(tuple, done) {
this.log("loggedamessage");
var data = JSON.stringify(tuple.values);
//originally tried something like this...
//this.emit([data]);
this.emit({'tuple':data,'anchorTupleId':tuple.values},function taskIdHandler(taskId){ return; });
done();
};
var bolt = new ExampleBolt();
bolt.run();
And unfortunately, the storm infrastructure I'm using does not report any useful runtime errors regarding the node bolt for me to figure out the problem.
https://github.com/apache/storm/blob/master/examples/storm-starter/multilang/resources/splitsentence.js
is a test split sentence bolt that is used as part of our tests. It should give you a good place to start.
I realize I can use the since parameter in my API call to determine which range of repos to download:
'https://api.github.com/repositories?since=0'
But is there a way to only pull the most recently updated repositories?
I checked out https://www.githubarchive.org/ but I could not find an easy to use command line interface associated with it. It seems like the only way to use it is to use Google's SDK. I am trying to get a list of all the most recently updated repos on Github using Node.js.
API init
self = None
assign = Null
'https://api.github.com/repositories?since=0'
'https://api.github.com/repositories?since=0'