on-internet

Template inheritance in Angular

I have the following child component and its inheritance parent component: @Component({ template: `<p>child</p>` }) export class EditChildComponent extends EditViewComponent{ constructor(){ super(); } } @Component({ template: `<p>parent</p>` }) export class EditViewComponent{ constructor(){ } } Now is there any way to place the template of the EditViewComponent in the ChildComponents template like you would do with ng-content in nested components? How would I get the following result: <p>parent</p> <p>child</p>

Join the discussion →

Does anyone know how can I convert JavaScript file to typescript file?

I have my JavaScript files in project. Now I want to convert my whole JavaScript code into typescript. So is there any tool or converter that converts my js code to ts. I got npm command from google to convert JavaScript to typescript $ npm install javaScript-to-typescript from the following link https://www.npmjs.com/package/javascript-to-typescript Can anyone help me how can I use above command??

Join the discussion →

Form Directive on submit is being ignored

I have an index.php which is my Main. It contains links to Login.php, Register.php and AboutUs.php. They are linked via hyperlinks so it works fine even though they not in the same folder as expected. Each 'called' page contains a form. Each calls a dal, to login or register or read about website. Therefore Login.php calls plogin.php which is a dal that resides in another folder for dals. The form action="common/dals/plogin.php" method="post". These paths are 100% correct. When I submit the form, the following error is generated: 404: Not found ......common/dals/index.php I do not understand t

Join the discussion →

ClosedXML Excel filter rows by values in multiple columns

I have a Excel file with several thousand rows and columns up to "BP". I need to filter all of these rows by specific values in columns C and BP. I tested the filter functionality in ClosedXML as per the code below. When I apply a filter to one column all works well and the data is saved in the new file. When I try to apply two filters, the last one executed is the one that is applied. I have tried to use the worksheet as a Range/Table, same filtering problem. I eventually created the "rows" expression, that works, but the 1st row (header) is filtered out. public static void Filter(string sour

Join the discussion →

'QML Connections: Cannot assign to non-existent Property' despite the opposite being true

So, I checked the following questions, which seemed most similar to my existing problem: QML: Using cpp signal in QML always results in "Cannot assign to non-existent property" Unfortunately that did not help. (Nor did any other solution that I could find on stackoverflow/google/qt forums, etc) I kept getting the following two errors: qrc:/view.qml:30:9: QML Connections: Cannot assign to non-existent property "onNewFrameReceived" qrc:/view.qml:31: ReferenceError: imageProvide is not defined Here is my code (edited down to make it, into a 'Minimum Working Example'). The only files important sho

Join the discussion →

What does --network=host option in Docker command really do?

I'm a little bit beginner to Docker. I couldn't find any clear description of what this option does in docker run command in deep and bit confused about it. Can we use it to access the applications running on docker containers without specifying a port? As an example if I run a webapp deployed via a docker image in port 8080 by using option -p 8080:8080 in docker run command, I know I will have to access it on 8080 port on Docker containers ip /theWebAppName. But I cannot really think of a way how --network=host option works.

Join the discussion →

Converter strings para booleanos

Estou adicionando dinamicamente um javascript e ao seu src preciso passar alguns parâmetros... a seguinte função cria esta "querystring": var querystring = {a:'b',b:true,c:'d',e:false}; var query = Object.keys(querystring).map((key) => {return [key, querystring[key]].map(encodeURIComponent).join("=");}).join("&"); // output: "a=b&b=true&c=d&e=false" Estes valores são usados como argumento de configuração do javascript adicionado... para resgatar estes valores para um object uso a seguinte função: var scripts = document.body.getElementsByTagName('script'), query = false; for (var i = 0; i < scr

Join the discussion →

Installing openpyxl in python 2.7

I am currently using Python 2.7 and I want to work on Excel sheets. So I found a package called openpyxl 2.4.0. I tried installing it by using pycharm and pip commands. The commands I tried are pip install openpyxl and pip install openpyxl==2.4.0 Also I tried installing using Pycharm. Both didn't work.* But it shows the following error: Could not find a version that satisfies the requirement openpyxl (from version s: ) No matching distribution found for openpyxl Should I go for another version of Python? *Copied from comment

Join the discussion →

Truth table with 5 inputs and 3 outputs

I have to make a truth table with 5 inputs and 3 outputs, something like this: A B C D E red green blue 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 . . . . 1 1 0 1 0 0 1 1 . . . 1 1 1 1 1 1 0 1 etc. (in total 32 rows, the numbers in the rgb table represents the number of 1's in each row in binary i.e in row 1 1 0 1 0 there are three 1's, so three in binary is 0 1 1). I would like to present the result of it in the Atanua (http://sol.gfxile.net/atanua/index.html) tool (so fore example when I press button E, the blue light will shine, when pressing A B D the green and blue light will shine a

Join the discussion →

REST API - Use the "Accept: application/json" HTTP Header

When I make a request, I get a response in XML, but what I need is JSON. In the doc it is stated in order to get a JSON in return: Use the Accept: application/json HTTP Header. Where do I find the HTTP Header to put Accept: application/json inside? My guess is it is not suppose to be inside the URL-request, which looks like: http://localhost:8080/otp/routers/default/plan?fromPlace=52.5895,13.2836&toPlace=52.5461,13.3588&date=2017/04/04&time=12:00:00

Join the discussion →

NoSuchSessionException when starting chromedriver

I am trying to create a simple test, just open the page and verify its title. I thought it could not be simpler, but... my test opens a new tab in a currently opened Chrome browser and fails on driver.get(myUrl); with the org.openqa.selenium.NoSuchSessionException I tried upgrading and downgrading chromedriver and upgrading downgrading selenium, but no luck so far. Currently I'm on selenium-java 3.3.1, chromedriver 2.28 and chrome 57.0.2987.98. Any help appreciated. Bonus question, last time I used chromedriver it opened a new browser window, any way to get back to that? I'd prefer my tests in

Join the discussion →

The supplied credential is invalid when using LdapConnection

I am attempting to connect to a LDAP server and do some searches. I am using LdapConnection and NetworkCredential objects to do this. Here is a sample of my code. When I attempt to do the Bind, I get an error that states "The supplied credential is invalid." I think my problem is I am not passing an expected value of Domain correctly. This is my first time programming using these objects, and I have struggled to find an example that works for me. Any help you can provide would be greatly appreciated! string myServerName = "111.22.333.444:389"; string myUserName = "MyLogin,ou=Systems,ou=LOCATIO

Join the discussion →

Driver not found connecting to oracle DB with jaydebeapi

Trying to connect to a db but getting error: conn = jaydebeapi.connect('oracle.jdbc.driver.OracleDriver', jdbc:oracle:thin:@mydomain.com:1234:GP1', [ 'user', 'pass'], 'C:\Program Files\Java\jdk1.8.0_121\ojdb6.jar') Gives the error File "C:\Anaconda2\Lib\site-packages\jpype\_jclass.py", line 55, in JClass raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name) java.lang.RuntimeExceptionPyRaisable: java.lang.RuntimeException: Class oracle.jdbc.driver.OracleDriver not found My JAVA_HOME variable is set to C:\Program Files\Java\jdk1.8.0_121, and in that directory I have the ojdb6.jar file, but

Join the discussion →

SSIS process greyed out

Unfortunately my SSIS process is greyed out like shown below (the tasks are not disabled!). The executed process stops immediately with "Validation is completed". Is there any way to reactivate the process? All connections/containers/tasks are working fine if executed manually. Greyed out process: All tasks are enabled:

Join the discussion →

Employee Classes - Python

Write a class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. Once you have written the class, write a program that creates three Employee objects to hold the following data: Susan Meyers - 47899 - Accounting - Vice President Mark Jones - 39119 - IT - Programmer Joy Rogers - 81774 - Manufacturing - Engineer ^ This is the problem I'm stuck on. I believe I have the first part of the code correct, but I don't understand what to do for the second part of the program to create Employee objects. Here is my code so far... emp.p

Join the discussion →

how to configure kotlin-logging logger

For logging purposes in my Kotlin project I am using kotlin-logging which is really nice to use however I am missing a very central point: How can I configure the log level of the logger? Per default it is set to info and I would like to set it to debug. As there is nothing about that on the Github page nor is there any method to set the level programmatically I had a look into slf4j as kotlin-logging is a wrapper around that. Apparently I have to set a System Property like this: -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG However I have no idea how to do this in Kotlin. Anyone can help me

Join the discussion →

PHP / MySQL: Display all rows matching specific value in column

I have a database table which looks something like this: dev_id dev_name cat_id subcat_id 1 Apple iPhone 6 1 1 2 Apple iPhone 6s 1 1 3 Apple iPad Air 1 2 dev_id is the primary key, cat_id is different for each brand (Apple = 1, Samsung = 2 etc.) and subcat_id indicates if the device is either a phone (1) or a tablet (2). I want to echo all the devices of one brand which have subcat_id == 1 assigned to them in one list with the header Smartphones. All the rows where the column subcat_id == 2 need to go in a list below that one with the header Tablets. Both lists need to be sorted by the primary

Join the discussion →

Good Values for Knuth's multiplication method - Hashing

Any guesses what are good values for the "c"? // h(k) = ⌊(m · (k · c − ⌊k · c⌋)⌋ return (int) Math.floor(distinctElements * (key * c - Math.floor(key * c))); I have found the this one: (Math.sqrt(5)-1)/2) However are there any other good choices known? Kind regards

Join the discussion →

Using psycopg2 or other python module within Visual Code

I am using Visual Code and wanted to script some Python code that connects to a database. Psycopg2 seems to be the perfect library for just that. So I had in my settings.json file: { "python.linting.pylintEnabled": true, "python.autoComplete.extraPaths": [ "c:/OSGeo4W64/apps/python27", "C:/OSGeo4W64/apps/Python27/Lib/site-packages/psycopg2" ], "python.pythonPath": "C:/OSGeo4W64/bin/python.exe" } I still get the error 'no module named psycopg2' on the first line in my code: import psycopg2.

Join the discussion →

Play local .avi videos in Node.js / Electron app

Maddening gap in an app I'm developing is there appears to be little (or no) support for AVI in the HTML5 video implementation. So, I need a workaround that is cross-platform, and package-able with my electron app. Videos are hosted locally I'm not averse to encoding on the fly (ffmpeg avi -> mp4 and use HTML5 natively?) WebChimera appears dying due to VLC and Electron changes (devs can't keep up) (Is there another npm package that can do this?) A wrapper that calls a native VLC instance might work -- but how do I ensure that VLC is available on the system with my packaging? Should I just spaw

Join the discussion →

Programming NVIC on STM32 (without libraries)

I have thoroughly searched the Datasheet and User's Manual for the STM32F4 MCU I am using (including PM0214 for STM32F4xx MCUs) as well as even information online about general MCUs to develop an understanding of how one would go about programming interrupts without a library... but to no avail. Is the NVIC so closely tied to the hardware that programming an interrupt and specifying an ISR address and acronym for a function unpractical nowadays without some sort of library? In every post and documentation I see something like: NVIC_EnableIRQ(IRQn_Type IRQn) NVIC_SetPriority(IRQn_Type IRQn, uin

Join the discussion →

php - is it possible to define properties for methods?

I would like to define some properties in a method that are contained within that method i.e not the the entire class. But want to do this from the instance of the object. Is that possible? The code below does not work. class foo{ var $x; function __construct(){ } function abc(){ echo $y; } } $new = new foo(); $new->abc->y = "bar";

Join the discussion →

Playing AUDIO from WebView

I've been looking for how to play audio from any website inside the webview? I've noticed Chrome Browser playing the audio but My WebView app doesn't play. Can you please provide me any resource or code snippet? Thanks in Advance!

Join the discussion →

How to serialize subtypes with MsgPack in C#

i have a question regarding msgpack serialization in c#. I have a base class and a class derived from base, each of them holding properties, for example: class Base { int PropertyA { get; set; } } class DerivedFromBase : Base { int PropertyB { get; set; } } Additionally i have an object of a third class Container, for example: class Container { Base ContainerProperty { get; set; } } My problem is, if ContainerProperty is of type DerivedFromBase, MsgPack serializes only PropertyA, not PropertyB! How can i achieve, that MsgPack internally recognize ContainerProperty to be a DerivedFromBase? Do i

Join the discussion →

Get list of physical interfaces in openwrt

How we can get all physical interfaces in openwrt, I tried with ls -l /sys/class/net/, But it is not right information. lrwxrwxrwx 1 root root 0 Mar 21 10:26 eth0 -> ../../devices/virtual/net/eth0 lrwxrwxrwx 1 root root 0 Mar 21 10:26 eth1 -> ../../devices/virtual/net/eth1 lrwxrwxrwx 1 root root 0 Mar 21 10:26 tun0 -> ../../devices/virtual/net/tun0 lrwxrwxrwx 1 root root 0 Mar 22 09:50 wlan0 -> ../../devices/pci0000:01/0000:01:00.0/net/wlan0 lrwxrwxrwx 1 root root 0 Mar 22 09:50 wlan0-1 -> ../../devices/pci0000:01/0000:01:00.0/net/wlan0-1 actually eth0 and eth1 are physical and wlan0-1 is logi

Join the discussion →

Disable file upload using htaccess

Recently, one of my clients website has been attacked. I noticed there, in the tmp directory attacker uploaded php script, where a user can upload images. My question is, is it possible to stop uploading any files other than images using HTACCESS? The website is built on Codeigniter. Thanks in advance. Any type of help is appreciated.

Join the discussion →

Save entity object with foreign key using CrudRepository

I have two entity classes with @ManyToOne relationship as below. @Entity public class Student { @Id private Integer studentId; @Column(nullable = false) private String studentName; @ManyToOne(targetEntity = School.class, fetch = FetchType.LAZY, optional = false) @JoinColumn(referencedColumnName = "schoolId", insertable = false, updatable = false) private School school; //Getters and Setters methods . @Entity public class School { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer schoolId; @Column(nullable = false) private String schoolName; //Getters and Setters methods When

Join the discussion →

mkimage doesn't add public key to .dtb file

I am trying to make a verified boot on beaglebone black by following the documentation https://github.com/01org/edison-u-boot/blob/master/doc/uImage.FIT/beaglebone_vboot.txt when i run the command to put public key into .dtb file mkimage -f sign.its -K am335x-boneblack.dtb -k keys -r image.fit I get the output FIT description: Beaglebone black Created: Fri Mar 24 18:47:51 2017 Image 0 (kernel@1) Description: unavailable Created: Fri Mar 24 18:47:51 2017 Type: Kernel Image Compression: lzo compressed Data Size: 8490316 Bytes = 8291.32 KiB = 8.10 MiB Architecture: ARM OS: Linux Load Address: 0x8

Join the discussion →

Regular expression for email masking

I am trying to write a regular expression to mask an email address. Example below. input: [email protected] output: j*******@e*********.com I have tried the following but I just can't seem to get it working correctly. regex:(?<=.).(?=[^@]\*?@) output:j*******@example.en.com regex:(?<=.).(?=[^@]\*?)(?=[^\.]\*?\.) output:j******************.com Any help would be appreciated. demo

Join the discussion →
Older stories