w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
wamp server not running PHP code in javascript statements
Either try alert("<?php echo .... or check php.ini for short_open_tag = on, see here.

Categories : PHP

How can an application tell silently if it's running in the sandbox?
As you've mentioned, applications that are sandboxed are code signed. You can check for the presence of this with the commandline call to 'codesign'. Therefore, if your program can call out to the commandline with: - codesign -d --entitlements :- <path to executable> Retrieve the output from the command and search for the string: - com.apple.security.app-sandbox If the string exists, the running executable is sandboxed. Do this once in an initialisation function at the start of your application and store a flag that you can then test for later on. -------EDITED ---------------- I've not tested it myself, but just came across this article which includes code to check if the app is sandboxed. The full code can be found on github here. ---- EDIT 2 -------------- I've finally

Categories : Osx

Sandbox and running /usr/bin/purge using system()
The official word on NSTask and Sandboxing is 'some executables may work.' For me this translates to 'don't count on it'. There are a ton of questions in the currently down Apple Dev Forums about this and purge definitely seems to be one that is blacklisted.

Categories : Objective C

Java sandbox for running multiple JVM platform languages
Would it be possible to have a single server running the JVM to evaluate user code in serval different languages? Yes it would be feasible. Would this be at all efficient? I'm not sure why efficiency is a particular concern. It strikes me that running small examples for remote users does not require efficiency. Either way, my take is that it should be efficient enough. However, the real concern here is that this kind of service invites various kinds of abuse: People may be inclined to try and break your sandbox. And if you haven't implemented it properly (or if they can exploit some unpatched security flaw) they may succeed, and get into the rest of your system. People may be inclined to launch denial of service attacks. There are various things that a security sandbox

Categories : Java

Running a runtime compiled C# script in a sandbox AppDomain
The first thing that i'll check is if there are compilation errors (i had several headache caused by this issues) The second idea is about the resolution of assemblies. I always add as a security check an event handler for AppDomain.CurrentDomain.AssemblyResolve, where i seek on my known path for the missing Assemblies. When the not found assembly is the one i just compiled i add a static reference to it and return it. What I usually do is this: Create the new Assembly on file system with the compiler Load its content with the File.ReadAllBytes Load the dll with the Assembly.Load in the AppDomain in which i will be using the object Add the AppDomain.CurrentDomain.AssemblyResolve event Just in case (since i use this a lot) i created a small library to accomply this kind of things The

Categories : C#

running an ironpython script from python : sandbox, loadFromRemoteSources
OK I just figured it out. It actually works, the thing is you need to add a config file called ipy.exe.config containing the following : <configuration> <runtime> <loadFromRemoteSources enabled="true"/> </runtime> </configuration> see here -> How do I setup configuration when I use command line to build C#/.NET?

Categories : Python

Running PHP, Ruby or Python processes in sandbox mode
You should spawn another process using the multiprocessing module, then run the users code within that spawned process, thus keeping the inputted code "isolated" in another process. However, you should still keep in mind, you should always run this in a virtual machine because running it outside of one is unsafe on many levels. Using this method, you can lower the processes priority, since you are in linux, and this should keep each proc. from slowing down your overall machine while the timeout runs. This is assuming that you are indeed running a linux system.

Categories : PHP

Running Selenium Java Code on Server
Once you have downloaded selenium-server-standalone-{VERSION}. jar place it on the computer with the browser you want to test. Then from the directory with the jar run the following java -jar selenium-server-standalone-{VERSION}.jar Then create a driver object that connects to the Remote Webdriver server. This driver object can drive any operation similar ways on the remote server as you have been using driver object in your system. try{ if ( browser.startsWith("IE")) driver = new RemoteWebDriver(new URL("http://" + hostname + ":" + port + "/wd/hub"), DesiredCapabilities.internetExplorer()); else if ( browser.startsWith("FF")) driver = new RemoteWebDriver(new URL("http://" + hostname + ":" + port + "/wd/hub"), DesiredCapabilities.firefox());

Categories : Java

Javascript background running code
Javascript can only run one thread at a time, so when it is running console.log ("Blah") forever as fast as possible, it is unable to do anything else. A better way would be to use setInterval, e.g. var a = setInterval(function () { console.log("blah"); }, 1000); // Set the function to be called every 1000 milliseconds //(optional) some time later clearInterval(a); // Stop the function from being called every second. In general, a busy infinite loop ( while (true) { ... } ) is never a good idea. See https://developer.mozilla.org/en-US/docs/Web/API/window.setInterval

Categories : Javascript

Javascript code is running out of memory
You're decreasing i but checking if n > 1 . Essentially, you've created an infinite loop because you never decrease the value of n. The conditions within loops allow execution until they evaluate to false. In your example, the condition clause of the for loop will always evaluate to true and the loop will continue forever. Consider: for (var i = n; i > 1; i--){

Categories : Javascript

Server Code HTTp POST to remote server; Javascript API call
use the $ajax() function from jquery use urllib and urllib2 to access external resources from python. Call these libraries from within your view function Here's an example for the $ajax function: $.ajax({ type: "GET", url: '/htmlApi/sendSms/', data: { 'phone':'+12412354135', }, success: function(data){ $("#ajaxDestination").html(data); } }); here's an example of a view function that posts data to the remote server: def verify1(request): u = request.session['user'] u.phone_number = request.GET['phone'] u.save() apiUrl = "http://www.XXXXXXXXX.net/api/send.aspx?username=XXXXXXX&password=XXXXXX&language=1&sender=XXXXXX&mobile=" + request.GET['phone'] + "&message=" + 'ghis' + " is your verificatio

Categories : Javascript

Running code inside another thread in javascript
javascript(browser) is a single thread application, so even if you use a setTimeout at any point of time there will be only one thread running(doing script execution, ui repainting etc). Read more about how the timers work here Since you have a script running in every millisecond it will freeze up the thread thus blocking the UI

Categories : Javascript

Email Contact retrieivng code running well on localhost but not server
I would suggest changing your code to the following if(preg_match("/Auth=([a-z0-9_-]+)/i", $response, $matches)) { $auth = $matches[1]; } else { $auth = null; } You could set $auth to null or 0. But if you set it to null I would then instead check: if(!is_null($auth)) {

Categories : Codeigniter

Eclipse juno won't hit breakpoints in GWT server side code running in tomcat
Turns out that instead of debugging it as a Remote Java Application, debugging it as a Web Application works. Still need to ensure that its in fact getting deployed to the correct tomcat installation directory. I've unchecked "Run built-in server" in the Debug Configuration for the Web Application type project. I've also ensured that eclipse has taken control of the tomcat installation identified in preferences. Manually setting the directory was not allowed as I had identified it separately in eclipse as THE tomcat installation dir.

Categories : Java

Is javascript code on different browser windows running on same thread?
As per this explanation, by default, every tab runs a separate process http://blog.marcchung.com/2008/09/05/chromes-process-model-explained.html ... EXCEPT when two pages in 2 tabs are called from one another (e.g. a pop-up). In that case, they share a Renderer process (the model is called "Process-as-site-instance") If a web page pops up another webpage (via JavaScript), then the sites are considered connected, and managed by the same process. Chrome uses a single Renderer process to handle a browsing context.

Categories : Javascript

There is a way to do something like rails server --sandbox?
There's no build in way to do this. You can start rails console in sandbox mode (rails c -s), but not server. But... If the changes you want to be rolled back, are only changes in your data, you can just write your seeds data and populate database with them every time you run server.

Categories : Ruby On Rails

how do i disable javascript while running headless selenium server and using firefox?
in case of PhantomJs Headless Tesing you can do it like this public static void main(String[] argv) { // prepare capabilities Capabilities caps = new DesiredCapabilities(); ((DesiredCapabilities) caps).setJavascriptEnabled(false);//by default it was enabled ((DesiredCapabilities) caps).setCapability( PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "E:\browsers\phantomjs-1.8.2-windows\phantomjs.exe" ); WebDriver driver = new PhantomJSDriver(caps); driver.get("https://www.google.com"); } if you want to disable javascript in firefox programtically in selenium you can do it by creating profile FirefoxProfile profile = new FirefoxProfile(); profile .SetPreference("javascript.enabled", false); driver = new FirefoxDriver(profile );

Categories : PHP

WSO2 API Manager not directing to Sandbox based on Sandbox Key
When looking at your mentioned issue,I think you have used the 'PRODUCTION' scoped access token to invoke your SANDBOX endpoint. After you defined two different endpoints as sandbox URL and production URL when creating the API,to invoke them you need to use different access tokens based on its scope [PRODUCTION/SANDBOX]. To invoke SANDBOX endpoint from your API,you need to use SANDBOX access token. To find these production and sandbox endpoints related keys,you can navigate to APIStore->My Subscriptions page and view the keys under sections of 'production' and 'sandbox' in the particular subscription.And under each 'PRODUCTION/SANDBOX' keys section of subscriptions page,you'll see a separate access token and consumer key/secret. Try invoking your SANDBOX endpoint of API,with above shown

Categories : Api

Apple Push Notifications using Sandbox server and SNS
I use exactly the same set up and have no trouble with anything, the push works as soon as it is sent from the server. We also have it set up to send one at the same time everyday, and it sends it right on the dot at the same time every time.

Categories : IOS

Push Notifications on Apple Sandbox APN Server performing poorly
You can and should test your app with an ad hoc build, that works with the production APN server. That's the best way to test that the app (and push notifications in particular) is production ready. As for the sandbox env, perhaps the db used for the sandbox test contains some production device tokens, which cause the failures.

Categories : IOS

Sandbox server access denied in Java app (works fine with cURL)
Google has controversially blocked PayPal. A new system called PaypalX acts as a paypal API, and has been released 2 years after the block. You can read up more on this post and its links. Namely, it requires less URL manipulation, instead using higher-level actions regarding a transaction.

Categories : Java

Compiling and Running Java and C++ Programs from Other Java Program in SandBox environment
The only way to do what you want (securely) is to use some sort of virtualization technology to launch these programs in isolated vms (e.g. virtualbox and vmware). as noted in the comments, the java SecurityManager will not protect any code run outside of the java vm.

Categories : Java

Safely sandbox and execute user submitted JavaScript?
This answer is outdated as gf3 does not provide protection against sandbox breaking http://gf3.github.io/sandbox/ - it uses require('child_process') instead of require('vm').

Categories : Javascript

Enable an Ajax ComboBox using either javascript or server side C# code
I stumbled on how to solve this problem by trial and error. Instead of var IMEI = $find("<%=cbIMEI.ClientID %>"); I used var IMEIID = '<%= cbIMEI.ClientID %>'; var IMEI = document.getElementById(IMEIID); Doing this, IMEI.disabled = false; works perfectly. I don't at all understand why, but there it is.

Categories : C#

Can Intellij debug javascript code served by a local web server
Sure you can - you need using the JavaScript Remote debug configuration, set your 'http://localhost:50036/src/index.html' as 'URL to open' and specify remote URL mapping for your project folder (usually it's your web server root url + web path on server) See http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm#Installing_and_configuring_Apache_Web_server for more info Note that as of WebStorm 7 there is only one run configuration for JS debugging, and the run configuration created from right-click menu (action "Create/Debug" html file) uses the url on built-in http server instead of file url

Categories : Javascript

How can I lock UI while running the long running process in the main UI Thread in WPF (code in C#)
I would do it this way: Make a "global" (seen for UI thread and background thread) object of one of concurrent types. You can make it as singleton or pass an object to both threads All the long running thread does is reading data from concurrent object and process them. If main thread (or any other) need to do anything in background simply adds it to the concurrent collection. This kind of approach in concurrent programming is called Producer-consumer problem

Categories : C#

java scripts on my website running locally but not running on server
Uncaught SyntaxError: Unexpected end of input jquery.js:6 Uncaught ReferenceError: jQuery is not defined Check if you uploaded jQuery correctly. The file might have been truncated in the process. UPDATE Checking your jQuery file, the file truncates on line 6 with these as the last few characters. if(this[0]){var b=f(a,this[0].owne SOLUTION Re-upload the jQuery file (jquery.js) again, or Use jQuery CDN: Change: <script src='http://www.broadigital.co.ke/style/newcss/js/jquery.js?ver=1.7.2' type='text/javascript'></script> To: <script src='http://code.jquery.com/jquery-1.7.2.min.js' type='text/javascript'></script>

Categories : Javascript

Using Vim as a Javascript Sandbox: How do I write a buffer to node and read the result in another buffer?
Pursuant to Randy's comment, utilising vim-slime on top of tmux with the node REPL in the right hand tmux pane does indeed work. This is a pretty valid way to answer this question specifically, although I'm still interested in the vim-contained answer. Although I haven't set it up yet, I plan to make this a specific tmux config managed by tmuxinator.

Categories : Javascript

What program/s or application can compile my Java Server Code, Android Client Code and Asynctask code?
I'm not sure what you mean by your ASyncTask code as this would be part of the android code. Anyway, your android code can be run from Eclipse but you would need the Android SDK and ADT plugin for eclipse. Details of which can be found here. There are other IDEs but this is probably the most used and if you are beginner at android Google has all the documentation about eclipse which will make things easier. As for your java server, this can be run in Eclipse, but there are lots of other browsers that can be used, Netbeans is another example.

Categories : Java

Cursors running 100 times slower in SQL Server 2008 R2 than in SQL Server 2000?
After reading all the suggestions, I ended up doing some old trick and it worked miracles! I had this cursor which was taking almost 3 mins to run, while the enclosing query was instant. I have other databases with more complex cursors that were only taking 1 second or less, so I ruled out the global issue on using cursors. My solution: Detach the database in question, but ensure you tick Update Statistics. Attach the database and check performance This seems to help optimize all the performance parameters without the detailed effort. I am using SQL Express 2008 R2. Would like to know your experience.

Categories : Sql Server

cleanest way to insert javascript code in html (inside javascript code)
You have to append the result to the DOM. add this line at the end. $('body').append(anchor_element); You can ofcourse replace 'body' with any other selector as you like. $(function(){ var href = 'http://testing123.com'; var label = 'Anchor label'; var anchor_element = '<a href="' + href + '">' + label + '</a>'; $('body').append(anchor_element); // add the element to <body> }); working jsFiddle

Categories : Javascript

Running script on a remote server in bash working on 1 server, not on the other
It's just a guess but i would try this filename=hostnames > export.log while read -r -a line do hostname=${line//"} echo $hostname":" >> export.log ssh -t -t $hostname "bash -s" < script.sh >> export.log & done < "$filename" exit Just to make sure you don t get stuck on one server.

Categories : Bash

basic javascript object and mime regarding a basic web-server code
Expanding on Jared's comments above. Using the single quotes in both the HttpServlet constructor and the MimeMap initializer is likely just the original authors style preference. There are times when this is necessary. For example when using a name that isn't a valid per the syntax rules or is a reserved javascript keyword. From A Survey of the JavaScript Programming Language: In the object literal notation, an object description is a set of comma-separated name/value pairs inside curly braces. The names can be identifiers or strings followed by a colon. Because of an error in the language definition, reserved words cannot be used in the identifier form, but they can be used in the string form. For example: { 'my name here': 'bob', '0': '', 'ne

Categories : Javascript

Using PHP site to post javascript code and it translates the code, resulting code doesn't work
I've revised your code. This should work <script language="javascript" type="text/javascript"> //<![CDATA[ var counting = 0; var totaltime; var audio; var timeout; function start_playing(a,b){ audio = document.getElementById(b); counting++; audio.play(); if(counting == 2){ document.getElementById(a).value = "No Plays Left"; document.getElementById(a).disabled = true; }else{ document.getElementById(a).value = "Playing"; document.getElementById(a).disabled = true; totaltime = Math.round(audio.duration)*1000; timeout = setTimeout("enable_button('"+a+"')",totaltime); } } function enable_button(a){ document.getElementById(a).value = "Play"; document.getElementById(a).disabled = false; } //]]> </scr

Categories : Javascript

How come the mex code is running more slowly than the matlab code
I'd suggest that if you can, you get in touch with MathWorks to ask them for some advice. If you're not able to do that, then I would suggest really reading through the documentation and trying everything you find before giving up. I've found that a few small changes to the way one implements the MATLAB code, and a few small changes to the project settings (such as disabling responsiveness to Ctrl-C, extrinsic calls back to MATLAB) can make give a speed difference of an order of magnitude or more in the generated code. There are not many people outside MathWorks who would be able to give good advice on exactly what changes might be worthwhile/sensible for you. I should say that I've only used MATLAB Coder on one project, and I'm not at all an expert (actually not even a competent) C prog

Categories : C

how to keep a node server app running on windows server
I'm not sure about running node in iis. However, you can take a look at the node packages forever, pm2, and nodemon, which will recover the instance in case of failure. Here's how to install node.js as a service Here's something on installing node in iis 7.5 Just an update. I've been using iisnode at work for the better part of a year. I would recommend it if you are deploying to Windows.

Categories : Node Js

imacros how do I play another javascript file after finish running a javascript function
If I understand your question right, it is that you want to load another javascript file using a function, to be able to execute functions defined in this file. This can be done using the following function. function loadJSFile(url){ var script = document.createElement('script'); script.setAttribute('src', url); script.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(script); } And load (play) the file like this: loadJSFile("anotherFile.js"); (don't forget the quotes)

Categories : Javascript

javascript console object is running on javascript engine?
console.log() is a native function – a function implemented by the host that is exposed to Javascript. All DOM methods are also native functions. You can see this from console.log.toString(), which returns "function log() { [native code] }".

Categories : Javascript

Is there a similar server side IDE for Python (like Spyder) similar to running R-studio server?
If you are using Rstudio-server, unfortunately similar tool like that is not available. The closest to rstudio is Ipython notebook: http://ipython.org/ipython-doc/stable/interactive/notebook.html

Categories : Python

Deploying code first code migrations based web app to server, but it's not creating the database
Well, one problem you have: you're defining both Integrated Security=True (i.e. Windows authentication) as well as User ID=...;Password=.... (i.e. SQL Server authentication) in your connection string. Choose one or the other - but not both at the same time! If you do have that user myUser specified as a login in your SQL Server, right now, it will not be used, because the Integrated Security=True setting will prevail ... So change your connection string to: <add name="Context" connectionString="Data Source=ServerDbInstance;Initial Catalog=blahblah;User ID=myUser;Password=myPassword" providerName="System.Data.SqlClient" /> and see if now, you're myUser user will be used.

Categories : Sql Server



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.