text:
Q: google place Manifest merger failed with multiple errors I have read there (Google Places Autocomplete Can't load search results)
how to solve an issue about troubles with Google Place and have decided to use version 2.0.0 because it recommended. Initially, I tried to use version 1.1.0 in my project. But had no success. After you type more than 3 characters an options in the search list have evaporated or works unstable.
So my project can't be built with version 2.0.0. With version 1.1.0 project has build. I'm confused.
It's working:
implementation 'com.google.android.libraries.places:places:1.1.0'
But when I switch to version 2.0.0
implementation 'com.google.android.libraries.places:places:2.0.0'
I see the error:
Manifest merger failed with multiple errors, see logs
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugManifest'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs
    at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication(AndroidBuilder.java:524)
    at com.android.build.gradle.tasks.MergeManifests.doFullTaskAction(MergeManifests.java:143)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:106)
    at sun.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 32 more

How can I update the version to 2.0.0?

A: You need to migrate your app to AndroidX to use v2.0.0. Google's migration guide states:

Version 2.0.0 of the Places SDK for Android now depends on
  AndroidX. Beginning with this version, the old support library will no
  longer be supported. In order to retain compatibility, you must
  migrate your projects to use AndroidX.

If you're using Android Studio, you can refactor your app to migrate to androidx very easily.
Hope this fixes your issue.

A: The advice about migration to AndroidX support library was useful. Some preliminary actions were necessary done before. At zero I have updated Android Studio to the newest version. At first, I removed .gradle and gradle directorys. At second I have changed 'com.android.tools.build:gradle:3.1.4' -> 'com.android.tools.build:gradle:3.2.0'. After that, I selected from the main menu Migrate to AndroidX. I pressed "Do Refactor" button and have got a message:
Cannot perform refactoring operation.
There were changes in code after usages have been found.
Please perform usage search again.

Would you like to rerun the search now?

I repeated the refactor and it was ended normally. I have change version of Places to 'com.google.android.libraries.places:places:2.0.0' and my project has been built successfully.


text:
Q: Ubuntu 16.04 stops booting, it has LVM and LUKS encryption configured, superblock restore already tried Suddenly my Ubuntu 16.04 drops me into an initramfs prompt like this:
BusyBox v.1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
Enter 'help' for list of built-in commands.

(initramfs)

If I type exit I get:
Gave up waiting for root device. Common problems:
  — Boot args (cat /proc/cmdline)
    — Check rootdelay= (did the system wait long enough?)
    — Check root= (did the system wait for the right device?)
  — Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!

BusyBox v.1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
Enter 'help' for list of built-in commands.

(initramfs)

Things I've tried, without success so far:

*

*Tried recovering a superblock backup with a USB boot disk, still boots into this.

*Cannot boot into a different kernel because when pressing SHIFT at grub time I only get one kernel in the advanced options.

When I get at the grub screen, if I press e these are my settings:
setparams 'Ubuntu'

    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 7ec61194-f216-4f1b-b684-5b2e2d643c25
    else
      search --no-floppy --fs-uuid --set=root 7ec61194-f216-4f1b-b684-5b2e2d643c25
    fi
    linux        /vmlinux-4.4.0-24-generic root=/dev/mapper/ubuntu--vg-root ro  quiet splash $vt_handoff
    initrd         /initrd.img-4.4.0-24-generic

If I boot into a bootable LIVE usb disk sudo fdisk -l returns:
Disk /dev/sda: 480.1 GB, 480103981056 bytes
255 heads, 63 sectors/track, 58369 cylinders, total 937703088 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x60229a0a

   Device  Boot     Start       End     Blocks    Id   System
/dev/sda1    *       2048    999423     498688    83   Linux
/dev/sda2         1001470 937701375  468349953     5   Extended
/dev/sda5         1001472 937701375  468349952    83   Linux

Disk /dev/sdb: (skipping since I think this is the USB disk...)

If I mount the partitions via nautilus (the encrypted one prompts me for my password, which I enter), then sudo lsblk returns:
NAME                                                 MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                                    8:0    0 447.1G  0 disk
├─sda1                                                 8:1    0   487M  0 part /media/ubuntu/7ec61194-f216-4f1b-b684-5b2e2d643c
├─sda2                                                 8:2    0     1K  0 part
└─sda5                                                 8:5    0 446.7G  0 part
  └─luks-11613ca4-65f2-4079-a750-6f71b6318903 (dm-0) 252:0    0 446.7G  0 crypt
    └─ubuntu--vg-root (dm-1)                         252:1    0 439.2G  0 lvm
    └─ubuntu--vg-swap_1 (dm-2)                       252:2    0   7.5G  0 lvm
sdb                                                    8:16   1   1.9G  0 disk
└─sdb1                                                 8:17   1   1.9G  0 part /cdrom
sr0                                                   11:0    1  1024M  0 rom
loop0                                                  7:0    0 938.7M  1 loop

What's wrong? What is preventing the system to boot up and ask me the encryption password like usual? Thanks!

A: You can try running the script below from the LiveCD (possibly updated versions at the link). The script attempts to partially automate the process for you. It was written and tested for an NVMe drive, so you may need to change things slightly if you are using a SATA/IDE drive with an /dev/sd* path. If you aren't using EFI you can delete any line containing efi or EFI by running sed -i -e '/efi/d' -e '/EFI/d' crypt-fix.sh after saving the script to your computer. Will have to add some detection logic for that eventually.
https://gist.github.com/dragon788/e777ba64d373210e4f6306ad40ee0e80
crypt-fix.sh
#!/bin/bash
# Call with `sudo bash DEBUG=1 ./crypt-fix.sh` for verbose output
[ -n "$DEBUG"] && set -x
# Prompt user for device from /dev/sd* /dev/nvme* /dev/mmc* prefixes?
# For /dev/sda probably sda1 is EFI and sda2 is boot and sda3 is encrypted
DEVICE=/dev/nvme0n1
EFIPATH="${DEVICE}p1"
BOOTPATH="${DEVICE}p2"
CRYPTPATH="${DEVICE}p3"
TARGETPATH=/mnt
# Need root for mounting stuff
if ! (( $EUID == 0 )); then echo "Please run with `sudo $0`"; fi

clear_mounts () {
# Clears mounts in case of interrupt or upon exit to allow running script multiple times
umount $TARGETPATH/boot/efi
umount $TARGETPATH/boot
umount $TARGETPATH/proc
umount $TARGETPATH/dev
umount $TARGETPATH
vgchange -an
cryptsetup close temp_name
cryptsetup close $CRYPTNAME
set +x
}
trap clear_mounts INT EXIT

cryptsetup open $CRYPTPATH temp_name
vgchange -ay
# Can't get this until LVM devices are scanned above
ROOTPATH=$(ls /dev/mapper/* | grep root)
# Make sure nothing else is mounted on our $TARGETPATH
umount $TARGETPATH
wait
mount $ROOTPATH $TARGETPATH
# Find the name that is required for `update-initramfs` to properly update things
CRYPTNAME=$(cat $TARGETPATH/etc/crypttab | awk '/^[ ]*[^#]/ { print $1; exit }')
umount $TARGETPATH
vgchange -an
cryptsetup close temp_name
# This proper name is required for `update-initramfs` to properly update things
cryptsetup open $CRYPTPATH $CRYPTNAME
wait
vgchange -ay
ROOTPATH=$(ls /dev/mapper/* | grep root)
mount $ROOTPATH $TARGETPATH
mount $BOOTPATH $TARGETPATH/boot
mount $EFIPATH $TARGETPATH/boot/efi
mount -t proc proc $TARGETPATH/proc
mount -o bind /dev $TARGETPATH/dev
# Have also seen people mounting dev/pts and run and sys, they don't appear to be necessary

chroot $TARGETPATH update-initramfs -c -k all
echo "Completed crypt-fix, try rebooting and you should get prompted for your passphrase after grub"

redpajama_set_name: RedPajamaStackExchange


text:
Q: Sign in with Apple - how to identify a user when sign up second time with real email I'm a bit of confused about documentation and what's in the variable description in sign up with Apple. Let's say we have an scenario:

*

*User Sign in with Apple using fake/generated email address.

*User switching the devices or using different device with my app.

*He's doing Sign in with Apple but with real email address.

Question: How to know that this is the same user in my database?
The docs linked above suggest that user in ASAuthorizationAppleIDCredential object is the answer I'm looking for:

var user: String
An identifier associated with the authenticated user.

But also Xcode displays this in variable description:

/** @abstract An opaque user ID associated with the AppleID used for the sign in. This identifier will be stable across the 'developer team', it can later be used as an input to @see ASAuthorizationRequest to request user contact information.
The identifier will remain stable as long as the user is connected with the requesting client.  The value may change upon user disconnecting from the identity provider.
       */
open var user: String { get }

What actualy that means in Sign in with Apple this as long as the user is connected with the requesting client. From that description I'm not sure if the user can deregister somehow or change this value or maybe this will happen in device-switch case?
What have I tried so far...
I've made a test in device and simulator and user value remain the same in dev environment but not sure how it's bahave IRL...


text:
Q: Why are Kubernetes Custom Resource Definitions cluster wide Hello StackOverflow users,
I've started working in the Kubernetes space recently and saw that Custom Resource Definitions(CRDs) types are not namespaced and are available to to all namespaces.
I was wondering why it isn't possible to make a CRD type scoped to a namespace. Any help would be appreciated!

A: See https://github.com/kubernetes/kubernetes/issues/65551#issuecomment-400909534 for a discussion of this issue.
A particular CRD can define a custom resource that is namespaced or cluster-wide, but the type definition (the CRD itself) is cluster-wide and applies uniformly to all namespaces.


text:
Q: data in arraylist not displayed correctly. instead displays "System.Collections.ArrayList" - vb.net Can anyone please help, tell me why the data from database did not display in the rows? Instead "System.Collections.ArrayList" and "System.Data.DataRow" are displayed.
Dim myArray(4, 4) As String
For Each dtrow As DataRow In dt.Rows
  list.Add(dtrow)
Next

For i = 0 To myArray.GetUpperBound(0)
  If i = 0 Then
    html.Append("
")
  ElseIf (i > 0 And i < 5) Then
    html.Append("
")
    html.Append("
")
    For j = 0 To myArray.GetUpperBound(1)
      Dim no = 0
         'insert the code i mentioned below here'
      no += 1
    Next ' j'
  End If ' if in i'
 Next ' i

When i tried running using this 1 line below inserted to the above code, it displays System.Collections.ArrayList in the rows.
html.Append(list)
But when i tried running using this 1 line below inserted to the above code, it displays System.Data.DataRow in the rows.
html.Append(list(no))
========================================================================
Another method i tried, when i tried running using this line "html.Append(dt.Rows.Item(0)(0))" , it displays the correct data, but when i tried to do a loop to increase the number of columns and rows, it shows the same value of data. as though as the 'rw' and 'col' loop didnt work.
 For j = 0 To myArray.GetUpperBound(1)
      Dim no = 0
      For rw = 0 To 5
        Dim rno = 0
        For col = 0 To 5
          Dim cno = 0
          no += 1
          html.Append(dt.Rows.Item(rno)(cno))
          cno += 1
        Next
       rno += 1
     Next
   Next 'j'

A: You already got a correct result when you used html.Append(dt.Rows.Item(0)(0)) - now you need write correct loop.
Noticed that you have DataTable instance - use this for looping through all rows and columns
For Each row As DataRow in dt.Rows
    html.Append("
")

    For Each column in dt.Columns
        html.Append("")
        html.Append(row(column.Ordinal))
        html.Append("	")
    End For

    html.Append("
")
End For

When working with xml I like using LINQ to Xml with XElement type, with those I can be sure that my xml structure is correct during compiling.
Visual basic have a nice feature which c# does not - XML Literals (Visual Basic)
Dim table As XElement =

For Each row As DataRow in dt.Rows
    Dim tr As XElement =

    For Each column in dt.Columns
        Dim td As XElement =
        td.Value = row(column.Ordinal).ToString()

        tr.Add(td)
    End For

    table.Add(tr)
End For


text:
Q: VBA Set Range With Blank Pivot Item I currently have the following code to set a range from my pivot table (the dataset is for regional income):
Set RngE1 = PT.PivotFields("Region").PivotItems("Europe").LabelRange
Set RngE2 = Intersect(PT.PivotFields("Region").PivotItems("Europe").DataRange.EntireRow, PT.PivotFields("Income").DataRange)
Set RngEurope = Union(RngE1, RngE2)

However this is a monthly report and in certain months there will be no income for Europe. As such, I would run into an error whereby the macro cannot get the LabelRange of the PivotItem class. Is there any code I can use that would skip this step if the LabelRange is not found, rather than break the macro?
Thanks

A: Its nasty but what about just an error trap?
Dim bTest as Boolean
bTest = False

' ----------
On Error Resume Next
Set RngE1 = PT.PivotFields("Region").PivotItems("Europe").LabelRange
If Err Then bTest = True
On Error Goto 0

If bTest Then
     'Handle here
Else
     'All good
End If


text:
Q: Trouble Creating Virtual_IP for PaceMaker + Corosync - CentOS 7 Ok so I have gotten fairly far into the configuration successfully, the two nodes have authenticated each other and all is well, but when I try to add the virtual_ip it never starts.
What i've used so far is not really relevant, but my write up (wip) is here, i just don't want to make this post look larger then it needs to be.
To create the virtual interface I have the used the following :
pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=192.168.1.218 cidr_netmask=32 op monitor interval=30s

I only have one nic and its config looks like this :
[root@node1 network-scripts]# cat ifcfg-eno16777984
TYPE="Ethernet"
BOOTPROTO=none
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT=no
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME=eth0
UUID="bf0b3de8-f607-42f3-9b00-f22f59292c94"
DEVICE="eno16777984"
ONBOOT="yes"
IPADDR=192.168.1.216
PREFIX=32
GATEWAY=192.168.1.1
DNS1=192.168.1.149

The Error: (found via "pcs status")
* virtual_ip_start_0 on node1 'unknown error' (1): call=12, status=complete, exitreason='Unable to find nic or netmask.',
last-rc-change='Fri Apr 29 02:03:57 2016', queued=1ms, exec=24ms

I don't think its an IPTables problem, as I have it disabled currently along with all other Firewalls. I don't have SELinux disabled. I suspect I need another network config, but im a bit lost what to make the device= and really I am just moving from Ubuntu, so the layout is a bit new, but I love NMTUI!
This looked promising regarding the interface, but I couldn't get it to work and I tried A LOT. Any help is appreciated.
A few other reads I went thru
https://www.centos.org/forums/viewtopic.php?t=50183
https://ihazem.wordpress.com/2011/03/15/adding-virtual-interface-to-centosredhat/
This is the guide I am following :
http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Clusters_from_Scratch/index.html#_add_a_resource
As always, if you need more info, I am happy to provide it, thanks in advance!

A: The guide doesn't have you add nic=eno### to this command, but it failed for me if I didn't use it.
You can find your device number via the following command
cat /etc/sysconfig/network-scripts/ifcfg-e* | grep DEVICE

Mine is eno16777984 so this is my example command.
pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=192.168.1.218 cidr_netmask=32 nic=eno16777984 op monitor interval=30s

Make sure it started using the following command:
pcs cluster start --all && sudo pcs status resources

A: When i used nic with resource creation, it worked:
pcs resource create VirtIP ocf:heartbeat:IPaddr2 ip=10.163.131.6 cidr_netmask=24 nic=eth0:1 op monitor interval=30s

A: You can update nic for an existing resource. Worked for me (CentOS 7.2)
pcs resource update RESOURCE_NAME nic=NIC_NAME
pcs resource cleanup


text:
Q: Filter in MDX query with Date Range filter and Year Filter I'm trying to filter my MDX query of can someone help me on how this can be done.
My code
Select
[Measures].[Net_Cost] on 0,
[State].[City] on 1

FROM
[SALES]

WHERE
([Date].[Date.AYearly].[2017]),([Date].[Date.AMonthly].[1] : [Date].[Date.AMonthly].[12])

and it throws an error.
I want to accomplish the following:
Where
year = 2017 and month is between 1 and current month.
How can this be done.
Thanks in advance

A: Maybe try one filter in a subselect and the other in the outer query:
SELECT
   [Measures].[Net_Cost] on 0,
   [State].[City] on 1
FROM
  (
   SELECT
     [Date].[Date.AYearly].[2017] ON 0
   FROM [SALES]
  )
WHERE
([Date].[Date.AMonthly].[1] : [Date].[Date.AMonthly].[12])
;

A: Thanks @whythe1 i did something like this
SELECT
NON EMPTY
 [Date].[Date.AYearly].[Year].[2017]:
 [Date].[Date.AYearly].[Year].[2017].PrevMember ON 0,

NON EMPTY
CROSSJOIN
(
    CROSSJOIN(
    {[Measures].[Net_Prod_Cost]},
    {[Territory].[Sales_Territory_Branch_Number].Members,
    [Territory].[Sales_Territory_Branch].Members}
    ),
    {[Products].[Products.SBM].[RYAN WEST]}
 ) ON ROWS

FROM [SALES]

WHERE
(
({[Date].[Date.AMonthly].[Month].[1] :
     [Date].[Date.AMonthly].[Month].[11]})
)}

and it worked.
Thanks your answer gave me an idea.


text:
Q: Can I manually decrease my FPS on windows 10? I'm working on a game in Unity and I set a flag to go off and essentially kick the user if their FPS is too low. I was wondering if there was an easy way to test if it works without having to go into the bios. Or is there perhaps a way to just test it in Unity before compiling?

A: Use Application.targetFrameRate, and make sure to set vSync off.
void Awake () {
    QualitySettings.vSyncCount = 0;
    Application.targetFrameRate = 4;
}


text:
Q: Combining an OR statement in a while loop I am building a small function to allow a player to select their shape at the beginning of a Tic Tac Toe game (pick X or O)  and for some reason I am having trouble with the following code.   The while statement does not work with OR statement in it.   The code runs when I remove either shape != "o" or  the shape != "x", but with both options in the while loop, I  never escape the while loop and am constantly asked what shape do I want to be.
def selectShape():
    shape = ""
    while shape != "o" or shape != "x":
        shape = raw_input("What shape do you want to be? x or o? ")
    if shape == "x":
        print "The computer is player o"
    else:
        print "The computer is player x"

A: You are constantly asked because one will always be true.
If you pick X then: shape != "o"
If you pick O then: shape != "x"
You should probably use AND instead of OR.
while shape != "o" AND shape != "x":
 That way if neither are correct it will continue to prompt. It will break and continue if one is X or O.


text:
Q: Highcharts: get index of the selection event On a chart, it is possible to get the minimum and maximum values when a selection event is performed https://api.highcharts.com/highcharts/chart.events.selection:
selection: function(event) {
// log the min and max of the primary, datetime x-axis
console.log(
    Highcharts.dateFormat(
        '%Y-%m-%d %H:%M:%S',
        event.xAxis[0].min
    ),
    Highcharts.dateFormat(
        '%Y-%m-%d %H:%M:%S',
        event.xAxis[0].max
    )
);
// log the min and max of the y axis
console.log(event.yAxis[0].min, event.yAxis[0].max);

}
I read that is possible to get the index on a specific selected point. So, I would like to know if it is possible to get also the indexes of those values? because, I want to avoid to search for those values in the series.

A: I am afraid not - the selection event returns only xMin, xMax, yMin, yMax coordinates. You need to find points that are included in this range, just like here: https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/chart/events-selection-points/


text:
Q: Pass a string by reference in Javascript I want to create a string and pass it by reference such that I can change a single variable and have that propagate to any other object that references it.
Take this example:
function Report(a, b) {
    this.ShowMe = function() { alert(a + " of " + b); }
}

var metric = new String("count");
var a = new Report(metric, "a");
var b = new Report(metric, "b");
var c = new Report(metric, "c");
a.ShowMe();  // outputs:  "count of a";
b.ShowMe();  // outputs:  "count of b";
c.ShowMe();  // outputs:  "count of c";

I want to be able to have this happen:
var metric = new String("count");
var a = new Report(metric, "a");
var b = new Report(metric, "b");
var c = new Report(metric, "c");
a.ShowMe();  // outputs:  "count of a";
metric = new String("avg");
b.ShowMe();  // outputs:  "avg of b";
c.ShowMe();  // outputs:  "avg of c";

Why doesn't this work?
The MDC reference on strings says metric is an object.
I've tried this, which is not what I want, but is very close:
var metric = {toString:function(){ return "count";}};
var a = new Report(metric, "a");
var b = new Report(metric, "b");
var c = new Report(metric, "c");
a.ShowMe();  // outputs:  "count of a";
metric.toString = function(){ return "avg";}; // notice I had to change the function
b.ShowMe();  // outputs:  "avg of b";
c.ShowMe();  // outputs:  "avg of c";

alert(String(metric).charAt(1)); // notice I had to use the String constructor
// I want to be able to call this:
// metric.charAt(1)

The important points here:

*

*I want to be able to use metric like it's a normal string object

*I want each report to reference the same object.

A: Strings in Javascript are already passed "by reference" -- calling a procedure with a string does not involve copying the string's contents. There are two issues at hand:

*

*Strings are immutable. In contrast to C++ strings, once a JavaScript string has been created it cannot be modified.

*In JavaScript, variables are not statically assigned slots like in C++. In your code, metric is a label which applies to two entirely separate string variables.

Here's one way to achieve what you want, using closures to implement dynamic scoping of metric:
function Report(a, b) {
    this.ShowMe = function() { alert(a() + " of " + b); }
}

var metric = "count";
var metric_fnc = function() { return metric; }
var a = new Report(metric_fnc, "a");
var b = new Report(metric_fnc, "b");
a.ShowMe();  // outputs:  "count of a";
metric = "avg";
b.ShowMe();  // outputs:  "avg of b";

A: You can wrap the string in an object  and modify the field the string is stored in.
This is similar to what you are doing in the last example only without needing to change the functions.
var metric = { str : "count" }
metric.str = "avg";

Now metric.str will contain "avg"

A: If you pass the variable as an object it will work, since objects are passed by reference in Javascript.
http://sirdarckcat.blogspot.com/2007/07/passing-reference-to-javascript.html
function modifyVar(obj,newVal){
obj.value=newVal;
}
var m={value: 1};
alert(x);
modifyVar("x",321);
alert(x);

A: Closure?
var metric = new function() {
    var _value = "count";

    this.setValue = function(s) { _value = s; };
    this.toString = function() { return _value; };
};

// snip ...
a.ShowMe();

metric.setValue("avg");
b.ShowMe();
c.ShowMe();

or making it a little more generic and performant:
function RefString(s) {
    this.value = s;
}

RefString.prototype.toString = function() { return this.value; }
RefString.prototype.charAt = String.prototype.charAt;

var metric = new RefString("count");

// snip ...

a.ShowMe();

metric.value = "avg";
b.ShowMe();
c.ShowMe();

If you don't close on the desired string variable, then I suppose the only other way would be to modify the ShowMe function, as in @John Millikin's answer or re-architect the codebase.

A: Jsfiddle: https://jsfiddle.net/ncwhmty7/1/
Both string primitives (String Literal) and  String objects are immutable. This means that any changes to the content of a string variable while in the function are completely separate from anything that happens outside the function. There are couple of options to overcome this:
1. Returning the modified function value form the function
function concatenateString(stringA, stringB) {
    return stringA + stringB;
}
alert(concatenateString("Hi", " there"));

2.  To convert the string variable to a true Object
function modifyVar(stringA, stringB) {
    var result = stringA + stringB;
    stringA.valueOf = stringA.toSource = stringA.toString = function() {
        return result;
    };
}
var stringA = Object('HI');
modifyVar(stringA, ' there');
alert(stringA);

A: If that string is a property of some object you can send the object and stringKey of the property:
    this.modificationFunction = function(object, stringKey){
      object[stringKey] = object[stringKey] + "bla bla bla";
    }

    myObject.myStringProperty = "She said: ";
    this.modificationFunction(myObject, "myStringProperty");
    // myObject.myStringProperty is now "She said: bla bla bla";

A: In JavaScript, strings are immutable. You can't change the string itself one the Report instances have a handle to it.
your solution works, but this may be simpler:
function Report(a, b) {
  this.showMe = function() { alert(a.str + " of " + b); }
}

var metric = {};
metric.str = "count";

a.Showme();
metric.str = "avg";
b.ShowMe();


text:
Q: Create Postgresql index with date_trunc Relating to this question. I want to create an index that returns the same output as this query;
--takes 2005-10-12
select date_trunc('month',table_withdates.dateoftransfer::date)::Date
from table_withdates;
--returns 2005-10-01

The below will index but returns with timestamp added to date which is not what I want.
create index on table_withdates  (date_trunc('month', dateoftransfer::timestamp));
--returns 2005-10-01 00:00:00

Is it possible to create an index which returns the date in that format without a timestamp

A: Quote from the manual

The return value is of type timestamp or interval with all fields that are less significant than the selected one set to zero

So you need to cast the result of date_trunc to a date:
create index on table_withdates  (date_trunc('month', dateoftransfer)::date);

Note that in order to make the index usable for a query, you need to use the exact same expression, eg:
where date_trunc('month', dateoftransfer)::date  = ...


text:
Q: What is causing a folder to act hidden when it is not? I have a home folder that is slightly grayed out. I can't open it unless I right click on it and 'Open'.
This is Mac OS X 10.10.2. This folder has been troublesome and I would love to get your help to find a solution.
Permissions are as follows:
drwxrwxrwx  60 root   staff   2040 14 May 14:04 sh
I have used Batchmod to try and modify all the permissions and remove ACLs but the folder keeps acting like hidden.

A: Try entering this command in Terminal:
chflags -v nohidden [path to homefolder]

You can see the full details for this command on its man page
-v provides verbose output
-nohidden is sets the target file/folder to be seen within the GUI (note: the flag is technically "hidden", but you can append "no" in front of any flag to remove it)


text:
Q: Descriptive flake8 errors in PyCharm PyCharm does not have a built-in support for flake8 at the moment. But, flake8 can be configured to run as an external tool.
Sometimes, especially for Python newcomers, not every flake8 warning is understandable and additional clarification is required.
We've recently stumbled upon the Flake8Rules project which attempts to describe every single warning in a detailed way with supportive examples.
Is there a way to combine PyCharm, flake8 and Flake8Rules altogether to have static code analysis warnings displayed with additional descriptions or links to the Flake8Rules catalog?

A: To all the folks, who need:

*

*run against files using a remote python interpreter with SSH

*who want only flake8 on changed files regarding git status

*who want to pass any other flake8 arguments without pain

To setup that kind of tool in Pycharm:
File | Settings | Tools | Remote SSH External Tools

see below screen for example configuration:

Arguments: -c "flake8 $(git status -s | grep -E '\.py$' | cut -c 4-) --max-line-lengt=120"
In my case the crucial thing was:

*

*use /bin/bash instead of flake8 directly

*Filling the arguments section by -c "whatever args subcommands etc I need here"
For reference:

*

*$(git status -s | grep -E '\.py$' | cut -c 4-) is responsible for passing locations of files with changes according to git version control

*https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000610520-Remote-SSH-external-tool-run-multiple-commands-once
NOTE: to have your flake8 from virtualenv you might want to specify full path like:
/z/your_virtual_envs/bin/flake8

A: It is definitely possible.
One approach would be to adjust the flake8 output using the --format command-line option to specify http(s) links to the Flake8Rules catalog:
--format='%(path)s:%(row)d,%(col)d:%(code)s:%(text)s:https://lintlyci.github.io/Flake8Rules/rules/%(code)s.html'

The problem then is for the console or PyCharm output window to render the links properly.
Fortunately, we can do that using the plugins - "Awesome Console" for the terminal and "Console Link" for the output window.

Step-by-step Instructions

*

*make sure to have flake8 installed in the current Python environment

*install "Awesome Console" plugin:

*

*go to PyCharm Preferences -> Plugins -> Browser Repositories...

*find "Awesome Console" and install (PyCharm restart required):

*configure "flake8" as an External Tool:

*

*go to PyCharm Preferences -> Tools -> External Tools -> "+"

*configure the path to flake8 as well as $FilePath$ placeholder for the desired directory/path to be processed:

Demo
Now, let's say we have created this test.py file with a few violations:
def f(a = 10):
  return a*10

If we right-click on a test.py file, select External Tools -> flake8, this is the output we are going to get (note the clickable links for every warning):

Now, whenever in doubt, we can follow the link for additional details about a warning.
This is just one way to do it, would be happy to hear if there is an easier or better way to combine these tools and projects.

A: I've wrote a library that offer - kind of native flake8 integration with pycharm. The library work by pretending to be a pylint executable. It accept pylint arguments and translate it to flake8 counterpart. Similarly it translate flake8 output to equivalent pylint output.
Result is native flake8 support.
https://gitlab.com/ramast/flake8-for-pycharm/

A: Here's the approach I used, we basically need to tell flake8 how to output it's errors and tell pycharm how to interpret them. And then run the job when a file changes.

*

*Install the 'File Watcher' plugin if not already

*Click '+' under 'Tools' > 'File Watcher'

*Create something that looks like the following. We're basically telling flake8 how to format it's output and how pycharm should interpret it here (see this and this)

*flake8 (this assumes it's installed globally)

*--format="ERROR: %(path)s[%(row)d, %(col)d]: %(text)s (%(code)s)" $FilePath$

*$FilePath$

*ERROR: $FILE_PATH$\[$LINE$, $COLUMN$\]: $MESSAGE$

*Now under 'Editor' > 'Inspections' make sure 'File Watcher Problems' is enabled

A: Today i Also face this problem although @alecxe answer is good for one project settings
If you want to set flake8 globally , you can follow below process

*

*make sure flake8 installed in your project

*make sure virtualenv path set in pycharm

*configure flake8 as external tool
goto file> settings> (Tools) > External Tools > '+'

configure the path

Program -
The path to the flake8 executable $PyInterpreterDirectory$ is a directory where the Python interpreter of the current project is placed
Argument- Specifies what files and folders should be checked $FilePath$
Working directory - Project root directory $ContentRoot$


text:
Q: Problem with reading pasted text in terminal I'm reading text in terminal with
description = raw_input()
It works if I write the text and press enter. The problem is when I paste the text from somewhere with Ctrl+Shift+V or with right click + paste. My program immediately ends, description contains only part of the text (I can see it in database).
Do you know how to do this so paste works? I'm using xfce4-terminal in Ubuntu.
thank you

A: Make sure that your pasted text doesn't contain any embedded control characters (such as a newline), which could end the input.

A: Try this, lifted it from a google search. You have to enter 3 blank lines after your paste, but of course, if there are 3 blank lines in your paste, then it won't work. The concept is there though, you just need to pick an end control character. Thanks for the comments catching that guys.
print "paste quote:"
emptycount = 0
lines = []

while emptycount < 2:
    t = raw_input()
    if len(t) == 0:
        emptycount +=1
    else:
        emptycount=0
        lines.append(t)
        lines.append("\n")

print " ".join(lines[:-1])


text:
Q: SysCache2 and FluentNhibernate on MVC aplication I am having a problem with SysCache/SysCache2 on my MVC application. My configuration seems to be correct. I have set it up just like countless examples on the web.
On my class I have put:  Cache.Region("LongTerm").NonStrictReadWrite().IncludeAll();
Here is a Test I made for the application cache.
[Test]
        public void cache()
        {
            using (var session = sessionFactory.OpenSession())
            using (var tx = session.BeginTransaction())
            {
                var acc = session.QueryOver<Log>().Cacheable().List();
                tx.Commit();
            }

            var test = sessionFactory.Statistics.SecondLevelCacheHitCount;

            using (var session = sessionFactory.OpenSession())
            {
                var acc = session.QueryOver<Log>().List();
            }

            var test1 = sessionFactory.Statistics.SecondLevelCacheHitCount;
        }

The first statement is cached as I see in the session factory statistics (for example 230 records).
If i understand it right second statement that is below shouldnt hit the db but the Cache.
Problem here is that it goes to DB anyway. Checked with profiler to be 100% sure.
I don't know what am I doing wrong here. Anyone has an idea?

A: I have managed to solve this problem. It had to do with my session creation. I didn't use session per request which triggered not going to cache. I created transaction on begining and it lasted through entire session. I managed to trigger entering cache if i opened the session again within using mark like: using(var sess = session.SessionFactory.OpenSession()) but this solution was only a workaround which didn't suit me so I changed how I created sessions in the first place and it works fine now! :)


text:
Q: Subversion: How do you get back a commit which was reverse-merged out of a branch? We have a SVN repository, and were attempting to create a release branch off of trunk.  We created the branch, then did a reverse merge of the commits in trunk which were not yet ready to be released.
This worked fine for that release, but now some of those commits have been approved and we're ready to bring them back into the release branch.  However, SVN doesn't see them as being mergable, and when we try to force it nothing happens.
This appears to be intended behavior (or at least known behavior), based on this SVN 1.5 document, which says that

[There will be no mergeinfo if] reverse merging a change from a path's own history. This is the common use case where
  merge is used to revert a committed change. This works, but mergeinfo is not updated
  because the current mergeinfo design has no way to explicitly record reverse merges.

So, given that that was written for 1.5, and we're currently on SVN 1.8... is there any way to make this work? How can I merge back a commit which was reverse-merged out of a branch?  Can I manually create the mergeinfo property to enable it?  Is there a way to force it?  Or is this branch hosed and we should handle it differently?

A: You should've used blocking changes instead of reverse merges. I guess that SVNBook | Blocking Changes section should help.


text:
Q: DGrid sorting itself after changing page I have a dGrid component in my application. In it I have custom sorting method.
var grid = new (declare([Grid, Pagination]))({
        store: new Memory({ data: data, idProperty: 'id' }),
        columns: columns,
        pagingLinks: 1,
        pagingTextBox: true,
        firstLastArrows: true,
        pageSizeOptions: [10, 15, 25]
    }, 'domID');

grid.on('dgrid-sort', function (event) {
                event.preventDefault();
                grid.set('sort', function (a, b) {
                    *sorting logic*
                grid.updateSortArrow(event.sort, true);
            })

My dGrid sorts itself just like I need it to. But now I have problem with paging. When I change page in my dGrid, it goes back to standard sorting from array prototype. Any ideas what to do?

A: It is preferable to implement your custom sorting logic in the store. In that way the logic will be always applied.
For details refer to this question: Non case-sensitive sorting in dojo dgrid


text:
Q: PyQt4.QtGui causes DLL Load Error with Python 2.7.5 PyQt4 seems to work fine on Python 2.7.5 running on Windows 8 64bit until now. Using the interactive shell via cmd:
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> from PyQt4.QtGui import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.

Question: What is causing this issue all of a sudden?


text:
Q: draggable() - preventing dragging element outside window how can you prevent the user to drag the element outside the window?
elm.css({
        top : $(window).scrollTop() + ($(window).height() - elm.height()) / 2+'px',
        left : ($(window).width() - elm.width()) / 2+'px'
    })
    .draggable({
        handle : tr_top
    });

A: You can use the containment option:
elm.draggable({
    handle: tr_top,
    containment: "window"
});


text:
Q: Having problems initialising a class into another class shows error code Im having problems initialising the MyFirebase class into the Profile Window class, an error code is occurring in the App class constructor on the line self.page = ProfileWindow(self.thefirebase) and the error is  TypeError: __init__() takes 1 positional argument but 2 were given. if required to I can post the whole traceback. Here is the relevant part of my code
mainfile.py

from kivy.app import App
import requests
import json
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.lang import Builder
from kivy.clock import Clock

class MyFireBase():

    def __init__(self):
        self.localId = None
        self.sign_up_request = None

    def sign_up(self, email, password):

            app = App.get_running_app()
            email = email.replace("\n","")
            password = password.replace("\n","")

            # Send email and password to Firebase
            # Firebase will return localId, authToken (idToken), refreshToken
            signup_url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=" + self.wak
            signup_payload = {"email": email, "password": password, "returnSecureToken": True}
            self.sign_up_request = requests.post(signup_url, data=signup_payload)
            sign_up_data = json.loads(self.sign_up_request.content.decode())
            print(self.sign_up_request.ok)
            print(self.sign_up_request.content.decode())

            if self.sign_up_request.ok == True:
                print(sign_up_data)
                refresh_token = sign_up_data['refreshToken']

                self.localId = sign_up_data['localId']
                idToken = sign_up_data['idToken']

                # Save refreshToken to a file
                with open(app.refresh_token_file, "w") as f:
                    f.write(refresh_token)

                app.local_id = self.localId
                app.id_token = idToken

                my_data =  '{"avatar": "profilepic.png", "jobs_done": "", "jobs_posted": ""}'
                post_request = requests.patch("https://moonlighting-bb8ab.firebaseio.com/users/" + self.localId + ".json?auth=" + idToken, data=my_data)
                print(post_request.ok)
                print(post_request.content.decode())

                app.root.current = "create"

            elif self.sign_up_request.ok == False:

                error_data = json.loads(self.sign_up_request.content.decode())
                error_message = error_data["error"]['message']
                app.root.ids.signup.ids.signup_message.text = error_message.replace("_", " ")

    def send_user_details(self):
        app = App.get_running_app()
        my_data ={"first name": app.root.ids.create.ids.first_name.text, "last name": app.root.ids.create.ids.last_name.text,
                   "phone number": app.root.ids.create.ids.phone_number.text, "job1": app.root.ids.create.ids.job1.text, "job2": app.root.ids.create.ids.job2.text,
                   "job3": app.root.ids.create.ids.job3.text, "date of birth": app.root.ids.create.ids.date_of_birth.text, "state": app.root.ids.create.ids.state1.text}

        user_details = requests.patch("https://moonlighting-bb8ab.firebaseio.com/users/" + app.local_id + ".json?auth=" + app.id_token,  json.dumps(my_data))
        print(user_details.ok)
        print(user_details.content.decode())

        app.root.current = "main"

    def sign_in_existing_user(self, email, password):
        signin_url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=" + self.wak
        signin_payload = {"email": email, "password": password, "returnSecureToken": True}
        signin_request = requests.post(signin_url, data=signin_payload)
        sign_up_data = json.loads(signin_request.content.decode())
        app = App.get_running_app()
        print(signin_request.ok)
        print(signin_request.content.decode())

        if signin_request.ok == True:
            refresh_token = sign_up_data['refreshToken']

            self.localId = sign_up_data['localId']
            idToken = sign_up_data['idToken']
            # Save refreshToken to a file
            with open(app.refresh_token_file, "w") as f:
                f.write(refresh_token)

            app.root.current = "main"

        elif signin_request.ok == False:
            error_data = json.loads(signin_request.content.decode())
            error_message = error_data["error"]['message']
            app.root.ids.login.ids.login_message.text = error_message.replace("_", " ")

thefirebase = MyFireBase()

class ProfileWindow(Screen):

    def __init__(self, thefirebase, **kwargs):
        super(ProfileWindow, self).__init__(**kwargs)

        self.thefirebase = thefirebase

    def print(self):
        print(self.thefirebase.localId)

class MyApp(App):
    refresh_token_file = "refresh_token.txt"
    members_list = "members_list.txt"

    def build(self):
        self.thefirebase = MyFireBase()
        self.refresh_token_file = self.user_data_dir + self.refresh_token_file
        self.page = ProfileWindow(self.thefirebase)

        Clock.schedule_once(self.manager)

        return sm
        # delay your call to sign_up() until the App is built

class WindowManager(ScreenManager):
    pass

kv = Builder.load_file("kivy.kv")

sm = WindowManager()

sm.current = "page"

kivy.kv
WindowManager:
    id: window manager
    ProfileWindow:
        id: page
        name: "page"

Traceback
Traceback (most recent call last):
   File "/Users/temitayoadefemi/PycharmProjects/test5/mainfile.py", line 144, in <module>
     kv = Builder.load_file("kivy.kv")
   File "/Users/temitayoadefemi/PycharmProjects/test5/venv/lib/python3.7/site-packages/kivy/lang/builder.py", line 301, in load_file
     return self.load_string(data, **kwargs)
   File "/Users/temitayoadefemi/PycharmProjects/test5/venv/lib/python3.7/site-packages/kivy/lang/builder.py", line 405, in load_string
     rule_children=rule_children)
   File "/Users/temitayoadefemi/PycharmProjects/test5/venv/lib/python3.7/site-packages/kivy/lang/builder.py", line 654, in _apply_rule
     child = cls(__no_builder=True)
 TypeError: __init__() missing 1 required positional argument: 'thefirebase'

Any help would be appreciated

A: The problem is not coming from your App constructor, but from the Builder.load_file(). In your kv file you are building a ProfileWindow, but not providing the required positional argument of firebase to the constructor. I'm not sure there is a way to do that in kv. However, the MyFireBase instance can be built in the kv file and assigned to the thefirebase attribute of ProfileWindow
So, one solution is to remove the required positional argument from the ProfileWindow constructor, and pass the firebase using kwargs. Here is a modified version of your code that makes that change and builds thefirebase in the kv file (and make a few other changes):
from kivy.app import App
import requests
import json

from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.lang import Builder
from kivy.clock import Clock

class MyFireBase(object):

    def __init__(self):
        self.localId = None
        self.sign_up_request = None

    def sign_up(self, email, password):

            app = App.get_running_app()
            email = email.replace("\n","")
            password = password.replace("\n","")

            # Send email and password to Firebase
            # Firebase will return localId, authToken (idToken), refreshToken
            signup_url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=" + self.wak
            signup_payload = {"email": email, "password": password, "returnSecureToken": True}
            self.sign_up_request = requests.post(signup_url, data=signup_payload)
            sign_up_data = json.loads(self.sign_up_request.content.decode())
            print(self.sign_up_request.ok)
            print(self.sign_up_request.content.decode())

            if self.sign_up_request.ok == True:
                print(sign_up_data)
                refresh_token = sign_up_data['refreshToken']

                self.localId = sign_up_data['localId']
                idToken = sign_up_data['idToken']

                # Save refreshToken to a file
                with open(app.refresh_token_file, "w") as f:
                    f.write(refresh_token)

                app.local_id = self.localId
                app.id_token = idToken

                my_data =  '{"avatar": "profilepic.png", "jobs_done": "", "jobs_posted": ""}'
                post_request = requests.patch("https://moonlighting-bb8ab.firebaseio.com/users/" + self.localId + ".json?auth=" + idToken, data=my_data)
                print(post_request.ok)
                print(post_request.content.decode())

                app.root.current = "create"

            elif self.sign_up_request.ok == False:

                error_data = json.loads(self.sign_up_request.content.decode())
                error_message = error_data["error"]['message']
                app.root.ids.signup.ids.signup_message.text = error_message.replace("_", " ")

    def send_user_details(self):
        app = App.get_running_app()
        my_data ={"first name": app.root.ids.create.ids.first_name.text, "last name": app.root.ids.create.ids.last_name.text,
                   "phone number": app.root.ids.create.ids.phone_number.text, "job1": app.root.ids.create.ids.job1.text, "job2": app.root.ids.create.ids.job2.text,
                   "job3": app.root.ids.create.ids.job3.text, "date of birth": app.root.ids.create.ids.date_of_birth.text, "state": app.root.ids.create.ids.state1.text}

        user_details = requests.patch("https://moonlighting-bb8ab.firebaseio.com/users/" + app.local_id + ".json?auth=" + app.id_token,  json.dumps(my_data))
        print(user_details.ok)
        print(user_details.content.decode())

        app.root.current = "main"

    def sign_in_existing_user(self, email, password):
        signin_url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword?key=" + self.wak
        signin_payload = {"email": email, "password": password, "returnSecureToken": True}
        signin_request = requests.post(signin_url, data=signin_payload)
        sign_up_data = json.loads(signin_request.content.decode())
        app = App.get_running_app()
        print(signin_request.ok)
        print(signin_request.content.decode())

        if signin_request.ok == True:
            refresh_token = sign_up_data['refreshToken']

            self.localId = sign_up_data['localId']
            idToken = sign_up_data['idToken']
            # Save refreshToken to a file
            with open(app.refresh_token_file, "w") as f:
                f.write(refresh_token)

            app.root.current = "main"

        elif signin_request.ok == False:
            error_data = json.loads(signin_request.content.decode())
            error_message = error_data["error"]['message']
            app.root.ids.login.ids.login_message.text = error_message.replace("_", " ")

#thefirebase = MyFireBase()    # not needed
Factory.register('MyFireBase', cls=MyFireBase)   # register MyFireBase so that it is available in kv

class ProfileWindow(Screen):
    thefirebase = ObjectProperty(None)

    def __init__(self, **kwargs):
        self.thefirebase = kwargs.pop('firebase', None)   # use kwargs to pass the firebase to eliminate the required positional arg
        super(ProfileWindow, self).__init__(**kwargs)

        #self.thefirebase = thefirebase   # not needed

    def print(self):
        print(self.thefirebase.localId)

class MyApp(App):
    refresh_token_file = "refresh_token.txt"
    members_list = "members_list.txt"

    def build(self):
        self.refresh_token_file = self.user_data_dir + self.refresh_token_file
        return sm

class WindowManager(ScreenManager):
    pass

sm = Builder.load_file("kivy.kv")

#sm = WindowManager()    # not needed, sm is built by the `kv` file

# sm.current = "page"    # not needed, it is the default

if __name__ == '__main__':
    MyApp().run()

kivy.kv:
#:import Factory kivy.factory.Factory

WindowManager:
    id: window manager
    ProfileWindow:
        id: page
        name: "page"
        thefirebase: Factory.MyFireBase()   # this builds thefirebase
        Button:
            text: 'ProfileWindow'   # just so the ProfileWindow has something to display
            on_release: page.print()


text:
Q: What is property of ring of factorization domain without uniqueness? I just studied UFD definition, and I figured out 'factorisable' and 'uniqueness' are independent.
Classical example $Z[\sqrt{-5}]$ is ring that every element and be factorisable but not uniquely.
I thought example $Z^N$ that not every element can be factorisable but every factorisable element can be uniquely factorized.
From those examples, I thought those questions:
(1) What is example of ring such as $Z^N$ without infinite tuple things?
(2) With only property 'every factorisable element can be uniquely factorized' (let call that ring UFD'), does property of UFD such as "prime iff irreducible" and "any of two elements has GCD/LCM" hold? ($Z^N$ holds this property.)
(3) What is properties of ring of factorization domain without uniqueness? Above property are strongly depends on uniqueness of factorization rather than factorization.
PS. For question (2), I think this is false because $R^N$ for any UFD $R$ hold those properties. It is almost same as question (1), finding UFD' other than this naive construction.


text:
Q: Composition or aggregation in this example I know the theory but obviously when it comes to real world, I just do not know. In the following example is the relation between game and player/board a composition (they are instantionated inside the Game class)? And between a board and a pawn - aggregation, because the board can exist with 0 pawns?
Class Game
{
   Player p;
   Gameboard b;
  void Start()
  {
     p=new Player();
     b=new Gameborad();
  }
}

class Gameboard
{
   List<pawn> listOfpawns=new List<pawn>();
}
}

A: The difference between composition and aggregation is not whether a board can exist with zero pawns, but whether pawns can exist without boards, and also whether players and game boards can exist without a game.
In other words, if destroying a game will destroy all the players and boards then you have composition.  If players and boards can live outside a game, then you have aggregation.
If destroying a board with destroy the pawns then you have composition.  If pawns can live without a board, you have aggregation.
In general, if destroying the container destroys its elements, that's composition.  Elements whose existence is not dependent on the container are said to be held by aggregation.
The classic examples of aggregation are:

*

*Countries within alliances, because countries continue to exist if the alliance is disbanded

*People within organizations, since the people still live when the organization ceases to exist

The classic examples of composition are:

*

*The schedule(s) of a person, since if the person goes away, the schedule does too.

A: Composition
An object contain other objects, stored by value. These are usually elements you think as internal to the object holding them, like a cardDeck object has card objects. Even if the deck isn't initially filled, the objects mostly have purpose only inside the holding object.
Aggregation
An object contains references to other objects, the aggregated objects are something that exist out in the program in another context, and the parent object is just holding them for organizational or functional reasons. Example given in the below site reference is a plane that holds person objects. The persons may come and go, and may be used in other parts of the program.
In This Case:
Your example I'd say falls more under Composition. Much like the deck of cards, the pawns have little meaning outside of the game board.
Terminology
The literalness "by value" or "by reference" depends on the language, when people say one or the other in this context they use it to refer to how strong an owning relationship the parent has.
Of course in Java all objects are stored by reference, But! As soon as no references to an object exist, it's eventually culled by the GC. The airplane is likely to be holding the only reference to the engine, so the engine dies when the airplane is removed. People can have other things referencing them beyond the airplane, so you can think of it less like the Airplane is holding them directly.
(Reference http://atomicobject.com/pages/Aggregation)

A: Ray and Vigilant are right but what is right for you depends more on the (goal of the) Application then it does on the objects itself.

*

*Game/Player:

*

*If the application is an ad-hoc Game: Player would be Composite

*If the application does more with the Players (keeps scores/ranking): Player
would be Aggregation

or

*

*Airplane/Engine:

*

*If the application is a Airline: Engine would be Composite

*If the application is Maintenance: Engine would be Aggregation


text:
Q: backspace does not work on my ssh client I SSH into a unix server using SSH client version 3.2.9.  Several key features do not work when i'm logged into the server. to name few: backspace (^H is made instead but shift+backspace works), when i press <tab> I do not get suggestions, ~ does not take me to home.
I have local.cshrc, local.login and local.profile in my home folder (when I login).
Following is in local.profile
$ more local.profile
#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
# ident "@(#)local.profile      1.10    01/06/23 SMI"
stty istrip
PATH=/opt/sunone_apps/Dep/POL/:/usr/bin:/usr/ucb:/etc:.

export PATH

A: A quick fix is to do:
stty erase <backspace>

Where, you try to hit backspace. Hit enter at the end of that line, and from that point on, the system will recognize that as your backspace character -- but it will only stick for the length of that session.
It's a temporary fix, for when you can't be bothered with logging out, changing the terminal type, and logging back in.

A: Permanent Fix:
I have seen such problems before.
Take the backspace for example, the remote host expects some character to be used as "erase/backspace" , while you pressing backspace in the terminal , the terminal program will send some character to the remote host, if what the remote host expects diffs with the characters sent by the terminal program, you would encounter this issue. So a quick fix is as below:
run command #stty -a in the remote host, and find what is expected to be an erase code in the output. Say erase=^?.
In the terminal, type Ctrl v and press your backspace. You'll see what code is sent as "erase". Say it is ^H.
In the remote host, run #stty erase ^H.
You can fix the Tab issue with the same as above.

A: Your issue could be related to a missing terminfo file.
In my case, none of the suggestions here worked. In fact, my terminal was sending ^? to erase (when I pressed backspace), which matched the server's erase character expectation, but I still couldn't erase.
What worked for me was installing my client's terminfo file to the server's terminfo database. Each system has a database of supported terminals, usually in /usr/share/terminfo. Each user in that system may have their own private supported terminal database, usually in ~/.terminfo. If your particular terminal isn't in either database, chances are you're going to run into this issue or possibly others.
To solve,

*

*Produce your client terminal's terminfo file by running infocmp > $TERM.ti. (The filename is actually irrelevant.)

*Copy $TERM.ti to the server. (For example, with scp, since you're already using ssh.)

*From the server, run tic $TERM.ti from the directory into which you copied $TERM.ti. (This will install your client terminal's terminfo to the server user's terminfo database or to the system's terminfo database if you run the command with superuser privileges.)

*Restart your terminal in the server. (Possibly running $0 would work.)

A: Also, Depends on the terminal. On a windows machine, I use MobaXterm which is like a beefy version of Putty. When you create a session (saved or not), you have a "Terminal sttings" tab that has an option to send ctrlH, as backspace. Uncheck this option. You can do this mid-session, without having to restart your session or get out of generating CSR's, etc.
This is also where you can change your terminal type (such as xterm or vt100, etc.).

A: Typically this is caused by your terminal not being recognized on the remote end. If you are connecting to an old Unix or Linux system you may need to change your terminal type to be vt100.

A: I don't know about "SSH Client 3.2.9", but most SSH clients let you specify whether your backspace key will send ^H (backspace) or ^? (DEL).  Your problem is that you're using the latter when you should be using the former.
In Putty, you change this for a saved profile under the profile's keyboard options.  Look for a similar configuration option in your client, or switch to Putty.
The suggestion from @oo. regarging stty erase <backspace> will tell your terminal session to expect whatever character your SSH client is sending.  Fixing this in your client is a better solution.
Note that in the stty command, you MAY have to prepend the backspace key with a Ctrl-V to "escape" it so that it's dealt with literally.  Modern shells (bash/tcsh) will often "accept" a DEL even when Backspace is the erase character, just to make things easier for people.


text:
Q: Find out last login time in hours Hello here is i am trying to do is to find out last login time of users in hours and want to find out the difference of current time and last login time in Api.
The response i am getting is
{
    "status": "true",
    "message": "Last Login Time Appeared Successfully!",
    "dataArray": [
        {
            "Lastlogin": "2016-05-31 23:06:39"
        }
]
}
and response i want to get is
lastLoginTime": "48 Hours",
and my Controller Code is
$id = $request->input('id');
    $user = DB::table('users')
        ->where('id', $id)
        ->select('users.Lastlogin')
        ->get();
    if($user)
    {
        $resultArray = ['status' => 'true', 'message' => 'Last Login Time Appeared Successfully!', 'dataArray' => $user];
        return Response::json($resultArray, 200);
    }
    else{
        $resultArray = ['status' => 'false', 'message' => 'Not Find Last Login Time!'];
        return Response::json( $resultArray, 400);
    }

Any help will be appreciatd.

A: You can calculate hour using Carbon,like that
$user = DB::table('users')
        ->where('id', $id)
        ->select('users.Lastlogin')
        ->get();
    if($user)
    {
        $lastLogin = \Carbon\Carbon::parse($user->Lastlogin);
        $current = \Carbon\Carbon::parse(date('Y-m-d H:i:s'));
        $diffInHour = $current->diffInHours($lastLogin);

        $resultArray = ['status' => 'true', 'message' => 'Last Login Time Appeared Successfully!', 'dataArray' => $user];
        $resultArray['dataArray']['lastLoginTime'] = $diffInHour.'hours';
        return Response::json($resultArray, 200);
    }
    else{
        $resultArray = ['status' => 'false', 'message' => 'Not Find Last Login Time!'];
        return Response::json( $resultArray, 400);
    }


text:
Q: Identify Phrases/Words in a Sentence I'm looking for an API or library that can identify certain phrases/words in a sentence or short phrase?
The application of this is to find items which are not permitted.  For instance, we will have a definitive list of phrases/words that are not permitted e.g., knife, battery, oil, paint, nail polish, glass etc.
We will then have a list of short phrases that need to be checked against this list.  Ideally the API should handle pluralisation, misspellings and number substitutions e.g., 0 as o
UPDATE 15 Oct 2021:
Over the past few months, I've been experimenting with Fuse (JavaScript) and FuzzySharp.  However, I'm still struggling to find a solution that can accurately identify words/phrases.
Using FuzzySharp, some examples of false positives are:

*

*"used hot water bottle" – this matched "water" with a score of 90

*"waterproof trousers" – this matched "water" with a score of 90

*"oil" – this matched "toiletries" with a score of 90

*"toilet" – this matched "toiletries" with a score of 90
I understand why these have a high score, however I'm unsure of what technology I should be using improve accuracy.  At the moment we only have 298 phrases that we want to search against


text:
Q: Unable to bring up vagrant box image which was added with parameter --name I downloaded the Vagrant box image directly using the URL and then added them using the --name option as
    C:\Users\vnathan>vagrant box add --name monasca c:\Users\vnathan\.vagrant\machines\monasca\devstack\virtualbox\devstack-0.1.3.box

and I was able to see the directory with vmdk file, manifest.json file, Vagrantfile, OVA file.
under the directory C:\Users\vnathan.vagrant.d\boxes\monasca\0\virtualbox
I was able to able to view the list of added box on running
       C:\Users\vnathan>vagrant box list
       monasca (virtualbox, 0)

but I was not able to bring up the vagrant box on running the vagrant up command.
      C:\Users\vnathan>vagrant up monasca
      The machine with the name 'monasca' was not found configured for this Vagrant environment.

I updated the config.vm.box = "monasca" in the main Vagrantfile but still I could not bring up the instance.
Please let me know what should I do to poweron the box on running vagrant up. Thanks in advance.

A: Thanks BMW; I tried below steps on going thru some of the sites and finally I was able to add monasca box as part of vagrant but VirtualBox fails to import the image; I need to now dig in to resolve this issue.
C:\Users\vnathan>vagrant status
Current machine states:

     default                   not created (virtualbox)

     The environment has not yet been created. Run `vagrant up` to
     create the environment. If a machine is not created, only the
     default provider will be shown. So if a provider is not listed,
     then the machine is not created for that environment.

On Running vagrant up
C:\Users\vnathan>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'monasca'...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["import", "C:/Users/vnathan/.vagrant.d/boxes/monasca/0/virtualbox/box.
ovf", "--vsys", "0", "--vmname", "ds-build_devstack_1412364613065_73348_14187919
33520_71376", "--vsys", "0", "--unit", "7", "--disk", "C:\\Users\\vnathan\\Virtu
alBox VMs\\ds-build_devstack_1412364613065_73348_1418791933520_71376\\box-disk1.
vmdk"]

Stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interpreting C:\Users\vnathan\.vagrant.d\boxes\monasca\0\virtualbox\box.ovf...
OK.
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Appliance import failed
VBoxManage.exe: error: Could not create the clone medium 'C:\Users\vnathan\Virtu
alBox VMs\ds-build_devstack_1412364613065_73348_1418791933520_71376\box-disk1.vm
dk'.
VBoxManage.exe: error: VMDK: Compressed image is corrupted 'C:\Users\vnathan\.va
grant.d\boxes\monasca\0\virtualbox\box-disk1.vmdk' (VERR_ZIP_CORRUPTED)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component A
ppliance, interface IAppliance
VBoxManage.exe: error: Context: "int __cdecl handleImportAppliance(struct Handle
rArg *)" at line 779 of file VBoxManageAppliance.cpp


text:
Q: Java 8 lambda list inside list filter Sample JSON
[
  {
    "id": "1",
    "products": [
      {
        "id": "333",
        "status": "Active"
      },
      {
        "id": "222",
        "status": "Inactive"
      },
      {
        "id": "111",
        "status": "Active"
      }

    ]
  },
  {
    "id": "2",
    "products": [
      {
        "id": "6",
        "status": "Active"
      },
      {
        "id": "7",
        "status": "Inactive"
      }
    ]
  }
]

I want to retrieve list of objects that have at least one active product.
Below code returns list of products but I want a list of ProdcutResponse. Any way to do this?
 response.stream()
 .map(ProductResponse::getProducts)
 .filter(s -> "Active".equals(s.getType()))
 .collect(Collectors.toList())

A: Because you didn't show much code, this will be a shot in the dark.  My main suggestion would be to not map the Stream<ProductResponse> to a Stream<List<Product>> before collecting it to a list:
response.stream()
        .filter(pr -> pr.getProducts().stream().anyMatch(s -> "Active".equals(s.getType())))
        .collect(Collectors.toList());

You can change anyMatch to allMatch if you want the List<ProductResponse> to contain onlyProducts with active types (whatever that means).


text:
Q: My subreport is displaying all the result in each cell in the Main Report I do have RDLC files named MainReport.rdlc and SubReport.rdlc.
Subreport.rdlc (Obviously, act as my subreport).
I was able to display the details of my subreport in my Main Table. but the problem is that the subreport displays all the data on each row in my subreport
What I want is this:

But what is happening is this:

The dataset query on MainReport
Select DISTINCT tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment,Rating.fldQuality, Rating.fldQuantity, Rating.fldAccuracy from tblMain
JOIN tblScope as SCOPE on  tblMain.Scope = Scope.Id
LEFT JOIN tblRatings as Rating on tblMain.RatingRefCode = Rating.ScopeCode
where tblMain.ID_Num = @RefNo AND fldDate between @Start and @End
Group By tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment,Rating.fldQuality, Rating.fldQuantity, Rating.fldAccuracy

Here is the dataset query on Subreport
Select DISTINCT tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment from tblMain
JOIN tblScope as SCOPE on  tblMain.Scope = Scope.Id
LEFT JOIN tblRatings as Rating on tblMain.RatingRefCode = Rating.ScopeCode
where tblMain.ID_Num = @RefNo AND fldDate between @Start and @End
Group By tblMain.ID_Num, tblMain.fldDate,Scope.Description,tblMain.Accomplishment

A: It seems that you didn't set subreport parameters.
In MainReport.rdlc:

*

*right click on subreport > Subreport Properties > Parameters

*set a new parameter with name ScopeParameter and value equal to Scope field in your dataset (e.g. [ScopeId])

In Subreport.rdlc:

*

*set a new parameter with name ScopeParameter

*in your Tablix or Tablix Group define a new filter with [ScopeId] = @ScopeParameter
With large amount of data it seems faster using SubreportProcessingHandler event to filter data in your subreport instead of setting a filter in Tablix or Tablix Group.
Private Sub SubreportProcessingHandler(sender As Object, e As SubreportProcessingEventArgs)

    Dim intScope As Integer = CInt(e.Parameters.Item("ScopeParameter").Values(0))

    Dim dvYourDataView As New DataView(Me.dsYourDataset.Tables(0))
    dvYourDataView.RowFilter = "ScopeId = " & intIdScope

    e.DataSources.Add(New ReportDataSource("YourReportDataSourceName", dvYourDataView.ToTable("YourReportDataSourceName")))

End Sub


text:
Q: Nuxt Vue `this.$axios` is `undefined` even though I set a `nuxt.config.js` file in the root directory this.$axios is undefined. As I said in the title I set nuxt.config.js. This is what the error looks like.

This is the HomeView.vue page code where the error is occurring (I removed some methods as they aren't relevant) BTW, notice the line console.log(this.$axios); because this is what printed undefined in the web console:
<template>

    <button
      color="primary"
      class="btn btn-primary btn-lg btn-block"
      large
      :disabled="buttonDisabled"
      @click="performAction()"
    >
      Login with Metamask
      {{ buttonInstallText }}
    </button>

  <button
    type="button"
    class="btn btn-primary btn-lg btn-block"
    @click="register()"
  >
    Block level button
  </button>
</template>

I already installed axios with yarn add @nuxtjs/axios and set up my nuxt config file:
export default {
  modules: ["@nuxtjs/axios"],
  axios: {
    baseURL: "http://localhost:30005",
  },
};

Btw, the function localhost:30005/register works perfectly in Postman when I add the parameter wallet: 0x00fffff.

Also here is the code for the register api call. It's in backend/index.js
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const sqlite3 = require("sqlite3");
const path = require("path");
const app = express();

let port = "30005";

let db = new sqlite3.Database(path.resolve(__dirname, "bonus_content.db"));

app.use(bodyParser.json());
app.use(
  bodyParser.urlencoded({
    extended: true,
  })
);
app.use(cors());

const registerUser = (request, response) => {
  const { wallet } = request.body;
  console.log(wallet);
  db.run(
    "INSERT INTO bonus_content (wallet) VALUES ($1)",
    [wallet],
    (error, results) => {
      if (error) {
        response.status(500).json({ status: "fail", message: error });
      }
      response
        .status(201)
        .json({ status: "success", message: "Wallet added." });
    }
  );
};

app.post("/register", registerUser);

// allow javascript on a different domain (or port) to call this server's routes
// e.g. front-end running on localhost:8080 can call the server on localhost:41205

app.listen(port);
console.log("App is running on port " + port);

So the problem is centered around this.$axios being undefined. What am I doing wrong?
Btw, It's worth noting that I am going off of this tutorial here: https://duartefdias.medium.com/authenticating-users-to-your-web-app-using-metamask-and-nodejs-e920e45e358

A: Thank you for mentioning my article, glad you found it useful.
First, you need to make sure you have axios installed as mentioned here:
https://axios.nuxtjs.org/setup
My nuxt.config.js axios setup looks like this:
export default {
  axios: {
    browserBaseURL: process.env.API_URL
  }
}

The process.env.API_URL is an environment variable I created, but you can simply hardcode a string such as "http://localhost:3000"
Then I just call this.$axios from anywhere in the code. Example of a basic .vue page:

<template>
    <button @click="getData()">
        My Button
    </button>
</template>

If I were you I would start by building a dummy backend endpoint which simply returns a string and getting that to work with Vue prior to moving into building the blockchain wallet register/login endpoints.


text:
Q: Tree position terminology/naming This is a naming things question. I am processing trees (XML documents), and there are often special rules applied to nodes based on structure. It's been very difficult coming up with concise naming conventions for some cases, namely for nodes in the first position among their siblings, along with some recursive relationship:

*

*Given an arbitrary node, I want to describe its first child, and then that node's first child, and so on recursively.

*Given another arbitrary node, I want to describe its parent if the parent is first among its siblings, and that parent's parent if it's first, and so on recursively.
Is there existing terminology to describe these tree positions? How would you name a variable or function that captures one of these cases so that it's intuitive to an unfamiliar developer trying to understand an algorithm?

A: I like to use the word Primary in situations where the word First isn't quite right, but is close.  It indicates that it's special in some way, without actually depending on an ordered enumeration.  First implies a Second, Third and so on, but Primary could be paired with everything else or Secondary, Tertiary, and only then everything else.

Given an arbitrary node, I want to describe its first child, and then that node's first child, and so on recursively.

I'd call this one PrimaryDescendant.  After all, if you enumerate every final descendant of a given node, in order, it's the one that will be first.  If you're referring to the "first child" status by itself, that'd just be FirstChild.

Given another arbitrary node, I want to describe its parent if the parent is first among its siblings, and that parent's parent if it's first, and so on recursively.

This one is harder, but I'd probably try to be consistent and call it PrimaryAncestor.


text:
Q: What does 'insinuate' mean in this particular context? While searching for a definition of 'insinuate' and its examples in context, I have stumbled upon the following sentence (Definition of insinuate from the Cambridge Advanced Learner's Dictionary & Thesaurus © Cambridge University Press):

An absolute is a verb that can not be measured because it is a lack of a behavior insinuating an end state

Thomson, M. (2012, June 12). PsyWar of Words. TIME. https://nation.time.com/2012/06/12/psywar-of-words/
According to COBUILD Advanced English Dictionary, if you say that:

*

*someone insinuates that something bad is the case, you mean that they say it in an indirect way

*someone insinuates themselves into a particular situation, you mean that they manage very clearly, and perhaps dishonestly, to get into that situation
But the use of 'insinuating' in the sentence mentioned earlier doesn't make sense to me (frankly, the whole sentence either).

A: A quick definition look-up gives, "slide slowly and smoothly into a position". For completeness, make sure to check more than one dictionary when the meaning isn't yet clear.


text:
Q: GPG file encryption I have tried to encrypt file with GPG. Use "gpg -e -r 'Recipient' message.txt".
Why I got this:

Instead of something like this:

A: To get output like I want. You should append option -a, "ascii output".


text:
Q: "Like" condition instead of an "isin" in pandas I have a parameter dictionary as below -
paramDict = {
    "DataFilter": {
        "tableField": [{
            "table":"GL_LEDGERS",
            "field":"NAME"
        }],
        "value" : ["ABC."]
    }
}

Now I want to use a "like" instead of the "isin" condition so that the data gets filtered for "ABC" as well as "ABC." -
DataFilter = df['NAME'].isin(
    pd.Series(paramDict['DataFilter']['value']))
df = df[DataFilter]

Can you please help me with the same. I am using python 2.7. Thanks.

A: I assume your Series is a string type.
If so, you can use .contains:
DataFilter = df['NAME'].str.contains('ABC')


text:
Q: Calling statistics functions from Scipy This may well be completely trivial.
I want to call the spearmanr function from scipy: (the data are just examples)
import scipy
from numpy import *

Len = [2,3,5,7,2]
Pop = [5,2,6,3,2]

a = array(Len)
b = array(Pop)

print scipy.stats.spearmanr(a,b)

This generates the error:
AttributeError: 'module' object has no attribute 'spearmanr'

What am I doing wrong?
Thanks

A: Use import scipy.stats. Then it works. Importing a package does not automatically import all the subpackages/modules. In these cases you have to do this explicitly.


text:
Q: Regex in R: How to separate or omit groups of regex to parse a transcript? (Massive problem with unequal rows) I'm working on creating a custom transcript parser that only parses speakers from speeches. I've hit a roadblock in how to set this up in a for loop. The issue: I have over 50 rows with a column named "lines", this variable carries the data that I need to extract and append to the data already there. The data looks as follows:
        col_date        col_name_speech           col_lines
Row 1:  2001-06-09         test1          "SPEAKER A. W. Hello this is a speech that I am giving. Blah.
                                            Blah. SPEAKER B. W. This
                                            is ALSO a line of a speech that I am giving."

Row 2:    2002-09-10         test2         "This is procedural garbage. I hate garbage. Blah BLAH Blah.
                                            header. SPEAKER. T. I. I have a speech now."

Row 3:    2006-09-19        test3          "procedural garbage. SPEAKER E. W. Wow, what a good speech.
                                             SPEAKER. T. I. yes. SPEAKER E. W. indeed."

The data frame that I would like to produce should look like this in the end:
date           name        speaker          lines
2001-06-09     test1       SPEAKER A. W.    Hello this is a speech that I am giving. Blah. Blah.
2001-06-09     test1       SPEAKER B. W.    This is ALSO a line of a speech that I am giving
2002-09-10     test2       SPEAKER T. I.    I have a speech now.
2006-09-19     test3       SPEAKER E. W.    Wow, what a good speech. indeed.
2006-09-19     test3       SPEAKER. T. I.   yes.

You should notice that the lines variable drops procedural garbage from the header of the row and combines the speakers' speeches.
I have a decent regex pattern to detect speakers and it works when applied to single rows, but it does not work in a for loop since the ultimate data frame has different row numbers in terms of speakers and speeches (which I attribute to the header problem). I should note the difference in row numbers is almost the same amount as the number of rows.  I will provide both sets of code.
Works to separate speakers one row at a time:
  person  = c(NA, unlist(stri_extract_all(data$lines[[1]],
                                          regex="([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)")))
  speech = unlist(stri_split(data$lines[[1]],
                              regex="([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)"))

To drop NA variable and combine like speakers (requires integrating into for loop):
df <-data.frame(person, speech)
df <- df[complete.cases(df), ]
df<- df %>%
  group_by(person) %>%
  summarise(speech= paste(speechsage, collapse = ","))

For loop that works for nothing:
for(i in 1:50){
  person  = c(NA, unlist(stri_extract_all(data$lines,
                                          regex="([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)")))
  message = unlist(stri_split(data$lines,
                              regex="([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)"))
}
df <- data.frame(person, speech)
error in data.frame(person, speech): arguments imply differing number of rows 927, 971

Moreover, I need to append the date and name variable to the final data frame which strikes me as easier to do inside of the for loop. ANY help on this is appreciated (especially if someone can show the complete steps needed to transform the data structure).

A: This is one of those hard but ultimately easy questions in transcript parsing hell. I solved it with a few simple solutions in stringr, stringi, and tidyverse as Akash87 pointed out -- much of this answer took inspiration from his reply. I added another observation to the dataset for more diagnostics.
First, I create a dataframe out of the data:
df  <- data.frame(col_date = (c("2001-06-09", "2002-09-10", "2006-09-19")),
       name = c("test1", "test2", "test3"),
       col_lines = c("SPEAKER A. W. Hello this is a speech that I am giving. Blah. Blah. SPEAKER B. W. This is ALSO a line of a speech that I am giving.","This is procedural garbage. I hate garbage. Blah BLAH Blah. header. SPEAKER. T. I. I have a speech now.","procedural garbage. SPEAKER E. W. Wow, what a good speech. SPEAKER. T. I. yes. SPEAKER E. W. indeed. SPEAKER A. W. Hello this is a speech that I am giving. "))
df$speakers <- NA
df$speech <- NA

Then I save the regex pattern for easier access (don't mind the last pipe).
speakers_names  = "([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)|[[:upper:]]+([[:upper:]]\\s[[:upper:]]{4}\\.)"

I directly extract the speakers into the dataframe
df$speakers <- stri_extract_all(df$col_lines, regex= speakers_names)

Speeches are extracted by removing the names and excess data.
df$speech = str_remove(df$col_lines, ".*?(?=(([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)|([[:upper:]]+([[:upper:]]\\s[[:upper:]]{4}\\.))))")
df$speech = stri_split(df$speech, regex= speakers_names)

This leaves us with a dataframe with nested lists. So we need to unnest them and shape up the data. Keep in mind that we need to get rid of the NA'd items to match our cases.
df <- data.frame(df %>% unnest(speakers), (df %>% unnest(speech) %>%
  na_if("") %>%
  na.omit()))
keeps <- c("col_date", "name", "speakers", "speech.1")
df <- df[ ,keeps, drop =FALSE]

Now all we have left is to concatenate speakers' speeches for a given date. I group by date, names, and speakers and summarise the strings.
df <- df %>%
  group_by(col_date, name, speakers) %>%
  summarise(speech.1 = toString(speech.1))
View(df)

And we are done. What was a baffling Kafka-esque never-ending and grueling battle with wrangling this data into something workable, is solvable in 18 lines. If anyone has suggestions, let me know.
I hope that anyone who is parsing transcripts can use this question as a blueprint -- especially if they come from long and complicated JSONs. This works on most stenographic styles/languages as long as the regex is specific enough to capture the speakers' names (and this, of course, also applies to stage directions, etc). Cheers.

A: Wow this was a doozie! I used a few different libraries tidyverse,stringr, and stringi:
First I create the data set in an R friendly format:
data          <- data.frame(col_date = as.Date(c("2001-06-09", "2002-09-10", "2006-09-19")),
                            name = c("test1", "test2", "test3"),
                            col_lines = c("SPEAKER A. W. Hello this is a speech that I am giving. Blah. Blah. SPEAKER B. W. This is ALSO a line of a speech that I am giving.","This is procedural garbage. I hate garbage. Blah BLAH Blah. header. SPEAKER. T. I. I have a speech now.","procedural garbage. SPEAKER E. W. Wow, what a good speech. SPEAKER. T. I. yes. SPEAKER E. W. indeed."))

Then I identify the speakers for each col_lines, and get a unique list of speakers for substringing later.
speakers      <- sapply(lapply(data$col_lines,
                          function(x) stri_extract_all(x, regex="([[:upper:]]+[ [:upper:]]+[ [:upper:].]+\\.+[ [:upper:].]+\\.)|([[:upper:]]+[[:upper:]]{19,20}\\.)")), unlist)

speak_unique  <- unique(unlist(speakers)) #GET UNIQUE SPEAKER LIST FOR

speak_mat     <- plyr::ldply(speakers, rbind)

I bind the result of speak_mat to my original data and make sure I name the columns for future use. The line used to generate speak_mat is used to go from list to matrix, filling blanks with NA in generation order.
data_new      <- cbind(data, speak_mat)

colnames(data_new) <- c(names(data), paste("speaker_", names(speak_mat)))

Now I replace the speak_unique in each col_line with a single character representation
data_new_lines <- data_new %>%
                  mutate( col_lines_new  = gsub(paste(speak_unique, collapse = "|"), ";", col_lines),
                          col_lines_new1 = gsub("[^;]*;(.*)", "\\1", col_lines_new))

I then get rid of trailing and starting whitespace for when a speak_unique was the first or last character, and remove all text for each col_lines that comes before the first speak_unique. I also break apart each text at ; and create a vector.
out <- unlist(lapply(strsplit(as.character(data_new_lines$col_lines_new1),";"), function(x) {x[!x == ""]}))

I take the out and combine it with the long format of data_new that does not have the original col_lines.
data_long <- data_new %>%
             select(-col_lines) %>%
             gather(num, speaker, -col_date, -name, na.rm = T) %>%
             arrange(col_date, num) %>%
             select(-num) %>%
             cbind(lines = out) %>%
             group_by(col_date, name, speaker) %>%
             summarise(lines_c = paste(trimws(lines), collapse = " "))

Hope this helps!


text:
Q: seleccionar un indice de un select en html y en base a ello afectar a otro elemento Javascript Hola tengo tiempo buscando una respuesta a esto,lo que quiero es que cuando seleccione una opcion de mi select pueda cambiar el texto de un imput

                Solicita:

                    Direccion General
                    Subdireccion Academica
                    Subdireccion de Servicios Administrativos
                    Subdireccion de Planeacion y Vinculacion

Nombre del o la responsable de la informacion:

                   <input id="respo" style="margin-bottom: 5px;margin-left: 40px;width: 400px;" name="responsable" type="text" aria-disabled="true" placeholder="">

                   <input style="margin-left: 150px;height: 40px;width: 200px;margin-bottom: 10px;" type="submit" value="Enviar">

        </form>

A: Si creo que he entendido tu pregunta, tienes que hacer saltar un trigger via jquery:
var nuevoValor = "El valor que quieras que tome el input text al hacer el change";
$.('#miSelect').change(function(){
    $('#miInput').val(nuevoValor);
});

Si el valor que quieres cambiar va en relación con el texto del option del select podría hacerse así:
$.('#miSelect').change(function(){
    $('#miInput').val($(this).text());
});

Un saludo.


text:
Q: running a code before showing context menu during customized right click in jquery I used context menu plugin and was able to make if functional on the page I currently developing. At right click, I want to run a code (such as to highlight a selected row or column) before showing the context menu. Where can I insert the code. I used the plugin on this link.
http://www.trendskitchens.co.nz/jquery/contextmenu/
My html:

My js (context menu)
$("table tr td").contextMenu('myMenu',{
     onContextMenu: function(e){
         // I want to process the selected 'td' or 'tr' here... ex. highlight it
     }
});

A: You can access the element that was right-clicked with e.target, e.g.:
$("table tr td").contextMenu('myMenu',{
    onContextMenu: function(e){
        $(e.target).effect("highlight", {}, 500);
    }
});

The highlight effect is part of jQueryUI.

A: You can use the following code to highlight the parent row
 $("table tr td").contextMenu('myMenu',{
 onContextMenu: function(e){
     var parent=$(e.currentTarget).parent();
     parent.addClass('SelectedRowColor');
 }

where SelectedRowColor row is the css class name .
hope that will help.


text:
Q: macOS 10.14: Cannot find stdio.h I am trying to run the following hello world program:
  #include <stdio.h>

  int main(){
      printf("Hello, world!\n");

      return 0;
  }

With my system's default C compiler located in /usr/bin/gcc, that works as expected. But when I am using the compiler I installed, GCC version 6.4, located in $HOME/usr/bin/, I get the following error:
$ gcc main.cc
main.c:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>

Any idea on how to fix it? I've tried xcode-select --install/reset. Also, at first, compilation was failing with the system's gcc but I fixed it by creating the /usr/include directory. However, I need to use the compiler I've installed.