Tagged Questions
1
vote
2answers
19 views
convert js regex into python regex
I'm working on a part of a project, which is repleacing http url's with https url's if possible.
The Problem is, that the regular expressions for that are written for the javascript regex parser, but ...
0
votes
3answers
23 views
How can I tell which of the two forms is submitted in Django?
I have a log_in and sign_up form in my home page. The log_in is set to display by default and the sign_up comes to view when a user clicks on Sign Up button. The two toggles, depending on the button a ...
-2
votes
0answers
27 views
How to convolve distributions in Javascript [on hold]
Using Python, I can convolve two 1-dimensional distributions like this:
import numpy as np
print np.convolve([1.0/6.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 1.0/6.0, 1.0/6.0],
[1.0/6.0, ...
-2
votes
2answers
30 views
how to make JavaScript read files name in a spacific folder? [on hold]
I want to make a slide show with images in it
and i want the JS code to read the files name in a spacific folder and show it in the website
so how can i do that
note that i'm using it for a site ...
0
votes
1answer
23 views
Execute javascript function attached to a html element in python
What I'm trying to do is what can be done in a browser by running this javascript: document.getElementById('foo').bar().
I don't know how to go about doing this in python. I used to do stuff with ...
0
votes
0answers
22 views
Having trouble with Jinja2 code to render a WebGL globe
I just started learning Jinja2 and I'm not sure if there's something wrong with the code, or there's something wrong with me actually approaching the render (i.e. I'm previewing the index.html file in ...
0
votes
1answer
21 views
Set Django CSRF_TOKEN with yui, but console says 'django.request Forbidden (CSRF token missing or incorrect.)'
I use this code in html:
<script>
YUI().use('node', function(Y){
var token = Y.Node.create("{% csrf_token %}");
YUI.Env.CSRF_TOKEN = ...
0
votes
0answers
31 views
How to use SinonJS with webdriver in python?
I like to use SinonJS to fake the browser's time running webdriver.
I use Firefox and code in Python.
The answer by Niels van Reijmersdal in this thread describes a rough sketch how to
achieve it: ...
2
votes
1answer
18 views
How to call Pyramid server from JavaScript
I have used pyramid to write a project. In a html page of the project, i want to use a button to call a python script, the python script is located in the path "myapp/Script".
I have this method ...
0
votes
0answers
11 views
Django geoposition the porblem of mapping field- GeopositionField() of model
I have used django -geoposition to mapping the location of my model. Everything ok then I try add model to the base using admin, I can see map in the admin . But then I try to render location field to ...
0
votes
2answers
32 views
Executing scripts from html using php
i have the follwing HTML with javascript calling a PHP file
<html>
<head>
<script type="text/javascript" src="jquery.min.js"></script>
<script ...
0
votes
1answer
26 views
How to feed lists from python into javascript?
I'm pretty new to Javascript. I was wondering, how does importing lists generated by Python work? Below is a rough version of what I'm thinking, I'm trying to import 3 lists into an HTML file using ...
1
vote
1answer
20 views
How can I get the data inside a javascript tag for a web graph, so I can make my own graph?
So far using the python libraries twill and beautifulsoup I was able to log into my utility company's website, and get to the page with my usage data for gas and electricity respectively. They ...
-1
votes
0answers
26 views
Call python functions from javascrpt and vice-versa [duplicate]
I have two files, one with python code and other with javascript (node) code (and not html + js). What I would like to do is call js functions from the python code file and vice versa.
Maybe what I'm ...
0
votes
0answers
14 views
How to get this form to send in Python Mechanize?
I have been working on this problem for a good 6 hours and I cannot for the life of me figure out why the form is not sending properly
br = mechanize.Browser()
br.addheaders = ...
0
votes
1answer
28 views
highcharts: A chart with 1 or 0 in Y axis
We have some PCs and IP-Cameras working and I wrote a python script to check all machines if they are up or not with pinging them. If machine is up result will be 1 and if it's down the result will be ...
1
vote
2answers
39 views
Bootstrap social buttons
I'm using social buttons for twitter bootstrap 2. For some reason, the Facebook "f" logo in the button is not showing up. Here is my front end code:
{% include "meddy1/header.html" %}
{% load ...
0
votes
0answers
25 views
Private chat using socket.io and django
I am trying to build the chat part of a system build using django. For that I thought of using this tutorial as a starting point ...
0
votes
0answers
23 views
Charts are not displaying in django website?
I need to display bar-charts in my Django project.I using Django-nvd3 to display charts.I manage to run bar-charts in a separate project but when integrate to my current project it not display the ...
0
votes
1answer
23 views
Python - How to export JSON in JS
I want to export a JSON string in python into a JS variable.
<script type="text/javascript">
var data = JSON.parse('{{ dataJSON }}');
console.log(data)
</script>
If I print the ...
0
votes
1answer
40 views
Create a PDF with content as Latex, text and images
I have a database and I want to create a form where a user can submit a query and create a PDF file with the results. The database has Latex and images as content and I cannot use simple libraries for ...
0
votes
1answer
20 views
How to send a form data from external html file to django?
Im trying to send a form data from an external html file (not inside the project of django) to a django database but i need to pass a CRSK token in that form, if i do it with a form inside project ...
-1
votes
1answer
29 views
How to parse text in websites that display additional text after clicking a button, but that text is not in the base html [closed]
I am trying to scrape all the blog links on this page:http://hypem.com/track/26ed4/Skizzy+Mars+-+Way+I+Live
You click more to reveal the links. However only one link is visible in the html source. I ...
0
votes
0answers
18 views
Best practices for integrating Backbone in Django
I am playing with Backbone and Django and I'd like to integrate them both in an application. I have been reading their documentation and playing with them but I have doubts on how programmers usually ...
1
vote
1answer
28 views
Make WebElement visible via Selenium with Python with JavaScript
I'm trying to upload a png via selenium. My Problem is, that the Input I need to use, is invisible to selenium, but not to the user. In the FAQ of Selenium they told me to use the JavascriptExcecutor ...
0
votes
2answers
18 views
How to click text area in Qwebview and python
I am using QWebView with python to create an automate application and I could select Qwebelements by tags and id, also it's easy to click buttons but I can't do the following
- click elements with ...
-1
votes
0answers
17 views
I can't make python click a javascript button and download a file [on hold]
I want to make a program in python that goes to a file hosting webpage and clicks a javascript button that says "download now", and then downloads a file! I managed to do this with selenium chrome ...
-1
votes
1answer
29 views
Scraping advice on Crawling and info from Javascript onclick() function
I've finally found a thread on newbie help on this subject but I am no way forward with resolving this issue, partly because I'm a newbie at programming :)
The thread is:
Newbie: How to overcome ...
0
votes
1answer
76 views
Running C in A Browser
I've spent days of research over the seemingly simple question: is it possible to run C code in a browser at all? Basically, I have a site set up in Appengine that needs to run some C code supplied by ...
0
votes
1answer
22 views
execute javascript after long running Django task
Suppose I have a Django website. On one page my function in views.py has to execute a process that may take 5-15 seconds to execute. Obviously I don't want to wait for this process to complete before ...
-7
votes
0answers
37 views
Save streaming data from a web site [closed]
I have a stock trading account that receives streaming stock price data. What I would like to do is save this streaming stock price data and save it to a file. Any suggestions would be greatly ...
2
votes
1answer
42 views
What is difference between javascript and python time stamp?
I have this javascript code:
(new Date()).getTime()
And this python code:
time.time()
The first one return some thing like 1410072754803 but the python return something like 1410077369.27 i need ...
0
votes
0answers
29 views
Google App Engine (DataStore) Referenced Entitydeletion
Consider the following data model in Google App Engine
class A(ndb.Model):
name = ndb.StringProperty()
b = ndb.KeyProperty(Kind='B')
class B(ndb.Model):
name = StringProperty()
now ...
-2
votes
1answer
39 views
How to select a value from an array (See discription for more info)
I am trying to encrypt some plaintext using a specific method. Given a key [4,5,6,7] and plaintext "This is some plaintext" First letter is T first number in key is 4 thus T becomes X by moving ...
-1
votes
0answers
19 views
Python regex equivalent for jQuery replace
I'm wondering if there is any similar option to break my lines with Python the way I would do it in jQuery.
Here is an example for splitting the lines for the comments in JavaScript:
var reg = ...
1
vote
2answers
29 views
understanding js code expression
var PgrtiJr = {
"TWfbR": +((!+[] + !![] + !![] + !![] + []) + (!+[] + !![] + !![]))
};
PgrtiJr.TWfbR -= +((+!![] + []) + (+!![]));
console.log(parseInt(PgrtiJr.TWfbR, 10));
I have above ...
1
vote
0answers
10 views
How to work with datetimes betwixt javascript, JSON, and python, and mongodb?
Colleague and I have scabbed together a little app that uses a bunch of JS in the browser, and communicates with a Tornado (Python3) server via JSON, the server uses mongodb as a backing store for ...
2
votes
1answer
26 views
Create a table, line-by-line of a dictionary using json.dump or pprint in django template [python]
I've been banging my head on desk on this for a while, not sure if I should trying going at it some more, or see a Doctor.
I query an API for json information. I've been using requests, and the neat ...
-1
votes
0answers
29 views
KeyError when uploading a file using ajax and python
I am having trouble passing file field to my python script using ajax.
When ever i am trying to pass file information using ajax from a from to python script, i am getting:
fileitem undefined, ...
0
votes
0answers
19 views
Django insert multiple objects with unique form
My django project is a kind of football league managerial.
Let's say I have a team and every player of the team is an object. Each team has 25 players. The tactics (18, 11 first-strings, plus 7 on ...
0
votes
0answers
39 views
Plotting distance from multiple values [closed]
I'm looking for examples on nearest/farthest neighbor-algorithms that can accomplish below. Also suggestions for implementation. Any ideas and methods using languages/software in tags are acceptable.
...
1
vote
0answers
15 views
Unable to display the events on fullcalendar in django app
Following the same steps as mentioned in using jquery fullcalendar in django app, I am still unable to display my events on the calendar itself. Need some advice on this!! I am kind of new to this and ...
0
votes
0answers
15 views
Using a proxy with JavaScript and other plugin requests in Qt
I'm trying to use a proxy with Python and Qt. I found it pretty easy to set up a proxy for the QWebView using QNetworkProxy.setApplicationProxy(), but had a lot of difficulty getting the proxy to work ...
0
votes
0answers
21 views
D3 On Click Show Slide Out Panel - Django, jQuery
Goal: When a node is clicked a slide out panel is displayed containing detail about that node.
I've gotten as far as sending the data to a view with an on click event. That data is then used to ...
-1
votes
1answer
31 views
Need to download a PDF using a url
I have a link to a page which has an embedded PDF. I want to download that pdf file using any code, but i cant. The only way to download it is by clicking on the download button, or setting the ...
-2
votes
0answers
14 views
How can i upload javascript programs to web using google app engine
i have recieved a file from my friend and he says it to upload it using gae
(google app engine) but i only know using python .I tried to embed javascript in html but did'nt work out for me. thanks in ...
0
votes
0answers
43 views
Image upload preview javascript
I am trying to make a image preview before upload. But when i am trying to upload them, there are upload only the latest ones.
Example: Firstly i upload 3 images(and it appears 3 file selected), then ...
1
vote
1answer
27 views
How to Call Python Visualization inside Javascript/HTML
I have a small web application done in HTML/JS. I wanted to use a Python Visualization inside in that application.
Executing Python component gives the HTML content, which I want to embedded inside ...
1
vote
1answer
17 views
Pyton POST request same JS/PHP
I'm not good in js/php, but i need to convert code below to Python.
Javascript version:
function api_query(key,keyId,url,post,body,signature,cb){var method='POST';
var date=new Date();
var ...
0
votes
0answers
26 views
How to handle scrollable pages like soundcloud.com using Matlab/R/Python?
I would like to retrieve a source code of the first N pages from soundcloud.com/explore, but the problem is that I have to somehow preload them first.
For now what I do is using some browser and ...