Lou

1

votes
2

answer
70

views

Bash - More efficient way to process csv file than grep [closed]

Updated I have a file (file.txt) with a list of words: apple banana cherry orange pineapples I have a csv file (data.csv) that contains lots of data: 1,'tasty apples',3,5 23,'iphone app',5,12 1,'sour grapes',3,5 23,'banana apple smoothie',5,12 1,'cherries and orange shortage',3,5 23,'apple iphone or...
Lou Diamonds
1

votes
1

answer
44

views

Python: Identify Times In File

I'm very new to Python, so apologies, but what's the best way to allow Python to identify times, and use them as integers? I have a file, and need to count the number of lines between two times, eg, per hour. The file looks like this: Feb 3 08:17:01 j4-be02 CRON[32735]: pam_unix(cron:session): sess...
Lou
1

votes
0

answer
165

views

Making a DKIM-Signature header on Mac

So, here is my situation in a few words. First off, I am running Thunderbird 59 on a Mac and use 1and1 as my hosting space and email server with SMTP. Just in case that helps. Now, I want to send a bunch of emails and would like to stay clear from spam filters and therefore want to sign my emails us...
Lou
1

votes
1

answer
50

views

Flow does not report the correct type for a variable without @flow

I have a file with the following three lines. // var g1 = navigator.geolocation; g1.getCurrentPosition(position => {}, () => {}); Flow reports the type of g1 as: '2:5-6: any' when I ran dump-types command. When I add @flow directive into the file as the following: //@flow var g1 = navigator.geolocat...
Lou
1

votes
2

answer
70

views

C# method skipping over java script call

I have an ASP button that has an event listener attached to it. When pressed it calls the C# method and executes whatever code I may have within it. I have a javascript function I want to call when the listener first executes. However, C# completely skips over the function call and moves on to the...
swapmeet_Lou
1

votes
0

answer
126

views

struggling to test flask-dance / flask-security / flask-sqlalchemy / pytest

My application requires login to google for later use of google apis. I have flask-dance, flask-security, flask-sqlalchemy working to the point where I can do the log in and log out in my development system. What I've been struggling with is testing of the login using pytest. I am trying force the l...
Lou K
1

votes
0

answer
79

views

CVS - local repository, on Windows Server 2016 - how to do this?

I am not a CVS expert (I have a little more knowledge in GIT), but at this point we continue to use CVS for some projects (and cannot change that for now). Our Jenkins build system has a few jobs that use CVS. I need to modify them in respect to tagging and branching. In my testing, I do not want...
Lou
1

votes
1

answer
37

views

Why in jquery all of the text field can connect to the Javascript file BUT only one is left out?

Why in jquery all of the text field can connect to the Javascript file BUT only one is left out when I insert linking It won't work! What works is I insert it in HTML and it works fine the validate: Price $('#price').on('keyup', function(){ var valid = /^\d{0,4}(\.\d{0,2})?$/.test(this.value), val =...
stephanie lou
1

votes
0

answer
22

views

How to fill a gridview from XSD file tableadapter query based on a selected paramter

I am trying fill out a GridView from a created table adapter connection. I can easily do this with an SQL data source but, I need to do the same with the table adapter. Here is the ASP Gridview code. Which resides on a testpage.aspx page I'm using. Here is the C# code I am using to define the parame...
swapmeet_Lou
1

votes
1

answer
35

views

Which handle to pass to CreateIoCompletionPort, if using IOCP for basic signaling?

Background: As described in this article, Designing Applications for High Performance: Consider using PostQueueCompletionStatus rather than SetEvent API. The latter boosts the target thread’s priority by 1 which may cause it to preempt something else. I am working in C on Windows, and I'd like...
Lou
1

votes
2

answer
38

views

Removing/Replacing a multiple words in a streamreader string

I have a file I am opening and reading. In this file I have a few key words that I am replacing with different DB stuff. My problem: I need to be able to REMOVE specific text from the read file. More than just one word. Nothing I have tried works. The .Remove method returns and empty file after I'm...
swapmeet_Lou
1

votes
2

answer
63

views

Convert a List to multidimensional Map

I'd like to transform (with Java8) a list of (JSON) data to a hierarchical structure. Could you please tell me what is the best way to deal with this? How can I convert an arraylist to a multidimensional map? The problem is something like converting this: { 'server': 'Manufacturer Co.', 'vehicles':...
ram lou
1

votes
1

answer
50

views

Can't cp files to Google Object Storage via gsutil

I'm sure I granted all the permissions that I can give: [email protected] ~> gcloud auth list Credentialed Accounts ACTIVE ACCOUNT * [email protected] [email protected] To set the active account, run: $ gcloud config set account `ACCOUNT` [email protected] ~> cur...
Chenyao Lou
1

votes
0

answer
22

views

Hobbyist way to connect to USB-C/A device from iOS device with or without MFi

If I have a generic USB device (can be a keyboard, an Arduino board, etc), and I want to connect it to my iOS device, can I access it from the iOS device specifically through an app I am developing in Swift? I'm looking for general information on this, and having trouble finding any myself. To be cl...
Lou
1

votes
2

answer
80

views

How to concatenate a list to a string in robot framework

I'm creating a md5 hash of some string in robot framework, and I want to split this hash and keep only the 32 first characters. I'm trying with list and then cutting the list, but I can't concatenante the list back to a string. Here is my code : ${test1}= Md 5 ${pwd_arg} ${test3}= Hexdigest...
Lou Gyde
1

votes
2

answer
1.3k

views

Single resource and multiple resources

I have a model Whitelabel and a User has_many :whitelables I have a custom method current_whitelabel (like authlogic or restful_auth for current_user) I want my users to manage their whitelabels (ie: edit_whitelabels_path(id)). But I don't want to send the whitelabel ID in params when it refers to...
lou
1

votes
1

answer
1.7k

views

GWT and java mail api: NoSuchProviderException

I have to send an email from a gwt project using java mail api. I manage to do it with a normal java application (a Main project, a Junit test, whatever) but it just doesn't work inside an RPC call on GWT (version 1.7.1). I think I'm using the proper java libraries as I can send this email outside...
lou
1

votes
3

answer
5.8k

views

Visual Basic - Sending a Carriage Return to an E-Mail

How can I send a string to an email with new lines (carriage returns) included? The problem is that I am sending the string to an email, and the email strips out the carriage returns. Dim myApp As New Process emailStringBuilder.Append('mailto:') emailStringBuilder.Append('&subject=' & tmpID & ' - '...
Lou
1

votes
5

answer
2k

views

WPF Layout question… How to scroll and auto-size content?

All, I am coming from a primarily ASP.NET background, but have experience with Windows forms as well. I am trying to learn how to layout my WPF app. I have the following code: When the DataGrid is short, the top and bottom rows are where I'd expect... at the top and bottom of the window with the c...
Lou Estrada
1

votes
3

answer
103

views

Can this mysql subquery be shortened with JOINs?

I am attempting to find all entries in the 'archive' table that have the same workID as any rows where historyID is NULL, worktype = 'WEST', and the completeDate at least four months old. I am using a sub query to complete this request. Is there a more efficient way? My query is below. SELECT * from...
Lou
1

votes
2

answer
608

views

Optimizing a big MySQL aggregate query for analytics

I'm trying to build out some basic marketing analytics tools and want to provide an 'Transactions to date at Day N' summary for each campaign code. Is there a way to make a query like this more efficient? For each day_n column I want to count all transactions made before or on that day. SELECT c.ca...
Lou Kosak
1

votes
1

answer
1.1k

views

maxSize parameter of CascadeClassifier::detectMultiScale not efficient

I'm performing pedestrian detection on a video stream using haar cascadeclassifiers and I am trying to optimize the code by reducing the scale range of detection thanks to parameters minSize and maxSize in the detectMutliScale function: fullbodyCascade.detectMultiScale(image, found_pedestrian, 1.1,...
lou
1

votes
1

answer
287

views

Authenticate a call to a WCF service

I am trying to call a Sharepoint Web Service via WCF from inside a .ASHX on a different server. My code works if I run inside of Visual Studio's debug web server, but not from IIS. The working server works in various authentication modes (Kerberos, NTLM), and the non-working one doesn't work in an...
Lou Franco
1

votes
1

answer
88

views

scanf in objective c returns weird result

The following returns an odd result in objective c. #import #import #import #import char risk[2]; char gen1[1]; printf('Enter gender: '); scanf('%s',gen1); printf('Enter risk: '); scanf('%s',risk); And I get as gen1 the result of gen1 + risk instead of just gen1. In other words if gen1 = 'm' and...
Lou
1

votes
5

answer
1.2k

views

Unknown column in `where` clause

I am getting the error described in title: Unknown column 'FeedbackType' in 'where clause' But I don't understand why. This is my query: SELECT SQL_CALC_FOUND_ROWS `Appointments`.ID, FeedbackType, FeedbackSubType FROM `UserFeedback` INNER JOIN `Appointments` ON `Appointments`.ID = `UserFeedback`.Ap...
Lou
1

votes
1

answer
239

views

Enclosing prepared statement placeholders in single quotes

When creating a prepared statement in mysqli, should I enclose string value placeholders in single quotes? I.e. should I write: INSERT INTO Person (Name) VALUES ('?') or INSERT INTO Person (Name) VALUES (?) The reason I am asking is because strings I am storing get their quotes escaped, so I am alwa...
Lou
1

votes
2

answer
637

views

How to check if a Thread spawned by an Activity is alive after the Activity has been destroyed

The first Activity of my app spawns a Thread to perform some IO operations. If in that moment the user hits the Back button the activity is destroyed (I can see the onDestroy method being called) but the Thread is still running (I can see it from the log messages). If the user then comes back to the...
lou
1

votes
2

answer
408

views

feature request: an atomicAdd() function included in gwan.h

In the G-WAN KV options, KV_INCR_KEY will use the 1st field as the primary key. That means there is a function which increments atomically already built in the G-WAN core to make this primary index work. It would be good to make this function opened to be used by servlets, i.e. included in gwan.h. B...
k.k. lou
1

votes
2

answer
202

views

Extract exact match of predefined phrases in array from string in PHP

Need $new_string to output New York NY but am getting New York NY York NY $phrases = array('New York NY','York NY','Wyoming MI','Wyoming Minnesota'); $string = ('I live in New York NY'); $matches = array(); foreach($phrases as $phrase) { if(stripos($string,$phrase) !== false){ $matches[] = $phrase;...
Lou
1

votes
1

answer
751

views

What needs to be installed along with google appengine for sqlalchemy / google cloud sql api?

I tried the recommendations in Can SQLAlchemy be used with Google Cloud SQL? to bring up an external connection to google cloud sql using sqlalchemy. To allow visibility of google appengine packages to my environment, after installing the google appengine sdk, I copied the google directory to site-p...
Lou K
1

votes
2

answer
700

views

How to disable a submit form button given a certain condition

I would like to disable a cancel button if the the record field 'Status' is already recorded as cancelled. I already know how to disable a button but the problem is how would the jquery know that the record field 'Status' is Cancelled. Here Are the Codes @foreach (var rDetail in Model.Customers.ToL...
lou lising
1

votes
2

answer
1.8k

views

VB.Net - Check when user has clicked outside Form but not minimised

I'm trying to create a copy-pasting utility in VB.NET forms, where I select text from anywhere, drag it to a textbox, and it is automatically copied to the clipboard as plaintext. I want it set up so that when the window is open and I click off it, this line is executed: CopyBox.SelectAll() But none...
Lou
1

votes
2

answer
39

views

Matching content with nested tags

I'd like to use .NET Regex to match a bit of a really broken HTML, and I am not sure how to do it. I know that Regex is a poor tool for this job, but I only need to extract some basic text from a huge file which has some really poorly HTML markup inside and my problem seems like a piece of cake for...
Lou
1

votes
2

answer
445

views

How do I use BeautifulSoup to move tag contents from one soup to a template soup

I have a template like this: and an input HTML like this COMPLEX HTML where COMPLEX_HTML is a lot of sub tags (it's clean -- validates) I'm trying to move just the HTML inside the body tag of the input HTML into the #here div in the template, to get this COMPLEX HTML I tried: t = BeautifulSoup('') p...
Lou Franco
1

votes
1

answer
389

views

Autocomplete searchkick with synonyms

I have a Capture model which uses searchkick: class Capture < ActiveRecord::Base searchkick autocomplete: ['name'], synonyms: [['scallion', 'green onion'], ['qtip', 'cotton swab']] end I'd like to do a search by name (autocomplete) in the Capture model so I tried this in console: Capture.search('sc...
lou
1

votes
1

answer
102

views

Fastest URL to GET in order to check HTTP availability?

I'm checking for HTTP availability in Android. I'm sending an HTTP GET and using URL http://www.google.com. This is my preferred method for actually sending the request. The response is taking much longer than I would like.. sometimes as long as 5 seconds. I would like it to be under 0.5 seconds...
Lou Morda
1

votes
1

answer
340

views

Socket server vs http server for iOS app

Im building a social app that requires a lot of user profiles and statuses. I currently have a protegeSQL setup, that communicates with a python script that is an api for my app's database. I need to make this as scalable as possible so I was thinking of using sockets to connect the iPhone to the s...
Lou
1

votes
1

answer
480

views

Using Java Socket vs. Apache HttpClient for asynchronous real-time HTTP data gathering

I had a quick conversation with a co-worker who asked if I knew how to use Java Socket for real-time data gathering in an Android app from an HTTP web server. I am only familiar with using Apache's HttpClient, HttpPost, HttpResponse, classes. What are the advantages of using the java.socket class...
Lou Morda
1

votes
1

answer
43

views

Another .htaccess redirect case

I have a site where mydomain.com and mydomain.com/frontpage serves the exact same content. Socalled SEO experts tell me it is very bad to have the same content on different addresses. Google will cast upon me a terrible fate. So I thought fine, I'll just redirect mydomain.com to mydomain.com/frontpa...
mr_lou
1

votes
1

answer
432

views

NSight Graphics Debugging cannot start

I am trying to debug a HLSL shader in VS2012 using NSight, but it can't start. When I click on 'Start Graphics Debugging', it seems like it starts the app for a moment, and then closes it (output windows from NSight shows several 'shader loaded'/'shader unloaded' lines). Windows Event log doesn't s...
Lou

View additional