code check system using ace code editor and angularjs - angularjs

I am in the middle of a project where we want to use ace code editor embedded in the browser. I would like to implement it just like how codeschool or any other teaching platform do using ace library. I want users to solve a given prompt in the code editor and want to grab it and run some test in the background before giving the result back to the result window. I am new to this field and would like to get some advice from someone who has the similar experience. Can anyone let me know where I can start and like a brief summary of flow I should follow? e.g
user solve the prompt
user hit "Run or Submit" button
the code will be delivered to a server that handles the result or it will be handled on the client side.
give the user the result of the prompt.

Related

React log to UI instead of console

I have an native mobile application that loads my react application within a child iframe (not sure exactly how it does it), but this application injects some variables into the page as windows.xxxx
So in order to test my application (yes, this sucks a lot) I need to run the app on my phone, have it open up the URL on my development machine (aka http://192.168.10.10:3300).
Then to debug anything I'm forced to alert(var1) .. as you can imagine this is a pretty painful process and I really wish the parent application would provide something better than this.
Normally a simple option would be something like console.log(var1) but I can't see the console on my mobile device and my URL is being loaded withing this native app.
So:
1. Any suggestions on a better debug process would be welcome.
2. One idea that would help is if there was a react component that would simply
print to screen anything any console.log().
3. I guess another option could be some kind of remote logger, so that console.remotelog(debugServerUrl, var1) pushes debug messages to the listener which then displays the debug.
All of this if a pain of course, but hoping someone out there has a clever idea for me.
If you're already using ReactJS, an easy quick-fix might be creating a log file in the phone. This post details a quick and relatively easy way to save a string as a text file, and it would not be hard to put everything you want saved into a string.
Furthermore, This post details an implementation of the remote logging feature you vaguely referenced.
Also, if you want to capture stdout and stderr, check out this npm package
Ultimately, hope this helps, and good luck

How do I validate Inputed data in CRUD application using MEAN stack?

I am working on CRUD application and above one is snapshot of its design and
I have done validation for updating in this application.
I go through from here.
But I did not rectify my problems.
I want to validate it during inputing means when I does not input anything in text box then it would not add it in database and give proper error on console.
Below is my code Image:
You can try one of the following:
https://www.npmjs.com/package/express-validation
https://www.npmjs.com/package/express-validator
https://www.npmjs.com/package/jsonschema
https://www.npmjs.com/package/json-validation
Next time include code examples in your question. It's hard to give you any specific answer seeing only random screenshots of your editor windows with a tiny font as JPEGs.

Show windows form over locked screen

I'm developing an application to run in background. This application is used to capture user’s activity on their system. Application is working very fine.
Now, I need to display a windows form over locked screen. Just like this:
Can any one help me! How can I show any windows form over locked screen?
Not possible, for security reasons no application should be shown when the screen is locked.
The only thing remotely similiar might be a Kiosk App:
Is the Windows.ApplicationModel.LockScreen namespace available for non-kiosk use?
There are a few different things here that are probably confusing things. unfortunately they are not very common scenarios so documentation is lacking.
You can use the Windows.ApplicationModel.LockScreen namespace for customising the display of the lock screen. This can be used to change the wallpaper or notification counts. It is probably the most common form of lock screen customization as it can be done by any app.
You can also use the functionality in this namespace to create an alternative lock screen. This could have different behaviour to the process of swipe up and enter password/PIN or Microsoft Hello face detection.
Creating such an app and distributing through the store requires extra permissions than 3rd party developers typically have.
"Kiosk mode" apps are created as apps that run above the lock screen. Such apps have no real connection to lock screen replacements but are related in their use of similar underlying elements of the OS.
In terms of what you are trying to achieve, it sounds like you should be able to do this by declaring the windows.lockScreen extension and then using LockApplicationHost to do the actual unlocking. As mentioned above the lack of a way for 3rd parties to distribute such apps through the store means there is a lack of documentation in this area but it should be possible.
One thing to take note of in such an app is an under even greater memory/resource constraints than a typical app and so you should keep this in mind during your planning and development.
I know this is an old question but for anyone still looking:
It is a security risk don't do it.
If you still want to do it this could help: SampleHardwareEventCredentialprovider
You will have to play with WinAPI and CredentialProviders but it is working demo and will show simple windows dialog with a button at lockscreen

Handling clipboard and toast in QPython

I want to monitor android clipboard and display toast from QPython. Actually, I want to check the clipboard for any changes, if the clipboard has a particular string in it that matches a particular regex, I want to process it (the process is really simple, think of its complexity as converting to uppercase, or some similar easy operation) and display the resulting string in a toast. Also, the script should run in background, so that it can monitor the clipboard even if the foreground app is different (e.g. WhatsApp or browser).
I had written a similar native app, but unfortunately the corresponding Java library doesn't work anymore, so I have to rely on a python module that does the same job.
Is it possible to do this using QPython?
You may want to check out the androidhelper module in QPython, and sl4a module in QPython3.
Both have the ability to toast something on the screen, but not sure about clipboard.
I think you can set the clipboard data, and don't know how to get it.
Documentation can be found here

GTK+ How to ask for super user with prompt

I am developing an application with GTK+-2.0. I need to access /dev/mmcblk0 device but it needs super user priviliges. It is not user friendly to login as su in terminal and run the program.
I want to create a prompt window and ask for super user password and run the program with super user priviliges. GParted is a program which runs in that way and I want a smilar opening procedure.
How can I achive that? How can I get super user privilidges in program?
Regards
You could check the gksu page on live gnome, or if you want to use the policy kit framework you can google for sample programs (e.g. like this one).
Another way, more straightforward, would require the creation of a group (which would allow users to access /dev/mmcblk0) and ask root to add specific allowed users to this group.

Resources