toDerInputStream rejects tag type 123 - google-app-engine

I am trying to run the Get started with Datastore example at https://developers.google.com/datastore/docs/getstarted/start_java/ trying it both from the command line and from Eclipse.
In both environments, it is not able to connect to datastore and gives an I/O error message 'toDerInputStream rejects tag type 123'.
Looking around, this may be because the private key file is in json format and perhaps it should the p12 - other than that the error message draws a blank.
Could anyone point to something that would help me past this?

You need to use PKCS#12 format, as you said, p12. There's a few other people with similar errors (although they're trying to accomplish different things). I hope this helps, let us know if it resolves the issue.
Push Notification in Java expect p12 file
toDerInputSteam rejects tag 66

Related

Date not resolving in camel simple expression

New to Camel. I'm trying to get the current DateTime to be a part of a filename. The key bit is here:
.to(s"sftp://$sftpStr/&fileName=MyFile_${date:now:yyyyMMdd}.csv&noop=true")
sftpStr contains the relevant path. But the Date expression throws an error on compilation. I'm sure it's something simple and stupid I'm doing, but it's not clear to me why this doesn't work.
There is a related thing I don't understand, which might help give context to my confusion. I tried this:
.log(LoggingLevel.INFO, LOG.getName, s"Route Started! Time = ${date:now:dd-MM-yyyy HH:mm:ss z}")
which threw an error. But I took away the s tag in the string, and it worked fine. I thought the s just signaled to read the string that follows as a simple expression.
To reiterate, basically just looking to capture the current date/time in a filename (and I can't just create a variable using, say, java.time.LocalDateTime.now() or whatever for reasons too annoying to get into). I included the bit about the log to hopefully contextualize my confusion.
Thanks!
In the statement that you write the problem i believe is $sftpStr. I think that this cannot be resolved.
If $sftpStr is a property then you should use {{$sftpStr}}.
If it is header then you should use ${header.sftpStr}.
I propose to use headers for both folder and file name. Something like:
from(...)
...
.setHeader("folder", constant("the value"))
.setHeader("CamelFileName", simple("${date:now:yyyyMMdd}"))
.to("sftp:username:password#{{ftp.server}}/${header.folder}&noop=true");
In the above ftp.server is a property that holds the SFTP host.
Hope that will help.

Cant able to access WinBUGS code in R using R2WinBUGS

I have the model specification in WinBUGS and I have specified all the parameters, initials in the R console. While using the bugs() function say,
bugs(data, parameters, initial,model.file="c:/ProgramFiles/WinBUGS14/sample1",n.chain,n.iters,bugs.directory="c:/ProgramFiles/WinBUGS14/")
I'm getting a warring message saying, "c:/ProgramFiles/WinBUGS14/sample1" does not exist. Can anyone help to crack this, please?

Uglifyjs unexpected token name error

Attached is an image of what I am receiving when I try to bundle my project for production. I am receiving a Unexpected token name <<Object>>, expected punc <<,>> message as shown in the image.
Terminal output of error
Not sure what the issue is but I have tried to use uglify-es and uglify-js and get the same error. I even attempted to make a simple app using es6+ code to see if uglify-js worked and it did. So some of the older threads on the internet mentioning that uglify-js won't handle es6+ code might be irrelevant now. I also read somewhere that the newest version (3.x) does support it but haven't been able to confirm that.
I would love to show some code but not sure what relevant piece of code I need to show. As per the image it also mentions the line, col, pos etc... but the code on that line does not start at the col number mentioned.
I will definitely update this post as I investigate but any tips or ideas would be great!
So the issue is now resolved after some thorough research. It looks like the line 1665 I was looking at in my non-optimised bundle app.js was not what I needed to look at (obvious since the column index was way off).
So instead I decided to output the bundle generated code that FuseBox was working on and it was in-fact different. This is the line I added in node_modules/fuse-box/quantum/plugin/BundleWriter.js inside the uglifyBundle function to output the content so I could read it clearly.
fs.writeFile('bundle.txt', bundle.generatedCode);
The output in bundle.txt that was the issue and my actual TypeScript code is shown here:
// bundle.txt line 1665
this.wholesalerSettings = [object Object]
// actual project code
constructor() {
this.wholesalerSettings = process.env.WHOLESALERSETTINGS;
this.API = this.setHostUrl();
}
So I took a look in my fuse.ts file and noticed I was not parsing the json object correctly.
public get wholesalerSettings()
{
const wholesaler = require(`./src/~/wholesalers/${this.wholesaler}/config.json`);
return JSON.stringify(wholesaler);
}
// then down in the environment plugin
EnvPlugin({
WHOLESALERSETTINGS: this.wholesalerSettings,
IMAGE_PATH: this.imagePath
}),
Once I parsed the object correctly with JSON.stringify it worked perfectly as process.env.WHOLESALERSETTINGS was now a JSON string instead of an Object.
First time I really dealt with devops stuff but was fun and at the same time highly stressful. I guess the main thing I learned is when you are dealing with tooling and third party tools (FuseBox uses uglify-js) then you need to take a closer look at the input that is being given to that tool rather than the output like I was at first.
UglifyJS says it sees Object where it's expecting a ,, so we can infer:
The code you wrote (or generated by some other tool right before uglifyJS processes it, e.g. babel? Though you probably don't use babel since your uglifyJS deals with es6 directly) is "Object" where the error occurs.
It's expecting a ,, so the error is occuring at some place like multiple variable declaration, let foo, bar, or object/array definition, [1, 2] {foo: 1, bar: 2}

How to debug delete() in CakePHP

how to debug delete() in CakePHP? When I do:
debug($this->Sessions->delete($s));
I get this error:
{
"message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column \u0027session_id\u0027 in \u0027where clause\u0027",
"url": "\/api\/sessions\/delete\/2856",
"code": 500,
"file": "\/var\/www\/vendor\/cakephp\/cakephp\/src\/Database\/Statement\/MysqlStatement.php",
"line": 39
}
EDIT: Figured out my problem, I had called the session_id column "sessions_id" in the table by mistake. I updated this, and it solved my problem. However I'd really like to know how to debug delete() and find() properly. I noticed there is a debugging console bin/cake console. Then help to debug stuff, but I dont know how to use it, and cant seem to find any documentation on this. Can anyone help out? Thanks.
The error message stems directly from the DBMS, not from CakePHP, and it tells you pretty much all you need to know about why the query failed, there's not really a way to get more info on that.
Unless you're talking about the line where the exception is being thrown, pointing to a specific line would be rather complicated, as in this case there isn't an exact line causing a problem, the CakePHP side is working perfectly fine, you just mis-configured/named things, which led to a non-working SQL query being generated.
I would suggest to use a proper IDE and a debugger like XDebug that can halt on exceptions, then you have your stacktrace and a bunch of contextual information right at hand, and you can easily step through the code. A plain stacktrace can also be found in the logs (/logs/*.log).

Export Data to file in GNU Radio Companion

I have run into a slight problem with GNU Radio. I inserted a “File Sink” block into GNU Radio companion. I was receiving data last week, but coming back to the classroom today, I am not able to execute the file anymore. Do you have any idea what is wrong?
Basically, what I am trying to do, is export data created from GRC file using a file sink block to export the data to a file. That file, using python to parse through the data, will then be uploaded to a database. My problem is now that I cannot execute the file to export the data.
Below is some data from the Python script associated with the File Sink
audiodata = gr.file_sink(gr.sizeof_float, "audio.dat")
self.connect(src0, audio)
audiodata = gr.file_sink(gr.sink(gr.sizeof_complex, "audio.dat")
Below is a link of my GRC File.
http://i58.tinypic.com/10wv78z.png
If anyone has a better way to export the data from GRC, please let me know.
The second line of python looks broken. Where did you get it from? I haven't seen a bug in GRC's python code generation yet, so this is surprising.
Regarding the red arrow: This most probably indicates that something is wrong with the data type of the file sink. You should set the type to float, set it back to complex, and see if that solved the problem. If it did not, then your GRC file is broken, and you'll either need to manually look at the XML or re-build it from scratch, sorry :(
I have not seen XML corruption in GRC, either, so please make sure your data storage is not corrupted.
I think the second line should be
self.connect(src0, audiodata)
The lines looks similar to Capturing Signals in GNU Radio.pdf available in internet

Resources