Questions tagged [prefixes]

47 questions
24
votes
11 answers

Finding whether a string starts with one of a list's variable-length prefixes

I need to find out whether a name starts with any of a list's prefixes and then remove it, like: if name[:2] in ["i_", "c_", "m_", "l_", "d_", "t_", "e_", "b_"]: name = name[2:] The above only works for list prefixes with a length of two. I…
Kawu
  • 13,647
  • 34
  • 123
  • 195
17
votes
3 answers

Generate Digital Signature but with a Specific Namespace Prefix ("ds:")

I digitally sign XML files, but need the signature tags contain the namespace prefix "ds". I researched quite the google and found many of the same questions, but no satisfactory answer. I tried to put the "ds" manually in the file, but the…
13
votes
3 answers

Do I still have to use all five vendor prefixes for the CSS box-shadow property?

When declaring say box-shadow or text-shadow or gradients for that matter, do you still need all the prefixes? -webkit-box-shadow: inset 0 0 1px 1px #e3e3e3; -moz-box-shadow: inset 0 0 1px 1px #e3e3e3; -ms-box-shadow: inset 0 0 1px 1px…
user39980
9
votes
2 answers

Combining prefixes in SSE

In SSE the prefixes 066h (operand size override) 0F2H (REPNE) and 0F3h (REPE) are part of the opcode. In non-SSE 066h switches between 32-bit (or 64-bit) and 16-bit operation. 0F2h and 0F3h are used for string operations. They can be combined so…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
6
votes
4 answers

Are "n" or "ch" prefixes common prefixes when naming int or char variables in C++?

I'm currently going through learncpp.com's C++ tutorials and I'm seeing that their variable naming trend has them naming int variables with an "n" prefix (i.e. int nValue) and "ch" prefixes for char variables (i.e. char chOperation). Is this…
Adam Schmidt
  • 103
  • 2
  • 8
5
votes
1 answer

Asp.Net MVC2 Clientside Validation problem with controls with prefixes

The problem is: when I put 2 controls of the same type on a page I need to specify different prefixes for binding. In this case the validation rules generated right after the form are incorrect. So how to get client validation work for the…
Sasha
  • 1,393
  • 16
  • 17
4
votes
4 answers

PHP Class Namespaces vs Prefixes

Just a quick question on your preference of using PHP namespaces or class prefixing.
Chris
  • 83
  • 9
4
votes
4 answers

Formatting an Integer using ISO-prefixes for kB,MB,GB,... and kiB,MiB,GiB,

I looking for the function that prints file size on the mode-line in size-indication-mode. I have searched for size-indication-mode in the source but cannot find a code-references to it. So where is the function that prints for example 22k when file…
Nordlöw
  • 11,838
  • 10
  • 52
  • 99
4
votes
6 answers

If you are using getters and setters, how should you name the private member variables?

As kind of a follow up to this question about prefixes, I agree with most people on the thread that prefixes are bad. But what about if you are using getters and setters? Then you need to differeniate the publicly accessible getter name from the…
Iain
  • 9,432
  • 11
  • 47
  • 64
3
votes
2 answers

Repeat prefixes and mandatory prefixes in x86

In my quest of writing a small disassembler for linux specific to x86 arch, I'm faced with a small issue. It's with regard to mandatory prefixes and repeat prefixes. Looking at the Intel docs [1], it's said that repeat prefixes are 0xf2 or 0xf3, and…
Hrishikesh Murali
  • 535
  • 3
  • 7
  • 16
3
votes
9 answers

Function in c++ for finding if a word is prefix

Let say i have some words AB, AAB, AA. AB is not a prefix to AAB but AA is a prefix to AAB because if i just add B at the end of AA it will become AAB, which is not possible with AB. So, is there any function in c++ (STL) so that i can determine…
VaioIsBorn
  • 7,683
  • 9
  • 31
  • 28
2
votes
1 answer

Is there a default operand size in the x86-64 (AMD64) architecture?

This is a question about the operand-size override prefixes in the x86-64 (AMD64) architecture. Here is a bunch of assembler instructions (nasm) and their encodings; by new I mean the r8, ..., r15 registers: …
user1752563
  • 149
  • 9
2
votes
0 answers

Find the sum of consecutive elements efficiently - INOI 2015, Problem 1

I was recently solving this problem from INOI 2015. In this problem, you are given two arrays A and B and a special sum for the given arrays for two indices i and j is A[i]+A[j] plus the sum of the elements in the B array with indices between i and…
Vasu090
  • 79
  • 1
  • 10
2
votes
2 answers

Make a set prefix-free

Is there a standard or best algorithm to make a given set of strings prefix-free? That is, given a set of strings, throw out all strings that have a (shorter) prefix also in that set. In case it matters, I'm ultimately gonna implement this in Python…
2
votes
1 answer

AutoMapper Conditional Mapping Not Working With Skipping Null Destination Values

Below are my classes public class Student { public long Id { get; set; } public long? CollegeId { get; set; } public StudentPersonal StudentPersonal { get; set; } } public class StudentPersonal { public long?…
Adam Levitt
  • 10,316
  • 26
  • 84
  • 145
1
2 3 4