appengine cloud storage compile error in demo project - google-app-engine

Following https://cloud.google.com/appengine/docs/go/googlecloudstorageclient/getstarted
fails when deploying
goapp deploy -oauth
with
app.go:78: cannot use google.AppEngineContext(c) (type "golang.org/x/oauth2".Option) as type "github.com/golang/oauth2".Option in function argument
I'm able to get the demo project to run by altering the import lines 33-34 in google.golang.org/cloud/examples/storage/appengine/app.go from
"github.com/golang/oauth2"
"github.com/golang/oauth2/google"
to
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
Most importantly, is this the right way to "fix" this (and should the demo project be / or have been updated by google?)
And if anyone has insight, if you could provide some context as to why there are (as it appears to me) multiple ways to refer to the same package that would be great as well.

Yes, the go subrepositories have been moved to golang.org/x/...
See the announcement: https://groups.google.com/forum/#!msg/golang-nuts/eD8dh3T9yyA/l5Ail-xfMiAJ
The problem with identifying the canonical import path will be addressed in Go 1.4: https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs
It seems there is indeed a problem with the examples. The oauth library refers to the golang.org/x/... paths with the recent commit.

Related

2SXC/DNN - Delete ADAM Files in Entity

We're designing a system for a client where they are allowing authenticated users to upload images. We've created an API to upload the files but the client only wants the latest file and delete all previous ones so that there would only ever be one.
We've looked through the docs and can't come across a way for ADAM to handle this in both 2SXC and DNN's file system.
Internally when deleting images we see API calls like the following to the internal 2SXC API, but we're wondering if this is exposed somewhere within the public API?
https://somedomain.com/api/2sxc/app/auto/data/61393528-b401-411f-a001-f423ea46700a/b7d04e2c-c565-496c-8efb-aa133cf90d33/Photo/delete?subfolder=&isFolder=false&id=189&usePortalRoot=false&appId=3
We could probably use the same endpoint above, but we'd likely run into permission issues or changes to the APIs that could be problematic.
Thank you for any advice you can give! Perhaps #iJungleBoy can provide some thoughts on this.
As a solution from a completely different direction, if you are on the later release of 2sxc (v12.8+, v13+), and comfortable programming in C#, you might consider doing this as a "cleanup" from a Dnn Scheduled Task. This can be done with a relatively easy setup. We have a Gist in place that we use as a starter. You simply put the code in the /App_Code folder then setup a normal Dnn Scheduled Task. NOTE that you can scroll down to the first comment on the Gist to see a screenshot of a complete working setup.
Accuraty's AccuTasks template on GitHub Gists
There are two more key things to note:
You need to install Dnn's CodeDom 3.6 because the example uses the later versions C#'s string interpolation - OR remove the few $"ASL2021 - {this.GetType().Name}, Task Scheduled Email", bits or convert to string.Format() or something.
Since your task's code is NOT running in a (2sxc) module, if needed, you'll do stuff like this: 2sxc Docs - Use 2sxc Instance or App Data from External C# Code
So, if you are comfortable writing code that "finds and deletes stuff older than NN days" - this might be the way to go.

The Babel-core module not working with Lingui

I am new to the concept of Localizing my react-application. After doing some research online, It seems as if jsLingui is the best library to use and implement translation on my React application. Following tutorials from https://lingui.js.org/tutorials/react.html , everything seems pretty straight forward. but when I run the command
$ lingui extract , I get the error :
module.js:557
throw err;
Error: Cannot find module 'babel-core'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25) .....
I have tried re-installing the babel-core , and it shows installed. Even when I check on my file system, I see the folder as node_modules/babel-core .
I also checked my package.json and I see "babel-core": "^6.26.3" as part of my devDependencies. Please any ideas around this will be helpful.
Beside, the pressing question, I also have a few other questions;
1) In the documentation, I am not sure on where to keep .babelrc file created. I hope it is suppose to be inside my babel-core folder.
2) When I was reading on the jslingui library, I discover that, they are still working on something that will help separate translations to be done page by page. I do not know whether this task is completed or still under development because, I am really interested in this one since my application really big and loading the whole translation at all times might become a real issue.
3) What if I have text in one part of my application which is exactly the same as in another part of my application, is it possible to write it in one section and call the id in another part to give me back the information?? or it is out of scope of the library .
4) I am building a social platform therefore I have information coming from the DB, which I do not know the content therefore such information can not be translated using jslingui just as it is. I will like to introduce some translation to this information( similar to what is happening on Facebook). I know this task needs some serious Artificial intelligence in the areas of natural language processing and machine learning. Please, Any good library that I can use to help my application translate only the portions of data provided to it( definitely information coming from DB)??. I have tried googling on this but I got nothing concrete( NB: I do not want Google Translate because, It will help to translate the whole page + names etc) which will mess-up the user experience of my application
jslingui
Thanks
I have tried re-installing the babel-core , and it shows installed. Even when I check on my file system, I see the folder as node_modules/babel-core . I also checked my package.json and I see "babel-core": "^6.26.3" as part of my devDependencies. Please any ideas around this will be helpful.
If you've installed #lingui/cli globally, please remove it and reinstall locally. If you use Babel 7 (your plugins/preset start with #babel/), then you need to install babel-core#^7.0.0-bridge.0 and #babel/core. Both locally as devDependencies. What also helped in some cases is good old turn it off and on again: rm -rf node_modules and reinstall everything...
1) In the documentation, I am not sure on where to keep .babelrc file created. I hope it is suppose to be inside my babel-core folder.
You should keep it in the root of your repository (next to package.json) unless you have specific needs.
2) When I was reading on the jslingui library, I discover that, they are still working on something that will help separate translations to be done page by page. I do not know whether this task is completed or still under development
It's still under development. However, it's a bit different - it helps you create separate message files, but not automatically. That's something we need to solve in further versinons.
3) What if I have text in one part of my application which is exactly the same as in another part of my application, is it possible to write it in one section and call the id in another part to give me back the information?
You have two options. Either you're using generated message IDs:
// App.js
<Trans>Hello World</Trans>
// Component.js uses the same message
<Trans>Hello World</Trans>
In this case, you only need to translate Hello World once, because messages are grouped when collected from source files.
Other option is that you're using custom IDs:
// App.js - define message
<Trans id="msg.hello">Hello World</Trans>
// Component.js - use message
<Trans id="msg.hello" />
4) I am building a social platform therefore I have information coming from the DB, which I do not know the content therefore such information can not be translated using jslingui just as it is. ...
I can't recommend any approach here, but it seems you need to use a machine translation. Either Google Translate or a better one, if you manage to find it. My guess it'll be either low-quality or expensive because as you said, this isn't a trivial task.

asp.net pages can use class library but site won't compile

I am using VS2012 Update 3 and have a solution containing three visual basic projects a class library, a conosole app, and an IIS website.
The website has a reference to the library project. The library compiles fine and automatically places the latest dll in the bin folder of the website.
This was all working without issue before this week.
My web pages are able to import and use the class library. I get proper intellisense and the pages browse or eventually browse showing they are using the library. This week sometimes I get a type not defined error with browsing but after waiting it works. But the compile is always a fail now.
When compiling sometimes the errors show in the error list then eventually disappear but at ALL times when building the errors show up in the output tab as:
SomeCodeBehindFile.aspx.vb(#,#) error BC30002: Type 'SomeTypeInMyLibrary' is not defined.
Error BC30002 - Type XXX is not defined did not help. I tried using fully qualified variable types versus using the import. I tried changing the identity on the app pool to Network Service which has read permission on the whole site.
I've also tried Visual Studio's build > Clean Solution and deleting all files from windows' framework Temporary ASP.NET Files.
The only thing I may have done to irritate VS would have been renaming one of my asp files and its class names/page directive attributes manually but I have done this before without issue. I got paranoid and deleted that file and re-added it also. I also have 3 pages complaining about types not being defined now.
Was really perplexed for awhile. It also got worse with the pages using the library permanently refusing to browse. Though if I copied the library and erroring pages in another web app it would work! Not knowing what went off the rails I started a fresh VB web site and was back in business for awhile but then it started again. I did not connect what I did that actually caused the grief in my 2nd site. For a 3rd time I started a fresh web site this time using C#. Going great again up until that point I kept shooting myself. Thankfully the C# compiler gave a more helpful error message: "A using namespace directive can only be applied to namespaces; 'StaffPlusLibrary' is a type not a namespace". Grrr the problem was I kept adding a help page to the site related to the class library and called the page StaffPlusLibrary.aspx. I am careful not to name pages the same as existing classes but it did not register in my mind I was about to create a page using the same name as my library's root namespace. So the page created a class using the same name as the namespace. The ambiguity I introduced was not apparent until C#.

Away3D & AwayPhysics: Content uses capabilities that require a license

Just grabbed all the Away3D branches from Github and included them in a test project I created in FlashBuilder. All runs fine, but if I run any of the files from the ‘awayphysics-examples-fp11’ collection, I get this dreaded message,
I’ve searched here and on Google, with Away3D included, for this message, but nothing relevant came up, so I’m sorry if this is already a known issue.
Is this just something I’ve just got to accept if I want to use Away3D and AwayPhysics?
The branches I'm getting the problem with are away3d-core-fp11, awayphysics-core-fp11 and awayphysics-examples-fp11.
And just to say, I understand Adobe's new models which stipulate that you must get a license to use both shared memory space (Alchemy and the like) and Stage3D. I'm questioning if there's a way to use Away3D and AwayPhysics without the Alchemy element, a lá (I've just found out) jiglibflash.
Don't use flash player. Using Stage3d in in a flash player app is a premium feature. http://www.adobe.com/devnet/flashplayer/articles/premium-features.html
Sorry for necroposting, but someone might find it useful, since google drops this link first on a few queries.

IMPORTANT: Remove this line from json2.js before deployment

I have an ASP.NET app in which I've used Vertigo's SlideShow 2 silverlight image gallery component. All was working well and the app went through testing and suddenly, after a recent deployment I get an alert box that says:
IMPORTANT: Remove this line from json2.js before deployment.
This pops up after the Silverlight component loads but then the SlideShow2 xap file seems to work fine after that.
Anyone have any ideas on why this would just start happening? I've done some research and can't come up with much and it's pretty mysterious that it just started happening. I've not directly used json2.js in this application nor have I customized the Slideshow 2 component in any way.
It also happens both in my dev and production environments.
-Kevin
Something like this?
From http://tech.groups.yahoo.com/group/json/message/1413:
Thu Dec 10, 2009 5:23 am
The server at JSON.org is getting
hammered. It turns out that there are
some sites that are linking directly
to json2.js instead of dispensing it
from their own servers. By far the
heaviest impact is from
onlinebootycall.com. My intention was
to provide the world with a free
implementation, but the world can buy
its own bandwidth.
So I have added this line as the first
line in the json2.js file:
alert('IMPORTANT: Remove this line
from json2.js before deployment.');
It will not break anything, but it
should help get a message to the
onlinebootycalls that you should not
load code from strange third party
servers. It is not safe.
- "Douglas Crockford" <douglas#...>
Don't link to json.js OR json2.js directly from json.org. It is bad etiquette, it uses their bandwidth for your site.
Copy the file to your own server, remove the line, and redeploy.
p.s. what are you using silverlight for at onlinebootycall.com? Curious... ;)
In doing more research (and taking a step back to evaluate my environment), the implementation of SlideShow2 I am using is a modified one from an opensource CodePlex project. This particular version supports streaming images and albums from Picasa's web albums. The version I'm using is located here: http://slideshow2picasa.codeplex.com/. In checking out their online dmeos they exhibit the same behavior so obviously this implementation is linking to the json2.js file on your servers as a means to interact with Picasa web.
Today I'll take at their code and see if I can rely on a local copy fo json2.js.
Thanks for helping me out.

Resources