Categories
Mastering Development

resd instruction in AT&T syntax

I’m having trouble finding the equivelent operation for the “resb” instruction as outlined in the nasm manual. I’ve also had trouble finding equivelents to “db”, “dw”, etc. They seem to be “.byte”, “.short”, and “.long” corresponding to “db”, “dw”, and “dd” respectively, but I am unsure as I’ve only gathered this from random code snippets. […]

Categories
Mastering Development

How can I collect only the elements of the greatest length with Java Streams?

I am trying to use Java Streams to collects all the Strings of the greatest length from my list: List<String> strings = Arrays.asList(“long word”, “short”, “long wwww”, “llll wwww”, “shr”); List<String> longest = strings.stream() .sorted(Comparator.comparingInt(String::length).reversed()) .takeWhile(???) .collect(Collectors.toList()); I would like my longest to contain {“long word”, “long wwww”, “llll wwww”}, because those are the Strings […]

Categories
Development

How can I format my text file to make it not repeat the same line over and over? [closed]

I am trying to write a text file using C++ ,but it keeps repeating the line. Is there a certain way to format to make it only have the line once and not 10 times? This is my code and when I try to make it write the definition for the keyword it writes the […]

Categories
Development

Finding the most profitable permutations of long/short pairs in Python – an optimization problem?

I have daily profit data and I’m trying to find the best combinations of two assets that will return the highest profit. I need to purchase one asset long and short the other and find the best performing pair over a time window. I can accomplish this by searching through all the permutations, but it’s […]

Categories
Development

How to handle multiple date format in Bsdatepicker

what i need i need to handle multiple date format in bsdatepicker. Date Component import { Component, Input, OnInit, ChangeDetectionStrategy, ChangeDetectorRef, AfterViewInit, AfterViewChecked } from ‘@angular/core’; import { FormGroup } from ‘@angular/forms’; import { ClientAppConstants } from ‘src/app/CLIENT/APP/Services/client-app-constants.services’; import * as moment from ‘moment’; import { BsDatepickerConfig, BsLocaleService } from ‘ngx-bootstrap/datepicker’; @Component({ selector: ‘date’, changeDetection: […]

Categories
Development

Which one does occupy less memory?

I was programming a thing and I wondered: Which of these two solutions occupies less memory? short X; short Y; array<pair<short,short>,1> Coords; The program is written in C++

Categories
Development

Is caching of boxed Byte objects not required by Java 13 SE spec?

Reading the JAVA 13 SE specification, I found in chapter 5, section 5.1.7. Boxing Conversion the following guarantee: If the value p being boxed is the result of evaluating a constant expression (§15.28) of type boolean, char, short, int, or long, and the result is true, false, a character in the range ‘\u0000’ to ‘\u007f’ […]

Categories
Development

Create object by merging other three with priority (C# .NET 3.5)

I have three C# (using .NET 3.5 for a legacy sw) objects of the same class (A, B, C) that has all public properties (string, int, short, byte, datetime, double) I need to create a fourth (D) by merging the “three” objects. If A has a property set (not null or empty) I have to […]

Categories
CMS Development Drupal

How to get value of checked tableselect row

Please help with tableselect element i want to get data from one of the checked rows. Here source: ‘ $options = array(); $nodes = db_query(“SELECT order_id, order_number, created, status FROM {commerce_order}”); foreach ($nodes as $nid=>$node){ $options[$nid][] = $node->order_number; $options[$nid][] = format_date($node->created, ‘short’); $options[$nid][] = $node->status; //$options[$nid] = array(‘order_number’ = $node->order_number, //’order_date’ = format_date($node->created, ‘short’), //’status’ […]

Categories
Development

FileNotFoundError from subprocess.run when executing command from /usr/bin/* – Python

I’ve seen many similar subprocess questions but none of them helped in fixing my problem. I’ve written an add-on for Firefox browser using Web Extensions API. This add-on uses Native Messaging API for communicating with native app (which is essentially a Python script). For reference, my extension and native app (Python script) works similarly to […]