i want to ues intell api read a file(app.properties) from target project and read file content, Which API should I use? like this:
Related
How to run SCROM.zip file URL in objective c?
I download the SCORM API zip file and course zip file. But it's nothing to show index.html of course zip file. How can I run this course zip file with SCORM API zip in Objective C?
Basically you can't. First you can't "run" a zip file as it isn't runnable. You need to unzip it, and in the SCORM case what is inside will be a manifest file along with HTML files and their supporting assets. A particular HTML file (determined by the contents of the manifest file, imsmanifest.xml) will need to be rendered in a browser context, specifically one that supports a full JavaScript runtime. Additionally the SCORM RTE will need to be made available in that JS runtime.
See https://scorm.com/scorm-explained/technical-scorm/ for a lot more about SCORM.
I am using blogdown to build my site.
For a recent post, I wanted to keep a variable (config) out of the .Rmd post itself, because config contained sensitive authentication information. If I set config globally, but not in the .Rmd file itself, calling blogdown::serve_site() failed because config was not defined in the new session serve_site() creates when rendering the markdown files.
To accomplish what I wanted, I manually rendered the .Rmd source file with config defined in the global environment by calling rmarkdown::render("path/to/post.Rmd"), as suggested in how-to-use-objects-from-global-environment-in-rstudio-markdown. This successfully built the .Rmd file and produced the correct html output.
Now, though, I am unable to use blogdown::serve_site() to automatically build new posts on my site. It continually fails on the post that does not contain the required config variable. Is there a way to ignore the offending post? Or alternatively, a better way to do this?
Just like how you set global R options for blogdown (see Section 1.4 of the blogdown book), you can create config in .Rprofile under the root directory of your website project. The R code in .Rprofile will be executed before each Rmd post is rendered.
I am using scrapy to scrape a website and I can download the file from the page, however everything that is being download is a plain text file. How do I download it with it's extension type? I am downloading scripts and as such, having the proper extension type on my download is necessary.
For example, if I am downloading exploits from exploit-db, the link that I go to to download them would be for example: https://www.exploit-db.com/exploits/19832/
and the link i would extract from there to download from is https://www.exploit-db.com/download/19832 which will, if I click on it normally, download a ruby file. But through scrapy it gets saved as a text file. Is there a way to download it as a .rb through scrapy?
Just save it as filename.rb. All files are text/binary files. Extension is there just to tell your operating system what to use to understand that file.
(In some operating systems extension isn't even required since files have headers at the beginning of the file telling what they are)
You can do try this:
scrapy shell https://www.exploit-db.com/download/19832
Then in the shell or your spider just do:
with open('ruby_file.rb', 'wb') as ruby_file:
ruby_file.write(response.body)
Right now, i am working on a go ahead embedded web server. i have an old 2.1 version of this server, which was open source. i want to upload .json file which i create from the firmware, to the web server and then want the page to process that file using flot tool,and display a graph.but that version does not support file uploading capability. on internet i have found that the new version of this web server support the file upload capabilities, but i have not found a proper example which explains the syntax that i would use to upload the file. can any one tell me which functions of this new version i would have to use to get things working.
can any one give a proper full example.
You ask how to upload using goahead.
When you build the source, it should build a test executable called goahead-test. This uses test/test.c as a main program. Test.c defines an upload action handler that is invoked when you do a file upload to the url /action/uploadTest. This handler will echo back to the browser the various file upload details. You can cut/paste from test.c into your own main program.
just wondering if it's possible to include some files (one txt file in this case) in the app package that I need in the application folder. The thing is that I might use a piece of code that requires the license to be included in the app as a text file, and I think this would be one way to do it.
Thanks in advance.
Absolutely, it's really no different than including images for instance. And if you need to process the file within your app you can access it via its local path or explicitly use the ms-appx:/// protocol.
See How to reference content and How to load file resources for more details.
Just include the file in your project with Build Action set to Content. You can put it in any folder you like.
The file can then be accessed from the app either using the ms-appx: protocol or using the StorageFolder API:
var license = await Package.Current.InstalledLocation.GetFileAsync("license.txt");