2018-10-22         Suzanne

Can and How do you use RandomAccessFile with a file contained on an FTP server?

This problem pertains to JavaBy using RandomAccessFile I intend to be able to also modify the file without blanking it. The FTP protocol only barely supports random access reads and writes.That is to say, an FTP client can use the REST command to start reading or writing from a particular offset, but it will always truncate the file from that point. [XXX]

 java                     1 answers                     82 view
 2018-10-22         Suzanne

NSSetUncaughtExceptionHandler not catch all errors on iPhone

I'm using GTMStackTrace from http://code.google.com/p/google-toolbox-for-mac.I need a way to test end-user to send me errors when the app crash. I know how send data to my website but the problem is how catch all non-handled errors.I have this code:void exceptionHandler(NSException *exception) { NSLog(@"%@", [exception reason]); NSLog(@"%@", [exception userInfo]); NSLog(@"%@", GTMStackTraceFromException(exception)); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error unexpected",@"Info: Can't save record") ...

 iphone                     2 answers                     53 view
 2018-10-22         Suzanne

Django, randomization of "default" parameter of a model

I want to set the "default" value as a randomly generated String for the promotion_code part of my Promotion model, for that the code_generate function is used.The issue with the code below that it seems like default=code_generate() generates this random string once every server start thus assigning the same value. I can see that by the admin panel, every time I try to generate a new Promotion, it gives me the exact same string.#generate a string, which is not already existing in the earlier Promotion instancesdef code_generate(): while 1: from django.conf import ...

 django                     2 answers                     54 view
 2018-10-22         Suzanne

Allow Python modules to write to disk on AWS Lambda

I am using the Python module googlesearch on AWS Lambda but it is throwing an error - I suspect because it wants to write a cookie to disk according to a folder structure that isnt there on AWS Lambda.Also, AWS Lambda only allows writing to /tmp/ What to do? The only thing I can think of is to download the module code from github and integrate into my Python script - dont really want to go down that road... Thanks for any advice...Here is the AWS Lambda error report:Errno 30] Read-only file system: './.google-cookie': OSErrorTraceback (most recent call last):File "/var/task...

 python                     1 answers                     6 view
 2018-10-22         Suzanne

Why isn't this axis or title showing up?

I'm working on creating a polar chart and I can't get everything to show up how I want it.Can someone help me figure out why the axis and title at 2 o'clock isn't showing up? Any other tips to make this look better would be appreciated! Here's my code:import numpy as npimport pylab as plimport matplotlib.pyplot as pyclass Radar(object): def __init__(self, fig, titles, labels, rect=None): if rect is None: rect = [0.05, 0.05, 0.95, 0.95] self.n = len(titles) self.angles = np.arange(90, 90+360, 360.0/self.n) self.axes = [fig.add_axes(r...

 python-3.x                     1 answers                     6 view
 2018-10-22         Suzanne

GeckoFX Source Get DOM / hidden div elements

I am trying to replace the inner HTML of a specific div. Which shows up through the Gecko browser and view-source, but when the collection of elements is sent to a text box, the div is nowhere to be found. Here are some of the methods I have tried.. Any help is greatly appreciated..//NODES GeckoNodeCollection nodes2 = mainbrowser.Document.GetElementsByClassName("*"); foreach (GeckoNode node in nodes2) { GeckoElement element3 = node as GeckoElement; } GeckoNodeCollection nod = mainb...

 c#                     2 answers                     82 view
 2018-10-22         Suzanne

meaning of " for a in html('.l')" in python

I have been looking in the source code of howdoi. https://github.com/gleitz/howdoiIn here the extract_links_from_bing and extract_links_from_google had these kind of syntax.I tried to search online everything related to xml, element trees but the contructor like syntax is not found anywhere. Here is the functiondef _extract_links_from_bing(html): html.remove_namespaces() return [a.attrib['href'] for a in html('.b_algo')('h2')('a')]def _extract_links_from_google(html): return [a.attrib['href'] for a in html('.l')] or \ [a.attrib['href'] for a in html('.r')('a')]...

 python                     1 answers                     102 view
 2018-10-22         Suzanne

How to hide library source code in Google way?

For instance, I have a library and I would like to protect the source code to being viewed. The first method that comes to mind is to create public wrappers for private functions like the followingfunction executeMyCoolFunction(param1, param2, param3) { return executeMyCoolFunction_(param1, param2, param3);}Only public part of the code will be visible in this way. It is fine, but all Google Service functions look like function abs() {/* */}. I am curious, is there an approach to hide library source code like Google does?Edit 00: Do not "hide" a library code by using anothe...

 google-apps-script                     2 answers                     24 view
 2018-10-22         Suzanne

Query working in mySql and not working in Oracle

Below is the query which is working in MySQL and not working in Oracle.Here I need to get the latest Date and corresponding event from table r for every ID in Table a . ID is unique. SELECT a.name , a.spids , a.group , a.id , r.date,r.event FROM a LEFT OUTER JOIN ( SELECT id, MAX(date) AS latest FROM r GROUP BY id ) AS rev ON rev.id = a.id LEFT OUTER JOIN r ON r.id = rev.id AND r.date = rev.latest group by a.id order by ID; --------------------------------------------- *The error in Oracle is "Not a group by function" I read several blog...

 mysql                     2 answers                     77 view
 2018-10-22         Suzanne

How to properly use ThreeTenABP to get the time in milliseconds between two dates based on UTC

I'm using this library I just discovered which is supposedly less heavier than Joda time for android and I said what the heck, let's use it. But now I'm struggling to find any good examples on the web about how to use it, besides these two methods I have: // ZonedDateTime contains timezone information at the end// For example, 2011-12-03T10:15:30+01:00[Europe/Paris]public static ZonedDateTime getDate(String dateString) { return ZonedDateTime.parse(dateString).withZoneSameInstant(ZoneId.of("UTC"));}public static String formatDate(String format, String dateString) { ret...

 java                     1 answers                     36 view
 2018-10-22         Suzanne

SQL Server Row Partition on the basis of Data Combination

I have data as below:Create table #PP(MM int,PP Int,DT date)insert into #PP values(1,1,'2016-01-01')insert into #PP values(1,1,'2016-02-01')insert into #PP values(1,1,'2016-03-01') insert into #PP values(1,1,'2016-04-01') insert into #PP values(1,2,'2016-05-01') insert into #PP values(1,2,'2016-06-01') insert into #PP values(1,2,'2016-07-01') insert into #PP values(1,2,'2016-08-01') insert into #PP values(1,1,'2016-09-01') insert into #PP values(1,1,'2016-10-01') insert into #PP values(1,1,'2016-11-01') insert into #PP values(1,1,'2016-12-01') select * from #PP My Data and...

 sql                     2 answers                     49 view
 2018-10-22         Suzanne

how to create "ngOnActive" life cycle hook in angular?

I want a life cycle hook to be called when ever my component is active on the main page.its login page.when ever my component is on the main page i.e is active i want to see if i already have login token from previous login and depending on the result i want to navigate to different page.is there any `ngOnActive' hook if not then how to create it?or is there is any other way to achieve this?my code:import { Component, OnInit } from '@angular/core';import { NgForm } from '@angular/forms';import {LoginService} from './login.service';import {TokenService} from '../data/token.s...

 angular                     1 answers                     81 view
 2018-10-22         Suzanne

Unable to setup, Let's Encrypt

I’m trying install SSL to my EasyEngine serve, but the message bellow appears:root@mautic:~# ee site update mautic.agencialoud.com --letsencryptLetsencrypt is currently in beta phase. Do you wish to enable SSl now for mautic.agencialoud.com?Type "y" to continue [n]:yPlease Wait while we fetch SSL Certificate for your site.It may take time depending upon network.Unable to setup, Let's EncryptPlease make sure that your site is pointed to same server on which you are running Let's Encrypt Client to allow it to verify the site automatically.I also looked for solutions in many ...

 lets-encrypt                     1 answers                     100 view
 2018-10-22         Suzanne

Azure - SSMS - PowerShell

I am working through my first Azure HDInsight tutorial. Can I do this without installing Azure Remote PowerShell on my local computer?Can I use SSMS (2008R2) to run the PowerShell? My first attempt at that led me down the path of using a Database in Azure, but I do not think that is what I want to do (the tutorial describes setting Storage (not a Database) and then an HDInsight instance to interact with that Storage).I am doing this tutorial: http://www.windowsazure.com/en-us/manage/services/hdinsight/get-started-hdinsight/Thank you. While you can use SQL Server and HD...

 powershell                     1 answers                     58 view
 2018-10-22         Suzanne

Mongodb Hashed Sharding

If I choose {a:1,b:1,c:1} as my shard key and in my query I filter {a:1} in a hashed sharding strategy , is the query a targeted operation or it is broadcasting to every shard in the cluster?If it is targeted operation how mongodb determine it? as hash of {a:1} is completely differ from hash of {a:1,b:1,c:1} The simple answear is: Yes.Look at it this way:Let's assume you have got the following collection: //1 { a: 1, b: 1, c: 1, d: 1 }, //2 { a: 1, b: 1, c: 1, d: 2 }, //3 { a: 1, b: 1, c: 2, ...

 mongodb                     1 answers                     20 view
 2018-10-22         Suzanne

Changing hardware flow control pins on STM32

I have been reading up on handshaking and hardware flow control for serial communication and I have a question that I can't seem to find an answer to.If you set up hardware flow control for a serial port on cubeMX it will set the pins up that are required. I know you can use alternative pins as well and this can be done through cubeMX. My question is, could you set up hardware flow control manually by using different pins or do you strictly have to use the implemented pins?I am using a STM32F207ZETx and I am using USB as well as serial - however when using the USB periphera...

 c                     1 answers                     65 view

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