Responsive Ad Area

Month: January 2019

How do I convert a column named ‘budget’ with its unit as $ to ‘million $’?

I am trying out ways to convert the unit of a column named as Budget from $ to Million $. What is the most effective way of doing it ? How do I convert a column named ‘budget’ with its unit as $ to ‘million $’? How do I convert a column named ‘budget’ with its unit as $ to ‘million $’? test {$excerpt:n}

Can I create a Powershell loop to create HTML / Java Elements?

I am creating a powershell script that takes servers from a .txt file and puts their system info on a HTML page. Each server has its own tab on the HTML page. I am trying to create a loop so that a new tab is created for each serer in the .txt file. I tried placing the portion of the script that makes the tabs, in different areas of the script along with using different ways to do a loop. Get-Content “C:UsersDocumentsComputerIp.txt” -ErrorAction SilentlyContinue | ForEach-Object { $HTMLFooter = @” $HostName $HostName </div> <div id="$HostName" class="tabcontent"> <span onclick="'none'" class="topright"> &times </span> <h3> $HostName </h3> <p> $SystemInputInformation </p> </div> <...

Laravel external API OAuth token managing

I am building web app. In this app used external web-service via REST API. I am junior dev. External API descr: Authorization by OAuth2 protocol REST API used for managing Users resourse one client_id, one client_secret are used to get tokens for all users Hierarchical structure (user1 (user1.1,user1.2(user1.2.1,user1.2.2))) for each user u can create 4 tokens, if there is more you can delete all, each token expired in 24 hour properly get token new token is refresh using refresh_token How i did it in my project? using table in data base to store all tokens (current token, refresh token) for each user i add and update row in table before each request to external service by API i check if token is not expired by sending request, if so i refresh it. Problem: all code in controller Question: ...

Why and when should trait and object have same name?

What is the reason that trait Dog { def bark = "woof" } object Dog extends Dog works, but the following does not trait Dog { def bark = "woof" } class Dog extends Dog I read somewhere that in the first case mentioned above the object is not a companion object. What is the scenario when object and trait should have the same name ? Why and when should trait and object have same name? Why and when should trait and object have same name? test {$excerpt:n}

How to fix Problem with configuration in Entity Framework

If updated my project to 8.0.13 and MySql.Data.EntityFramework. The target Framework is .net 4.5.2 EF is on 6.2 I have now the strange behavoiur that i have to add the part to my configuration <> <DbProviderFactories> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data" /> </DbProviderFactories> </> Then it’s running on some machines. But on others you get following error. (translated to english since system is german) System.Configuration.ConfigurationErrorsException: An error occurred when creating the configuration section handler for The column 'InvariantName' has the ...

TypeError: the first argument must be callable in python

i’m trying to run my first project in python and i get “TypeError: the first argument must be callable” , and “Traceback (most recent call last):” i have another main in another module and it has the same problems. import os from PL import courses, classrooms, students def print_table(list_of_tuples): for item in list_of_tuples: print(item) def main(): clr_list = classrooms.getAllClr() clr_size = clr_list.__len__() counter = 1 while os.path.isfile('schedule.db') and courses.getAllCourses().__len__ != 0: courses_list = courses.getAllCourses() if counter == 1: i = 0 while i < clr_size: tmpCourse = courses_list[i] # filling up the classrooms classrooms.updateClassroom(, tmpCourse.course_length, clr_list[i].id) students.reduceAmount(tmpCourse.course...

How to filter items by category using tab?

I’m making a POS and there are buttons in the side that show the items and when i click it, that item will be added in the receipt. I want to add tab in the top to make the items categorized. For example if i click drinks tab, only the drinks will be shown in the button. How to filter items by category using tab? How to filter items by category using tab? test {$excerpt:n}

why we are dowcasting to view controllers

Images As you see the image why we are downcasting segue .destination as! SEcondviewcontroller instead of let secondVC=segue.destination why we are dowcasting to view controllers why we are dowcasting to view controllers test {$excerpt:n}

How to find Unicode Pattern using Regex in Python3.7?

I am trying to find a Unicode pattern but it always returns an empty list [ ]. I have tried the same pattern in Kwrite and it worked fine. I have tried u u in place of w but didn’t work for me. Here Unicode string can be any Unicode string. InputString=r"[[ਅਤੇCC_CCD]]_CCP" Result = re.findall(r'[[]+[w]+\w+[]]+[_]w+',InputString,flags=re.U) print(Result) How to find Unicode Pattern using Regex in Python3.7? How to find Unicode Pattern using Regex in Python3.7? test {$excerpt:n}

React Native async fetch JSON, but abstracting to a separate component

My app has a button which fetches JSON api results, and updates that in a TEXT field. Works fine. import React, { Component } from 'react'; import { View, Text, StyleSheet, Button } from 'react-native'; export default class HomeScreen extends Component{ state = { serverJSON: 'not yet downloaded', } onPress_ServerDownload = () => { this.fetchServerJSON(); } fetchServerJSON() { return fetch('http://localhost/test.json') .then((response) => response.json()) .then((responseJson) => { this.setState({serverJSON: responseJson.myapielement.description}); }) .catch((error) =>{ console.error(error); }); } render() { return ( <View> <View><Text>Welcome</Text></View> <View><Button title="Download Server INIT feed" onPress={this.onPress_ServerDownload}...

Work Books Sheets copy to Multiple WorkBooks and Rename

I have workbook and there many sheets i want to copy one by one sheets to new work book and rename workbook I tried, but it saved in one workbook instead of separate workbooks also i dont want to copy first worksheet to copy new workbook Option Explicit Sub CreateWorkBooks() Dim ws As Object Dim i As Long Dim ws_num As Integer Application.ScreenUpdating = False Set ws = Worksheets ws_num = ThisWorkbook.Worksheets.Count For i = 2 To ws_num 'Copy one worksheet as a new workbook 'The new workbook becomes the ActiveWorkbook ws.Copy 'Replace all formulas with values (optional) ActiveSheet.UsedRange.Value = ActiveSheet.UsedRange.Value 'May want (not required) to add a file name extension (.xls or .xlsx) to the file name ActiveWorkbook.SaveAs ThisWorkbook.Path & "" & _ "AR Balance- " &...

How to resolve error C2612 in Visual Studio 2017?

I’m trying to compile a class, which was compiled before in Linux by using GCC as: Block::Block(Domain& dom, const Index& ind, const unsigned int& size) : size(size), index(ind), min(ind*size), max((ind+1)*size), domain(dom) { But it shows this error at the initializer list line as: error C2059: syntax error: ')' and error C2612: trailing ')' illegal in base/member initializer list. Any idea how to resolve it? How to resolve error C2612 in Visual Studio 2017? How to resolve error C2612 in Visual Studio 2017? test {$excerpt:n}

Skip to toolbar