text:
Q: slow hashing (sha256) on uboot 2009 (iMX25 processor) Below calculation is done with uboot (2009 an older version) on iMX25 processor.
I am running sha256_process() function (sha256.c) under uboot to process 50Mbytes of data to get the hash.
It takes more than 100sec to complete the calculation. While the same hashing takes no time if run with openssl under Ubuntu (same processor).
Cross Compiler:
arm-none-linux-gnueabi-gcc 4.4.1.
Need some input on what can possibly be the problem.
Tried another arm toolchain with improvement, but still not as expected.
---sha256 code.
static void sha256_process(sha256_context *ctx, const uint8_t data[64])
{
    uint32_t temp1, temp2;
    uint32_t W[64];
    uint32_t A, B, C, D, E, F, G, H;

    GET_UINT32_BE(W[0], data, 0);
    GET_UINT32_BE(W[1], data, 4);
    GET_UINT32_BE(W[2], data, 8);
    GET_UINT32_BE(W[3], data, 12);
    GET_UINT32_BE(W[4], data, 16);
    GET_UINT32_BE(W[5], data, 20);
    GET_UINT32_BE(W[6], data, 24);
    GET_UINT32_BE(W[7], data, 28);
    GET_UINT32_BE(W[8], data, 32);
    GET_UINT32_BE(W[9], data, 36);
    GET_UINT32_BE(W[10], data, 40);
    GET_UINT32_BE(W[11], data, 44);
    GET_UINT32_BE(W[12], data, 48);
    GET_UINT32_BE(W[13], data, 52);
    GET_UINT32_BE(W[14], data, 56);
    GET_UINT32_BE(W[15], data, 60);

#define SHR(x,n) ((x & 0xFFFFFFFF) >> n)
#define ROTR(x,n) (SHR(x,n) | (x << (32 - n)))

#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3))
#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10))

#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22))
#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25))

#define F0(x,y,z) ((x & y) | (z & (x | y)))
#define F1(x,y,z) (z ^ (x & (y ^ z)))

#define R(t)                    \
(                       \
    W[t] = S1(W[t - 2]) + W[t - 7] +    \
        S0(W[t - 15]) + W[t - 16]   \
)

#define P(a,b,c,d,e,f,g,h,x,K) {        \
    temp1 = h + S3(e) + F1(e,f,g) + K + x;  \
    temp2 = S2(a) + F0(a,b,c);      \
    d += temp1; h = temp1 + temp2;      \
}

    A = ctx->state[0];
    B = ctx->state[1];
    C = ctx->state[2];
    D = ctx->state[3];
    E = ctx->state[4];
    F = ctx->state[5];
    G = ctx->state[6];
    H = ctx->state[7];

    P(A, B, C, D, E, F, G, H, W[0], 0x428A2F98);
    P(H, A, B, C, D, E, F, G, W[1], 0x71374491);
    P(G, H, A, B, C, D, E, F, W[2], 0xB5C0FBCF);
    P(F, G, H, A, B, C, D, E, W[3], 0xE9B5DBA5);
    P(E, F, G, H, A, B, C, D, W[4], 0x3956C25B);
    P(D, E, F, G, H, A, B, C, W[5], 0x59F111F1);
    P(C, D, E, F, G, H, A, B, W[6], 0x923F82A4);
    P(B, C, D, E, F, G, H, A, W[7], 0xAB1C5ED5);
    P(A, B, C, D, E, F, G, H, W[8], 0xD807AA98);
    P(H, A, B, C, D, E, F, G, W[9], 0x12835B01);
    P(G, H, A, B, C, D, E, F, W[10], 0x243185BE);
    P(F, G, H, A, B, C, D, E, W[11], 0x550C7DC3);
    P(E, F, G, H, A, B, C, D, W[12], 0x72BE5D74);
    P(D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE);
    P(C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7);
    P(B, C, D, E, F, G, H, A, W[15], 0xC19BF174);
    P(A, B, C, D, E, F, G, H, R(16), 0xE49B69C1);
    P(H, A, B, C, D, E, F, G, R(17), 0xEFBE4786);
    P(G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6);
    P(F, G, H, A, B, C, D, E, R(19), 0x240CA1CC);
    P(E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F);
    P(D, E, F, G, H, A, B, C, R(21), 0x4A7484AA);
    P(C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC);
    P(B, C, D, E, F, G, H, A, R(23), 0x76F988DA);
    P(A, B, C, D, E, F, G, H, R(24), 0x983E5152);
    P(H, A, B, C, D, E, F, G, R(25), 0xA831C66D);
    P(G, H, A, B, C, D, E, F, R(26), 0xB00327C8);
    P(F, G, H, A, B, C, D, E, R(27), 0xBF597FC7);
    P(E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3);
    P(D, E, F, G, H, A, B, C, R(29), 0xD5A79147);
    P(C, D, E, F, G, H, A, B, R(30), 0x06CA6351);
    P(B, C, D, E, F, G, H, A, R(31), 0x14292967);
    P(A, B, C, D, E, F, G, H, R(32), 0x27B70A85);
    P(H, A, B, C, D, E, F, G, R(33), 0x2E1B2138);
    P(G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC);
    P(F, G, H, A, B, C, D, E, R(35), 0x53380D13);
    P(E, F, G, H, A, B, C, D, R(36), 0x650A7354);
    P(D, E, F, G, H, A, B, C, R(37), 0x766A0ABB);
    P(C, D, E, F, G, H, A, B, R(38), 0x81C2C92E);
    P(B, C, D, E, F, G, H, A, R(39), 0x92722C85);
    P(A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1);
    P(H, A, B, C, D, E, F, G, R(41), 0xA81A664B);
    P(G, H, A, B, C, D, E, F, R(42), 0xC24B8B70);
    P(F, G, H, A, B, C, D, E, R(43), 0xC76C51A3);
    P(E, F, G, H, A, B, C, D, R(44), 0xD192E819);
    P(D, E, F, G, H, A, B, C, R(45), 0xD6990624);
    P(C, D, E, F, G, H, A, B, R(46), 0xF40E3585);
    P(B, C, D, E, F, G, H, A, R(47), 0x106AA070);
    P(A, B, C, D, E, F, G, H, R(48), 0x19A4C116);
    P(H, A, B, C, D, E, F, G, R(49), 0x1E376C08);
    P(G, H, A, B, C, D, E, F, R(50), 0x2748774C);
    P(F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5);
    P(E, F, G, H, A, B, C, D, R(52), 0x391C0CB3);
    P(D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A);
    P(C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F);
    P(B, C, D, E, F, G, H, A, R(55), 0x682E6FF3);
    P(A, B, C, D, E, F, G, H, R(56), 0x748F82EE);
    P(H, A, B, C, D, E, F, G, R(57), 0x78A5636F);
    P(G, H, A, B, C, D, E, F, R(58), 0x84C87814);
    P(F, G, H, A, B, C, D, E, R(59), 0x8CC70208);
    P(E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA);
    P(D, E, F, G, H, A, B, C, R(61), 0xA4506CEB);
    P(C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7);
    P(B, C, D, E, F, G, H, A, R(63), 0xC67178F2);

    ctx->state[0] += A;
    ctx->state[1] += B;
    ctx->state[2] += C;
    ctx->state[3] += D;
    ctx->state[4] += E;
    ctx->state[5] += F;
    ctx->state[6] += G;
    ctx->state[7] += H;
}

Expect the hashing time to be withing a few seconds, not 100sec.

A: The difference in performance you did notice may be caused by one of both of the CPU Instructions/Data caches being disabled.
You can enable/disable both caches from u-boot provided that it was compiled with the icache/dcache commands.
If your u-boot does not already include the icache/dcache commands, you may have to re-compile it after having added the following line to the configuration file: CONFIG_CMD_CACHE=y.
Another option would be to enable it in your code programmatically prior to start computing the hash.


text:
Q: How I assign a value to variable from constructor in angular? Problem with my Angular app. This is my first angular web. I want to assign a value to my variable named _name from the constructor. I tried the below way but didn't work. How can I assign a value for that?
The value comes to that page in the console.log the value is displayed. I want to assign that value to my _name variable and display the value in the HTML page when the page load. How can I do that ?
This is my current code
export class DashboardTemplateComponent implements OnInit, OnDestroy {
    private userSub: Subscription;
    inAuthenticate = false;
     _name: any;
      constructor(private router: Router, private authService: userService ) {
        this.userSub = this.authService.user.subscribe(user => {
          console.log(user.token);
          return this._name = user.name;
        });
      }

      ngOnInit(): void {
        this.userSub = this.authService.user.subscribe(user => {
          this.inAuthenticate = !user ? false : true;

        return this._name = user.name;
        });
      }

A: I would rewrite your code like below avoiding complication
import { Subject } from 'rxjs';
import { takeUntil, tap } from 'rxjs/operators';

  export class DashboardTemplateComponent implements OnInit {
    destroyed$ = new Subject();
    inAuthenticate = false;
    _name: any;
    name$ = this.authService.user.pipe(
        tap(user => this._name = user.name),
        tap(user => this.inAuthenticate = !user ? false : true)
        takeUntil(this.destroyed$)
      )

      constructor(private router: Router, private authService: userService ) {
      }

      ngOnInit(): void {
        this.name$.subscribe();
      }
  }

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is it a $\mathbb{R}$-vector space? Let $V_1=\{a\in \mathbb{R}\mid a>0\}$ with the multiplication as the vector addition and the scalar multiplication $\lambda \odot v=v^{\lambda}$.
I want to check if $V_1$ is a $\mathbb{R}$-vector space.
Let's symbolize with $\oplus$ the vector addition. Then we have the following:
Closure of addition: $x\oplus y=x\cdot y\in V_1$
Associativity: $(x\oplus y)\oplus z=(x\cdot y)\cdot z=x\cdot (y\cdot z)=x\cdot (y\oplus z)=x\oplus (y\oplus z)$
Existence of neutral element: $e\oplus x=x=x\oplus e \Rightarrow e\cdot x=x=x\cdot e \Rightarrow e=1$
Existence of additive inverse: $x\oplus y=e=y\oplus x \Rightarrow x\cdot y=e=y\cdot x$, so $y$ is $x^{-1}$ ? (Wondering)
Commutativity: $x\oplus y=x\cdot y=y\cdot x=y\oplus x$
So, $(V_1, \oplus)$ is an abelian group.
Is this correct?
Let $a,b\in K$ and $x\in V_1$
$(a+ b)\odot x=x^{a+ b}$
$a\odot x\oplus b\odot x=x^a\cdot x^b=x^{a+b}$
Let $a\in K$ and $x,y\in V_1$
$a\odot (x\oplus y)=a\odot (x\cdot y)=(x\cdot y)^a=x^a\cdot y^a$
$a\odot x\oplus a\odot y=x^a\cdot y^a$
Let $a,b\in K $ and $x\in V_1$
$(a\cdot b)\odot x=x^{a\cdot b}$
$a\odot (b\odot x)=a\odot x^b=(x^b)^a=x^{a\cdot b}$
Let $x\in V_1$
$1\odot x=x^1=x$
Is everything correct so far?
So, do we get that $V_1$ is a $\mathbb{R}$-vector space?

A: Spoiler

Consider the map $\log : V_{1} \to \mathbb{R}$. Then this is a bijective linear map, where $\mathbb{R}$ has the usual vector space structure. So your $V_{1}$ is just $\mathbb{R}$ in disguise.


text:
Q: Scheduled function in Python not starting I made the following script, it connects to a websocket and receives some data from it. While this script is running, i'm trying to run a function every 2 seconds. In this case, the function only prints a message, but of course that's for debugging, it will do other tasks in the future.
My issue is that Printer() doesn't start running, i don't see the message appearing every 2 seconds. I know that the problem is that Connect() has its own thread, so Printer() won't be scheduled until Connect() stops working. I want Printer() to run while i'm receiving data from the websocket. Is there any way to do it? Making it asynchronous? Using more threads?
import websocket, json, time, schedule, logging, cfscrape
from websocket import create_connection

try:
    import thread
except ImportError:
    import _thread as thread

MyList = []
MexCoinsToMonitor = ['XBTUSD']
LastOrder = format(float(time.time()), '.0f')
BU = cfscrape.create_scraper()

def process_message(ws,msg):

    try:
        message = json.loads(msg)
        print(message)

    except Exception as e:
        print(e)

def Printer():
    print('hello')

def on_error(ws, error):
    print('Error')

def on_close(ws):
    Checker()

def on_open(ws):
    def run(*args):
        for value in MexCoinsToMonitor:
            tradeStr=""" {"op": "subscribe", "args": ["orderBookL2_25:%s"]} """%(value)
            ws.send(tradeStr)
            time.sleep(1)
    thread.start_new_thread(run, ())

def Checker():
    global LastOrder
    TimeDiff = float(time.time()) - float(LastOrder)
    print (LastOrder, TimeDiff)
    if TimeDiff > 20:
        ws = websocket.WebSocketApp("wss://www.bitmex.com/realtime", on_message = process_message, on_error = on_error, on_close = on_close)
        ws.on_open = on_open
        ws.run_forever()

def Connect():
    websocket.enableTrace(False)
    ws = websocket.WebSocketApp("wss://www.bitmex.com/realtime", on_message = process_message, on_error = on_error, on_close = on_close)
    ws.on_open = on_open
    ws.run_forever()

Connect()
schedule.every(2).seconds.do(Printer)

while True:
    schedule.run_pending()
    time.sleep(2)

To schedule, i'm using the Schedule module.

A: You could indeed make it asynchronious. That would run printer while connect is working. You can use the threading module for this.
import threading
threading.Thread(target=Printer).start()

That would start a printer. Than you can connect and the printer doesn't have to be finished.
If you want to keep calling the function, just use a while loop.
import threading
import time
while True:
    threading.Thread(target=Printer).start()
    time.sleep(2)


text:
Q: Multiplying an array with a floating number The method Array#* takes an integer:
thumbs = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
thumbs = thumbs*2
#=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

How can I multiply an array to any floating number and not just an integer? For example, I would expect the following result:
thumbs = thumbs*1.5
# => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5]

A: array = [*1..10]
fraction = 1.5
thumbs = array.cycle.take((array.length * fraction).floor)

Depending on how you want to handle fractional cases, you can use ceil or round instead of floor.

A: Answer 1
Simply because Array * x is only defined to work with an integer.
Answer 2
Because in some cases, it is unclear what output to expect from this. For example
[1,2,3]*1.5

Should this output [1,2] or [1]?
Possible Solution
You can define your own method, though:
class Array
  alias_method :old_mult , :'*'            # remember, how old multiplication worked

  def * other                              # override * method
    result = old_mult(other.floor)         # multiply with floored factor
    end_index = (size * (other % 1)).round # convert decimal points to array index
    result + self[0...end_index]           # add elements corresponding to decimal points
  end
end

p [1,2] * 1
p [1,2,3] * 2
p [1,2,3,4,5] * 1.5
p [1,2,3,4,5,6] * 1.5

this outputs
[1, 2]
[1, 2, 3, 1, 2, 3]
[1, 2, 3, 4, 5, 1, 2, 3]
[1, 2, 3, 4, 5, 6, 1, 2, 3]

A: You can define a method and do whatever you want:
def arr_times(f, arr)
  i = float.to_i
  arr*i + arr[0..(((f-i)*arr.length).floor)]
end


text:
Q: Cannot connect to http sites with Volley (Andoid, Kotlin) (https works fine) This is the first time that I am dipping my toes into andoroid development. For this I decided to make a little project to get into it.
My settup:
I want to control an led strip with a Raspberry Pi Pico W with my own android app. The Pico hosts a Webpage that I can access with its local IP adress. To change the LED's I can go to, for eg:192.168.0.201/setrgb/255/000/000 this would make the LED strip Red. (This works fine in a browser)
Using this article I set up a simple string request with volley. Using the example "https://www.google.com" works just fine and I get the html code of google.com as a string. However whenever I try to access my Pico it prints: "that didn't work" (see the code below). It also doesn't work with "http://www.columbia.edu/~fdc/sample.html" although I don't really know why.
Could it have something to do with the fact that google uses https and the other use http?
println("start")
        val queue = Volley.newRequestQueue(this)
        val url = "http://192.168.0.201/setrgb/000/000/000"

        val stringRequest = StringRequest(Request.Method.GET, url,
            { response ->
                println((url))
                println("response:")
                println(response)
                println("end of response")
            },
            { println("that didn't work")
            println(url)})

// Add the request to the RequestQueue.
        queue.add(stringRequest)

This is the output:
System.out                           I  start
Volley                               V  [61] CacheDispatcher.run: start new dispatcher
System.out                           I  damn
Volley                               D  [61] WaitingRequestManager.maybeAddToWaitingRequests: new request, sending to network http://192.168.0.201/setrgb/000/000/000
HostConnection                       D  createUnique: call
HostConnection                       D  HostConnection::get() New Host Connection established 0x7cfd607d6010, tid 32234
HostConnection                       D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_
OpenGLRenderer                       W  Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
OpenGLRenderer                       W  Failed to initialize 101010-2 format, error = EGL_SUCCESS
EGL_emulation                        D  eglCreateContext: 0x7cfd607d8290: maj 2 min 0 rcv 2
EGL_emulation                        D  eglMakeCurrent: 0x7cfd607d8290: ver 2 0 (tinfo 0x7cff77380080) (first time)
Gralloc4                             I  mapper 4.x is not supported
HostConnection                       D  createUnique: call
HostConnection                       D  HostConnection::get() New Host Connection established 0x7cfd607d7b10, tid 32234
goldfish-address-space               D  allocate: Ask for block of size 0x100
goldfish-address-space               D  allocate: ioctl allocate returned offset 0x3ebffe000 size 0x2000
Gralloc4                             W  allocator 4.x is not supported
HostConnection                       D  HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_
Parcel                               W  Expecting binder but got null!
System.out                           I  that didn't work
System.out                           I  http://192.168.0.201/setrgb/000/000/000
Volley                               D  [2] MarkerLog.finish: (298  ms) [ ] http://192.168.0.201/setrgb/000/000/000 0x85adfa16 NORMAL 1
Volley                               D  [2] MarkerLog.finish: (+0   ) [ 2] add-to-queue
Volley                               D  [2] MarkerLog.finish: (+1   ) [61] cache-queue-take
Volley                               D  [2] MarkerLog.finish: (+0   ) [61] cache-miss
Volley                               D  [2] MarkerLog.finish: (+0   ) [62] network-queue-take
Volley                               D  [2] MarkerLog.finish: (+7   ) [62] post-error
Volley                               D  [2] MarkerLog.finish: (+290 ) [ 2] done

There seems to be some sort of "post-error", but I really don't know why and I can't really find anything though google.
The Following is the output if I use a working website like google.com:
[2] MarkerLog.finish: (+0   ) [ 2] add-to-queue
[2] MarkerLog.finish: (+2   ) [76] cache-queue-take
[2] MarkerLog.finish: (+0   ) [76] cache-miss
[2] MarkerLog.finish: (+1   ) [77] network-queue-take
[2] MarkerLog.finish: (+340 ) [77] network-http-complete
[2] MarkerLog.finish: (+5   ) [77] network-parse-complete
[2] MarkerLog.finish: (+3   ) [77] network-cache-written
[2] MarkerLog.finish: (+0   ) [77] post-response
[2] MarkerLog.finish: (+338 ) [ 2] done

Does anyone know how to fix this or do you have other ideas how to achive what I want?

A: I ended up figuring it out myself.
The problem had to do with the fact that the website I tried to access used http instead of https:
To give permission to acces http websites I added folowing line to the manifest.xml file:
android:usesCleartextTraffic="true"

It goes after <application.


text:
Q: How To Fix Unicode Character Issues On iTunes Feed I am trying to pull applications from the Apple App Store using their authorised flat feed. However, I am having a tough time dealing with the encoding issues. Here are some examples :
A Japanese app titled

ホームページ用和英辞典

is displayed as

ホームページ用和英辞å

Not just that, even commonly used special characters like '(apostrophe), "(quote) are displayed with characters like ' and ".
Can someone please help me with how this issue can be sorted out?
Edited to Add : I am working on PHP

A: What character set is the feed provided in, and what character set are you declaring your document to be? It's pretty common for people starting out to be sending ISO-8859-1, while reading in a UTF-8 feed. You'll want those two to match for simplicity.
These two articles may also be of interest while dealing with these issues

*

*http://phpadvent.org/2009/character-sets-by-paul-reinheimer

*http://seancoates.com/blogs/tag/unicode

A: It looks like you are either not retaining the original character coding or you are outputting Unicode into a non Unicode coded stream.


text:
Q: How to use Group-Object to extract key info and ConvertTo-HTML I have a csv file with various email addresses and collaborators. I then use | Group-Object INVITER_EMAIL -AsHashTable –AsString to create a hash table with keys where an INVITER_EMAIL can have multiple collaborators.
I am able to show on screen using:
foreach ($User in $Collaborators.keys) {
  $Collaborators[$User] | select INVITER_EMAIL,COLLABORATOR_LOGIN,INVITE_ACCEPTED,ITEM_NAME,URL_TO_ITEM
}

but when I try to pipe | ConvertTo-HTML it won't format the string correctly.
I can do [string]$Collaborators.'user@email.com' which gives me the correct HTML I want to generate for one user, but having difficulty getting this to go through the foreach loop. Not sure what I may be missing, but I'm hoping to get each of these into a separate $body of a form email at some point. Not sure if this is possible or not? Thx
$Collaborators

Name                           Value
----                           -----
user@email.com           {@{REAL_OWNER_EMAIL_DOMAIN=somewhere; REAL_OWNER_EMAIL=user@email.com; REAL_OWNER_FIRST_NAME=Anna; REAL_OWNER_LAST_NAME=Someone; OWNER_LOGIN=admins@email...

A: I think you are started correctly in your question.
But the idea is getting information of each person and combining from it a new object and putting it to the array. You just need to create a customObject in each loop cycle.
For Example.
foreach ($User in $Collaborators.keys) {
    [array]$MyList += [PSCustomObject]@{
        Email = $Collaborators[$User].Name
        Inviter = $Collaborators[$User].INVITER_EMAIL
        Login = $Collaborators[$User].COLLABORATOR_LOGIN
    }
}


text:
Q: Is it possible for one iphone application to read the logs of another application? I need help with acquiring logs for an application without usage of third party or external applications

A: One application can read other application logs only if both applications are published by the same account and put/read logs into a shared folder (developer write correct code and did some other important things, google "sharing data between iOS apps").
But in general, the short answer is "No, it's not possible for an iOS application to read logs of other application".
At least until the device is jailbroken.


text:
Q: main program run like an infinite while loop I'm working in PIC24F microcontroller. My main program doesn't have infinite loop, but it is run like an infinite loop.  Before I test the code with infinite while loop (while (1)), but when I remove the while loop, it's still running like an infinite loop. What's the problem?
Thanks

A: Microcontrollers are often programmed bare metal , meaning your program has to initialize the CPU and RAM to get your program going. This is called a startup script and some IDEs/compilers may hide it from the user at first glance.
The startup script does the bare minimum to get to a C main, combined with the C "environment". That is (optionally sometimes) filling RAM with zeros, and most importantly copying variables with predefined values from FLASH to RAM. E.g. if you declare a (global) variable with an initial value, it is stored in program FLASH and copied to RAM before main is called.
I suspect you use XC16 or C30 compiler. You can find these scripts in XC16/v*.**/src/libpic30.zip in the files crt0_standard.s. It contains the following (simplified for this example) start-up code:
        mov      #__SP_init,w15    ; initialize w15
        mov      #__SPLIM_init,w14

        mov      w14,_SPLIM        ; initialize SPLIM
        nop                        ; wait 1 cycle
    mov  #__enable_fixed, w0
        cp0      w0
        bra  z, CORCON_RESET
        mov      #0x0010,w0
        mov      w0,CORCON         ; enable super saturation and clear IF

CORCON_RESET:
        rcall    __psv_init        ; initialize PSV
        mov      #__dinit_tbloffset,w0 ; w0,w1 = template
        mov      #__dinit_tblpage,w1   ;
        rcall    __data_init_standard  ; initialize data

        mov      #__has_user_init,w0
        cp0      w0                ; user init functions?
        bra      eq,1f             ; br if not
        call     __user_init       ; else call them
1:
        call  _main                ; call user's main()

        .pword 0xDA4000            ; halt the simulator
        reset                      ; reset the processor

Even if you don't speak assembler fluently you should see what is going on. The script initializes the stack, some CPU registers, initialize PSV & data memory (e.g. copying pre-initialized variable contents from FLASH to RAM), and then call your main function.
The script more or less expects the main will never return, which is why you often see a while(1) at the end of any embedded program.
If it does return for some reason, it will execute the reset instruction. This reinitializes everything again and eventually call main again. This turns into the behavior you're seeing, namely it's looping.

A: There's no operating system on this microcontroller, right? What happens if you allow your main() function to exit, is up to the C startup code (which is what calls your main() in the first place). Presumably there's another equivalent while(1) loop surrounding the call to main(); halting would not generally be as useful as restarting the program.
If you actually want a microcontroller to run once and then halt, you must explicitly halt instead of returning from main().

A: A hosted program in a HLL returns to the operating system when it finishes. If there is no operating system the behaviour is undefined- it might jump back to the beginning, it might execute random bytes in program memory until the PC rolls over or it gets stuck in some kind if loop, or something else entirely.
Of course it is deterministic at some level- you can gain insight by examining the start-up assembly code, the emitted code, and by single stepping the code through an emulator or simulator. You should have reasonable understanding of machine language programming.


text:
Q: Non-linear least squares standard error calculation in R I am using implementations of the Levenberg-Marquardt algorithm for non-linear least squares regression based on MINPACK-1 utilizing either the R function nlsLM() from minpack.lm or an implementation in C using the mpfit library.
I have observed that while I come up with comparable parameter estimates in both cases, the calculated uncertainty is drastically different in the two approaches. Below you find the code of the two approaches:
In R:
library(minpack.lm)

x <- seq(1,9)
y <- c(2.93,1.79,1.03,0.749,0.562,0.218,0.068,0.155,0.03)
table <- data.frame(x,y)

fit <- nlsLM(y ~ N * exp( -rate * x ), data = table, start = list(rate = 0.1, N = 1)

summary(fit)

which returns the estimates and standard errors:
rate    0.47825, std.Err: 0.02117
   N    4.69723, std.Err: 0.18950

In C:
#include <math.h>
#include <stdio.h>
#include <string.h>

#include "cmpfit-1.2/mpfit.h"

// Data structure to keep my vectors
typedef struct my_data {

  double *x;
  double *y;
  int n;

} my_data;

// defining the function that is to be fitted
int my_exp(int m, int n, double *p, double *dev, double **deriv, my_data *data)
{

  int i;
  double *x, *y, f;

  x = data->x;
  y = data->y;

  for (i = 0; i < m; i++) {

    f = p[0] * exp(-p[1]*x[i]);
    dev[i] = y[i] - f;

  }

  return 0;
}

int main(void)
{

  // define test data
  my_data data;
  data.x = (double[]){1,2,3,4,5,6,7,8,9};
  data.y = (double[]){2.93,1.79,1.03,0.749,0.562,0.218,0.068,0.155,0.032};
  data.n = 9;

  // start values
  double p[2] = {1.0, 0.1};

  mp_result result;
  memset(&result, 0, sizeof(result));

  double perr[2];
  result.xerror = perr;

  int ret;

  ret = mpfit((mp_func)my_exp, data.n, 2, p, 0,0, &data, &result);

  printf("rate:   %f, Error: %f\n", p[1], perr[1]);
  printf("   N:   %f, Error: %f\n", p[0], perr[0]);

  return 0;
}

which returns:
rate:   0.479721, Error: 0.270632
   N:   4.707439, Error: 2.422189

As you can see, the errors returned by mpfit are about 12x higher then from R. I also implemented the same thing using GSL which produces results identical to mpfit. Unfortunately I am not very comfortable with the R code base, so it would be great if anyone has any inside into what nlsLM in R does differently then mpfit and GSL when calculating the errors.
* EDIT 1 *
So, I've made a few discoveries I'd like to share and hopefully get some input on. The errors returned by mpfit in the C implementation actually correspond to what one would get in R using:
diag(sqrt(summary(fit)$cov.unscaled))

i.e. the square root of the diagonal of the unscaled covariance matrix. The standard error estimates for the parameters actually returned by summary(fit) are apparently scaled by the residual standard error of the regression, so that:
sqrt(diag(summary(fit)$cov.unscaled) * s$sigma^2)

actually returns the values also observed in summary(fit).
Why is this scaling done? What is the statistical reason behind it? Any input would be very welcome!
* EDIT 2 *
So, I think I figured it out now and I'll put it here for future reference. What is returned by the C implementation as error, as well as stored in cov.unscaled in R is just the equivalent of solve(t(J) %*% J) which needs to be scaled by sigma^2 to get the variance of the parameter estimates. Thanks @dave for the help!

A: I fit your data with AD Model Builder. The R code has the right std devs (almost) but poor parameter estimates. The C code has good parameter estimates but the wrong std devs You need to multiply by sqrt(9/7) to convert from fisher information to nls stdevs
index name   value      std.dev
  1     N   4.7079e+00 1.7120e-01
  2    rate 4.7979e-01 1.9154e-02


text:
Q: Why jQuery next can't find the next div? I want to create a page for FAQs and used jQuery to show each answer. But it does not work.
The format of each question-answer is like this:

First Question

First Answer

And the jQuery code that I have used is:
$(".expand").click(function(){
    $(this).next('.answer').slideToggle();
});

Is it wrong? You can see its jsFiddle too.

A: Because jQuery.next() grabs siblings, the div you're trying to get is the parent's sibling, not the sibling.

A: Well $(this) is the a-element, and there are no siblings to that element. If you want the div, use parent:
$(this).parent().next()

A: The two elements are not at the same level for next() to work.
Try this:
$(".expand").click(function(){
    $(this).parent().next('.answer').slideToggle();
});

Here is an updated fiddle for your reference


text:
Q: Elegant way to terminate the VirtualBox VBoxSVC.exe process How do we terminate all the vbox*.exe (e.g.: VBoxSVC.exe, VBoxNetDHCP.exe, VBoxNetNAT.exe) processes without using the OS process signaling tools (e.g.: taskkill)?

A: According to the user manual ("Chapter 8. VBoxManage"), "8.33. VBoxManage metrics":

... The data is available as long as the background VBoxSVC process is alive. That process terminates shortly after all VMs and frontends have been closed. ...

Then from "8.35. VBoxManage dhcpserver":

... After this, VirtualBox will automatically start the DHCP server for given internal or host-only network as soon as the first virtual machine which uses that network is started. ...

So, VBoxSVC.exe should stop automatically. OTOH, I'm guessing but I don't think you'd have any problem stopping VBoxNetDHCP.exe and VBoxNetNAT.exe with OS signalling, if they don't already stop automatically too. But I don't see why you'd need to stop them.
FWIW, I just had the VBoxNetAdp.sys driver crash for lack of memory, killing the network between my VMs, and rerunning VBoxNetNAT.exe manually, then VBoxManage.exe natnetwork start --netname NatNetwork got the network back without issues. That seems to indicate one would have no problem by stopping it with OS signals.

A: I had the same issue in Win7 x64, with Docker Toolbox - VBoxSVC.exe didn't finish even after shutting down all VMs.
This advice from VB issue tracker has helped (thanks to the poster). Open your VirtualBox folder with cmd.exe and run VBoxManage.exe list vms. VBoxSVC.exe disappears shortly from the process tree and doesn't appear hanging afterwards.

A: Or the easy way is to just press Ctrl+Alt+Del and click on the task Manager. The find Oracle box and right click. Then click End Task.


text: Q: Using VMs as pods in Kubernetes I have found KubeVirt.io project which allows you to manage VM as if being Pods in Kubernetes cluster. The problem with that is it is using KVM to create such VMs on the nodepool nodes. Is there any alternative that will create VM directly as Azure VM? I have read about Metal3.io, but not sure how they fit in the picture.


text:
Q: GobEncoder for Passing Anonymous Function via RPC I'm trying to build a system that will execute a function on multiple machines, passing the function anonymously via RPC to each worker machine (a la MapReduce) to execute on some subset of data. Gob doesn't support encoding functions, though the docs for GobEncoder say that "A type that implements GobEncoder and GobDecoder has complete control over the representation of its data and may therefore contain things such as private fields, channels, and functions, which are not usually transmissible in gob streams" so it seems possible.
Any examples of how this might work? I don't know much about how this encoding/decoding should be done with Gob.

A: IMHO this won't work. While it is true that if your type implements
Gob{En,De}coder it can (de)serialize unexported fields of structs it is still impossible to (de)serialize code: Go is statically compiled and linked without
runtime code generation capabilities (which would circumvent compile time type
safety).
Short: You cannot serialize functions, only data. Your workers must provide
the functions you wan't to execute. Take a look at encoding/rpc.

A: You may want to try GoCircuit, which provides a framework that basically lets you do this:
http://www.gocircuit.org/
It works by copying your binary to the remote machine(s), starting it, then doing an RPC that effectively says "execute function X with args A, B, ..."


text:
Q: Dynamic scheduling in uipath orchestrator I'm trying to schedule a bot which is being triggered from orchestrator every 3 hours. The process is basically an email automation. If the no of emails that is being processed is less than average, i want to trigger the bot.
Is there a cron expression that can help me with this type of scheduling?
Do let me know if there any other way to achieve this (like making a change in code or some other method).

A: You'll need something to determine when the criteria are met to trigger a job to run. This could be done from another automated process; a monitor, which in turn would invoke your email process, or from an outside source if you have a monitoring platform or another external source.
When triggered, you'll want to make a few calls to the Orchestrator API to start an adhoc/manual job.

*

*Authenticate /api/Account/Authenticate (Assuming you are using local credentials and not Domain)

*Get Job Key /odata/Releases (If you already know the key for the given process, you could hardcode it in the next step instead of calling this one each time)

*Start Job /odata/Jobs/UiPath.Server.Configuration.OData.StartJobs
Example request body:
{
  "startInfo": {
    "ReleaseKey": "string",
    "Strategy": "All",
    "RobotIds": [
      0
    ],
    "NoOfRobots": 0,
    "JobsCount": 0,
    "Source": "Manual",
    "InputArguments": "string"
  }
}

*Check Status of Job /odata/Jobs(jobid).
More information on the Orchestrator API can be found in The UiPath ORchestrator Guide. I'd also recommend checking out your swagger UI in Orchestrator, by adding /swagger onto the end of your Orchestrator URL. e.g. https://platform.uipath.com/swagger/

A: To trigger your robot from studio you can use invoke power shell activity (https://activities.uipath.com/docs/invoke-power-shell) with -file / -f command to execute a workflow.
UiRobot -file "C:\UiPath\Project\Main.xaml"

For this you will have to navigate to the directory in which the Robot is installed.
You can find more information here: https://robot.uipath.com/docs/arguments-description.
OR
You can also make a HTTP request to the orchestrator API. You can find more information here: https://orchestrator.uipath.com/v2018.4/reference#jobs-requests


text:
Q: How to input these variables in a magento 2.3.4 mail template We would like to display these variables in a new email template (which is currently assigned to a orderstate):
Ordernumber, Customername, Order Status & Invoicenumber.
The following code does not work:
{{var order.increment_id}}, {{var customer.name}}, {{trans "%name," name=$order.getCustomerName()}}

A: here is my execute function (observer) any other file code add
You can try as below:
$templateVars = array(
                'store' => $this->storeManager->getStore(),
                'message'   => 'We processed your order ID We will contact you soon in mail for the acknowledgement if you not receive mail within 4 hours please get help from support@xxx.com',
                'myvar2' => 'myvar2 value come here',
                'myvar3' => 'myvar3 value come here'
            );

In email template email_template.html, use like
{{var myvar2}}
{{var myvar3}}
{{trans "%customer_name" customer_name=$myvar3}}


text:
Q: Official BIOS updates for Intel NUC NUC6i3SYH not working I have a Intel NUC model 'NUC6i3SYH'. I verified the model name by running the 'Intel Software Update' utility.
My current BIOS version is - Ver 44 (SYSKLi35.86A.0044.2016.0512.1734).
Latest BIOS version available on Intel website - Ver 61.
I downloaded the latest BIOS updates from here (EXE and BIO files) - https://downloadcenter.intel.com/search?keyword=NUC6i3SYH
EXE method - Once I run the installer, it asks to reboot to finish installing the BIOS, and  after reboot I get the following error message dialog - "CURRENT BIOS IS AN UNSUPPORTED LEGACY BIOS".
BIO file method - Loaded BIO file on a USB drive, detected by NUC through F7-mechanism, accepts BIO file and system reboots twice, then boots into Windows OS. No change in BIOS version.
Instead of jumping from ver 44 to ver 61, i tried going to ver 45 first. Same results.
Has anyone successfully updated BIOS on a Intel NUC (NUC6i3SYH)?

A: For others it can apparently be caused by a bug in the reporting program that starts after reboot.
Source: https://communities.intel.com/thread/116477
To verify what version you have you can run this from command prompt:
wmic bios get smbiosbiosversion
I saw the same error but at least it reports I have the latest version. But I see for this poster it didn't update.


text:
Q: How to continue running my testcases in the same window using selenium C#? Please help me with this.
My second method is dependent on first method and so on.
I am not using driver.quit() or driver.close()
 [TestMethod]
        public void CheckInAsDcs()
        {
            Thread.Sleep(2000);
            Assert.AreEqual(driver.Title, "NeuTravel");
            var selectDropDown = driver.FindElement(By.Id("viewSelect"));
            var dcsOption = driver.FindElements(By.TagName("option"))[1];
            //checking for dcs in dropdown
            var checkForDcs = driver.FindElement(By.Id("viewSelect"));
            dcsOption.Click();
            Thread.Sleep(2000);
}

        [TestMethod]
        public void CreateNewRequest()
        {

            //calling CheckInAsDcs function
             CheckInAsDcs();

            //waiting for the web elements to load
            Thread.Sleep(10000);

            //finding CreateNewRequest button and clicking it
            var selectCreateNewReq = driver.FindElements(By.TagName("input"));
            selectCreateNewReq[0].Click();
}


text:
Q: Add message store spring integration dsl I am currently looking at the options to add real-time tracking of all the messages going over in my application.
I have enabled messagehistory so technically I'll get all the steps happened during the flow.
Now I want to store each message with the history in disk cache using CQEngine as it has great support and is very quick.
Then from the UI I'll show the message and history and display using GraphVIZ so the users can actually see the lifecycle of each message with diagram.
Option # 01
Add the call in the handle() method in each flow to add the message and history asynchrnously in the disk cache.
But this means I'll have to manually do that every time for new flow.

Is there any option 02 I can utilize like adding interceptor etc that
  will be called whenever a flow is completed succesfully or
  un-sucessfully?

A: You need to use a WireTap interceptor for channels: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/core.html#channel-interceptors.
And configure a global channel interceptor pattern for that wire-tap to specify those channels you would like to track. The same doc has info on the matter. Also see annotation configuration on the matter: https://docs.spring.io/spring-integration/docs/5.2.2.RELEASE/reference/html/configuration.html#annotations


text:
Q: Screen Dimmer in Ubuntu than in Windows - Haswell NEC Lavie I just bought a new laptop, on which I immediately installed Ubuntu 13.10.
Pretty much everything worked out of the box, except the screen brightness. The maximum brightness in Ubuntu is much lower than it was with the preinstalled Windows 8. Brightness controls work, but they go from backlight being totally off to something like 50-60% of Windows brightness.
I've tried changing grub settings to acpi_vendor=legacy as well as vendor. I've also tried various settings for the osi string.
Any ideas how to diagnose and fix this? I think I'm the first person to ever install linux on this particular laptop. It's an NEC Lavie LZ750, imported from Japan. It's an i7-4500U using intel graphics.
Any help would really be appreciated. I love this laptop and can't really consider switching back to windows, but the screen is really dim.

A: Try this, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
sudo apt-get install xbacklight

Then you can set the backlights brightness percentage from terminal
xbacklight -set 10

Also you may want to take a look at dconf-editor.  If its not installed, just do:
sudo apt-get install dconf-tools

Once installed, from the left pane, navigate to org --> gnome --> settings-daemon --> plugins --> power.  See image below:


text:
Q: A sufficient condition under which a continuous function on an *unbounded open interval* $I$ will be uniformly continuous on $I$ *A sufficient condition under which a continuous function on an unbounded open interval $I$ will be uniformly continuous on $I$*
If the the interval $I$ is closed and bounded, then the continuous function is uniformly continuous.
But what about the case when the interval is unbounded open interval .so is there any sufficient condition for that.

A: Some conditions are:

1.If $f$ is Lipschitz continuous then is uniformly continuous.
2 If $f:(a,+\infty) \to \Bbb{R}$ continuous and $\lim_{x \to a^+}f(x),\lim_{x \to +\infty}f(x) \in \Bbb{R}$ then the function is uniformly continuous. Similarly for intervals of the form  $(-\infty,a)$.
3.If $f:\Bbb{R} \to \Bbb{R}$ continuous and $\lim_{x \to +\infty}f(x)=\lim_{x \to -\infty}f(x)=0$ then $f$ is uniformly continuous.
4.If $f: \Bbb{R} \to \Bbb{R}$ is continuous and periodic then it is uniformply continuous.
5.If $f: \Bbb{R} \to \Bbb{R}$ is continuous,monotone and bounded,then it is uniformly continuous
6.If $f: \Bbb{R} \to \Bbb{R}$ is continuous at zero and $f(x)+f(y)=f(x+y),\forall x,y \in \Bbb{R}$,then $f$ is uniformly continuous.

A: If the function f has first order bounded derivative on the open unbounded interval I ; then f is uniformly continuous on I.


text:
Q: code to prevent skew of the view after scale in one dimension and rotation in iphone when i am scaling the view in one direction and then rotate that time the image is stretched.
How to prevent this?
i am using the codes like the following ---
//===By Scaling Width===//
    float scale = [self widthResizeDistance:origin toPoint:touchLocationpoint]; // [self widthResizeDistance:origin toPoint:PrevioustouchLocationpoint];
    CGAffineTransform newTransform2 = CGAffineTransformScale(self.transform, scale,1.0);
    self.transform = newTransform2;

//===Then By Rotating===//
    CGAffineTransform newTransform = CGAffineTransformScale(self.transform, 1, 1);
        CGFloat previousRotation = atan2(previousDifference.y, previousDifference.x);
        CGPoint currentDifference = [self vectorFromPoint:origin toPoint:touchLocationpoint];
        CGFloat currentRotation = atan2(currentDifference.y, currentDifference.x);
        CGFloat newAngle = currentRotation- previousRotation;

        newTransform = CGAffineTransformRotate(newTransform, newAngle);
        self.transform = newTransform;


text:
Q: jsf application performance improvement tips How to improve performance of jsf myfaces based application  ?
Some tips that I have collected so far
Trinidad

*

*Set following init parameters to false in web.xml

*

*org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT

*org.apache.myfaces.trinidad.DISABLE_CONTENT_COMPRESSION

*org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION

*use client-side state saving

*clear pageflow context map when not in use

Myfaces

*

*Set following init parameters to false in web.xml

*

*org.apache.myfaces.COMPRESS_STATE_IN_SESSION

*org.apache.myfaces.SERIALIZE_STATE_IN_SESSION

*org.apache.myfaces.PRETTY_HTML

*org.apache.myfaces.VALIDATE

*Reduce value of org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION from init param (default is 20)

facelets

*

*Set following init parameters to false in web.xml

*

*facelets.DEVELOPMENT

*facelets.SKIP_COMMENTS

*set facelets.BUFFER_SIZE and com.sun.faces.responseBufferSize to large value like 10000000

*set facelets.REFRESH_PERIOD to -1

Is there anything else to add to this ?

A: Moving to Stateless JSF would offer a great performance boost.  Now it's possible to use JSF entirely stateless. See this blog & this issue. A payoff is that you can't create views dynamically (e.g. by binding, JSTL tags, etc), nor manipulate it after creation.

A Stateless JSF operation mode
  would be incredibly useful for high-load applications and
  architectures:
https://web.archive.org/web/20140626062226/http://industrieit.com/blog/2011/11/stateless-jsf-high-performance-zero-per-request-memory-overhead/#comment-4
This has previously been suggested by Jacob:
  http://weblogs.java.net/blog/jhook/archive/2006/01/experiment_goin.html
This would help JSF ditch the stigma of "slow and memory hog," and
  help keep up with current tech trends (stateless architectures.)

A: Came across the following link. Will be useful if you're using ADF based (now MyFaces Trinidad) implementation.
http://download.oracle.com/docs/cd/B31017_01/web.1013/b28967/web_getstarted006.htm


text:
Q: Slow boot after installing separate distro So I have been searching for a solution for my problem for weeks now but was not able to find anything. Although topics that I found were sometimes similar/related they did not solve my specific problem in the end.
I started out with a notebook that had Windows preinstalled and I installed Ubuntu 15.10 on a separate partition additionally. After that, Ubuntu started up within 20 - 30 seconds... or at least quick enough for me to assume it's a boot at suitable pace.
Then I made another partition and installed a Debian distro. After that, the Ubuntu boot became painfully slow, like 5 minutes or so. I managed to enable verbose boot, so I could see what the system is taking so long with.
There appears to be two times when the system hangs during the boot. Once is when the verbose output reaches something that has to do with Bluetooth,  but the second and more significant hang apparently happens during the time something is done to the swap.
The attached image shows where the system hangs during boot. The code is the output from systemd-analyze critical-chain .

graphical.target @1min 34.575s
└─multi-user.target @1min 34.575s
  └─getty.target @1min 34.575s
    └─getty@tty1.service @1min 34.575s
      └─rc-local.service @1min 31.748s +199ms
        └─network-online.target @1min 31.746s
          └─network.target @1min 31.745s
            └─wpa_supplicant.service @1min 31.954s +62ms
              └─basic.target @1min 31.545s
                └─sockets.target @1min 31.545s
                  └─uuidd.socket @1min 31.544s
                    └─sysinit.target @1min 31.532s
                      └─systemd-rfkill@rfkill0.service @22.681s +3ms
                        └─system-systemd\x2drfkill.slice @3.393s
                          └─system.slice @1.295s
                            └─-.slice @1.294s

My system:

*

*Intel Core i5

*12GB RAM

*1TB HDD

*NVIDIA GeForce 840M

A: I think that the additional partition with the Debian installation is not related to the slowdown. The most likely causes are: corruption of your Ubuntu installation, or bad system updates. The easiest solution is to avoid debugging things at this point. As you haven't invested many hours in configuring your Ubuntu install, I recommend just formatting over and then reinstalling Ubuntu. Also, just to rule out Windows interference, it's currently best to change partitions from within Windows.


text:
Q: Issue with SSH on Ubuntu - Local connection ok, remote connection - Is it me or my ISP? I have an issue with a server running Ubuntu 12.04, I am trying to set up a remote connection so I can access the server at my work from out of town. I have installed the SSH server and all that stuff, and I have reassigned the default port from 22 to 3399.
A local connection from any OS can connect on the 192.168... address, but in no way can I get a connection on the actual IP address.
I believe my configuration is correct, and I will attach it. If I have done something wrong in the config, please tell me and I will make a change to it.
I honestly think that the Router that my ISP provided is horrible, and although the port for ssh is forwarded, it might be stopping any traffic coming inbound. Is there anything I can try to verify this? /var/log/auth does not show any error when I connect VIA our static IP. I have included all values not commented out below: (sshd_config)
Port 3399

ListenAddress 0.0.0.0
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
UseDNS no
RSAAuthentication yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication yes
GSSAPIAuthentication no
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

Am I doing this wrong?
port forwarding image
EDIT: Is there a way to check if a connection even reaches the server? I ran ssh -vvv to my IP and it says it loads my local ssh config, do I need to configure this? below v
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 204.191.22.127 [204.191.22.127] port 3399.
debug1: connect to address 204.191.22.127 port 3399: Connection refused

Here's the result of a ssh -vvv to my local 192.168 server

A: On your router, ensure that you are forwarding port 3399 on your external IP to port 3399 on your internal IP.  If it doesn't allow you to specify port numbers, then you'll have to change your sshd config back to run on port 22 and setup your router to forward to that.
Your sshd config looks fine.  My recommendation on that is for you to create a regular user account that has full sudo access, then change PermitRootLogin to no in your sshd config and restart the sshd service.  Then ssh into the server with your regular user account and use sudo for administrative purposes.


text:
Q: Monitoring array for changes I want to monitor a product on my own site for changes. I have stored all available sizes of the product in an array and I want to console.log once a new size gets added to the array.
I'm doing that just for practice hence why I don't want to monitor data source.
for (let product of products) {
    main(product)
};

function main(product) {
    request({
        url: product.url
    }, (err, res, body) => {
        if (res.statusCode == 200) {
            const $ = cheerio.load(body);
            const availableSizes = []; //this stores all available sizes
            $('.size_box').each((i, el) => {
                let size = $(el).text()
                availableSizes.push(size) //adds each size to availableSizes
            })
        } else {
            console.log('Error ' + err)
            console.log('Retrying in ' + (config.delay/1000) + ' second/s')
            setTimeout(() => {
                main(product)
            }, config.delay)
        };
    });
};

Basically what I want to achieve/add to the code would be this:
if (<no sizes added>) {
    setTimeout(() => {
        main(product)
    }, config.delay)
} else {
    console.log('New size added ' + size)
}

But like I said, I'm not sure how to check for specific changes to the array without just spamming all available sizes all the time.
If there's a better way of monitoring sizes for changes, feel free to suggest it, just storing all sizes in an array was the first thing that came into my mind.

A: His is a bit of a hack, but unfortunately I do not know of a better way to do this. You can amend to the push function being called by over riding the push function on definition. See below:

var myArr = [];

myArr.push = (...args)=>{
  logOnPush(args);
  Array.prototype.push.apply(myArr, args);
}

function logOnPush(res){
  var container = document.getElementById("displayContainer");
  container.innerText = container.innerText+'\n'+'Items added: ' + res;
  console.log('Items added: ', res);
}

function addToArray(){
  myArr.push(Math.round(Math.random() * 10));
  var container = document.getElementById("displayContainer");
  container.innerText = myArr.join(', ');
}

document.getElementById("addBtn").addEventListener('click', () => {
  addToArray();
});
<button id="addBtn">Add to array</button>

A: You could create a custom class, with its data being updated with a custom push method. This class would act exactly as an Array object (you could even extend the Array class), but you can then add your custom behavior
Take a look at this page for an example: https://github.com/wesbos/es6-articles/blob/master/54%20-%20Extending%20Arrays%20with%20Classes%20for%20Custom%20Collections.md


text:
Q: Paging data in dolphindb In dolphindb, do I have a way to paginate data, such as getting data from 100 to 200 rows of a table, just like select * from table limit 100,100 in mysql?

A: Use top clause in DolphinDB to handle data paging.
(1) select top N rows of result set.
select top 100 * from table

(2) select rows from #100 to #200 (exclusive)
select top 100:200 * from table


text:
Q: Sorting for format (Y-m-d H:i:s) is not working in Datatables.net Plugin I have a problem with sorting a date column.
My date is in this format
Y-m-d H:i:s

And I am getting this output:
2012-04-14 23:07:00
2012-01-14 22:40:14
2012-03-09 19:03:20
2012-03-12 16:00:28
2012-05-01 16:09:38
2012-02-11 05:07:08
2012-01-17 15:15:09
2012-03-10 16:02:20
2012-02-09 14:33:19

This is my initialization:
$(document).ready(function() {
        oTable=$('#jphit').dataTable( {
          "sDom": 'T,C<"clear">lfrtip',
             "oTableTools": {
            "sSwfPath": "swf/copy_csv_xls_pdf.swf"
        },
             "oColVis": {
             "buttonText": "Extend table",
            "activate": "mouseover"
        },
        "aoColumnDefs": [
      { "bVisible": false, "aTargets": [ 2 , 4 , 6] }
    ],
            "aoColumns": [
              {
                "mDataProp": null,
                "sClass":"center",
                "sDefaultContent": '<img src="images/plus-icon.png" style="width:27px; height:27px;display: inline;">'
              },
              { "mDataProp": 0 }, //date column
              { "mDataProp": 1 },
              { "mDataProp": 2 },
              { "mDataProp": 3 },
              { "mDataProp": 4 },
              { "mDataProp": 5 },
              { "mDataProp": 6 }
            ],
            "aaSorting": [[0,'desc']], //sort date column
            "bProcessing": true,
            "bSort": true,
            "sPaginationType": "full_numbers",
            "bServerSide": true,
            "sScrollY": "500px",
            "bDeferRender": true,
            "sAjaxSource": "history_table.php"
        } );

This is my PHP part:
$aRow[$iTimestampCol] = date( 'Y-m-d H:i:s', $aRow[$iTimestampCol] );

A: i think you should see this http://datatables.net/plug-ins/sorting. There are some examples how to do sorting by date.


text:
Q: Can I mix RKEntityMapping and RKObjectMapping It seems here they do a workaround:
Relationship between RKObjectMapping and RKEntityMapping
Can I mix them without doing any workaround?
Thanks.
EDIT: Here I add a sample JSON. What I want to store in Core Data are the two entities Region, but nothing about the resultCode or resultDescription. That's the reason I ask if I can mix them.

{
    "resultCode": 0,
    "resultDescription": "OK",
    "resultContent": [
        {
            "region_id": 0,
            "description": "USA"
        },
        {
            "region_id": 1,
            "description": "Europe"
        }
    ]
}

A: I'm not sure what you're asking exactly.. RKEntityMapping is used to map to Core Data entities, and RKObjectMapping is used to just map to regular object representations. So maybe the question is, are you using Core Data or not?

A: You needs to define two separate descriptors for RKObjectMapping & RKEntityMapping objects, in your case for StatusMapping & RegionMapping then add them to ObjectManager, it works like charm (I am giving you sample code and classes to achieve this):
Define ResponseStatus class like this :
//...
ResponseStatus.h
//...
@interface ResponseStatus : NSObject

@property (nonatomic) BOOL resultCode;
@property (nonatomic, strong) NSString *resultDescription;

+ (RKObjectMapping *)rkObjectMappingForResponse:(BOOL)includeAll;
+ (RKObjectMapping *)rkObjectMappingForRequest:(BOOL)includeAll;
+ (NSDictionary *)rkAttributeMappingsDictionary:(BOOL)request includeAll:(BOOL)includeAll;

@end

//...
ResponseStatus.m
//...
@implementation ResponseStatus

    + (RKObjectMapping *)rkObjectMappingForResponse:(BOOL)includeAll {
        RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[ResponseStatus class]];
        [mapping addAttributeMappingsFromDictionary:[self rkAttributeMappingsDictionary:NO includeAll:includeAll]];

        if (includeAll) {
        }

        return mapping;
    }

    + (RKObjectMapping *)rkObjectMappingForRequest:(BOOL)includeAll {
        RKObjectMapping *mapping = [RKObjectMapping requestMapping];
        [mapping addAttributeMappingsFromDictionary:[self rkAttributeMappingsDictionary:YES includeAll:includeAll]];

        if (includeAll) {
        }

        return mapping;
    }

    + (NSDictionary *)rkAttributeMappingsDictionary:(BOOL)request includeAll:(BOOL)includeAll {
        NSMutableDictionary *dic = [NSMutableDictionary dictionary];

        if (includeAll) {
            [dic addEntriesFromDictionary:@{
                 @"resultCode": @"resultCode",
                 @"resultDescription": @"resultDescription",
             }];
        }

        return dic;
    }

    @end

Define a descriptor Mapping for your ResponseStatus (results)
NSIndexSet *statusCodes = RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful); // Anything in 2xx

RKResponseDescriptor *statusResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:[ResponseStatus rkObjectMappingForResponse:YES] method:RKRequestMethodAny pathPattern:nil keyPath:@"" statusCodes:statusCodes];

Define a descriptor Mapping for your RKEntityMapping
RKResponseDescriptor *gameResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:[Game rkEntityMappingForResponse:YES] method:RKRequestMethodAny pathPattern:nil keyPath:@"games" statusCodes:statusCodes];

Add response descriptors to objectManager
[objectManager addResponseDescriptorsFromArray:@[gameResponseDescriptor, statusResponseDescriptor]];

This is how to handle Mapping Results
RKObjectRequestOperation *operation = [objectManager managedObjectRequestOperationWithRequest:requestObject managedObjectContext:managedObjectContext success: ^(RKObjectRequestOperation *operation, RKMappingResult *result) {

    if ([RKUtils isResponseStatusError:[result array]])
        {
         //..
        }

        } failure: ^(RKObjectRequestOperation *operation, NSError *error)
        {
        NSLog(@"Failed with error: %@", [error localizedDescription]);
        }];

+ (BOOL)isResponseStatusError:(NSArray *)itemsList {
    if ([itemsList count] != 1) {
        return NO;
    }

    id object = itemsList[0];

    if ([object isKindOfClass:[ResponseStatus class]]) {
        ResponseStatus *responseStatus = object;
        if (!responseStatus.resultCode) {
            NSLog(@"Error : %@", responseStatus.message);
            return YES;
        }
    }

    return NO;
}

and make a REST call, Hope thats helping.

A: You do not need to mix them in this case. When you create your response descriptor you set the key path to resultContent and just use an entity mapping.
It is possible to mix the mapping types in some ways but this generally needs to be considered on a case-by-case basis. Often you would use multiple response descriptors to keep the mappings separate and then combine the results as post processing.

A: I encountered the same problem myself when i worked with a legacy api. Here are my solutions:
Response json:
{
    "resultCode": 0,
    "resultDescription": "OK",
    "resultContent": [
        {
            "region_id": 0,
            "description": "USA"
        },
        {
            "region_id": 1,
            "description": "Europe"
        }
    ]
}

There are two solutions for this problem:
Solution #1: using object mapping with @"" key path
Suppose you already have the managed class Region with attribute names same as json key names
@interface Response
@property (nonatomic) NSInteger resultCode;
@property (nonatomic, strong) NSString resultDescription;
@end

@implementation Response
// Make it KV compliant
@end

Mapping
// Response map
RKObjectMapping*  resMap = [RKObjectMapping mappingForClass: [Response class]];
[resMap addAttributeMappingsFromArray: @[@"resultCode", @"resultDescription"]];

responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:resMap method: RKRequestMethodAny pathPattern:@"" keyPath:@"" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];

// Region map
RKEntityMapping* mapping  =  [RKEntityMapping mappingForEntityForName: name inManagedObjectStore:[[RKObjectManager sharedManager] managedObjectStore]];

[mapping addAttributeMappingsFromArray: @[@"region_id", @"description"]];
descriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping method: RKRequestMethodAny pathPattern:@"/api/regions" keyPath:@"resultContent" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];

Get the result
Response* res = [[mappingResult dictionary] objectForKey:[NSNull null]];
NSArray* reg =  [[mappingResult dictionary] objectForKey:@"resultContent"];

Solution #2: Using serialization
You can register your RKSerialization implementation
[RKMIMETypeSerialization registerClass:[NKJsonSerialization class]
                               forMIMEType:RKMIMETypeJSON];

And in your serialization implementation, you can check if response is erroneous response and create a NSError object then send it back to Restkit.
@implementation NKJsonSerialization
+ (id)objectFromData:(NSData *)data error:(NSError **)error
{
    NSError* serializingError = nil;
    NSMutableDictionary*  jsonObject = [NSJSONSerialization
                                        JSONObjectWithData:data
                                        options:NSJSONReadingMutableContainers
                                        error:&serializingError];

    // Process if there is no error
    if (!serializingError)
    {
        NSString* resCodeStr = [jsonObject objectForKey:@"resultCode"];

        if ([resCodeStr intValue] != 0) {
        {
            // Create your NSError for your domain, contain information about response err
            serializingError == <#new created error#>
            jsonObject = nil;
        }else{
            [jsonObject removeObjectForKey: @"resultCode"];
            [jsonObject removeObjectForKey: @"resultDescription"];
            serializingError = nil;
        }
    }

    *error = serializingError;
    return jsonObject;
}

If your response contains erroneous code, In your request callback, RestKit will return a NSError object with underlying error is the error you just created during serialization.
The beauty of this solution is that you dont have to care about mapping response status. The erroneous response will be (should be) handled as an NSError.
And if the json object contains data object at the top level (key path @"") you still can use mapping to obtain it without key conflict as it would happen in solution #1.

A: OK, after a few tests, I realised RestKit saves the RKEntityMapping in core data but not the RKObjectMapping. It works perfectly. I love RestKit :)


text:
Q: Clear Session in ASP.Net I want to clear the session on Page unload.
Here is a condition :

*

*If user goes from Page A to Page B of the same site session must not get cleared.

*If user close the browser window or Tab(close the site),session must gets cleared.

I have tried using AJAX PageMethod to call server-side procedure to remove session from client side script.But the procedure is not getting hit,I have checked it using Breakpoint.
server side procedure is in master.cs file
I will appreciate your help.
Here is code in site.master
<body onunload="HandleClose();">
    <script type="text/javascript">
        function HandleClose()
        {
            PageMethods.AbandonSessions();
        }

and here is a code in master.cs :
[System.Web.Services.WebMethod]
        public static void AbandonSessions()
        {

            HttpContext.Current.Session.Abandon();

        }

A: You need to register a javascript event for page unload and send an AJAX request to clear the session. This event will be trigerred when the user closes the browser window or tab. Here's an example page:
<html>
<head>
<script type="text/javascript">
function clearSession() {
    // TODO: Send an AJAX call to a server side script
    // that will clear the session
}
</script>

</head>
<body onunload="clearSession();">

</body>
</html>


text:
Q: " Movesense ECG sample keeps stopping" and error "couldn't find "libmds.so" I'm using Android Studio version 3.3 on Windows 10 (64 bit). Here are the characteristics of virtual devices on which the error occurred:

*

*Nexus 5X API 28, Android 9.0, CPU/ABI: x86

*Nexus 5X API 28, Android 9.0, CPU/ABI: x86_64

*Nexus 5 API 24, Android 7.0, CPU/ABI: x86

*Pixel API 27, Android 8.1, CPU/ABI: x86

The Movesense mobile library version: 1.28.1.
I downloaded the folder suunto-movesense-mobile-lib-e78baa174a4a from the Movesense website (https://bitbucket.org/suunto/movesense-mobile-lib/downloads/) and I tried to run the various samples for Android. The problem I'm going to show is documented for ECGSample but it has also occurred for the other three.
The application is built correctly but when I run the application on the virtual device I have the following error:
Installation failed with message Failed to finalize session:
INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

(Changing Android device and API version, the same error occurred). I solved this problem adding this to my Module's build.gradle script Inside Android{} block:
 splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }

After doing this, the application was launched on the virtual device but unfortunately crashes immediately. The application starts correctly but closes immediately with the following message:
" Movesense ECG sample keeps stopping".

By checking the Logcat I have the following errors:
2019-02-08 12:03:28.641 4770-4770/com.movesense.samples.ecgsampleE/AndroidRuntime: FATAL EXCEPTION: main
Process: com.movesense.samples.ecgsample,PID: 4770
java.lang.UnsatisfiedLinkError:No implementation found for void com.movesense.mds.SDSInternalWrapper.sdsSetDelegate(java.lang.Object)(tried Java_com_movesense_mds_SDSInternalWrapper_sdsSetDelegate and Java_com_movesense_mds_SDSInternalWrapper_sdsSetDelegate__Ljava_lang_Object_2)
at com.movesense.mds.SDSInternalWrapper.sdsSetDelegate(NativeMethod)
at com.movesense.mds.SDSInternalWrapper.setDelegate(SDSInternalWrapper.java:167)
at com.movesense.mds.internal.operation.MdsOperationHandler.<init>(MdsOperationHandler.java:87)
at com.movesense.mds.Mds$Builder.build(Mds.java:357)
at com.movesense.samples.ecgsample.MainActivity.initMds(MainActivity.java:85)
at com.movesense.samples.ecgsample.MainActivity.onCreate(MainActivity.java:70)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

To catch the real problem, we debug the program, it gets an error and the error is "couldn't find "libmds.so".
 Details:
System.loadLibrary(mds) FAILED! Error: sds: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/base.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_resources_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.movesense.samples.ecgsample-gmciklKIfxkuippl92JJAQ==/lib/x86, /system/lib]]] couldn't find "libmds.so"

The code that error occurred.
private native void sdsSetDelegate(Object var1);

static {
    try {
        Log.d("SDSInternalWrapper", "Start load library call [mds]");
        System.loadLibrary("mds"); (Error occurred)
        Log.d("SDSInternalWrapper", "Finished load library call [mds]");
    } catch (UnsatisfiedLinkError var2) {
        String error = String.format("System.loadLibrary(mds) FAILED! Error: sds: %s", var2);
        Log.e("SDSInternalWrapper", error);
    }

}

A: From the build.gradle in the showcase app the mdslib-.aar library should be located in the Movesense folder located at "../Movesense/" relative to the project or if you are trying the other examples it should be located at "../../../Movesense/" have you placed it there?
If not try keeping the folder structure as it is here https://bitbucket.org/suunto/movesense-mobile-lib/src/master/android/
|_Movesense/
| |_libmds-<version>.aar
|
|_Showcasapp/
| |_gradle/
| |_src/
| |
|
|_Samples/

A: The current MDS does not have x86 or x64 support, that is why you are getting the UnsatisfiedLinkError. Therefore it cannot be used with Android simulator for now, only debugging on device.
Full Disclaimer: I work for the Movesense team


text:
Q: How Do I Write CloudFormation Tests For AWS Amplify To Ensure Resources Are Built Correctly? I am looking to build a suite of tests that can be integrated into the CI/CD Pipeline for AWS Amplify. Whilst I have established my front-end testing suite, Cypress, I am trying to determine a suitable path for backend testing.
I've tested the CDK before with Template, and believe I can add a custom resource into AWS Amplify that can import the CloudFormation stacks and then test them.
Where I expect to have the tests:

Example Test Cases:

*

*My Cognito User Pool uses SES to send emails

*My Cognito User Pool has a Post Confirmation Trigger

*My Lambda has the correct permissions

What is the best practise for testing backend resources for AWS Amplify? Is there already an "approved" method?


text:
Q: how to create chart in jsf by FusionCharts I'm trying to create simple fusionchart in jsf.
I have a bean which can get chart JSON by method, but I could not find where should I put that.
Could you give me example, JSF2 fusion chart JSON?

A: Creating Charts using Fusioncharts is just a matter of 10-15 mins. I have tried it several times. If you want to get a chart in JSON format it is just that you need to keep the dataFormat as JSON. One of the basic example of rendering is :
FusionCharts.ready(function() {
var salesAnlysisChart = new FusionCharts({
    type: 'candlestick',
    renderAt: 'chart-container',
    width: '800',
    height: '600',
    dataFormat: 'json', //here the method JSON is specified
    dataSource: { /*Here you can insert the data for your chart*/ }
}).render(); });


text:
Q: Sending files from .net application to python application i have .net web app and python app. The requirement is to pass the text files in one go from .net app to python app. Python app will further process it.
What is the best way to do it?
A> using shared location or FTP Server, where .net app will dump files, and then python app picks files from the location.
B> Or using Rest Service, where .net app will invoke python service and send multiple files, which will be processed in python app.
Please guide what is the best way  to do it.

A: There are probably more factors to consider. Such as:

*

*the size of the files

*are there any firewalls to traverse

*what will the the files after processing

*how are you going to trigger the processing after upload

*potential future features

For example, the Secure FTP (SFTP) or HTTP server implementations you may be using may have a max file size limit (e.g. 1.18 G).
Can the .net app use ftp/sftp to access the target ftp server?
Is there a requirement to keep copies of the file (e.g. remain on the ftp server) or just keep the results?
Can your ftp server trigger the python app?
Do you have any future requirements that will tip the balance?
Is there any reason not to use REST API approach? It probably has more flexibility.


text:
Q: Найти лишние файлы javascript Сайт делался очень давно, потом его переделывали, сначала все работало на prototype, потом часть переписали на jQuery, но prototype все же остался, ибо некоторые сервисы было в лом переписывать из-за их объемности. Сейчас 2 фремворка совместно работают.

Также на сайте куча разных примочек, ну там для листающихся слайдеров и т.д.

Код настолько загадили что в главный файл уже жутко заходить, естественно уже никто не помнит для чего какой скрипт, изначально все валилось на главную страницу и почти весь js грузится на главную и на все остальные.

Как сейчас понять какие js файлы уже не нужны, которые не используются, чтобы без вреда для сайта, ибо возможно что файл используется на какой-то одной странице, но он подгружается в каждую. Это ужасно, и хотелось бы навести порядок + повысить качество шаблона html + ускорить страницу.
A: Переписывать или пересматривать странички, одну за другой, потихоньку отмечаяя нужные функции и переписывая их в нормальный код. А дальше методом исключения, то что осталось можно сносить. Как вариант, а копать в самом коде довольно таки тяжело, уже грабли эти пройдены, я через месяц забываю что я писал, а что нахожу нужное помечаю комментарием.
Если уж совсем все плохо, то лучше начать с нуля.
A: Не вижу альтернативных вариантов, кроме как просмотреть участки кода и удалить ненужные. То есть сделать всё вручную.


text:
Q: Android 12: Layout is not properly displayed when using startActivityForResult I'm migrating a android app from target SDK 30 to 31:
    compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig {
    applicationId "some.app.id"
    minSdkVersion 16
    targetSdkVersion 31
    versionCode xyz
    versionName "xyz"
    testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true
}

There is one activity that behaves differently depending on how it is opened:

*

*startAcitity: The Acitivity works as expected

*startActivityForResult: The UI is not working properly (elements dont appear after programatically changing their visibility, the button size is not adapted to its content anymore but a fixed size is set)

After some tests, the problem seems to be related to the resizing of the UI. Its not happening anymore. Buttons are not resized based on its content, elements set to GONE still take the space etc.
Anyone else came across this issue?

A: I tried to reproduce the issue in a new project without success.
Eventually I found that this problem occured due to changes to the UI in the wrong thread:
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
Running the code in "runOnUiThread" solved the issue.


text:
Q: Ember.JS: There is no route named blah I am getting this error:
Assertion Failed: You attempted to define a `{{link-to "companies.show"}}` but did not pass the parameters required for generating its dynamic segments. There is no route named companies.show

But I do have that route in router.js and is was working before I added two new routes along with a component for editing/adding records. But it is indeed gone right now - I can nav directly to it either. So I think I have an error in a different part of my that is dominoing into my route.
// router.js
Router.map(function() {
  this.route('states');
  this.route('companyTypes');

  this.route('companies', function() {
    this.route('show', {path: '/:company_id'});
    this.route('new');
    this.route('edit', {path: '/:company_id'});
  });

  this.route('counties', {path : '/counties/:state'});
});

// routes/companies.js
export default Ember.Route.extend({
  model() {
    return this.get('store').findAll('company');
  }
});

// routes/companies/show.js
export default Ember.Route.extend({
  model(params) {
    return this.get('store').findRecord('company', params.company_id);
  }
});

I am passing the model parameter in the link-to and the show route has its model hook.

A: Ok, so the problem was I duplicated the same route in router.js
// router.js
this.route('companies', function() {
    this.route('show', {path: '/:company_id'});
    this.route('new');
    this.route('edit', {path: '/:company_id'});
  });

Both show and edit have the same route: If you nav to http://localhost:4200/companies/1 are you supposed to go to show or edit? edit overwrites show because it comes last. Move show after edit:
// router.js
this.route('companies', function() {
    this.route('new');
    this.route('edit', {path: '/:company_id'});
    this.route('show', {path: '/:company_id'});
  });

And show starts working, but edit will break.
So you need to do something like this:
// router.js
this.route('companies', function() {
    this.route('new');
    this.route('edit', {path: '/edit/:company_id'});
    this.route('show', {path: '/:company_id'});
  });

Your routes are now:
http://localhost:4200/companies/1
http://localhost:4200/companies/edit/1


text:
Q: Cannot load files as modules Here's my app directories structure

This is my "excel_import_tests.py" code
import unittest
import pandas
from nasdaq_info import nasdaq_loading

class MyTestCase(unittest.TestCase):
    def test_import_excel(self):
        nasdaq_dataframe = nasdaq_loading.loading_nasdaq_info_from_spreadsheet()

        self.assertEqual(nasdaq_dataframe.loc['ZVO', 'Sector'], 'ConsumerServices')
        self.assertEqual(nasdaq_dataframe.loc['STT', 'Name'], 'StateStreetCorporationCommonStock')
        self.assertEqual(nasdaq_dataframe['Name']['ZVO'], 'ZovioInc.CommonStock')
        self.assertEqual(nasdaq_dataframe['AEG']['Industry'], 'LifeInsurance')
        self.assertEqual(nasdaq_dataframe['AIN']['Sector'], 'BasicIndustries')

if __name__ == '__main__':
    unittest.main()

When I'm trying to run him i got

No module named 'nasdaq_info'

What's going wrong?

A: Do you have init.py in nasdaq_info directory? if not then try placing it there and it is just an empty file

A: Try to add project root path to PYTHONPATH environment variable. In Linux you can do it e.g. with:
export PYTHONPATH=path/to/project/dir

A: Probably Python assumes that nasdaq_info/test is you root directory. Try to set PYTHONPATH environment variable to path with your project.


text:
Q: A Question about Variational Calculus when F= y-y' I am having trouble with F = y - y'
If I set F = |y - y'| and
do $\int F(y,y') dx$,
it seems obvious that $y=\exp(x)$ should be extremal
since $F=|\exp(x)-\frac{d \exp(x)}{dx}| = |\exp(x)-\exp(x)|=0$
But I am not sure how to apply Euler-Lagrange Equation...
Is this any way to solve generalization of this problem?


text:
Q: How Sort data from database in php when using while in php I want to sort date, time from the database from new to old ( high to low ) and I use this code but didn't work!
can you help me?
and I want MySqli Solution and it uses while because I don't know how many numbers of information I will receive from the database!
$sql = "SELECT * FROM orders WHERE seller='$id' ORDER BY dtime ASC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        $ordernumber = $row['ordernumber'];
        echo "

 $ordernumber

";
    }
}

A: If you want to get more details for ordering then click Here.
In your code, you should write like this below,
$sql = "SELECT * FROM orders WHERE seller='$id' ORDER BY dtime DESC";

And please do some search for ordering for your doubt.
Thanks..!!


text:
Q: Cannot commit from command line using github 2FA I can't commit to my repos using username/pass with git via the command line now that I've got 2FA enabled on my account.
I have a "user access token" but I really, really hate it. So now I can only commit when I have this super long string copied into my clipboard, and if anyone sees that string or somehow gains access to my clipboard or I paste it somewhere by mistake or I put it in a file and the file is accessed the attacker can just wreck havoc on my repos?
I really don't understand how this is more secure than remembering a 12 digit random number/letter/symbol password that is not written down anywhere. I must be doing something wrong or misunderstanding how to use this personal access token. What am I doing wrong?

A: First, you can cache that token: see:

*

*"Is there a way to skip password typing when using https:// github"
(I use the credential helper netrc both on Ubuntu, Red Hat and Windows)

*"Configure Git clients, like GitHub for Windows, to not ask for authentication".

Second, the main difference between a (shorter) account password and a token is:

*

*you can revoke a token (and keep your password)

*you can have multiple tokens (which can be created for a limited use or time, and then revoked)


text:
Q: Default argument inside method I try to implement format for a class. I want to have an argument that defaults to 'short'.
I tried:
def __format__(self, code='short'):
    if code == 'short':
        return f'Filename {self.filename}: {self.config}'
    elif code == 'long':
        string = f'{self.filename}'
        for key, value in self.config.items():
           string = string + f'\n{key}{self.sep}{value}'
        return string
    else:
        raise TypeError('Choose between short or long.')

my_config_file = ConfigFileWithBackups('mycofig.txt')
print(f'{my_config_file}')

This last call raises the TypeError but I expected to default to 'short' implementation. Any ideas why?
Of course I can use something like: if not code or code == 'short' but I hope I can understand what's going on with my initial implementation.

A: The __format__ method will be invoked with a format_spec which, in your case, will be an empty string. A value will always be passed. Therefore, setting a default is pointless. Do you realise that you could do this:- print(f'{my_config_file:short}') Either that or if the format_spec is an empty string then assume that's equivalent to 'short'
class ConfigFileWithBackups:
    def __init__(self, filename):
        self.filename = filename
        self.config = {}
        self.sep = ':'
    def __format__(self, format_spec):
        match format_spec:
            case '' | 'short':
                return f'Filename {self.filename}: {self.config}'
            case 'long':
                string = f'{self.filename}'
                for key, value in self.config.items():
                    string = string + f'\n{key}{self.sep}{value}'
                return string
        raise TypeError('Choose between short or long.')

my_config_file = ConfigFileWithBackups('myconfig.txt')

try:
    print(f'{my_config_file}')
    print(f'{my_config_file:short}')
    print(f'{my_config_file:long}')
    print(f'{my_config_file:foo}')
except TypeError as e:
    print(e)

Output:
Filename myconfig.txt: {}
Filename myconfig.txt: {}
myconfig.txt
Choose between short or long.


text:
Q: How to register ELResolver in JSF 2.0 Programmatically While working with Spring 3.x and and JSF 2.x, we can register the Spring Beans EL resolver for JSF in the faces-config.xml as:
<application>
    <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
</application>

Is there a way we can do this programmatically and get rid of faces-config.xml?
Edit: 02/27/2012
I found a way to get this working. Not quite sure yet but I'm still reviewing my solution. Here's is how I got it working.
1.Write a Java Servlet and implement its init() method which contains the code to register ELResolver i.e.
public final class ELResolverInitializerServlet extends HttpServlet {
private static final Logger LOGGER = Logger.getLogger(ELResolverInitializerServlet.class.getName());

private static final long serialVersionUID = 1L;

/**
 * @see HttpServlet#HttpServlet()
 */
public ELResolverInitializerServlet() {
    super();
}

/**
 * @see Servlet#init(ServletConfig)
 */
public void init(ServletConfig config) throws ServletException {
    FacesContext context = FacesContext.getCurrentInstance();
    LOGGER.info("::::::::::::::::::: Faces context: " + context);
    context.getApplication().addELResolver(new SpringBeanFacesELResolver());

}

}
2.Register this servlet using Spring's bootstrapper org.springframework.web.WebApplicationInitializer i.e.
public class AppInitializer implements WebApplicationInitializer {
private static final Logger LOGGER = Logger.getLogger(AppInitializer.class
        .getName());

@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    LOGGER.info("Bootstraping Spring...");
            ...

    ServletRegistration.Dynamic elResolverInitializer = servletContext
            .addServlet("elResolverInit",
                    new ELResolverInitializerServlet());
    elResolverInitializer.setLoadOnStartup(2);
            ...
}

}
With this configuration, Spring bootstrapper registers the servlet as a loadOnStartup servlet. This servlet is loaded after the JSF's FacesContext is created. Then it adds the ELResolver to the JSF's context which is available for the application after the application starts up.
Any thoughts / reviews are welcome.

A: Take a look at addELResolver method in Application class.
Something like:
FacesContext.getCurrentInstance().getApplication().addELResolver(myResolver);


text:
Q: How to force Power BI to filter out individual records, rather than groups? I'm using Power BI Desktop to create some table visualizations. Each record is a sales. I'd like to count up the total number of sales less than $200,000 in each department.
After trying to use a visual level filter it seems that Power BI is using it as a HAVING-clause (filtering out departments with less than $200,000 in total sales) rather than a WHERE-clause (filtering out individual sales worth less than $200,000).
How can I filter out individual records, rather than groups?

A: Create a measure:
Small Sales Count = COUNTROWS( FILTER('Sales', 'Sales'[Amount] < 200,000))

It filters 'Sales' table for the records where amount is <200,000, and counts rows in the result.


text:
Q: Overlapping Divs -- How to Wrap Around? I got a large div that is containing several dynamic divs inside of it.
They are often padded to the left and inside another div that is also padded left.
What I'm trying to do is have the overall containing div (it has a border) look inside these children divs and find how big it needs to expand itself in order to look like it's "containing" all its children.
Any ideas on a nice elegant way to do this? Right now I've got some hobbled together combination of finding the large div in question, finding its length and adding on all the -left-padding of its parents.

A: just set the css property, overflow:hidden; on your "overall containing div".  That'll make it automatically expand to contain all the stuff inside it.

A: You could use a CSS clearfix.  This is ideal for floating the contents inside a container.  Just save the code to clearfix.css and link to that in your html.


text:
Q: Como salvar em um banco de dados, confrontos entre times? Gostaria de saber como salvar em uma tabela no banco de dados confrontos entre times, por exemplo:
TIME A x TIME B
TIME A x TIME C
TIME B x TIME C

A: Uma tabela associativa, creio eu, seria a alternativa mais interessante:
CREATE TABLE CONFRONTOS
(
    ID_CONFRONTO INT PRIMARY KEY,
    ID_TIME_1 INT NOT NULL,
    ID_TIME_2 INT NOT NULL,
    DATA_CONFRONTO DATETIME NOT NULL,
    GOLS_TIME_1 INT NOT NULL,
    GOLS_TIME_2 INT NOT NULL
    -- Aqui você pode colocar FKs, algumas outras coisas de verificação, etc.
)

Fiz um SQL genérico. Não sei que banco você está usando, mas é um começo.

EDIT
Não faço a menor ideia de qual framework você está usando, mas segundo seu comentário, falta uma associação no join:
$cons = $fcrud->select('t1.nome, t2.nome, confrontos.gols_time_1, confrontos.gols_time_2', 'confrontos c JOIN times t1 ON t1.id_time = confrontos.id_time_1 JOIN times t2 ON t2.id_time = confrontos.id_time_2', 'ORDER by confrontos.id_confronto DESC',array());
$ver = $cons->fetchAll(PDO::FETCH_OBJ);


text:
Q: How to make a struct that uses Callable (callAsFunction()) works with protocol? I'm trying to make the callAsFunction() works when working directly with protocol or dependency injection, but it seems like the protocol instance is not aware of the Callable feature. I tried adding the func callAsFunction() within the protocol decorating, but it did not work too. As you can see the sample code below, when creating an instance with the concrete struct, I'm able to work with the callAsFunction(), but not with the protocol instance.
protocol Decorating {
  //to implement
}

struct Decorate: Decorating {
 func callAsFunction() {
    print("Decorated!")
 }
}

let decorate: Decorate = Decorate()
decorate() //worked

let decorate2: Decorating = Decorate()
decorate2() //failed

A: You can extend your protocol:
protocol Decorating {

}

extension Decorating {
    func callAsFunction() -> {
        // Your code
    }
}

Example of use:
protocol Decorating {
    var foo: Foo
}

extension Decorating {
    func callAsFunction() -> {
        foo.foo()
    }
}

let decorate: Decorating = Decorate()
decorate()


text:
Q: Porting a unicode enabled Delphi 2006 application to Delphi 2009 I have an application which is fully unicode compatible in Delphi 2006. I had replaced all AnsiStrings with WideStrings, replaced all VCL controls with TNT controls, and changed all string functions from AnsiStrings to WideStrings. It looks like all that work was for nothing, because I'm going to have to reverse it all. Is there anyway to Trick Delphi 2009 into thinking Widestrings are in fact UnicodeStrings?

A: No, there really isn't. But you won't regret the work to truly Unicode enable your application.
The TNT controls can easily be replaced with the regular VCL controls.  You can do that pretty simply using the wizard from GExperts (http://www.gexperts.org) that replaces one control type with another automatically.
Then, you can change all your WideString declarations to regular strings.  String is now an alias for UnicodeString, and so all your strings can hold Unicode data just fine.
BTW, the author of the TNT controls, Troy Wolbrink, now vastly prefers Delphi 2009 over his own controls.

A: Main advantage of TNT Controls is only that It can work as Ansi program in Windows 9x. It is not full unicode. If you want full unicode support everywhere (such as Stringlist.LoadFromFile, Form.OnKeyPress) it's good to move to Delphi 2009.

A: I have done the same thing in an application that used different XML files as input.  In my case, I was working with UTF-8 (so we could use regular strings) throughout the program and only converted to WideString for display purposes (TNT controls).
I removed the conversions back and forth between WideString and UTF-8 and replaced the TNT controls with regular VCL controls by hand since there were only a handful of forms.
The conversion took about an hour with testing.  The code is simpler and the program is noticeably faster.


text:
Q: Is it possible to repurpose old Bluetooth remotes into Bluetooth dongles? I have picked up a cheap Bluetooth remote shutter (AB Shutter 3) from a shop. On the PCB it turns out that the firmware chip code is
ATHYC802
24C02N
SU27 D

and the (supposedly) Bluetooth chip code is
YC1089
E8R068
1841A6

I was wondering if it was possible to modify the PCB in such a way that a USB Male connector could be attached to the Bluetooth chip on the PCB so that i can connect it to my computer in order to have Bluetooth connectivity on my computer. Is it possible to do this in any way?

A: This is not possible.
Bluetooth devices are either master (computers, phones, etc) or slave (speakers, mouse, etc). While both devices have the ability to receive and transmit, only master devices have the hardware needed to pair connections.
If you want to add Bluetooth to your computer, there are a wide variety of off-the-shelf Bluetooth adapters to purchase.