Thursday, May 20, 2021

Recent Questions - Stack Overflow

Recent Questions - Stack Overflow


How do I print scatter plots in a pandas column?

Posted: 20 May 2021 08:51 AM PDT

I created a pandas dataframe using the below code. (See the extra code and plt.show() which is there to create a new plot every time or else we get one plot with all of them in the same plot)

%matplotlib inline    pd.DataFrame(      np.array([[          col,          plt.scatter(data[col], data['SalePrice']) and plt.show()]      for col in data.columns]),      columns=['Feature', 'Scatter Plot']  )  

But what I get is this

a pandas dataframe with some no-so-useful information about scatter plots

And at the end of the dataframe, I get all the scatter plots separately.

What I want is, for those graphs to get printed inline, inside the columns, just like the other values.

ValueError: Found input variables with inconsistent numbers of samples: [4, 3]

Posted: 20 May 2021 08:51 AM PDT

I'm looking to figure out why this code is not working. The error code I'm getting is ValueError: Found input variables with inconsistent numbers of samples: [4, 3] and I'm just not really understanding why

import numpy as np  import matplotlib  import matplotlib.pyplot as plt  from sklearn import svm  from sklearn.model_selection import train_test_split    L1=[1,2,3,4]  L2=[5,6,7]  trainX, testX, trainY,testY = train_test_split(L1,L2,test_size = 0.4, random_state = 12345678)  trainX.shape,testX.shape,trainY.shape,testY.shape    def poly_grid_search(L1, L2):        for list1 in L1:          for list2 in L2:              print(list1, list2)              print(list1*list2)          psvm = svm.SVC(kernel='poly', degree=list1, C= 2)          psvm = svm.SVC(kernel='poly', degree=list2, C= 2)          psvm.fit(trainX,trainY)           print("polynomial kernel degree = {}, acurracy rate {}".format(L2, psvm.score(testX,testY)))        

Conditional statement just to display login text

Posted: 20 May 2021 08:51 AM PDT

Hi guys am just trying to display in my breadcrumbs login or register depending on the page the user is on.

So if the user is on my login page it shows login and if the user is on register page it shows register

I tried using route help function i.e

@if( Route::has('login') )  <H2> login </h2>  @endif  

It doesn't work any ideas please 😊

Vue 1.x ignoredElements equivalent

Posted: 20 May 2021 08:51 AM PDT

I'm tryin to integrate a stencil.js component with an existing Vue 1.x project. I've done the same thing in a Vue 2.x project and ingoredElements config. Is there an equivalent to such thing in Vue 1.x or is the integration done differently?

As of now, I'm unable to see my component and the following warning is outputted to the console.

Unknown custom element: <test-component> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Any help is appreciated :)

Flutter: Periodically calling list.add() inside initState() causes build() to run but the updated List isn't shown on screen

Posted: 20 May 2021 08:51 AM PDT

On the screen I expect to see an ever growing list:

  • 0
  • 1
  • 2
  • ...

but it's just black. If I hit CTRL+S in Android Studio all of a sudden the whole list is finally shown.

import 'dart:async';    import 'package:flutter/material.dart';    void main() => runApp(MyApp());    class MyApp extends StatefulWidget {    @override    _MyAppState createState() => _MyAppState();  }    class _MyAppState extends State<MyApp> {    List<Widget> list = [];      @override    Widget build(BuildContext context) {      print('${list.length}');      return MaterialApp(        home: ListView(          children: list,        ),      );    }      @override    void initState() {      super.initState();        new Timer.periodic(const Duration(seconds: 1), (timer) {        setState(() {          list.add(Text('${list.length}', key: Key(list.length.toString())));        });      });    }  }    

At first I thought it was because I wasn't setting key property, but I added that and still nothing.

I know the build() property is being triggered every second because I see the print() statement showing the numbers in the debug Run tab output.

What am I missing here? It's got to be something simple!

Hi, I have a project in which I need to display the binary search tree, this is my algorithm, how can I display the output in a tkinter widget?

Posted: 20 May 2021 08:51 AM PDT

def binary_search1(elem, data): low = 0 high = len(data) - 1

while low <= high:        middle = (low + high) // 2        mark=data[middle]      def afisare():        print((mark-1)*'  '+'|')        print((mark-1)*'  '+'|')        print((mark - 1) * '  ' + str(data[middle]))      afisare()      if data[middle] == elem:          return middle      elif data[middle] > elem:          high = middle - 1      else:          low = middle + 1  return -1  

elem=1 data=[1,2,3,4,5,6,7,8,9,10,11,12,13]

for i in data: print(i,end=' ') print('') binary_search1(elem,data)

Given these type declarations in OCaml for a stream type, how to I write a flatten function?

Posted: 20 May 2021 08:51 AM PDT

exception Empty_list    type 'a stream = Stream of 'a * (unit -> 'a stream) | Nil    let shead s = match s with    | Stream (a, _) -> a    | Nil -> raise Empty_list    let stail s = match s with    | Stream (_, s) -> s ()    | Nil -> raise Empty_list  

The flatten function would take an arbitrarily nested set of streams and produce a completely flattened version that's a result of an inorder traversal of the nesting structure and contains only the leaves. This would mean that the result of shead on each member of this new thing would return something that was not a stream.

Where can I find the Azure App service client library in ARM(Azure.ResourceManager)to get list of app service instances or the slots of a subscription

Posted: 20 May 2021 08:50 AM PDT

Where can I find the Azure App service client library in Azure Resource Manager Azure.ResourceManager to get list of app service instances or the slots of a subscription

Running Total in Django Template

Posted: 20 May 2021 08:50 AM PDT

I listed debit and credit for my account transactions. Now I want to running total in last column by debit subtracted by credit added with previous arrived amount as running total (as you know). Thanks for your support.

my view:

 def listaccounttrans(request):      alltrans = FinTransDetail.objects.all()      context = {'alltrans': alltrans}      return render(request, 'waccounts/list_account_trans.html', context)  

my html:

 {{% extends 'wstore_base_generic.html' %}}   {% block content %}   <h3>Table</h3>   <div>     <table id="customers" >   <thead>      <tr>       <td>AcctCode</td>       <td>TransNo</td>      <td>TransDate</td>      <td>AcctDetail</td>      <td>Debit</td>      <td>Credit</td>      <td>Balance</td>    </tr>  </thead>  <tbody>  {% for acct in alltrans%}    <tr>      <td>{{ acct.fd_acct }}</td>      <td>{{ acct.fd_no}}</td>      <td>{{ acct.fd_no.fh_dt}}</td>      <td>{{ acct.fd_no.fh_detail }}</td>      <td>{{ acct.fd_debit }}</td>      <td>{{ acct.fd_credit }}</td>     <td>{{ acct.fd_no}}</td> # needs running total here#    </tr>    {% endfor %}     </tbody>     </table>     </div>     {% endblock %}  

my template is showing now:

 AcctCode   TransNo TransDate   AcctDetail  Debit   Credit     Balance   1101         94    May 18, 2021    Detail  11.00   0.00        94 (needs to be replaced with    1101         94    May 18, 2021    Detail  0.00    11.00       94  running balance)                                                                      [total balance]  

How to use a git submodule with typescript code in a typescript project

Posted: 20 May 2021 08:50 AM PDT

I'm working on a VueJS project that uses different colors and some other things depending on a environment variable. These values are contained in another repository I added as a submodule. So the structure in my project is:

  • my-project
    • the-submodule
    • node_modules
    • public
    • src

To make this work I included this in the vue.config.js:

module.exports = {    chainWebpack: config => {      config.resolve.alias        .set('@theme', path.resolve('the-submodule/' + process.env.VUE_APP_THEME))    },  ...  

I use it like this, for example in plugins/vuetify.ts:

import Vue from 'vue'  import Vuetify from 'vuetify/lib/framework'  import colors from '@theme/colors'    Vue.use(Vuetify)    export default new Vuetify({    theme: {      themes: {        light: {          ...colors        }      }    }  })  

Or in router/index.ts:

import texts from '@theme/texts'    ...    router.afterEach((to) => {    Vue.nextTick(() => {      document.title = to.meta.title ? `${texts.appName} | ${to.meta.title}` : texts.appName    })  })  

While this does compile and works, I still get errors during compilation:

ERROR in /Users/sme/projects/aedifion-frontend/src/plugins/vuetify.ts(4,20):  4:20 Cannot find module '@theme/colors' or its corresponding type declarations.      2 | import Vue from 'vue'      3 | import Vuetify from 'vuetify/lib/framework'    > 4 | import colors from '@theme/colors'        |                    ^      5 |       6 | Vue.use(Vuetify)      7 |   ERROR in /Users/sme/projects/aedifion-frontend/src/router/index.ts(12,19):  12:19 Cannot find module '@theme/texts' or its corresponding type declarations.    > 12 | import texts from '@theme/texts'         |                   ^  

These are examples of the files in the themes:

the-submodule/some-theme/colors.ts:

import { Colors } from '../types'    export default {    accent: '#288946',    error: '#e60046',    info: '#969196',    primary: '#007982',    secondary: '#96BE0D',    success: '#a0af69',    warning: '#fab450'  } as Colors  

the-submodule/some-theme/texts.ts:

import { Texts } from '../types'    export default {    appName: 'MyApp'  } as Texts  

the-submodule/types.ts:

export interface Colors {    accent: string;    error: string;    info: string;    primary: string;    secondary: string;    success: string;    warning: string;  }    export interface Texts {    appName: string;  }  

I also created different versions of .d.ts files in the-submodule, both for each type or one for alle types.

I've tried pretty much everything I could find. How do I get rid of those errors?

How to speed up heatmap?

Posted: 20 May 2021 08:50 AM PDT

I am trying to plot heatmap with three variables x, y and z, each with vector length of 932826. The time taken with the function below is 28 seconds, with a bin size of 10 on each x and y. I have been using another program where the same plot happens in 6 - 7 seconds. Also, I know that the plot function of that program uses Python in the background

So, I was wondering how can I speed up my heatmap plots. Also, is it possible to write the values within each bins of the heatmap ?

    plt.figure()      xi = npr.linspace(min(x), max(x), x_linspace)      yi = npr.linspace(min(y), max(y), y_linspace)      zi = griddata((x, y), z, (xi[None, :], yi[:, None]), method='linear')      plt.figure()      plt.pcolormesh(xi, yi, zi)      plt.colorbar()      plt.xlabel(x_lab)      plt.ylabel(y_lab)      plt.title(title + 'Mean =' + str(mean(z)) + ' Mean Abs Dev = ' + str(mad(z)))      plt.clim(z.min(), z.max())      act_save = savepath + '\\' + plot_name + '_heatmap3.png'      mng = plt.get_current_fig_manager()      mng.window.state('zoomed')      plt.savefig(act_save)      plt.close()  

Background Video Width and Height CSS

Posted: 20 May 2021 08:50 AM PDT

i made some website with video on the background, I use 80vh(Vertical Height), but when I press f12, the video background height went smaller, how to fix it? should I change it to px or %?

This is my code

HTML :

<section class="head-banner">    <div class="head-background">      <video autoplay muted loop>        <source src="frontend/media/header-background.mp4" type="">      </video>    </div>    <div class="row">      <div class="col-12">        <div class="head-content">          <h1>FASHION</h1>          <h1 class="hoks">FESTIVAL</h1>          <h1 class="hoks">IS HERE</h1>        </div>      </div>    </div>  </section>  

Scss :

.head-banner{  width: 100%;  height: 80vh;  box-sizing: border-box;    .head-background{      position: relative;      video{          width: 100%;          height: 80vh;          object-fit: cover;      }  }    .head-content{      position: absolute;      color: whitesmoke;      z-index: 1;      top: 0;      left: 5%;  }    h1{      font-family: 'Montserrat', sans-serif;          font-size: 72px;           font-weight: 700;  }    .hoks{      margin-top: -20px;  }  

}

Thanks

Ctrl+F underlying implementation

Posted: 20 May 2021 08:50 AM PDT

Ctrl+F (Cmd+F on MacOS) is the standard keyboard shortcut for finding instances of a string in a document. I've recently been using this command in very large documents, on the order of hundreds of MB of ASCII characters. In the default text editor on Ubuntu, I've noticed that it often takes quite a while for the find to work, and sometimes it seems to simply fail. This makes me wonder about what's going on under the hood. How optimized is the algorithm that runs when I do a Ctrl+F? The difference in runtime between a naive character-by-character search and something like the BLAST algorithm from computational genomics can be enormous with long query strings in long files. Also, does Ctrl+F call the same underlying code when I do it in Text Editor as in VSCode as in Chrome, or do different applications use different implementations?

c++ returning object from a function

Posted: 20 May 2021 08:51 AM PDT

The code below shows a class representing complex numbers. My interest is in understanding the operator+ function. As I understand Complex res should be allocated on the frame of the function operator+. Is it correct to return this object to the caller? By the time this function returns the frame would have been popped but res would continue to be used by the caller. Unless there is more to this than meets the eye, like the actual return res may actually be copying the object from current frame to the caller's frame. Another possibility can be that the code inside the operator+ function may be inlined on the call site in main? From my limited understanding of the language, functions declared within the class are by default inlined on the call site. Any help will be appreciated.

#include<iostream>  using namespace std;    class Complex {  private:      int real, imag;  public:      Complex(int r = 0, int i =0) {real = r; imag = i;}            Complex operator+(Complex const &obj) {          Complex res;          res.real = real + obj.real;          res.imag = imag + obj.imag;          return res;      }      void print() { cout << real << " + i" << imag << endl; }  };    int main()  {      Complex c1(10, 5), c2(2, 4);      Complex c3 = c1 + c2;       c3.print();  }  

I am using a Rest API code and Eclipse IDE. I need to create a class that allows me to get the population and the name of the city

Posted: 20 May 2021 08:51 AM PDT

I am using a Rest API code and Eclipse IDE. I need to create a city class that allows me to get the population and the name of the city. How do I extract the specified data from the API code?

Yarn Cannot find module 'logform' winston in build

Posted: 20 May 2021 08:51 AM PDT

i'm trying to build with Yarn 2 one nodejs application with:

"build": "rimraf ./dist && tsc"  

but i'm getting:

.yarn/cache/winston-transport-npm-4.4.0-e1b3134c1e-16050844d2.zip/node_modules/winston-transport/index.d.ts:9:26 - error TS2307: Cannot find module 'logform' or its corresponding type declarations. 9 import * as logform from 'logform';  

Even with this message the program still runs correctly. In dev no errors are logged in terminal.

typescript: 3.9.7

Yarn: 2.4.1

Node: 12.19.0

winston: 3.3.3

nodeLinker: pnp

Responsive and resizing

Posted: 20 May 2021 08:51 AM PDT

Good Afternoon All,

I was wondering if you could point out where I have gone wrong please?

I am looking for the following to be more responsive on a mobile etc.

<section class="hero">          <div class="row">              <div class="col-8 sm-8" id="tennis-pic"><img src="assets/images/home-hero.jpg" class="home-hero"                      alt="Tennis player being coached on court"></div>              <div class="col-4 sm-4 blue-box">                  <h3 class="welcome">Welcome to Go Tennis System</h3>                  <p class="tips">Your home of Tips, Tricks, Training and of course Tennis</p>              </div>          </div>      </section>      <article>          <div class="why-header">              <h4>Why use our Go Tennis System service?</h4>          </div>          <p class="why-text">              We offer a bespoke unique service. We do things digitally and at your pace.              With our service we ask for a small donation that will be shared with a dogs charity and animal rescue              charity,              as part of our aim to give something back.              We offer you the chance to upload your videos for coaching, tips and honest constructive feedback, this in              turn will allow you to create your own video diary as well as improve and fine tune your skills.              When we say we play the same game, just easier we mean at your pace and time scale. We cater for all ages as              well as all levels, so if you're a beginner that would like to play like a pro, come and give us a go, you              will be glad you did.          </p>      </article>  

I have the following CSS:

/* ------------------------------------------- Home Hero Image */

.hero {      margin-top: 100px;      margin-bottom: 150px;  }    .home-hero {      position: relative;      max-width: 110%;      width: auto;      height: auto;      padding: 0;      margin: 0;  }      /* ------------------------------------------- Home Welcome Box */    .blue-box {       position: relative;      padding: 0;      margin: 0;      background: #2a5490;  }    .welcome {       font-family: Montserrat, sans-serif;      font-weight: 400;      position: relative;      margin-left: auto;      margin-right: auto;      margin-top: 45%;      margin-right: 10%;      margin-left: 10%;      top: 60px;      right: auto;      height: auto;       width: auto;      text-align: center;      color: #fff;   }      .tips {       font-family: Montserrat, sans-serif;      font-weight: 300;      float: right;      position: relative;      margin-left: auto;      margin-right: auto;      margin-right: 10%;      margin-left: 10%;      top: 60px;      right: auto;      height: auto;       width: auto;      text-align: center;      color: #fff;   }  

Many thanks for your help in advance.

All the best

Andrew

My site that I am working on is here

Why is spark dataframe repartition faster than coalesce when reducing number of partitions?

Posted: 20 May 2021 08:51 AM PDT

I have a df with 100 partitions, and before saving to HDFS as .parquet I want to reduce the number of partitions because the parquet files would be too small (<1MB). I've added coalesce before writing:

df.coalesce(3).write.mode("append").parquet(OUTPUT_LOC)  

It works but slows down the process from 2-3s per file to 10-20s per file. When I try repartition:

df.repartition(3).write.mode("append").parquet(OUTPUT_LOC)  

The process does not slow down at all, 2-3s per file.

Why? Shouldn't coalesce always be faster when reducing the number of partitions because it avoids a full shuffle?

Background:

I'm importing files from local storage to spark cluster and saving the resulting dataframes as a parquet file. Each file is approx 100-200MB. Files are located on the "spark-driver" machine, I'm running spark-submit in client deploy mode. I'm reading files one by one in driver:

data = read_lines(file_name)  rdd = sc.parallelize(data,100)  rdd2 = rdd.flatMap(lambda j: myfunc(j))  df = rdd2.toDF(mySchema)  df.repartition(3).write.mode("append").parquet(OUTPUT_LOC)  

Spark version is 3.1.1

Spark/HDFS cluster has 5 workers with 8CPU,32GB RAM

Each executor has 4cores and 15GB RAM, that makes 10 executors total.

JFreeChart: Add labels for datapoints in TimeSeriesChart

Posted: 20 May 2021 08:50 AM PDT

I am new to Java and JFreeChart (Servlet in Web application). I created a Time Series Chart that displays Progress (Y Axis) on weekly (X Axis) basis. I am including my code snippet below.

I want to add labels to datapoints. As the datapoints are large in number (weekly data for 2 years), displaying label for every datapoint makes the graph look congested and the labels are not readable because of overlap.

  1. How to skip labels for certain datapoints? Say, labels needs to be displayed for first week data of every month.
  2. How to tilt the labels by certain angle (say 30 degrees) so that they do not overlap?

Any working code snippet would be highly helpful to me.

    JFreeChart chart = ChartFactory.createTimeSeriesChart("Progress", "On Week", "Progress", dataset);      XYPlot plot = (XYPlot) chart.getPlot();      plot.setDomainGridlinesVisible(true);      plot.setRangeGridlinesVisible(true);            DateAxis dateAxis = (DateAxis) plot.getDomainAxis();      dateAxis.setVerticalTickLabels(true);                    XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer)plot.getRenderer();      renderer.setSeriesShapesVisible(0, true);      renderer.setSeriesPaint(0, Color.GREEN);      renderer.setBaseItemLabelsVisible(true);  

EDIT: My graph looks like this. I highlighted the portion where the labels overlap. enter image description here

Why isn't @JmsListener in ActiveMQ working?

Posted: 20 May 2021 08:50 AM PDT

First, I made a test project to learn how to work with ActiveMQ. Everything worked there.

But when I did the same with an already made application on Spring + security + JAAS then everything stopped working, and apparently the JmsListener class is not working. I sent messages to this queue via ActiveMQ admin but didn't work.

How to query certain jsonb fields using Npgsql

Posted: 20 May 2021 08:50 AM PDT

I'm trying to map a query like this using a jsonb column in Postgres into a C# object:

select item_object->'thing'   FROM "Table", jsonb_array_elements("JsonColumn")   with ordinality arr(item_object);  

(Where in this case JsonColumn contains an array of JSON objects, each of which has a 'thing' field.)

I see that using JsonDocument or POCO can be used to map these Json functions in the WHERE clause, but in my case I'm trying to restrict how much of the document gets sent back to reduce the size and amount of deserialization needs to happen. Is there any way to do this in C# or do I need to build customized queries?

Thanks!

-- Edit --

For example, can we query specific jsonb fields using this sort of query in C#

DataContext.Table.Select(t => new { t.JsonColumn.thing });  

To dig through the json and only return the 'thing' field instead of the entire json blob.

DAX SUM DISTINCT values by groups

Posted: 20 May 2021 08:51 AM PDT

I'm new to PBI/DAX. I have a table called Opp Recs with a few columns: Group1, NumEmp, OppRec, AcctNum. I want to sum the NumEmp column if Group1 equals "Corp Employees" but only for unique AcctNum.

I used this formula but realized NumEmp was double counted for dup AcctNums: **Corp # Emps = CALCULATE(SUM('Opp Recs'[NumEmp]), 'Opp Recs'[Group1] = "Corp Employees")**

How can I sum NumEmp correctly?

Sample Data:

Group1    NumEmp    OppNum    AcctNum
Corp Employees    450  000030689  A0000123
Corp Employees    450  000030624  A0000123
Corp Employees    150  000030118  A0000662
Small Bus Emp      5  000030637 A0000737
Small Bus Emp      37    000030738  A0000755
Corp Employees    100    000030639   A0000784
Corp Employees    100    000030616   A0000784

I want to make a GUI in Matlab 2021a. I want to upload a file and that will be the input of GUI and graph will generate. How can I do that?

Posted: 20 May 2021 08:50 AM PDT

i have already the file uploaded in the GUI but it doesn't generate the graph.

[filename, pathname] = uigetfile( ...      {'*.csv;', 'CSV file (*.csv)';       '*.xlsx',  'Excel Spreadsheet file (*.xlsx)'; ...       '*.*',  'All Files (*.*)'}, 'Pick a File to Import');  full_filename = fullfile(pathname, filename);  [A, delimiterOut] = importdata(full_filename);  S=fileread(full_filename)  T1=full_filename(:,1);              T2=full_filename(:,2);              plot(app.UIAxes,[T1],[T2])  

what next to do?

What is the proper technique for using the postscript 'clip' command to print multiple fields within a document?

Posted: 20 May 2021 08:51 AM PDT

My first clip seems to be working properly, but the second string isn't printing at all.

newpath  20 20 moveto  0 24 rlineto  50 0 rlineto  0 -24 rlineto  closepath clip  20 20 moveto  (Hello World) show    newpath  80 20 moveto  0 24 rlineto  50 0 rlineto  0 -24 rlineto  closepath clip  80 20 moveto  (Hello Again) show  

Dependency Injection not working for IConfiguration C#.Net Core

Posted: 20 May 2021 08:51 AM PDT

I have injected IConfiguration using following code:

 public class InjectorConfig      {          /// <summary>          /// configuration for DI          /// </summary>          /// <param name="services"></param>          /// <param name="configuration"></param>          public static void Init(IServiceCollection services, IConfiguration configuration)          {              services.AddSingleton<IConfiguration>(provider => configuration);              services.AddSingleton<AppSettingUtil>();          }  }                               

while using this in my class called AppSettingUtil I am getting null pointer exception on IConfiguration object.

Below is the code I am using

public class AppSettingUtil      {              public AppSettingUtil(IConfiguration configuration)         {            _configuration = configuration;         }         public IConfiguration Configuration { get; }      }  

While executing below function I am getting null pointer exception

 private static object GetDefault(string name)      {          if (_configuration[name] != null)          {              return Convert.ToInt32(_configuration[name]);          }          return null;      }  

While executing this function the object _configuration is null, and hence throwing null pointer exception,

Code128 Barcode in Adobe Acrobat Form Text Field

Posted: 20 May 2021 08:51 AM PDT

We have a PDF form where you fill out product options then it converts those options into a single text field "Lot Number" then finally a field, "Lot Number Barcode", takes the lot number and converts it to a barcode. For some reason this is not working. I know almost nothing about barcode integration but I am a programmer and just looking for some guidance on this topic.

The "Lot Number Barcode" field uses under properties Calculate->Custom Calculation Script this code. So like I said above it's taking the "Lot Number" field and converting to a string which I believe then the font uses to generate the correct barcode or that is the idea.

event.value = this.getField("Lot No").valueAsString;  

Here is a link to the actual PDF I was given from the client:
https://ufile.io/ihh87

This is what I have found out on this topic but obviously still missing pieces to the puzzle and hope someone can give me the exact steps needed to get this working in Acrobat Pro.

  1. I need an embeddable CODE 128 font? I found this font set but costs $159 is there a free version that I could use and have it still work? https://www.idautomation.com/barcode-fonts/code-128/
  2. Javascript - I need to add custom Javascript code to the Actions properties of the "Lot Number Barcode" text field but I don't know which code needs to be implemented and looking for a resource on this to better explain the process.
  3. Font height and font size - If I get the previous 2 steps working I still need to be concerned with setting the PDF text field to an exact font size and height otherwise the barcode scanner could error out. Is this true? Currently the PDF text field font size is set to "Auto"

Flutter.h not found error

Posted: 20 May 2021 08:51 AM PDT

I've lost the ability to build Flutter applications for iOS since a few days back. I updated my iPad to 11.4 which forced me to update xCode to 9.4 and I think there was a new release of Flutter thrown in the mix too. In my infinite wisdom I updated them all and now can't test my projects any more.

With deadlines approaching quickly I am looking for advice on how to get moving again. I'm not that familiar with Apple products so don't really know my way around xCode etc yet.

This is a fresh 'FLUTTER CREATE testproject' project, no changes have been made to it whatsoever.

FLUTTER RUN log:

Launching lib/main.dart on iPad Pro (12.9-inch) (2nd generation) in debug mode...  Starting Xcode build...  Xcode build done.  Failed to build iOS app  Error output from Xcode build:  ↳      ** BUILD FAILED **    Xcode's output:  ↳      === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===      cp: /Users/trevburley/FlutterSDK/flutter/bin/cache/artifacts/engine/ios/Flutter.framework: No such file or directory      find: /Users/trevburley/IdeaProjects/testproject/ios/Flutter/Flutter.framework: No such file or directory      Project /Users/trevburley/IdeaProjects/testproject built and packaged successfully.      Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure      In file included from /Users/trevburley/IdeaProjects/testproject/ios/Runner/GeneratedPluginRegistrant.m:5:      /Users/trevburley/IdeaProjects/testproject/ios/Runner/GeneratedPluginRegistrant.h:8:9: fatal error: 'Flutter/Flutter.h' file not found      #import <Flutter/Flutter.h>              ^~~~~~~~~~~~~~~~~~~      1 error generated.  Could not build the application for the simulator.  Error launching application on iPad Pro (12.9-inch) (2nd generation).  

and verbose FLUTTER DOCTOR:

Trevs-MBP:testproject trevburley$ flutter doctor -v  [✓] Flutter (Channel beta, v0.4.4, on Mac OS X 10.13.5 17F77, locale en-GB)      • Flutter version 0.4.4 at /Users/trevburley/FlutterSDK/flutter      • Framework revision f9bb4289e9 (3 weeks ago), 2018-05-11 21:44:54 -0700      • Engine revision 06afdfe54e      • Dart version 2.0.0-dev.54.0.flutter-46ab040e58    [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)      • Android SDK at /Users/trevburley/Library/Android/sdk      • Android NDK location not configured (optional; useful for native profiling support)      • Platform android-27, build-tools 27.0.3      • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java      • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)      • All Android licenses accepted.    [✓] iOS toolchain - develop for iOS devices (Xcode 9.4)      • Xcode at /Applications/Xcode.app/Contents/Developer      • Xcode 9.4, Build version 9F1027a      • ios-deploy 1.9.2      • CocoaPods version 1.5.3    [✓] Android Studio (version 3.1)      • Android Studio at /Applications/Android Studio.app/Contents      • Flutter plugin version 25.0.1      • Dart plugin version 173.4700      • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)    [✓] IntelliJ IDEA Community Edition (version 2018.1.4)      • IntelliJ at /Applications/IntelliJ IDEA CE.app      • Flutter plugin version 25.0.2      • Dart plugin version 181.4892.1    [✓] VS Code (version 1.23.1)      • VS Code at /Applications/Visual Studio Code.app/Contents      • Dart Code extension version 2.13.0    [✓] Connected devices (1 available)      • iPad Pro (12.9-inch) (2nd generation) • D8D24435-C465-4403-B74F-E8DD32DDD30A • ios • iOS 11.4 (simulator)    • No issues found!  

Python: modul not found after Anaconda installation

Posted: 20 May 2021 08:50 AM PDT

I've successfully installed Python 2.7 and Anaconda but when i try to import a library i get always this error:

>>> import scipy  Traceback (most recent call last):  File "<stdin>", line 1, in <module>  ImportError: No module named scipy  

I've set up the PYTHONHOME to C:\Python27 and PYTHONPATH to C:\Python27\Lib.

EDIT : content of PATH

In my $PATH variable i have C:\Users\Mattia\Anaconda2, C:\Users\Mattia\Anaconda2\Scripts and C:\Users\Mattia\Anaconda2\Library\bin.

Do i have to set any other env veriables?

Name attribute in @Entity and @Table

Posted: 20 May 2021 08:50 AM PDT

I have a doubt, because name attribute is there in both @Entity and @Table

For example, I'm allowed to have same value for name attribute

@Entity(name = "someThing")  @Table(name = "someThing")  

and I can have different names as well for same class

 @Entity(name = "someThing")   @Table(name = "otherThing")  

Can anybody tell me what is the difference between these two and why we have same attribute in both?

CSS: Set divs horizontally in 2 rows

Posted: 20 May 2021 08:51 AM PDT

Lets say I have

<div class="cont">      <div class="single">1</div>      <div class="single">2</div>      <div class="single">3</div>      <div class="single">4</div>      <div class="single">5</div>      <div class="single">6</div>      <div class="single">7</div>     </div>  

What I want to have is to plase the .single divs in 2 rows like bricks horizontaly from left to right this simple way: 1st div will be in left top corner, 2nd will be placed below 1st, 3rd will be placed next to 1st, 4th will be placed below 3rd and so on like:

1 3 5 7 9  2 4 6 8  

All the divs has the same size.

I've tried with masonry.js and its working like a charm, but its way to complex solution for so simple task (simply solution is important).

fiddle playground

No comments:

Post a Comment