on-internet

Is there a Typescript editor for Android?

I see that this is not a specific progamming question, however I have asked it in a binary way so perhaps this will pass scrutiny. I've been using Quoda on my Android phone and have started needing to edit .ts / Typescript files, which it does not support. At the moment I am using SGit which just opens whatever Android app to edit a file type based on the extension. Quoda (and general text editors) can open a .ts if opened within the app, however do not have syntax highlighting. So I have searched high and low, the only .ts editor I have found is CodeAnywhere, which is really great in a deskto

Join the discussion →

Spark "Executor heartbeat timed out"

I have a simple reproducible Spark error. (Spark 2.0 + Amazon EMR 5.0 FYI) def row_parse_function(): # Custom row parsing function. Details omitted. return pyspark.sql.types.Row(...) if __name__ == "__main__" spark_context = build_spark_context("max value bug isolation") spark_sql_context = SQLContext(spark_context) full_source_path = "s3a://my-bucket/ten_gb_data_file.txt.gz" # Tried changing partition parameter to no effect. raw_rdd = spark_context.textFile(full_source_path, 5000) row_rdd = raw_rdd.map(row_parse_function).filter(bool) data_frame = spark_sql_context.createDataFrame(row_rdd, At

Join the discussion →

getting "skipping: no hosts matched" with ansible playbook

my below ansible (2.1.1.0) playbook is throwing "skipping: no hosts matched" error when playing for host [ec2-test]. The ansible hosts file has the fqdn of the newly created instance added. It runs fine if if i re run my playbook second time. but 1st time running throws no hosts matched error :( my playbook: --- - name: Provision an EC2 instance hosts: localhost connection: local gather_facts: no become: False vars_files: - awsdetails.yml tasks: - name: Launch the new EC2 Instance ec2: aws_access_key: "{{ aws_id }}" aws_secret_key: "{{ aws_key }}" group_id: "{{ security_group_id }}" instance_t

Join the discussion →

docker install and enable php extension

I trying to use Docker for my Symfony3 project I got it running but I get this error: The LDAP PHP extension is not enabled. It does sound right as I am using Ldap extension for my project. I have tried installing the Ldap extension using Dockerfile for my php image which seems to install it but still gives me this error. Q1) How do I install required php extensions to my php image. Q2) Once extension installed how do i enable it. docker-compose.yml: web: image: nginx:latest ports: - "80:80" volumes: - ./site.conf:/etc/nginx/conf.d/site.conf project files volumes_from: - php links: - php php:

Join the discussion →

How to access a file in a private/var folder?

I got a path that looks like this: /private/var/mobile/Containers/Shared/AppGroup/D4A4F193-4125-406F-9A85-2B301F233D7E/image0.jpg However when I check for existence (file.exists) it always returns false. The full path I try to open is the same as before but adding file:// before it, so it ends up like this: file:///private/var/mobile/Containers/Shared/AppGroup/D4A4F193-4125-406F-9A85-2B301F233D7E/image0.jpg When doing app extensions apparently the file is shared in that folder. Tried File.applicationDirectory, File.documentsDirectory and File.storageDirectory, is there any other special place

Join the discussion →

ERPNext Unable to switch back to site erpnext

I was experimenting on creating new apps with frappe. At some stage after creating the site, I had to switch the default site using bench use library. Now I want to switch back to erpnext (the default app). But it's not working when I run: bench use erpnext or bench use erp-next or bench use erp_next. What's the site name to the default erpnext site. Or is there some other way to achieve this?

Join the discussion →

Cannot find module ‘gulp’

When I run the ionic build android command, I get the following error: WARN: ionic.project has been renamed to ionic.config.json, please rename it. Uh oh! Looks like you're missing a module in your gulpfile: Cannot find module 'gulp' Do you need to run `npm install`? I have already tried running this command: npm install --save-dev gulp But I am still getting the same error. Am I missing something here?

Join the discussion →

Switch case in Apache Camel

Is there a construct in Apache Camel (in Java DSL) similar to Java switch-case? For example: from( incomingRoute ) .choice() .when( simple( "${body.getType} == '" + TYPE.A.name() + "'" ) ) .to( A_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.B.name() + "'" ) ) .to( B_Endpoint ) .when( simple( "${body.getType} == '" + TYPE.C.name() + "'" ) ) .to( C_Endpoint ) .otherwise() .to( errorEndpoint ); Can be translated into something else more similar to switch? I mean that I do not want to use simple predicates, only value of type of body element. Or is my approach completely wrong? (That co

Join the discussion →

Combining CSS transition and animations together?

Hello I am having trouble combining both css transition and animations together. The animation is working but some reason when I add a transition, the transition works, but cancels out the animation. Anyone know how to combine them? Here is my CSS: .circle-spin { transition: all 1s ease; } .circle-spin-reverse { transition: all 1s ease; } .success li:hover .circle-spin-reverse { animation:spin-reverse 10s linear infinite; /* the above works until i add the transition below */ transform:scale(1.25); } .success li:hover .circle-spin { animation:spin 10s linear infinite; /* the above works until

Join the discussion →

Extract package description as string

How can I extract the description of a package from the package's DESCRIPTION file? I'm interested in getting the text from the Description: field and being able to use it in renderText() for a Shiny app. renderText() just requires a string, so getting it in a string format is my goal (unless someone knows another way to do it). The reason I'm not just copy-pasting is because I want to update the description in one single place (the DESCRIPTION file) and not have to remember to update the description in multiple locations with every new version.

Join the discussion →

Extract package description as string in R

How can I extract the description of a package from the package's DESCRIPTION file? I'm interested in getting the text from the Description: field and being able to use it in renderText() for a Shiny app. renderText() just requires a string, so getting it in a string format is my goal (unless someone knows another way to do it). The reason I'm not just copy-pasting is because I want to update the description in one single place (the DESCRIPTION file) and not have to remember to update the description in multiple locations with every new version.

Join the discussion →

ansible play_hosts template loop

I'm trying to use the play_hosts variable in an ansible template. I'm trying to setup a master / slave domain setup for wildfly. So I wish to loop over all hosts in the inventory group, without having to specify a group. This is what I'm trying: {%- for host in play_hosts %} {%- if 'master' in hostvars[host][ansible_hostname + '_alias'] %} <remote protocol="remote" host="{{ hostvars[host]['ansible_default_ipv4']['address'] }}" port="9999" /> {%- endif %} {%- endfor %} I get the below error: failed: [atllvjksap012d.hughestelematics.net] (item=host) => {"failed": true, "item": "host", "msg": "An

Join the discussion →

Using RewriteCond with %{REQUEST_URI} for mod_rewrite

I would like the URL: http://example.net/category/subcategory/title To point to: http://example.net/posts/category/subcategory/title.php My .htaccess file looks like this: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{QUERY_STRING} !^.+ #RewriteCond post/%{REQUEST_URI}.php -f RewriteRule ^(.*)$ post/$1.php [L] This works. However, when I uncomment the line with "post/" and "REQUEST_URI" above, it does not work. I have tried: RewriteCond /post/%{REQUEST_URI}.php -f RewriteCond post/%{REQUEST_URI}.php -f RewriteCond post%{REQUEST_URI}.php -f None of these work.

Join the discussion →

How to correctly terminate an application?

In the past I've usually added the following line to the KeyDown sub in order to end my applications: If e.KeyCode = Keys.Escape Then End However, upon reading the documentation on what End actually does, it turns out that it probably is one of the worst ways to end the application in terms of releasing resources, etc. So now I'm trying to find the recommended way to terminate the application which will properly handle all resources, etc. I've found these two questions on SO (here and here) but I can't conclude what the right answer actually is. The accepted answer on the first link says that

Join the discussion →

How to open and run a userform?

I have a userform on an Excel file called "userform": Private Sub add1_Change() End Sub Private Sub add2_Change() End Sub Private Sub Calc_Click() Result.Value = Val(add1.Value) + Val(add2.Value) End Sub This userform takes the value from the user and adds them together and shows the result in a textbox. I want to create a new macro in another workbook named "input". The macro in this workbook should open the userform workbook, enter values in the textbox add1 and add2, then run the userform calculate button. What I've tried thus far: Set add1.value to extract a value from say, cell A1, and si

Join the discussion →

eclipse marketplace proxy authentication

I've downloaded eclipse with the properties described at the appendix below. When I try to download a plugin using the eclipse marketplace, such as Moonrise UI Theme or Color Theme, It doesn't work and prompts "HTTP Proxy Authentication Required" error box. No info other than the plug-in's eclipse website is available. I can not install an eclipse plug-in. --- Appendix--- Eclipse IDE for Java Developers Version: Neon Release (4.6.0) Build id: 20160613-1800 recently downloaded using zip file.

Join the discussion →

Generate UUID and get Least and Most significant bits in Javascript

I need to generate a random UUID in Javascript and get the Least and Most significant bits from it (like in Java's UUID class). I found enough scripts to generate the UUID, but wasn't able to find a script that gets the least and most significant bits. (I don't need the UUID itself, though). Thanks in advance, Chrisstar

Join the discussion →

int object has no attribute __getitem__

I am working on some code to recognises the face and speak someone's name. I am working this code in raspberry pi 3 with opencv 3.1 and python 2.7. This code works fine on windows but when I try it on raspberry, it gives an error: Type error: 'int' object has no attriibute '__getitem__' For the line: if prediction[1]<100: Full code: import cv2, sys, numpy, os, pyttsx, time,picamera haar_file = 'haarcascade_frontalface_default.xml' datasets = 'datasets' engine = pyttsx.init() rate = engine.getProperty('rate') engine.setProperty('rate', rate-40) print('Training...') # Create a list of images and

Join the discussion →

Changing video resolution on HTML 5.0 video with JavaScript

UPDATE: I was using the Fotorama plugin and it seems that the bottom menu was causing the problem. Disabling that menu by putting div-tags around the video-tags made the function for setting resolution work. Thanks for the help and encouragement. For the bottom menu I create a simple one using link buttons that link to a similar page with the next video. I have written JavaScript code that changes the resolution of a video based on input of a option/select-element. It works. The problem is that it stops working when I put exactly the same code inside a function (so that the code can be execute

Join the discussion →

Angular 2 New Router - Routes not displaying in

Pretty new to Angular 2 and not fully up to speed on the new Router. I've followed the example from the Angular Documentation, and while I'm not getting errors, my components aren't displaying in the tag. Here's the router code: import { Routes, RouterModule } from '@angular/router'; import {HomeComponent} from './home.component'; import {FeaturesComponent} from './features.component'; const appRoutes: Routes = [ { path: '', component: HomeComponent },, { path: 'features', component: FeaturesComponent }, { path: '**', component: HomeComponent } ]; export const appRoutingProviders: any[] = [ ];

Join the discussion →

How to display Date-picker in IONIC 2?

I wanted to display the DatePicker as soon as page loads. <DatePicker android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/datePicker" android:layout_gravity="center_horizontal|top" android:headerBackground="?attr/colorPrimary" android:layout_alignParentTop="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" /> I used Android studio and wrote above code to get the output as in the below image. I wanted to implement the same thing using ionic 2 and wrote below code to get the datepicker. import {Component} from '@angular/core'

Join the discussion →

Code injection into Gmail via a Google Chrome extension - how to make sure that my script gets injected when it has finished loading?

I'm creating a Google Chrome extension that adds some extra functionality to Gmail by injecting a script that I've written. By 'injected script' please see this definition. To do this, my content script matches on ["https://mail.google.com/mail/*"]. However, the problem with this is that this is the same URL for when Gmail is loading and has finished loading. As a result, my script appears to sometimes to get injected too early, while Gmail is still loading, leading to reference errors. To try to circumvent this problem, I'm only running my script on load by doing: window.addEventListener("loa

Join the discussion →

Update dataGridView when cell value changed

I'm having some problem with refresing cell value in dataGridView. My program in c# set values of some rows on button click, but I allow user to change some value in DataGridView. EG. Column3 = Column2+Column1. Which works correctly when i click button but after it when I change some cell value in Column2 I also want Column3 to change value. I'v tried private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { dataGridView11.Update(); dataGridView1.Refresh(); } And private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { button1_Cl

Join the discussion →

Python currying with any number of variables

I am trying to use currying to make a simple functional add in Python. I found this curry decorator here. def curry(func): def curried(*args, **kwargs): if len(args) + len(kwargs) >= func.__code__.co_argcount: return func(*args, **kwargs) return (lambda *args2, **kwargs2: curried(*(args + args2), **dict(kwargs, **kwargs2))) return curried @curry def foo(a, b, c): return a + b + c Now this is great because I can do some simple currying: >>> foo(1)(2, 3) 6 >>> foo(1)(2)(3) 6 But this only works for exactly three variables. How do I write the function foo so that it can accept any number of varia

Join the discussion →

Upload file to SFTP using PowerShell

We were asked to set up an automated upload from one of our servers to an SFTP site. There will be a file that is exported from a database to a filer every Monday morning and they want the file to be uploaded to SFTP on Tuesday. The current authentication method we are using is username and password (I believe there was an option to have key file as well but username/password option was chosen). The way I am envisioning this is to have a script sitting on a server that will be triggered by Windows Task scheduler to run at a specific time (Tuesday) that will grab the file in question upload it

Join the discussion →

Getting token in Office 365 Oauth2 authentication

I am implementing Oauth 2 authentication for Office 365 account in a java based server side application. After reading the documentation, I have done the following things: I have office 365 subscription. I have created an app in Azure Actve directory, that is necessary to authenticate web app using office 365 account. I have client ID and secret. I have also given all permission to the Azure app. I am requesting authorization code using the Url: https://login.microsoftonline.com/common/oauth2/authorize?client_id={client_id}&response_type=code&redirect_uri={redirect url}&response_mode=query As

Join the discussion →

MVCC & B-Tree & Concurrency

I'm currently reading dbms book and as i've understood Mvcc (Multi version concurrency control) is used for high concurrent read and write transactions. But "concurrency control on search structures" chapter mentions different locking concepts (lock coupling,link technique etc) for B-Trees. Doesn't Mvcc applied on B-Tree's internal and leaf nodes in dbms? Are B-Tree concurrency and MVCC completeley different things?If so how Mvvc is implemented in dbms?

Join the discussion →
Older stories