2018-10-22         Scott

Iterating and Writing Pandas Dataframe NaNs back to MySQL

I'm attempting to write the results of a regression back to MySQL, but am having problems iterating through the fitted values and getting the NaNs to write as null values. Originally, I did the iteration this way:for i in dataframe: cur = cnx.cursor() query = ("UPDATE Regression_Data.Input SET FITTEDVALUES="+(dataframe['yhat'].__str__())+" where timecount="+(datafrane['timecount'].__str__())+";") cur.execute(query) cnx.commit() cur.close().....which SQL thew back to me by saying: "mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in ...

 python                     1 answers                     7 view
 2018-10-22         Scott

How can I convert a binary number into a string character using Perl script?

How can I convert a binary number into a string character using Perl script? If you mean binary to ASCII like this webpage, this should do the trick:#!/usr/bin/perl$binarySample = "01010100011001010111001101110100"; # "Test" in binary$chars = length($binarySample);@packArray = pack("B$chars",$binarySample);print "@packArray\n";output:Test [XXX]chr(0x41) or chr(65) turns the number 65 (41 in hex) into the letter "A", is this what you are looking for? [XXX]Strings can contain either binary data or text characters; nothing special is needed.Tell us more about what y...

 perl                     3 answers                     38 view
 2018-10-22         Scott

How SAML 2.0 SSO can be done by Service provider for an existing IDP?

One of the IDP who has setup on SAML 2.0 . How as an SERVICE PROVIDER I should configure the SAML and send them a call back url so that my login page should be called by them You need a client-side SAML stack.This will do all the plumbing for you. [XXX]

 php                     1 answers                     16 view
 2018-10-22         Scott

Create a zip with files from an AWS S3 path

Is there a way to provide a single URL for a user to download all the content from an S3 path?Otherwise, is there a way to create a zip with all files found on an S3 path recursively?ie. my-bucket/media/123/*Each path usually has 1K+ images and 10+ videos. There's no built-in way. You have to download all files, compact them locally, re-upload it, and then you'll have a single URL for download. [XXX]There is no single call you can make to s3 to download as a .zip. You would have to create a service recursively download all of the objects and compress them. It is impor...

 python                     3 answers                     74 view
 2018-10-22         Scott

Recalling information from dictionaries within dictionaries

So say I have a number of dictionaries within a dictionaryd = {'a': {'name': bob, 'class': 2a}, 'b': {'name': mike, 'class': 2b}, 'c': {'name': ben, 'class': 2b}}How would I go about identifying items within each of these internal dictionaries. Say I wanted to identify the keys of the internal dictionaries that were in 'class' '2b'. How would I code this so that it gave me the keys 'b' and 'c'???Thanks in advance. You need to loop over the keys of your dictionary and check each sub-dict.[k for k in d if d[k]['class'] == '2b']Out[16]: ['c', 'b']optionally,[k for k,v in d....

 python                     1 answers                     56 view
 2018-10-22         Scott

ORACLE expression is of wrong type on pipelined function (multiple joins table)

I'm writting a Oracle Package with a pipelined function to get multiple records, the query is about multiple joined tables, which that will save into another table, I created a TYPE RECORD and the TABLE TYPE for the type record, then I created the pipelined function with their query, but when I compiled the package I get an error "expression is of wrong type".Here are the definition package:CREATE OR REPLACE PACKAGE MYPACKAGE_PKG AS TYPE GLD_R IS RECORD ( ID NUMBER, PRCCVE NUMBER(7,0), LOTCVE NUMBER(7,0), EPCSEQ NUMBER(18,0), ...

 oracle                     1 answers                     54 view
 2018-10-22         Scott

Add Macro to all Google Sheets

I have a macro that I want to save for all my past, current, and future Google sheets as this is a repetitive task that I constantly have to do. For some reason, I can't seem to figure out how to save my macro to other google sheets. According to https://developers.google.com/apps-script/guides/sheets/macros at this time it's not possible to add a macro to all spreadsheets. The alternative is to create an add-on. [XXX]

 google-apps-script                     1 answers                     90 view
 2018-10-22         Scott

Select2 performance for large set of items

I'm using select2 jquery plugin with twitter bootstrap. It's working fine for smaller number of items. But when the list is huge (more than 1500 items) it really slows down. It's slowest in IE.Normal Dropdownlist works very fast with more than 1500 items. Are there any workarounds for this situation? You can make this work good even in IE8 with paginating the suggestions,Code:// Function to shuffle the demo datavar shuffle = function (str) { return str.split('').sort(function () { return 0.5 - Math.random(); }).join('');};$(function () { $('#e24').select2...

 jquery                     5 answers                     23 view
 2018-10-22         Scott

Accessing table from a sub-query inside an inner join - MySql

I am having an SQL query as follows -select * from Ainner join AA on A.id = AA.aidinner join AAA on ( select B.bid, B.bname from B inner join C on B.id = C.bid where C.aaid = AA.id) as B1 on A.id = B1.aidWhich gives an error Unknown column 'AA.id' in 'where clause'It will be very helpful if someone can tell me the reason and provide me with a possible solution. I believe that you need something like thisselect * from Ainner join AA on A.id = AA.aidinner join AAA on AA.id = AAA.aid inner join( select B.bid, B.bname, C.aaid from B inner join C on B.id = C.bid) as...

 mysql                     3 answers                     22 view
 2018-10-22         Scott

Issues updating a MySQL table using Python's MySQLdb

I am trying to UPDATE a MySQL table using Python's MySQLdb module. Although the query seems fairly simple it just won't update the information. Here is my code:for username,info in users.iteritems(): if info[0] > 0 and info[1] > 0: month = 8 year = 2010 cursor.execute(""" UPDATE users_disk SET bytes = %s, quota_in_mb = %s WHERE username = %s AND month = %s AND year = %s """, (info[0], info[1], username, month, year)) print "Username: %s; Rowcount: %d" % (username, cursor.ro...

 python                     4 answers                     82 view
 2018-10-22         Scott

Performance of timescaledb with large datasets

we are considering using timescaledb and we would like to know if it is suited to storing timeseries of arrays of data. One example is we record 350 floats 4 times a second over months. We would then like to extract a few days or weeks of daya. A single entry is 350xfloats = 350x4 bytes = 1.4 kilobytes. A week's worth is 1.4x4x60x60x24x7 = 3.386 gigabytes. How does timescaledb perform with such queries? Does anyone have experience storing and extracting timeseries datasets like this? Thanks you for your feedback / suggestions.Andy TimescaleDB allows storing your data val...

 timescaledb                     1 answers                     49 view
 2018-10-22         Scott

Gitlab: filtering commits with Since attribute also gives older commits

I'm trying to only get the commits of this day. I'm using CURL to make the request. I've tried ISO 8601 and RFC3339 but neither yield the result I'm looking for. $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://gitlab.example.com/api/v4/projects/ID/repository/commits", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Private-Token: PRIVATE-TOKEN", "since: 2018-09-03T00:00:00Z", "until: 20...

 php                     1 answers                     64 view
 2018-10-22         Scott

Windows Azure deployment problem

I'm having a problem with deploing my solution to Windows Azure.I've created a basic ASP.NET web role and tried to run that against my local DevFabric and everything is running perfectly. The ASP.NET site is reachable via a browser, I can see the valid results of executed code and everything is perfect.Later on, I tried to deploy that to Windows Azure, the exactly same solution that I run against my local fabric and it was deployed successfully. Azure "told" me that the solution is ready (the green icon).When I try to reach my service's url, I'm getting 10060 timeouts, as i...

 asp.net                     2 answers                     9 view
 2018-10-22         Scott

Select distinct on DocumentDB and C#

I am having a challenge retrieving data from my DocumentDB using C#.I get the expected results when I run the query below in my Azure DocumentDB data explorer. Ignore the use of contains query, it's a dynamically crafted queryselect distinct c.model from c where ( CONTAINS (c.manufacturer, \"BMW\") )Attempting to run the same query on c# gives me an errorvar dblink = UriFactory.CreateDocumentCollectionUri(ConfigurationManager.AppSettings["DocumentDbDatabase"], "Conversation");var models = _dbclient.CreateDocumentQuery<dynamic>(dblink, "select distinct c.model from ...

 c#                     1 answers                     68 view
 2018-10-22         Scott

Bad state: PostgreSQLSeverity.error : Specified parameter types do not match column parameter types in query SELECT to_regclass(@tableName:text)

I was following the Aqueduct (dart's web service framework) tutorial (https://aqueduct.io/docs/tut/executing-queries/) and then when i tried to run this command aqueduct db upgrade --connect postgres://heroes_user:password@localhost:5432/heroesi got an error:PostgreSQL connecting, heroes_user@localhost:5432/heroes.*** Uncaught error Bad state: PostgreSQLSeverity.error : Specified parameter types do not match column parameter types in query SELECT to_regclass(@tableName:text) **** Stacktrace * #0 __TransactionProxy&Object&_PostgreSQLExecutionContextMixin._...

 database                     1 answers                     31 view
 2018-10-22         Scott

How To Open Another Activity By Swiping

I am A beginner at android. I have created an app which loads news from JSON to recycler view. I want to open an activity when the user swipes from left to right. I tried different methods but it doesn't work for me. Please help. You have to create an activity first and put a view pager in it and switch between fragments : ( its better to use fragments at this kind of situations, u can swipe between ur fragments by using android view pager )Here is a great link that gonna help you :https://medium.com/@kyroschow/how-to-use-viewpager-for-navigating-between-fragments-with-t...

 android                     2 answers                     137 view

Page 1 of 145  |  Show More Pages:  Top Prev Next Last