robherc
#offtopic
Mj
Write a class called Name that has the following member variables: • Fname: A string that holds the person’s first name. • Lname: A string that holds the person’s last name. 2- Write two constructors: • The first constructor is a default constructor. • The second constructor can take the first name and last name as arguments from the object. 3- Write a function that adds the two names and shows the value as a full name and create the appropriate get functions for the member variables. 4- Create a destructor to destroy the created object of this class. 5- Once you have written the class, write a separate program that creates two Name objects. • The first object uses the default constructor with first name and last name as whitespace strings. • The second object uses the constructor with your first name and last name as arguments. 6-The program should store this data in the two objects and then display the data of the full name on the screen.
Mj
/
Mj
No
Mj
home work?
Can you help me?
Anonymous
Jyoti don't PM me asking to do your Home works.
Mar!o
#ASK #x86_64 #AVX512 Good day everybody, I am studying AVX-512. I have a question about VORPS. The documentation says like this: EVEX.512.0F.W0 56 /r VORPS zmm1 {k1}{z}, zmm2, zmm3/m512/m32bcst Return the bitwise logical OR of packed single-precision floating-point values in zmm2 and zmm3/m512/m32bcst subject to writemask k1. EVEX encoded versions: The first source operand is a ZMM/YMM/XMM register. The second source operand can be a ZMM/YMM/XMM register, a 512/256/128-bit memory location, or a 512/256/128-bit vector broadcasted from a 32-bit memory location. The destination operand is a ZMM/YMM/XMM register conditionally updated with writemask k1. Ref: https://www.felixcloutier.com/x86/orps What does "subject to writemask k1" means? Can anyone give a concrete example of k1 contribution in this instruction? I wrote this code to do some experiment about VORPS. https://godbolt.org/z/r78a16 Here, I tried to change the value of k0, k1, k2. But the result is always the same. Result: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
(KL, VL) = (4, 128), (8, 256), (16, 512) FOR j←0 TO KL-1 i←j * 32 IF k1[j] OR *no writemask* THEN IF (EVEX.b == 1) AND (SRC2 *is memory*) THEN DEST[i+31:i]←SRC1[i+31:i] BITWISE OR SRC2[31:0] ELSE DEST[i+31:i]←SRC1[i+31:i] BITWISE OR SRC2[i+31:i] FI; ELSE IF *merging-masking* ; merging-masking THEN *DEST[i+31:i] remains unchanged* ELSE *zeroing-masking* ; zeroing-masking DEST[i+31:i] ← 0 FI FI; ENDFOR DEST[MAXVL-1:VL] ← 0 The destination operand is a ZMM/YMM/XMM register conditionally updated with writemask k1 (IF k1[j])
Ammar
(KL, VL) = (4, 128), (8, 256), (16, 512) FOR j←0 TO KL-1 i←j * 32 IF k1[j] OR *no writemask* THEN IF (EVEX.b == 1) AND (SRC2 *is memory*) THEN DEST[i+31:i]←SRC1[i+31:i] BITWISE OR SRC2[31:0] ELSE DEST[i+31:i]←SRC1[i+31:i] BITWISE OR SRC2[i+31:i] FI; ELSE IF *merging-masking* ; merging-masking THEN *DEST[i+31:i] remains unchanged* ELSE *zeroing-masking* ; zeroing-masking DEST[i+31:i] ← 0 FI FI; ENDFOR DEST[MAXVL-1:VL] ← 0 The destination operand is a ZMM/YMM/XMM register conditionally updated with writemask k1 (IF k1[j])
Yeah I am aware of this, but I didn't know how to implement the writemask. But now I know. The answer to my question: The reason of why mask register did not affect the result is because I did not encode the mask register in the destination operand for vorps. In AT&T syntax, the usage is something like: # Without z-bit vorps %zmm0, %zmm1, %zmm2 {%k1} # With z-bit vorps %zmm0, %zmm1, %zmm2 {%k1}{z} —————— In GCC inline asm, the {} have to be escaped like this: # Without z-bit vorps %%zmm0, %%zmm1, %%zmm2 %{%%k1%} # With z-bit vorps %%zmm0, %%zmm1, %%zmm2 %{%%k1%}%{z%}
Ammar
I answered my own question here several hours ago: https://stackoverflow.com/a/66362299/7275114
Ammar
Thanks for the reply anyway.
Mar!o
Thanks for the reply anyway.
np ^^ glad u solved it
Codigo
Hello, I have a question. When coding I'm often blamed for not using names that are not easily recognizable. In my programs, I often use the following names: fillArray: Function that fill an array checkArray: Function that check if a value is in an array. number: Intiger variable (often used for user input) numbers: Array of intigers. Any advice?
Pavel
Hello, I have a question. When coding I'm often blamed for not using names that are not easily recognizable. In my programs, I often use the following names: fillArray: Function that fill an array checkArray: Function that check if a value is in an array. number: Intiger variable (often used for user input) numbers: Array of intigers. Any advice?
It's not a simple topic, it depends of whether it class member, local variable. Depends on scope, surroundings, and meaning of the data. For numbers for example, your array of integers or an integer represent some logical part of the app, right? I mean if the integers are temperatures, then it temperatures not just numbers. Or if it really some random numbers to feed into some algorithm, then it randomNumbers or maybe randomPositiveNumbers. There are lot of articles about good naming (some of them controversial with others, but stil can give some ideas). One good suggestion I found that if you want to name some variable in one word, like count, it's good to think, maybe you need to describe "count of what", like recordsCount or mobsCount, the same for words: number, size, length, average, ... .
Igor🇺🇦
Hello, I have a question. When coding I'm often blamed for not using names that are not easily recognizable. In my programs, I often use the following names: fillArray: Function that fill an array checkArray: Function that check if a value is in an array. number: Intiger variable (often used for user input) numbers: Array of intigers. Any advice?
There is a reason why "naming things" is considered one of the hardest problems in programming. Here are some articles on the subject: this is a collection "naming related" rules from CPP coding guidelines https://users.ece.cmu.edu/~eno/coding/CppCodingStandard.html This one is useful too: https://www.fluentcpp.com/2017/01/30/how-to-choose-good-names/
robherc
Help!☹️
you showed 0 effort & simply asked us to do your homework for you. I'm pretty certain that's considered "ban bait" around here.
Anonymous
Hey I think I have a problem with my JavaScript,any suggestions?
Anonymous
All it does is ,it exits every time I enter,any suggestions?
Ammar
All it does is ,it exits every time I enter,any suggestions?
No detail = No solution No one can help you with this information, even in JavaScript group. Please practice how to ask smart question.
Ammar
And anyway, read the group rules please.
Anonymous
Fucken dum ass
robherc
suggestion: go to javascript group
and then ask a question with some substance and even maybe a *gasp* code snippet.
robherc
Fucken dum ass
/report rules
Syoma
Hi
robherc
Hi
cute fox....I'd have photoshopped some glasses on him tho 😉
Roxifλsz 🇱🇹
Fucken dum ass
/ban don't do javascript, kids
𝕸 𝖕𝖆𝖞𝖉𝖆𝖗
Hi friends Who know that how can I work with githhub?
MAC
Hi friends Who know that how can I work with githhub?
There have a guide for beginners in official site
𝕸 𝖕𝖆𝖞𝖉𝖆𝖗
Igor🇺🇦
Hi friends Who know that how can I work with githhub?
https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners
Anonymous
/ban
MRT
/ban
Generation Z
Hola what do scanf used for in c, i am a beginner
Generation Z
I wonder how to create an input in c
Igor🇺🇦
Hola what do scanf used for in c, i am a beginner
The first thing every beginner in anything should learn is "how to use Internet search" Did you try any of the available results https://www.ecosia.org/search?q=scanf+in+c ?
Generation Z
Thanks a lot
ricoh
hello guys... sorry to be have disturb this crowd with some rando homework... ..but apparently i have to implement an `error creation' module to a synchronous transmission system, so that a CRC check might capture this down the transmission pipeline... ...mahn...ive been scratching my head for hrs tryna figure this bit out n i thought i'd rather ask comrades here...any pointers (😂😂 no puns intended) would be of great help... ...if encountered with such a problem, how would/could you have solved it??
J
(Hard to understand. It seems not an easy homework.)
ricoh
Can you explain in detail ?
1. The Synchronous Transmitter Creates files of bits (‘0’ and ‘1’ characters) from the input files. All valid input files contain data made up of ASCII characters and have the .inpd file extension. The data to be transmitted must be structured as a set of blocks. Each block will consist of 2 SYN characters, ASCII 22, one control character to indicate the length of data block followed by a maximum of 64 data characters. Assume that there are no trailing control characters. Every block transmitted must contain 64 data characters except possibly the case where the remainder of the file cannot fill the buffer. Each character will consist of 7 information bits and a parity bit. These bits will be transmitted from the least significant bit (LSB) to the most significant bit (MSB). The table below illustrates the structure of a block created to transmit the “Hello!” character string. The actual contents of this block has to be encoded with characters ‘0’ and ‘1’ to simulate the binary representation of the characters used.   2222 6 Hello!     2. The Synchronous Receiver This program reads the files created by the Transmitter (.binf) as input, checks for transmission errors, decodes stream of bits, and stores the resulting information on a file (.outf).   Both programs should have three distinct layers: physical, data link and application. The physical layer should contain routines to handle jobs such as converting a character into a binary bit pattern, calculating, and including a parity bit, executing the cyclic redundancy check and writing bits into an output file (i.e., transmission of bits). It should also include routines for reading bits from a file (i.e., reception of bits) and converting bits into characters. The data link layer should contain routines for framing (putting two SYN characters, a LENGTH character, and data into a frame) and deframing (separating those control characters from data characters). The application layer should contain routines to handle tasks such as reading data to be transmitted from input data file in the Transmitter and writing received data into display (or output data file) in the Receiver, as well as any other routines that you feel necessary.  Your solution must also include a module to simulate transmission errors.   3. Details The following are the tasks to be done for this project: a.      Create a simple client/server (transmitter/receiver; consumer/producer) application as discussed in this document that uses a simple odd parity bit and a file for "data transmission". b.     Design and implement the Error Creation module. This component must, in a random way, change a single bit as well as more than one bit in the message. Your function must have the number of bits that are to be modified as an input parameter. It must also inform the user the frame, byte and bit locations of the errors introduced. The receiver must be able to report the location of errors introduced during transmission.    ...here's the low down
Anonymous
what are static members ?
Anonymous
in c++
Anonymous
can anyone explain please?
Henry
/get
Henry
/book
Henry
/cbook
Henry
/getcbook
Henry
/get
Alex
can anyone explain please?
you don`t need object of class to call static method or get static var
Henry
/getcbook
Henry
/get cbookguide
Henry
/getcbook
Anonymous
Alex
I don`t know what is static data member
Anonymous
in c++ programming i am asking
AHMED
string f; cout<<"Enter any type of data you need to store:\n"; cin>>f; cout<<"You entered "<<f<<endl;
AHMED
If the user entered multiple words separated by space , the program stores only the 1st word. HOW to solve this?
Nameful
use some function that reads an entire line
حماد
is stastic data member/stastic member same?
Static data members are the data members of class which are declared static... And also you can declare a method or function static which will be called static method or static function... Both static data members or static functions could be called or invoked without creating an object of that class
AHMED
I did it :
AHMED
string f; cout<<"Enter any type of data you need to store:\n"; getline(cin, f); cout<<"You entered "<<f<<endl;
حماد
Static member or static data member are both Same ❓
I don't remember the terminology but maybe Static Data Members and Static functions are called Static Members of the class... But this is only my thought
حماد
Just search on the Google for that
Anonymous
I didn't find 😔