jeudi 4 août 2016

Urgent: ParseError: bad input [on hold]

Help:( whats wrong with this bit

remainder = sum1 % 10

if remainder == 0 :

PyQt - QScrollBar

Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks.

window.location.reload() used in my js page I am getting logout I am using spring security

I need to reload my page using window.location.reload() but I am facing logout. I am using spring security jquery

How to parse parse large .csv file in java? [on hold]

I want to parse different format large csv file and generate pdf based upon the csv file values. how to do this?

How to set the build description via Jenkins REST API or Python?

Is there any way (like Jenkins REST API or Python module) to set the existing jenkins build's build description ?

Many thanks :)

How to interface Python with Qlikview for data visualization?

I am using Scikit-Learn and Pandas libraries of Python for Data Analysis. How to interface Python with data visualization tools such as Qlikview?

Python 2 change the way to start a new process

Can I change the way Python 2 creates a new process, like what set_start_method does in Python 3 on UNIX based OSes?

How to make QPushButton editable text when one click on it?

Using Python 2.7 and PyQt4. So I need a way to make a text of the QPushButton editable when click on it, like on QTextEdit.

Django retrieve all rows from a table but the last three

I have the last three rows by using Book.objects.order_by('-id')[:3], is there a way to get all the rows excluding those three elements?

which site provide python packages?

i need some packages for data mining programming.Can you tell me which packages are good and also need trusted sites which contain the packages?

How I can make a python program search for updates?

I have a python script that I want it can search for updates and if there is an update, it downloads it and installs it.

Level_date into Singe cell

I am having One method that Methon return two date Object (eg : (datetime.date(2016, 6, 20), datetime.date(2016, 6, 26))). How to store this into single cell in a table?

Writing plot increments in Latex font?

Is there a way to type the increments on the x and y axes in Latex font, instead of just Arial?

Likewise, the legend?

how to install python for cygwin? Mine python's sys.platform == "win32"

My python in cygwin environment is: sys.platform == "win32"

But I want to use pexpect.spawn(...) method which is not available on win32 platform.

What features would a *perfect* Python debugger have?

Please tell me which features you wish your current Python debugger had. I'm creating a new Python IDE/debugger and am looking forward to challenging requests!

How to get mouses scrollX value from a point of event's call in jQuery?

I need to know mouse scrollX value not by left window's border, but by element that has triggered an event. Thank you, i rely on you guys!

Do something only once Python

I have this sequence of numbers 12345 do something 12345 12345 12346 do something 12346 12346 12346 12347 do something 12347 12347 12347 The numbers are repeated unknown number of times I just need to do something on the first change

how to listen docker events and run command when new event emit?

I know docker events command can listen docker events, but how to watch docker events 's output and run command when have new output?

Installing pip on Mac OS X

I spent most of the day yesterday searching for a clear answer for installing pip. I can't find a good solution.

Can somebody help me install it?

How can convert YYYY-MM-DD hh mm ss into MonthName, date, year | Hour:Minuts (am/pm) in JavaScript or jQuery

I have date string (2013-03-10 19:43:55) and want to convert it in this format (Mar 10, 2013 | 7:43 pm) using JavaScript or jQuery. How can I do this ??

Onchange open URL via select - jQuery

What would be the best way to attach an event so on change of a select option a URL. Store the href in an attr and grab it on change?

How to increase the perfomance of R in machine learning?

I am using both R and python(Anaconda).When it comes to modelling,R is taking more time for the same operation.Is there any method for parallel operations or multi threading in R?

find google spreadsheet by title via api in python

I would like to retrieve data of spreadsheet by searching for the spreadsheet by name. I wonder how it works?

result = service.spreadsheets().values().get(title=spreadsheetTitle, range=rangeName).execute()

mercredi 3 août 2016

Writing multi-line strings into cells using openpyxl

I'm trying to write data into a cell, which has multiple line breaks (I believe n), the resulting .xlsx has line breaks removed. Is there a way to keep these line breaks?

How to compare two psv files through Robot framework; is it possible?

I have two psv (pipe-separated) files, I need to compare the data columnwise.

How can I compare those two files, is it possible to compare two psv files through Robot??

Python: How do you unit test a nested function?

How would you unit test the nested function f1() in the following example?

def f():
    def f1():
       return 1
    return 2

Or should functions that need testing not be nested?

Get Big Query Metadata

How can I get table meta data (Last Modified Time) in Big Query using Python?

I will use the BigQuery table only if its last modified datetime is greater than some datetime.

ImportError when importing scitools

I am using python 3.4, and every time I use scitools, I get this error:

  File "<stdin>", line 1, in <module>
ImportError: No module named 'scitools'

Checking network connection

I want to see if I can access an online API, but for that I need to have Internet access.

How can I see if there's a connection available and active using Python?

Use os.system in Python 3 script [on hold]

I would like to install matplotlib to Python 2.7 with a script that I wrote in Python 3:

os.system('c:\Python27\python.exe c:\Debug2.py') 

But nothing happens.

I am looking for a scroll bar jquery for my photo gallery [on hold]

enter image description here

Can anyone help me to find such gallery??

how can i adjust the delay timing of bootstrap slider changing

am trying to adjust the delay time of bootstrap slider. How can i adjust that please check the link http://bootsnipp.com/snippets/featured/responsive-bs-carousel-with-hero-headers

How to achieve this in python? [on hold]

I have something like this

उत्तराखंड |2

स्टेट |3

इंफ्रास्ट्रेक्चर |1

डेवलपमेंट |1

कॉर्पोरेशन |2

लि. |3

I want to achieve this:

1->इंफ्रास्ट्रेक्चर,डेवलपमेंट

2->उत्तराखंड,कॉर्पोरेशन

3->कॉर्पोरेशन,लि.

Get error when importing FuncAnimation from matplotlib.animation

I can't import FuncAnimation from matplotlib.animation. When I try to do it I get the error :

ValueError: insecure string pickle

I use matplotlib 1.5.1, Python 2.7, Mac OSX 10.11.3 , in Jupyter Notebook.

django.db.migrations.exceptions.NodeNotFoundError

When i run makemigrations command, i got this error:

Traceback (most recent call last):
 ...
django.db.migrations.exceptions.NodeNotFoundError: Migration products.0002_auto_20160618_1143 dependencies reference nonexistent parent node (u'products', u'0001_initial')

jQuery UI Datepicker - Multiple Date Selections

Is there a way to use the jQuery UI Datepicker widget to select multiple dates?

All help is appreciated! If its not posable to use the jquery UI datepicker then is there something similar that does?

Get by condition column values

I have following dataframe:

   A      B
0  1      5
1  2      3
2  3      2
3  4      0
4  5      1

How I can get by condition values of column A ?

For example all values that great then 3 and less then 6.

Difference between exit(0) and exit(1) in Python

What's the difference between exit(0) and exit(1) in Python?

I tried looking around but didn't find a specific question on these lines. If it's already been answered, a link would be sufficient.

Remove pre heades from csv before using DictReader - Python

Hi I have csv file like this here is some text some more text summary id score 1 33 2 22 3 11 detail id try score 1 1 22 1 2 11 2 1 10 2 2 12 3 1 11 I want to parse the data id, try, score which comes after detail to DictReader How can I do that?

Jquery Datatable Pagination : Listbox combine with Full numbers

I want to display listbox along with full numbers pagination ? anyone have idea how to combine both of them

Attached Image - for pagination

Starting jupyter notebook programmatically from another notebook

Is it possible to start another notebook from the current notebook? I know how to create and save the current notebook but I cannot launch another notebook from the current one. %run does not work while starting another notebook

Make footer menu collapse to dropdowns

Hostgator has a great way of making the footer collapse and only show the headers with accordion type dropdown for the links below it, when it's in mobile mode. How can I achieve the same?

Thanks Anton

When running a python script in IDLE, is there a way to pass in command line arguments (args)?

I'm testing some python code that parses command line input. Is there a way to pass this input in through IDLE? Currently I'm saving in the IDLE editor and running from a command prompt.

I'm running Windows.

What are the parameters sent to .fail in jQuery?

I can’t find the documentation on what the names of the three parameters are when $.ajax fails.

Right now, I’m just using:

.fail(function(A, B, C) {

How to turn a string into a dict in Python

I have a string

"{a:'b', c:'d',e:''}"

What would be the most convenient way to make it to a dictionary

{'a':'b', 'c':'d', 'e':''}

jQuery equivalent of MooTools' Scroll().toElementCenter()

I am adapting someone else's script to my site. The use MooTools; I use jQuery. Their code has the following line:

new FX.Scroll(window).toElementCenter('obj');

How would I do this in jQuery?

Python skip block of code if it take more then 2 second

I am new to python and I would like to ask if there is a way to skip a line of code in a python script if that line take more then a given time (like for 2 second) ? Thank you very much !

mardi 2 août 2016

How I can check whether a page is loaded completely or not in web driver?

I am writing some Java Webdriver code to automate my application. How can I correctly check whether the page has been loaded or not? The application has some Ajax calls, too.

I have declared an implicit wait for WebDriver.

python: IOError: [Errno 36] File name too long:

I want to create a file within tmpfs (under CentOS 6.5) like this: fpath = '/tmpfs_mounted/with/long/file/name' with open(fpath, 'w') as fd: write(somedata) ... But I got the IOError: [Errno 36] File name too long: ... error, How to fix it?

Given a python whl package, is it possible to retrieve it's development status information?

So I have a python .whl package, and I want to get the development status (dev, beta, release etc.) of it, is it possible to do that without scanning and parsing the setup.py file and only with the given package?

Get user input until Enter key is pressed twice

I want to get user input multiple times and store the input data together in a string until the user presses Enter twice. I think a for loop can work, but I don't know how to do it.

Specifying vertex position via coordinates in python graph-tool

Is it possible to plot a vertex at a particular position on the xy-axis by specifying coordinates? I want to have a square lattice of vertices without the edges between them (and then add edges later as I see fit).

Thanks

Micro:bit import songs? [Python]

Would it be possible to import songs from my desktop and play them on my micro:bit? I have configured my speakers for it and they work - but could it play actual songs? If so, how would I go about doing it?

How to find particular column unique values count in python pandas?

I have following dataframe.,

company,sector,marks
a,b1,21
b,b2,27
c,b2,20
a,b3,70

I have to display no of company,sector and sum of marks how do we take unique column value length in pandas

How to add image as watermark in microsoft document using Java?

Image Link

I have added watermark image in this document manually. Is there any way to add image as watermark in Microsoft document using Java or JavaScript(jquery) programming language ?

How do I show a constantly changing variable in python?

New to python. I have a variable called 'score' which changes constantly throughout the running of the program. Is there a way to show the variable at all times in a window/place so that the user can see their score changing? Thanks!

Host a Python based Websocket server

I am looking to host a basic Websocket server.

The code I want to see running is : FastFlicker

Do you know how and where I can host this application online?

How is list += implemented in Python?

What is its time and space complexity?

I haven't been able to find an authoritative answer elsewhere on the web.

Also, not sure why, but StackOverflow won't let me post this question until I write more text in this box.

How can one load an AppEngine cloud storage backup to a local development server?

I'm experimenting with the Google cloud storage backup feature for an application.

After downloading the backup files using gsutil, how can they be loaded into a local development server?

Is there a parser available for these formats (eg, protocol buffers)?

How to On webcam on page load in jquery webcam

I am using Jquery-Webcam-Plugin to capture Images. But every time when I load the page I have to click on "Allow" button of Flash file to start the webcam. I want to on camera on page load without clicking any button. How can I do it ?

how to get equation for nonlinear mutivariate regression in which one variable is dependent on other two independent variables in python

I have set of 5000 data points of like_so_ (x,y,z) for eg (0,1,50) where x=1,y=2,z=120.with help of these 5000 enteries,i have to get an equation in
which given x and y ,equation should be able to get value of z

How do I draw a grid onto a plot in Python?

I just finished writing code to make a plot using pylab in Python and now I would like to superimpose a grid of 10x10 onto the scatter plot. How do I do that?

How to resize image using Cropit js

Hi I am using cropit js library for image manipulation. I have new zoomed height and width of the image so i want to resize the image using cropit js to new height and width. enter image description here Could anybody help on how to do this?

The ouput of the code is 3. Can someone explain how?

def my_fun(x):     
    z = 0     
    for item in x:         
       m = x.count(item)         
       if m > z:             
           z = m     
       return z  

y = ["cat", 4, "dog" , "cat" , 2, "cat", 2] 
print (my_fun(y))

The ouput of the code is 3. Can someone explain how?

Adding a meta tag via jquery?

I need to add this meta-tag in the head section of the page as i need the page to force IE7.

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

I am using DNN 5.6

How can i do this?

Removing specific matching substring from a string python

I want to remove a matching substring from a string in python .

Here is what I have tried so far:

abc= "20160622125255102D87Z2"

if "Z2" in abc:
    abc.rstrip("Z2")
    print(abc)

But this doesn't work. Kindly help

Nagios alert over phone call

Does anyone has idea how can get Nagios alert over phone call using Python or any other method? Please share with me.

But except Pager-Duty which we are already using so am planning to create an alternate of PD.

Thanks in advance

Add space after first character of a string

I want to add a space to the first character of a string using jquery.

For example, I have a number "92030" and I want to replace it with "9 2030"

Is there a simple way to do it with jquery ?

Why is Spyder so slow in OS X? Is there a way to make it faster?

I have Spyder installed as part of the Anaconda Python analytics package and I'm finding the editor to be very slow. There's always a half-second lag time between key presses and the letter showing up on screen. I'm using Spyder on a fairly new i7 MacBook.

Why is this regex matching taking forever?

I'm trying to query html using the request python module and this is taking forever:

ad = re.findall(r'([^>]+)><a class=" td-n"([^>]+)>', str(soup_url))

Why is that so and how can I optimize this?

Why do I keep getting this invalid syntax error? [on hold]

def both_positive(x, y):
"""
Returns True if both x and y are positive.
>>> both_positive(-1, 1)
False
>>> both_positive(1, 1)
True
"""
If x > 0 and y > 0:
    Return True
Else:
     Return False 

What am I doing wrong?

lundi 1 août 2016

from Nondeterministic finite automaton-lambda to Deterministic finite automaton

How do I code a program that receives a NFA-l and throws the equivalent DFA in a .txt. I need to make this in Python, and I have no idea what to do. I can't implement the algorythm, because I have no clue how. Pls send help

Movement between Images in Gallery with Next & Prev Buttons

i have how many images in gallery.i would like to implement a previous and next button that i can movement between images. i have found this simple but it doesn't work(accepted answer). please you try. ٍsimple link

Open source alternative to MATLAB's InterX function?

Is there an open-source alternative to MATLAB's InterX function for intersection of curves? I'm rewriting a MATLAB program to use Python and this is the only function I haven't found an equivalent to. I know the function " Python curves intersection with fsolve() ". Is it similar to InterX in MATLAB

Retrieve data from jQuery Object

I am having problems with my jQuery object which I recieve from Ajax function.

console.log(data) ==> dumps {"isUnique":true}

and

console.log(data.isUnique) ==> dumps undefined

How should I get these "isUnique" data?

python beautifulsoup : lxml html.parser

I must use beautifulsoup, but i don't know which parser I have to take. I hesitate between lxml and html.parser, or why not both. How to know if a web page is lxml compliant ? How to know if a web page is html parser compliant ? Many thanks

How to debug a python function in ipython?

I have a python function, for example:

def fun():    
    a = 1.0
    b = a*2+1
    return b

But I want to debug it in ipython, so I want to watch all the variable a and b, like a global variable, how can I do this?

I don't know how to use vivus.js [on hold]

I am very new to web design.

I wanted to use vivus.js plugin animation for my svg, but i can't seem to make it work. i have added the vivus script in my svg code as well. can anybody help me with the code? thank you

Fetch entire set of twitter user IDs from accounts created at given date?

Cant find method from REST and streaming API docs for fetching entire set of user IDs from accounts created at a given date. Similar question asked here at twittercommunity in 2014 but still unanswered...

Sorry for bad english.

How to redirect urls using django on a raspberry pi hotspot network?

I have a raspberry pi hotspot running with internet shared through ethernet. I also have django installed and running with a basic application. I want to use django to redirect any http request to a different url based on the previous url. How can I go about doing this?

Anything slider Delay Appearance

I am trying to use the AnythingSlider to play two songs. I want the arrows to be disabled for 30 seconds so that you have to listen for 30 seconds before you can go to the next song. Does anyone know how to put a delay on the Anything Slider options?

Is there an "exists" function for jQuery?

How can I check the existence of an element in jQuery?

The current code that I have is this:

if ($(selector).length>0) {
    // Do something
}

Is there is a more elegant way to approach this? Perhaps a plugin or a function?

I am getting a syntax error when trying to lock a label in ClearCase in a python script

I am new to python and I am trying to execute a cleartool lock command.

Here is my code:

 def lock_label(lname):
        os.system('cleartool lock lbtype:' + lname'@vob:/cm_data/jupsw')

lname is my variable name

plotting from a data frame in pandas

Please I'm new to pandas and want to obtain a multiple time series plot with the dataframe below using TIMESTAMP as index.

TIMESTAMP shf_1 shf_2 shf_3 2016-06-18 09:20:00 24.98201 40.98293 18.75554 2016-06-18 09:25:00 24.59746 37.85617 18.11409 2016-06-18 09:30:00 24.93322 40.07658 20.18585 2016-06-18 09:35:00 25.79265 40.91981 21.60389 2016-06-18 09:40:00 26.49355 45.02221 23.86291 2016-06-18 09:45:00 25.65839 42.93957 23.56091 2016-06-18 09:50:00 28.22184 47.68266 25.76584 2016-06-18 09:55:00 28.68465 49.86813 26.68878 2016-06-18 10:00:00 25.28899 48.88993 26.958 2016-06-18 10:05:00 22.24257 43.74584 24.88566 2016-06-18 10:10:00 21.02077 39.90298 23.48933

How to stem a list of 1000 documents in python using PorterStemmer?

I am recently doing project in nlp using python. Where I need to preprocess a excel file which contains text with many row and column. I could became able to stem only simple sentence only. And couldn't able to stem whole excel file at once. How can I do that?

How to find the sum of an array of numbers

Given an array [1, 2, 3, 4], how can I find the sum of its elements? (In this case, the sum would be 10.)

I thought $.each might be useful, but I'm not sure how to implement it.

Problems with pip (python 2.7)

I am trying to install pandas library and have a problem with pip (the picture below). I`ve changed the name of computer (login, main directory) but nothing have changed.

UnicodeDecodeError: "ascii" codec can`t decode byte 0Xd2 in position 0: ordinal not in range <128> 

How to find number of vowels in each word of string using python

s=input("Enter a sentence: ")

emp = "" vow=0 for i in s: if i.isspace() == False: emp = emp+i else: for j in emp: if j in 'aeiouAEIOU': vow=vow+1 print("The number of vowels in",emp,"are",vow) emp = "" it only gives vowels for first word.

Python: How to read data from webpage and then write back from database?

I am a beginner. I want to read two inputs (probably from a slide down menu) from a web page and use them as variables to execute python program, then return the result to a database and also display it on the webpage. I`m using mySQL for database management.

jQuery popup min and max width/height

If I set the popup minWidth to 440 px (example), will the width automatically grow with the content? Do I have to write extra code to make it dynamically growing?

dialogDiv.dialog({
        title: "Confirm Delete",
        autoOpen: false,
        modal: true,
        draggable: false,
        resizable: false,
        closeOnEscape: false,
        minWidth: 440,
        minHeight:220,

I have written two separate files, one containing classes and the other calling them but calling one makes object of all. Why?

separate.py

    class foo():
       print 'a bunch of time consuming work'

    class tryme():
       print 'try me'*

main.py

from separate import *

foo()

It however printed both:

a bunch of time consuming work
try me

How can i write to a specific memory address using python?

I'm working in python in ubuntu. I have an object named packet which I don't have access to its fields. I want to somehow get its address in memory and write to an offset of that address. something like (in c): address=&packet address+=offset *address=0

any suggestions?

How to append variables to a string inside for loop in python?

I am trying to append variable inside for loop (cname[0].decode('utf-8')). In php we could do like this :

TotalData .= ",".$cname[0];

How we could achieve same thing using python ?(ouput be 1,2,3,,4)

for cname in match:
         TotalData .= ","+cname[0].decode('utf-8');

print TotalData

is it possible to use .stopPropagation() on .trigger() function?

How can I use the .trigger()-event together with .stopPropagation() ? I need to simulate a submit event without triggering the submit event.

$('.form .submit').trigger('click', function (e) {
    e.stopPropagation();
});

does not work. Is there any way to achieve this?

how to open chrome in incognito mode from Python

This works, in powershell:

Start-Process chrome.exe -ArgumentList @( '-incognito', 'www.foo.com' )

How can this be achieved from Python?

EDIT: Like this!

import subprocess
subprocess.Popen(["C:Program Files (x86)GoogleChromeApplicationchrome.exe", "-incognito", "www.google.com"])