iphone – How can i regain functionality with automatic downloads? they no longer work in either direction

I cannot get applications I download on my iphone to appear on my ipad. Nor vice versa. I did not have this problem with my old devices so I know it worked at one time.

Is this feature restricted to “new” purchases? AKA if i’m trying to re-download something I already purchased in the past, it wont auto download to other devices?

I have ensured everything is signed in on the same appleid and both devices have auto downloads and auto updates on. I have tried toggling it off and on. Both are connected to the same wifi network. Both have been restarted and are on the newest version of ios.

coordinate transformation – How to troubleshoot TransformedField functionality in Mathematica?

I list up this method to transform a complex function to Cartestian form, which can be used on virtually any function:

such as:

u0(r_, phi_) := Sum(I^(-n) BesselJ(n, r) Exp(I n phi), {n, -5, 5});

TransformedField("Polar" -> "Cartesian",  u0(r, phi), {r, phi} -> {x, y})

which yields:

  u0(x_, y_) := 
 BesselJ(0, Sqrt(x^2 + y^2)) + 
  1/(x^2 + y^2)^(5/2)
    2 (-I x (x^2 + y^2)^2 BesselJ(1, Sqrt(x^2 + y^2)) + 
      Sqrt(x^2 + y^2) (-x^4 + y^4) BesselJ(2, Sqrt(x^2 + y^2)) + 
      I x^5 BesselJ(3, Sqrt(x^2 + y^2)) - 
      2 I x^3 y^2 BesselJ(3, Sqrt(x^2 + y^2)) - 
      3 I x y^4 BesselJ(3, Sqrt(x^2 + y^2)) + 
      x^4 Sqrt(x^2 + y^2) BesselJ(4, Sqrt(x^2 + y^2)) - 
      6 x^2 y^2 Sqrt(x^2 + y^2) BesselJ(4, Sqrt(x^2 + y^2)) + 
      y^4 Sqrt(x^2 + y^2) BesselJ(4, Sqrt(x^2 + y^2)) - 
      I x^5 BesselJ(5, Sqrt(x^2 + y^2)) + 
      10 I x^3 y^2 BesselJ(5, Sqrt(x^2 + y^2)) - 
      5 I x y^4 BesselJ(5, Sqrt(x^2 + y^2)))

or

a Hankel and Bessel function together:

u(r_, phi_) :=  Piecewise({{BesselJ(1.5 r, 5)*Exp(I 5 phi), 
0 < r < 1/2}, {(BesselJ(3 r, 5) + BesselY(3 r, 5))*Exp(I 5 phi), 
1/2 < r < 1}, {HankelH1(r, 5)*Exp(I 5 phi), r > 1}})

which yields:

Hankel+Bessel

which yields the respective given plots, when plotted:

Plot_Bessel_Cartesian

and

Plot_Hankel+Bessel_Cartesian

However, my supervisor thinks these plots look “strange”.

How can I verify that the TransformedField command did the right job – for such extended functions?

In other words, how to trobleshoot TransformedField?

winforms – Undo/Redo Functionality in DataGridView c#

Review

Welcome to Code Review. There are few suggestions as below.

Layout and formatting

Not sure why many newlines between the curly brackets and the method definition, if statements and for statements. For improving readability, those unnecessary newlines can be removed.

Magic numbers and List<DataTable>

I have no idea about why the initial value of counterUndo is set to 2 (in int counterUndo = 2) and why the inequality check if (_counterUndo != 2) is needed in doWhenClickedUndo method. Is the times of undo operation limited in 2? How about the case of more steps the user wants to undo? To solve this issue, I tried to use Stack<DataTable> instead of List<DataTable> so that the Push, Pop and First methods is available (Stack is useful for maintaining the historical sequence like the states of DataTable here). The following code is as an example implementation with Stack class.

public partial class Form1 : Form
{
    Stack<DataTable> dtStack = new Stack<DataTable>();
    int RecordIndex = 0;
    bool UndoRedo = false;

    public Form1()
    {
        InitializeComponent();

        //    Construct Columns
        dataGridView1.ColumnCount = 1;
        dataGridView1.Columns(0).Name = "0";

        dataGridView1.Rows.Add(20);// Add row

        dtStack.Clear();

        dtStack.Push(GetDataTableFromDGV(dataGridView1));
        UpdateBtnStatus();
    }

    public DataTable GetDataTableFromDGV(DataGridView dgv)
    {
        var dt = new DataTable();

        foreach (DataGridViewColumn column in dgv.Columns)
        {
            dt.Columns.Add(column.Name);
        }

        object() cellValues = new object(dgv.Columns.Count);

        foreach (DataGridViewRow row in dgv.Rows)
        {
            for (int i = 0; i < row.Cells.Count; i++)
            {
                cellValues(i) = row.Cells(i).Value;
            }
            dt.Rows.Add(cellValues);
        }
        return dt;
    }
    
    public void datatablaToDataGrid(DataGridView dgv, DataTable datatable)
    {
        for (int i = 0; i < datatable.Rows.Count; i++)
        {
            for (int j = 0; j < datatable.Columns.Count; j++)
            {
                dgv.Rows(i).Cells(j).Value = datatable.Rows(i)(j).ToString();
            }
        }
    }

    private void UpdateBtnStatus()
    {
        if (RecordIndex == this.dtStack.Count - 1)
            this.btn_Undo.Enabled = false;
        else
            this.btn_Undo.Enabled = true;

        if (RecordIndex == 0)
            this.btn_redo.Enabled = false;
        else
            this.btn_redo.Enabled = true;
    }

    private void btn_Undo_Click(object sender, EventArgs e)
    {
        UndoRedo = true;
        datatablaToDataGrid(dataGridView1, dtStack.ToList()(++RecordIndex));
        UpdateBtnStatus();
        UndoRedo = false;
    }

    private void btn_redo_Click(object sender, EventArgs e)
    {
        UndoRedo = true;
        datatablaToDataGrid(dataGridView1, dtStack.ToList()(--RecordIndex));
        UpdateBtnStatus();
        UndoRedo = false;
    }

    private void dataGridView1_CellValidated(object sender, DataGridViewCellEventArgs e)
    {
        if (UndoRedo)
            return;

        while (RecordIndex != 0)
        {
            dtStack.Pop();
            RecordIndex--;
        }

        DataGridView dgv = (DataGridView)sender;
        int r = e.RowIndex;
        int c = e.ColumnIndex;
        if (dgv.Rows(r).Cells(c).Value != null)
        {
            string dgvResult = dgv.Rows(r).Cells(c).Value.ToString();
            string dtResult = dtStack.First().Rows(r)(c).ToString();
            if (dgvResult != dtResult)
            {
                dtStack.Push(GetDataTableFromDGV(dataGridView1));
            }
        }
        UpdateBtnStatus();
    }
}

c++ – DirectWrite and Set Character Spacing – Trouble using extended DW functionality

I’m having a hard time grasping the problem getting the newer/extended functions in dwrite_1.h to work with my existing code and hope that someone here can shed some light.

This is my existing set up…

 // HEADER
IDWriteFactory* pDWriteFactory_ = nullptr;
IDWriteTextFormat* pTextFormat_ = nullptr;
IDWriteTextLayout* pTextLayout_ = nullptr;
IDWriteTextRenderer* pTextRenderer_ = nullptr;

//CPP File in my PrepareText() Fcuntion.
hr = pDWriteFactory_->CreateTextLayout(
    str.c_str(),
    str.size(),
    pTextFormat_,
    gfx.GetWindowWidth(),
    gfx.GetWindowHeight(),
    &pTextLayout_);

I would like to be able to use the IDWriteTextLayout1::SetCharacterSpacing function outlined here :
MSDN Link

However if I change my IDWriteTextLayout* to be IDWriteTextLayout1* I get an error as pDWriteFactory_ cannot be initialised with an IDWriteTextLayout1 as an argument. This error occurs if I change IDWriteFactory* to an IDWriteFactory1* also.

What am I missing? Many thanks!

screen – How to implement AOD functionality in Rom that lacks it (LOS)?

I’m using latest unofficial LOS 18.1 (by zeelog) on my Redmi Note 4/ mido. It works super-well and smooth and has everything I need – except for AOD (Always On Display).
Before I go into more detail, a couple of disclaimers:

  1. I know there’s other Roms out there that have it natively, such as crDroid (but I prefer LOS)
  2. I know that AOD drains a considerable amount of battery (but I don’t mind)
  3. I know there’s AOD apps (but I prefer native / in-built solutions)
  4. I know it probably could be done using Xposed / Substratum, (but I don’t want to use that)

That being said – is there any way one could modify the Rom so that AOD becomes possible? If the option is there, obviously it can easily be turned on and off using Shell commands

settings put secure doze_always_on 1

and

settings put secure doze_always_on 0

, respectively (I would use the app Tasker for that).

From what I found out, presence/absence of AOD might be related to the Gapps package one is using. I also found out that (maybe only in older versions of Android?) there is a file called AmbientDisplayConfiguration.java in frameworks/base/core/java/android/hardware/display folder which has one or several boolean(s) for AOD that just need(s) to be changed from 0 to 1(?) However, I don’t find that file/folder on my phone (although I’m rooted, of course). Maybe this is just present when compiling the Rom?

There are also flashable zips out there that claim to be able to activate AOD, but this did not work for me.

What exactly has to be done to enable it (given my phone/Rom constellation as mentioned)? Like which files have to be added or modified and/or which permissions have to be changed? Is it even possible to implement this feature after the Rom has been baked, or can this only be done in the building/ compilation process?

Thank you so much in advance for any hints! 🙂 Regards, Gary

P.S. please feel free to ask for any details I might have missed! 🙂

In C++, If a member function can be made static with no change to functionality, are there any performance or memory benefits from doing so?

Practically in 99.9% of cases: no.

Theoretically: maybe. You won’t be passing the implicit this parameter to every function, and not passing that could save you bytes and the time passing those bytes. The compiler may well optimise it away though in any case. If profiling has shown one of these functions is on your hot path, it might be worth considering.

However, I’d argue you should still do this anyway, because it makes it clear to anybody looking at the code that your static function doesn’t act on any object state. That’s far more important than any discussion about memory or performance.

plugins – WordPress (not woocommerce) Request A Quote functionality

I’ve seen plugins for WooCommerce that provide Request A Quote functionality (turning their cart into a quote request) as well as plugins that are glorified forms (allowing you to select multiple products while ON the form) to submit a request for.

What would be the best solution (coded or plugin) to allow customers to click a button on item pages (custom post types currently) that would add that item’s data to the main contact form (We’re using Gravity Forms currently)?

I’ve looked through the GF docs and they have ways to programmatically add data to the fields.. but I need it to persist while the customer is browsing other pages on the site.

Recommendations?

Ex: Customer goes to four different pages, clicks the ‘Request A Quote’ button (we’ll show an alert after they do, that directs them to the Request Form or allows them to keep browsing).
Once the customer is navigated to the Request Form, they see the info for the items (we can scrape the title, item #, etc from the post they click the button on) within the main forms Textarea.

samsung – Recording calls reliably using pre-installed hidden functionality

While poking around the activities available for the pre-installed apps on an older non-rooted Samsung Galaxy Android 7.0 phone, I noticed one for recording phone calls. It was located in package com.android.phone, and the activity is com.android.phone.RecordCallsAutomaticallyActivity.

I created a shortcut for the activity and launched it. Sure enough, it brought up a screen with an option to enable automatically recording phone calls. I turned on that option and made a call. I didn’t find any new files in storage/emulated/0. I have a hunch it didn’t record, but I don’t know how to determine that for sure.

Without breaking this question up into a bunch of separate Android SE questions, I’ll simply state my objective: I want to be able to reliably record phone calls. Currently, I use an app to do that, but it has failed to record a few recent important calls, and that’s a big problem.

So what I’m wondering is:

  1. Did I look in the right place to see if the call was recorded? If not, where do you advise looking?
  2. Is there any chance of getting this hidden functionality to work (it is not present in the standard UI) without root? If so, is there anything else you advise that I try doing?
  3. Will rooting the device make any difference?

web development – Sharing functionality developed in python with non-programmers

I am a proficient python programmer and use Windows. I would like to make the functionality I develop available for non-programmers working under different platforms such as MacOS. I am on a budget and wish to create very minimalistic/educational proofs of concept for the time being. I will not be using this for profit or commercial gain.

The following options exist for packaging python applications:

  1. Building a GUI using a library such as tkinter
  2. freezing the python app using a library such as PyInstaller
  3. packaging into a library using PyPi and uploading to the python package index
  4. deploying into a web app using one of many commercially available PaaS services

The first three options are heavily platform-dependent [with the first two being particularly clunky]. For instance, if I package and test an application on a Windows machine, nothing guarantees it will work properly on a MacOS or Linux distribution. I have found no budget-friendly or lightweight method to test an app under MacOS conditions on my Windows local machine.

The fourth option showed a lot of promise at first, as it seems to eliminate the platform problem. Requesting data/functionality from a back-end server via a browser does not require knowledge about the server’s platform. Furthermore python libraries such as Flask and Django facilitate this from a developer’s point of view.

Unfortunately, and much to my dismay, I have found that most PaaS companies protect their products behind significant paywalls. I have looked through the following options:

  • PythonAnywhere
  • Netlify
  • Heroku
  • Google App Engine
  • Kubernetes

Heroku showed the most promise, however I quickly found that it reserves its “Pipelines” feature to premium users only. I still think this is essential functionality for someone who wishes to learn the ropes of web app development. Kubernetes also looks very good, but I found no examples where it is used to deploy a flask app to an actual website, complete with CI/CD.

Does anyone understand my dilemma? How can I circumvent expensive, commercially oriented PaaS web services for the time being? How can I develop a small web app on a budget and still make use of good practices such as version control, continuous integration and deployment?

Thanks in advance for your help.