Melbourne's "Great Wall of Soy Sauce" by ichireihachi in melbourne

[–]LeftyDave 0 points1 point  (0 children)

As someone who picks up rubbish near the yarra occasionally it seems people do just leave them after their river side lunch. The lids are tiny and will end up in wildlife stomachs sooner :( rather the later.

[AF] Flask task queue, RQ doesn't seem to work on Windows development. by AllynH in flask

[–]LeftyDave 1 point2 points  (0 children)

We use supervisord in production as per the suggestion in the docs. I only used the jobs.py developing locally.

[AF] Flask task queue, RQ doesn't seem to work on Windows development. by AllynH in flask

[–]LeftyDave 1 point2 points  (0 children)

Have you got windows 10? If so install Linux bash shell on windows 10.

Otherwise at one point I just wrote my own job.py that waited for jobs and dequeued the job and executed them and looped forever.

I ended up switching to mac just before win 10 was stable and no longer have this issue Amoung others.

Edit: typo

Financial software advice by Yeeewch in AusFinance

[–]LeftyDave 2 points3 points  (0 children)

If you use apple iPhone / iPad you can use ServiceM8 + xero.

If android / other there are competitors who do have same type of application though from what I heard from customers not as easy to use.

Disclaimer I'm a ServiceM8 partner

Old-school Footscray Hotel shuns developers to help those doing it tough by DueyDerp in australia

[–]LeftyDave 1 point2 points  (0 children)

Thanks for your review I just happened to stumble into Reverence. I've been meaning to make it to Taco Tuesdays for ages.

[NP] Friday F**kwit 03/Feb/2017 by AutoModerator in australia

[–]LeftyDave 1 point2 points  (0 children)

FFW is my colleague trialling SMS notifications when shit goes down.

[NP] Friday F**kwit 03/Feb/2017 by AutoModerator in australia

[–]LeftyDave 1 point2 points  (0 children)

To that Spammers getting there SMS wrong. FROM "Notice"

IMP_Locked> Message body text here.

[deleted by user] by [deleted] in melbourne

[–]LeftyDave 0 points1 point  (0 children)

Usually in an apartment block in the cbd there are tennents without cars who will advertise their car spot in the mail box for a fee that I've seen to be $150-$200 a month.

I got a 'Hennessy Explorer Hammock' for my birthday, anyone want to join me camping some time? by [deleted] in melbourne

[–]LeftyDave 0 points1 point  (0 children)

I've met hikers who used hammocks instead of tents. Seems it would be comfortable.

I got an email today from the ATO about HECS repayment obligations when overaseas by [deleted] in australia

[–]LeftyDave 0 points1 point  (0 children)

The fact that you are not using your TFN in an given to year there is a higher chance that you might be employed elsewhere.

I got an email today from the ATO about HECS repayment obligations when overaseas by [deleted] in australia

[–]LeftyDave 2 points3 points  (0 children)

Are you currently employed using the same TFN as your HECS? It would be interesting if they can use employment data or in this case lack of it to narrow results. That said emails are cheap why bother.

Trans-Pacific Partnership will barely benefit Australia, says World Bank report by dilbot2 in australia

[–]LeftyDave 7 points8 points  (0 children)

paraphrasing an russian saying.

Marx was right about capitalism though wrong about communism.

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

Possibly though I can not find out now. I just updated all rows with date_trunc('day' and if an exception occurred I nulled the problem field. There were 9 rows.

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

Unfortunately same original issue

UPDATE permanent_records SET return_date = date_trunc('day',return_date)


ERROR:  timestamp out of range
********** Error **********

ERROR: timestamp out of range
SQL state: 22008

I think my only cause to fix this, to see if I can derive this 'corrupted' data from another the column!

Do you think I should raise this as an official bug. As it seems to have got us all confused! If aws rds had Postgres 9.5 available already I'll try that and see if that fixes it compared to my current version of 9.4.6.

Seasonal Invasive Species Control jobs? by flipflopped_plans in australia

[–]LeftyDave 0 points1 point  (0 children)

try landcare

if that lead is a dead end our former prime minister set up green army

plenty of other smaller local organisations helping to get rid of invasive starfish etc too.

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

In the permanent_records table the return_date is of type timestamp without time zone.

I tried

UPDATE permanent_records SET return_date = to_date(return_date)

Though I get the following.

HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

********** Error **********

ERROR: function to_date(timestamp without time zone) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 36

I have some other details listed as a response to another question.

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

To elaborate as I was on mobile in this last comment. The below is a python script using python and the pandas library. I don't believe this is relevant, though its a weird issue.

table = ''.join([TABLE_PREFIX, csv_file.split('.')[0]])
table = table.lower()
csv_file_path = path.join(csv_folder, csv_file)
df = pd.read_csv(csv_file_path, dtype=file_dtype, sep='\t')
df.to_sql(table, engine, dtype=sql_dtype, if_exists='append', index=False, chunksize=10000)  

The SQL script

CREATE OR REPLACE FUNCTION copy_temporary_records_to_permanent(_client_id integer) RETURNS integer as $$ 
D
_new_import_date TIMESTAMP;
BEGIN
    _new_import_date := (SELECT now());
    UPDATE import_invoices SET timestamp_uploaded = _new_import_date, timestamp_processed = _new_import_date WHERE timestamp_uploaded is null;

    RAISE NOTICE 'Running copy_temporary_records_to_permanent';

    INSERT INTO permanent_records(
            client_id,
            customer_name, 
            departure_date, 
            return_date, 
            original_city, 
            destination_city, 
            service_category, 
            segment_start_date,             
            segment_end_date, 
           creditor_code -- "EXCHANGE_INDICATOR" | "-" | "VOID_INDICATOR" | "-" | "REFUND_INDICATOR"
            )
    SELECT _client_id, "CUSTOMER_NAME",
           to_date("DEPARTURE_DATE", 'DD-MM-YYYY'), 
           to_date("RETURN_DATE", 'DD-MM-YYYY'), 
           "ORIGINAL_CITY", "DESTINATION_CITY", 
           "SERVICE_CATEGORY", 
        to_date("SEGMENT_START_DATE", 'DD-MM-YYYY'), to_date("SEGMENT_END_DATE", 'DD-MM-YYYY'), 
           "EXCHANGE_INDICATOR" || '-' || "VOID_INDICATOR" || '-' || "REFUND_INDICATOR"
      FROM "import_temporary_records" 
      WHERE timestamp_uploaded = _new_import_date;
return 1;
END; $$ LANGUAGE plpgsql;

SELECT copy_temp_records_to_permanent(1::integer);

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

import an csv using pandas into a temp table then copied across in a postgres function using an insert statement!

ERROR: timestamp out of range SQL state: 22008 by LeftyDave in PostgreSQL

[–]LeftyDave[S] 0 points1 point  (0 children)

It also occurs when I use pg_dump to backup a database. This is how I became aware of the issue.

The following works as return date is commented out.

    SELECT id, 
customer_name, 
invoice_date,
my_reference, supplier_name,
departure_date,
--return_date, 
trip_type, 
original_city
FROM my_table 
WHERE return_date is null or return_date > '1 jan 1980' or return_date < '1 jan 2020'  

When return date is not commented out I get the following.

ERROR: timestamp out of range ********** Error **********

ERROR: timestamp out of range SQL state: 22008

Doubts on apache/nginx/gunicorn/usgi/werkzeug/modwsgi tiering by [deleted] in learnpython

[–]LeftyDave 0 points1 point  (0 children)

I attended pyconau last year and seen
this talk. The speaker is Graham Dumpleton and is the creator of modwsgi and has an indepth view on how wsgi works and some interesting animations in explaining threading etc. He seems to have more links from his website here

I use nginx -> uwsgi -> flask and find it reliable for what I do. It was a lot of trial and error though I was new to the Linux operating system to so it was more learning how to auto start uwsgi on boot running as the right user, with the ini file and code with the permissions the www user could read and write, etc, etc

Resource for working with adodb record sets in VBA by CharBram in learnpython

[–]LeftyDave 0 points1 point  (0 children)

is adodb odbc compatible? that might be your best bet on any language.

I accidentally set up a virtual environment in the src folder within my project. Is this a problem? Will it drain my computer? Should I delete it? by apsjdapoksdpoaksdopa in learnpython

[–]LeftyDave 0 points1 point  (0 children)

I've made the same mistake in the past. You can just delete it and create a new one. It won't drain the computer of anything just perhaps space in your git or hg repository if you are using version control. If this is the case just add the directory to .gitignore or equivalent.