Menu
  • HOME
  • TAGS

The type 'System.Runtime.InteropServices.SafeHandle' exists in both 'System.Runtime.InteropServices.dll' and 'System.Runtime.Handles.dll'

c#,dll,reference,compiler-errors,interop

I finally found a solution for my problem. It wasn't easy to find but I did it! Since my solution is very specific to my project, I'll post the steps I used to solve it. I hope it can help someone! I unloaded my startup project and created a new...

Returning a reference from a pointer

c++,pointers,c++11,reference,singleton

A reference is not an address of an object. It is just an alias for one. You simply have to de-reference the pointer: return *_instance; This lets the reference refer to the object pointed at by _instance. Note that the implementation can be greatly simplified: SingletonSample& SingletonSample::Instance() { static SingletonSample...

Java : setting object to null within a method has no effect (Reusing code)

java,algorithm,reference,binary-search-tree

You have to delete the node from the tree and not locally in your program. Node<Integer> nodeToBeDeleted = getNode(deletionNodeValue); gives you a copy of the Node in the tree. nodeToBeDeleted = null; sets this copy to null. The connection to the tree is not deleted because it is part of...

Swap and Return Char Array from the Function

c++,arrays,reference,char,swap

First of all, you can indeed not return arrays. That's one big problem with them. If you really want to use char[], you can just pass the output array as an extra parameter: void reversit(const char *a, char *b){ int size=strlen(a)-1; int i; for(i=0; i<strlen(a); i++){ b[size--] = a[i]; }...

Visual studio does not exist in the namespace, but reference is added

c#,visual-studio-2012,reference,code-coverage

I should have checked the warnings in visual studio, they had the real error details, the project had to be built against .net 4.5 and not 4.0. Once this was changed the project built correctly.

Why does this program compile fine in C++14 but not in a C++11 compiler?

c++,c++11,reference,c++14,list-initialization

It works on C++14 and also works on C++11. You're very likely using an out-of-date compiler. There's a fixed bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50025) for your exact issue (cfr. DR 1288) C++0x initialization syntax doesn't work for class members of reference type Quoting from Jonathan Wakely The original C++11 rules required a temporary...

Referencing properties in mongoose

node.js,mongodb,properties,reference,family-tree

This should work: var gran1 = new Grand ({ name: "Paul", childs: dad1._id, grandchilds: dad1.child }) ...

error: use of overloaded operator '*' is ambiguous

c++,pointers,vector,reference

The problem is that you didn't understand the syntax that comes with references. While you do declare a reference with &, you use it as you would use the actual variable and not like a pointer, which means you can't use the operator * on it (unless it's a reference...

When you reference library how to copy to TargetDir not only .dll but also .config

c#,reference,config,solution,class-library

As Micky pointed out assemblies don't have config files, but you could use "Add existing file" and select "Add as Link" and then set "Copy To Output Directory" To "Copy always" this way the file should be copied to the output directory.

Method works if called from one Class but not from another

java,methods,reference

Your variable private Serial sl is just not initialized. Try public RxTx(GUI g){ this.g = g; this.sl = new Serial(g); } ...

Private variable cannot reference to another method in the same class

java,variables,reference

Your jbtn variable is declared within the createForm method. Java uses what are called "scoping rules" to make sure you don't accidentally use variables you don't mean to. By declaring jbtn in createForm, you are telling the Java compiler that you only want to use it in that method, and...

C++ - Why does 2 local references to the same object stay in sync?

c++,pointers,syntax,reference,variable-assignment

string & ref1 = *it; string & ref2 = *it; Okay, so you create two references to the same string. ++it; // After this line, both ref1 && ref2 evaluates to "a" Right, because they are both references to the same string. This is the way you created them. ref2...

C++: creating an instance of an iterator nested class

c++,templates,reference,nested-class

In C++ a reference must be initialized in the member initialization list, it cannot be initialized in the coustructor body. You need to change your code to iterator(OrderList& ord, bool is_end) : order(ord) { if (is_end == false) { ... } } instead of using an assignment. Assignment on a...

Laravel References 2e en 3th level

php,laravel,reference,foreign-key-relationship

In your TableWriter model you should have a function 'country'. public function country() { return $this->belongsTo('TableWriter'); } The the country_id should be the id of the country and you can do $tableWriter->country()->name where $tablewriter is an instance of your TableWriter. So with the above in app/TableWriter.php you should be able...

c++ 2 ref classes should have acess to one same object of a other class

c++,windows,reference,system,command-line-interface

If your class of c is a ref class, you can use ^ (handle) to reference it. like the code here ref_class_c ^ d(gcnew ref_class_c); ref_class ^ e = d; As for the tracking reference versus a handle, the difference is similar to a reference/out parameter in C# method versus...

Why does this code in java print a reference instead the result of invoking the method?

java,arrays,methods,reference,boolean

add returns an array. Arrays in Java are objects, but they do not override the toString() method. When printing, you'd print their default toString() call, which is implemented by Object as return getClass().getName() + "@" + Integer.toHexString(hashCode());. Luckily, Java provides a utility in the form of java.util.Arrays.deepToString(Ojbect[]) to generate a...

Assign a reference return value to a non-reference variable

c++,reference

Is the copy constructor of A called, thus creating an object independent from the one returned (by reference) by the function? Yes. The copy constructor takes a reference to the source object as it's parameter and a copy is independent of the original object assuming the copy constructor does...

Microsoft Access - Missing Reference to acrobat.tlb

vba,ms-access,reference

I'm not 100% on this, but loading Adobe by itself may not give you the library you are looking for. You could need the file which is located in the SDK (which happens to be free) adobe site. Try installing this, and see if you can navigate to the tlb.

C# - Getting List reference index

linq,list,object,reference,compare

This is how I try to make reference: List<byte> reference = new List<byte>(bytes[0]); That's not the right way to make a reference, because you make a copy by calling a constructor of List<byte>. The copy of bytes[0] is not present in bytes, so you wouldn't be able to find...

Non-static method reference?

java,methods,reference,non-static

Your method appears to have intended to return date2 minus the current DAY_OF_YEAR (not minus the DAY_OF_YEAR constant). And if you make it static then you don't need an instance like, public static int getDaysBetween(int date2) { return date2 - Calendar.getInstance().get(Calendar.DAY_OF_YEAR); } Assuming this is your own Date class, then...

Passing Complex real and imag by reference

c++,c++11,reference,complex-numbers,rvalue

Just do cplx = std::polar(1.0f, /*...*/); ...

Raycast to get gameobject being hit to run script and function on gameobject

c#,unity3d,reference,raycasting

enHit is likely null. Repace all your hit.transform.gameObject.GetComponent<EnemyHealth>(); with hit.collider.gameObject.GetComponent<EnemyHealth>(); You have about 4 of them in your script. You want to get the EnemyHealth Script attached to the object the Ray hit through the collider. EDIT: You also need to change hit.transform.CompareTag("Enemy_Head") hit.transform.CompareTag("Enemy_Torso") hit.transform.CompareTag("Enemy_Limb") to hit.collider.gameObject.CompareTag("Enemy_Head")...

Conditionally include script for browsers

javascript,jquery,javascript-events,reference,conditional-statements

You can achieve this without the use of any library. Here's how to do it: if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1) { //Your code } ...

How to change reference in created import function in R?

r,function,reference

First, the <<- and assign() parts are redundant. If you want to call with a character value, you can use g.import<- function(x) { z <- read.csv(file.choose(), header=TRUE, sep=",") assign(x,z,envir=.GlobalEnv) return(head(z,3)) } g.import(x="a") to call with an unquoted symbol, you can use g.import<- function(x) { z <- read.csv(file.choose(), header=TRUE, sep=",") assign(deparse(substitute(x)),z,envir=.GlobalEnv)...

Sublists in a 2D List, Referencing

java,reference,sublist

tmp.subList() returns a new List instance that is different from the first element of dList. That's why the original List was unchanged. You need to set the first element of dList to refer to the sub-list you created : List<Double> tmp = dList.get(0); tmp = tmp.subList(1, 3); tmp.set(0, 4.5); dList.set...

Understanding the Debug implementation for Vec

reference,rust,dereference

In cases like this, I find it useful to make the compiler tell you what the type is. Just cause a type error and let the compiler diagnostics do it for you. The easiest way is to try to assign your item to something of type (): fn main() {...

How to declare a reference to a empty stack in OCaml?

reference,ocaml,imperative-programming

Well, stack has an empty value, since Stack.create () will create an empty stack. What concerning your general question, then usually None is used as an empty value. And of course this automatically lifts your value into option. But this is intentional, since if you're creating a value as an...

How to check if a linked list is a palindrome or not in Java?

java,reference,linked-list,parameter-passing,value

Actually, your method is not working. Try it for a list that contains 3,4,5,3. It will return true. Also, it changes the list that was passed to it, which is not a very good idea. If you do something like System.out.println(a) (assuming you wrote a proper toString() method) after you...

(Dangling?) Reference returned from function does not “work”

c++,pointers,reference,unique-ptr

The issue is here: auto pos = entity.addComponent<inc::CPosition>(); ^^^^^ addComponent() returns a reference, and everything in that function is fine (no dangling reference issue as far as I can tell). But auto does not deduce a reference type unless you tell it to - so you're simply making a copy...

Using a stored integer as a cell reference

excel,excel-vba,reference

You have to find a suitable formula for entering in the target cell. Then you would build such formula with string concatenation, etc., for entering it via VBA. One option for the formula is to use OFFSET, as in =SUM(OFFSET($A$1,D3-1,COLUMN()-1):OFFSET($A$1,ROW()-3-1,COLUMN()-1)) This sums all values from Cell1 to Cell2, in the...

returning reference to private vs public member

c++,qt,reference,private,public

In general, returning a member by reference breaks as much encapsulation as having a public member, and neither is encouraged. I suppose when a class is sufficiently simple (plain old data-it is anticipated that neither interface, nor data will ever change), one could make all its members public. Returning a...

Watching a variable in python?

python,reference

A raw int will not work, but as k4vin points, out, any other type of object that can be referenced, will. We can demonstrate this with a list that contains the count, as k4vin did: class Watcher(object): def __init__(self, to_watch): self.to_watch = to_watch def print_current_value(self): print self.to_watch i = 0...

Passing const references to functions

c++,reference,const

Consider the following three examples: (i) void setAge(int &a) { age = a; } (ii) void setAge(const int &a) { age = a; } (iii) void setAge(int a) { age = a; } Further think of your class as an encapsulated object, that is the outside world in general doesn't...

Troubles with reference variables/pointers an class members [C++]

c++,class,reference

This line of code: B bar(foo); Attempts to declare a member function named bar which returns a B and takes an argument of type foo. However, in your code, foo is not a type - it's a variable. I'm guessing you meant to initialize bar instead: B bar{foo}; // non-static...

Java Pass-by-reference not working?

java,variables,reference,pass-by-reference

The problem is that you aren't updating the reference in your Player class. When you store your Dimension in your Entity constructor you are storing a reference to that Dimension in memory. In your resetOverWorld() method you change the overworld and activedimension variables to point to a new OverWorldDimension but...

Parameters to use in a referenced function c++

c++,pointers,reference

Your code makes no sense, why are you passing someStruct twice? For the reference part, you should have something like: void names(someStruct &s) { // <<<< Pass struct once as a reference cout << "First Name: " << "\n"; cin >> s.firstname; cout << "Last Name: " << "\n"; cin...

Use code from repository that has no setup.py

python,reference,workflow,setup.py

You could just paste the code into your own codebase, yes. As long as it was written for the same Python version and you're aware of the needed dependencies (both to third-party libraries and within the same project), you should be golden. However, the project does not have a license....

Why a slice []struct doesn't behave same as []builtin?

go,reference

What you do when calling update3 is you pass a new array, containing copies of the value, and you immediately discard the array. This is different from what you do with the primitive, as you keep the array. There are two approaches here. 1) use an array of pointers instead...

Im referencing a constant class static variables, but when i do the values somehow change

c#,visual-studio-2013,reference,static

Your problem is here: public static decimal positivePastLimitDecimal = Convert.ToDecimal(80000000000000E+40) public static decimal negativePastLimitDecimal = Convert.ToDecimal(-8000000000000E-40); You cannot store such big numbers on a decimal. Use float or double for that. The maximum value you can store in a decimal is: 79,228,162,514,264,337,593,543,950,335....

Discussion about std::vector and standard array

c++,arrays,pointers,vector,reference

The two versions with the array are equivalent: in the first, the array is implicitly converted to a pointer to its first element, which the second creates explicitly. The first version with the vector won't compile, since there is no implicit conversion to a pointer. You'll have to explictly get...

C++ - Reference where to put it? [duplicate]

c++,function,reference

does this make any difference or has a different meaning? It makes no difference. Any explanation would be brilliant In general, white-space only changes the meaning of the program where it's needed to separate tokens. Punctuation tokens like & don't need separating from alphanumeric tokens, so you'll get the...

System.Windows.Interactivity must be referenced in the main project

c#,wpf,dll,reference

System.Windows.Interactivity.dll is not in the GAC, so .Net doesn't know where to find it. By adding a reference to your main project, you make the build system copy the DLL to the output folder. This lets the runtime find it....

how to use one core project for a SQL Server 2014 and Azure SQL Database

sql,database,azure,reference,sql-azure

Assuming that you are referring to creating CoreDB and AzureDB as Database projects in SSDT - Unfortunately SSDT will not allow you to create a Database Reference to another database with a different version. To relate to your earlier example, the following scenario will not be allowed in SSDT: CoreDB's...

Is a Java class variable a reference to a class object?

java,class,object,reference

obj is a reference to the object of type foo , your understanding is correct. In line 1 , JVM creates a new instance (ojbect) of type foo (new memory is allocated in the heap) , and obj now stores the reference to that memory location, lets assume that memory...

Reassigning Object References in Java [duplicate]

java,object,reference

Java is not pass-by-reference. This means that there is no way you can swap the contents of variables in the caller's scope from within a method. All you have been doing is exchanging the contents of the local variables p1 and p2 inside of your swap method. This has no...

References - Why do the following two programs produce different output?

c++,reference,static,output

In the first case, fun() returns a reference to the same variable no matter how many times you call it. In the second case, fun() returns a dangling reference to a different variable on every call. The reference is not valid after the function returns. When you use fun() =...

Passing varriables by reference

c#,reference

Is a going to be a reference to b, or a is going to copy the value which ref b points to ? It depends: if Boo is a reference type, such as below, a will point to the same instance after the call public class Boo { public...

reference a cell from another worksheet using a variable

excel,vba,excel-vba,variables,reference

Cells(i, j) = "='BASE tab'!R[" & x & "]C[" & y & "]" ...

Backslash before a subroutine call

perl,reference,subroutine

What is happening here is: You are returning an array from somefunc. But you are assigning it to a scalar. What this is effectively doing therefore, is simply putting the last value in the array, into the scalar value. my $value = ( 110, 120, 130 ); print $value; When...

return reference of static member variable c++

c++,reference,static

If POS is declared static then its lifetime is the lifetime of the program, and so returning a reference to it is safe.

Can't use an undefined value as a symbol reference in perl

perl,reference

That error is generated by print when the file handle it's writing to is undefined. E.g.: my $test = undef; print $test "some text"; Will generate that same error. Without seeing what you're doing to define $sequences I can't tell you why - but did you check the return codes...

What is the difference between * and & in function parameters?

c,pointers,parameters,reference,dereference

Your question is actually related to C++ void function(A_struct &var) is not valid for C because in C it is used to get an address of a variable. In C++ it is a type of variable which is known as reference. You can see an example of it in here...

Referencing a numpy arrray without creating an expensive copy

python,arrays,numpy,reference,slice

It shouldn't create a copy. For illustration: >>> A = np.ones((50000000,)) >>> B = A[:,np.newaxis] >>> B.flags C_CONTIGUOUS : False F_CONTIGUOUS : False OWNDATA : False WRITEABLE : True ALIGNED : True UPDATEIFCOPY : False Note the OWNDATA : False - it's sharing data with A. For a few more...

Passing an array by reference to thread

c++,multithreading,templates,c++11,reference

Your function expects a reference to the array but std::thread stores decayed copies of the bound arguments. Array-to-pointer decay results in a prvalue of pointer type. To fix, pass arr through a std::reference_wrapper to preserve the type: std::thread worker(..., std::ref(arr), row, column); You might also want to use a lambda...

Method can not initialize value c++

c++,reference,bellman-ford

When I tried to run code from github repository about you sad I got segmentation fault. The reason was in the file FordBellman.cpp line 42. There you didn't allocate array but you used it. The reason why you didn't see anything is in the fact your program is terminated before...

Wrong Theme being applied to PreferenceActivity with xml reference

android,xml,reference,themes,android-preferences

Fixed it! i just renamed all the styles to inst_theme and referenced them with just @style/inst_theme Moral of the story: Think before you post...

passing arguments via reference and pointer C++

c++,function,pointers,reference

Yes. There's no copy anywhere as you're either using pointers or references when you “pass” the variable from one place to another, so you're actually using the same variable everywhere. In g(), you return a reference to z, then in f() you keep this reference to z. Moreover, when you...

MongoDB query show all value in array property when reference database

database,mongodb,reference

MongoDB doesn't support joins. You can read more about that here. However, you can manually reproduce the same scenario you described above in MongoDB by using some native JavaScript functions to fill in the friends array with the references and save the modified data to another collection say self_friends. Let's...

Int& to const int -static vs dynamic-

c++,dynamic,reference,const

It is telling you that you can't return a non-const lvalue reference to a data member from a const member function. You need const int& f() const {return x;} You may decide to provide a non-const overload if needed: int& f() {return x;} As for operator[], it does not return...

Why can't I pushback a new element to a list

c++,pointers,reference

No, the return type of MakeNode() is Node*. You can declare a class method as static so that you can call the method without needing an instance of the class beforehand, you call the method on the class type itself. The static in this case is not part of...

Adding reference of current record in a one2many relationship

python,reference,openerp-7

class parent(osv.Model): _name = 'parent' _columns = { 'field1' : fields.one2many('child','field2','Childs Field'), } class child(osv.Model): _name = 'child' _columns = { 'field2': fields.many2one('parent', 'Parents Field'), } You need a field in child class to hold the reference of parent class. Technically parent id will be stored in child, not child...

How to get API documentation to be shown inside Eclipse Help window?

java,eclipse,reference,documentation,javadoc

The Eclipse 'Help Contents' only shows help for Eclipse components and does not include the JDK help.

Keeping track of references in Java

java,multithreading,reference

The answer is simple: No GC works at VM global level and in current implementation (at least in Hotspot) it doesn't use reference counting, much less reference tracking. That means even the VM doesn't always know what is referenced at arbitrary points in time. The GC is also generally the...

Chain linked classes

c#,arrays,reference

1) This structure is called a double linked list 2) This implementation exists in C# through LinkedList 3) There is a lot of articles on this topic : here or this SO post...

Using NON static class Methods Without reference

java,object,methods,reference,static

If Calendar was following a fluent builder pattern, where i.e. the add method was adding, then returning the mutated instance, you would be able to. You're not, because Calendar#add returns void. But don't be fooled: Calendar.getInstance() does create an instance as indicated - you're just not assigning it to a...

Interfaces are not passed by reference

c#,asp.net,pointers,reference

Since you've already implemented one facade, why not implement a second one: class ChangableDiet : IDiet { private IDiet _diet; public ChangableDiet (IDiet diet) { _diet = diet; } public Diet Diet { get { return _diet;} set { _diet = value; } } public void Eat() { _diet.Eat(); }...

Would it be more efficient to pass a variable to a function by reference than to make a function to return a variable?

c++,reference

A value of a small, simple built-in type like short or int is almost certain to be returned in a register, so it won't involve creating anything. If we simplified your code a tiny bit to something like return 1;, we'd expect the body (when we turned off optimization, so...

Could not load file or assembly 'Microsoft.SqlServer.Types even with Copy Local

c#,reference

It's probably looking for one of its dependencies if you'r sure the dll is in the bin folder. Instead of referencing from the GAC have you tried removing the reference and adding the following NuGet package ? https://www.nuget.org/packages/Microsoft.SqlServer.Types/...

Is it possible to define a parameter set and reference it?

reference,swagger,swagger-2.0

Indeed that's not a valid definition and as you suggested, you'd have to specify each parameter separately by referencing the global one. If your parameters are shared for all operations under a specific path, you can define those at the path level and they would be applied to all operations....

Quickest way to evaluate a variable in TCL

reference,tcl,expect,evaluation

If you have a string containing just the name of a variable, you are best off using set with only a single argument: set myref {expect_out(buffer)} puts "The value is [set $myref]" But if you've got that $ as well, the right thing to do is to use subst (which...

Not understanding C++ type mismatch: const Foo* to Foo* const&

c++,pointers,reference,const

There seem to be a couple of misunderstandings here (both by the questioner and by some answers). First, you said "My guess would be that I have to convert get() to a reference but I'm unsure how to do that". Let's try clearing this up: 1) "I have to convert...

SomeClass &a = *new SomeClass(…)

c++,reference

What purpose does this serve? Rep generation on Stack Overflow. Or perhaps someone deliberately trying to get fired. why couldn't this have been written as SomeClass a(...) It should have been. Also, does this code leak memory? My guess is that it does, as new is called with no...

Why does my value change when I am not resetting it?

perl,reference

Try using @favcols = map { [@$_] } @actors; @favanim = map { [@$_] } @actors; Deep copy vs shallow copy....

Why can't a function change its argument object's address/reference value?

c++,reference,parameter-passing,pass-by-reference

Once an object is allocated, nothing can change its address. You can change its content (that is what your program does) but the address will stay the same for the lifetime of the object. If you create an object dynamically with new, you would be able to assign a different...

reference data class member visitor pattern

c++,design-patterns,reference

Well since its a design question, I thought of it in a different way. Not knowing your limitations fully, here is my suggestion: Make DataStore and visitorData separate class with proper getter and setter methods. Do away with the old datatype if u can. Convert the xyz class to a...

Why can a raw type reference refer to a generic instance? [duplicate]

java,generics,reference,generic-collections,raw-types

Map<Object,Object> map2 = new HashMap<String,String>(); As per my understanding Map map1 is same as Map<Object,Object> map1 No. A Map is not the same as a Map<Object,Object>. A reference of type HashMap<T,T> is a subtype of a reference of type Map. In other words, a reference of type Map can...

AngularJS - ReferenceError: $ is not defined

javascript,angularjs,canvas,reference

try this: var fbcanvas = document.getElementById('fbcanvas'); instead of: var fbcanvas = $('#fbcanvas'); check if data is undefined too...

Access to reference in member variable discards constness

c++,c++11,reference,compiler-errors,const

Yes, this is correct behaviour. The type of ref is Foo &. Adding const to a reference type1 does nothing—a reference is already immutable, anyway. It's like having a member int *p. In a const member function, its type is treated as int * const p, not as int const...

Object passed by reference will not exist. Swift

ios,swift,reference,pass-by-reference

You have a couple of options: Make the Generate_New_Array process cancelable, and then cancel the old one before starting the new one. Make the Generate_New_Array serial so that when you make a subsequent call to this method, it will finish the calls first. For example, you could have this enqueue...

Function returns the same value instead of unique values [duplicate]

c#,memory,random,reference

This is because your random object starts with the same seed. Move it's declaration and assignment to the class level.

Return type of list front (C++)

c++,function,reference,linked-list,return-type

There are two types of constructors added automatically to any class you declare: The default constructor, which default-initializes all members of that class §12.1.4 and the copy constructor §12.8.7. In your case, we have to take a look at the copy constructor: The declaration of the copy constructor looks like...

Every include should refer to other instance

jsf,jsf-2,reference,uiinclude

You'll have to hold as many instances of editorVisibility.evb as you have editors. You could for example create a List<TypeOfEvb> evbList in your EditorVisibility bean, and pass only one element to the <ui:include> as a <ui:param>: Main page <ui:include src="include/includeAbleEditor.xhtml"> <ui:param name="includeParam" value="MyClass" /> <ui:param name="evb" value="#{editorVisibility.evbList[0]}" /> </ui:include> includAbleEditor.xhtml...

How to Find a class in external reference that implements certain interface?

c#,visual-studio-2013,interface,reference

You can do this with reflection: interface MyInterface { } public static void Main() { Assembly asm = Assembly.Load("externalAssembly"); var interfaces = asm.GetTypes().Where(t => t.IsSubclassOf(typeof(MyInterface))); foreach (var i in interfaces) { Console.WriteLine(String.Format("Found: {0}", i.Name)); } } ...

How can I tell PHPStorm to find references to rewritten URLS?

reference,phpstorm,file-rename

IDE cannot do that because (as you have mentioned yourself) the file name does not match actual URL reference. Your only option here is to use ordinary Find & Replace functionality, e.g. Replace in Path to find all occurrences of /user/mypage/ and replace them into /user/myprofile/ in all files in...

using the 'Match' function in Exel to return a cell address

excel,reference,match,cell,formula

To make CELL work you need a cell reference, e.g. CELL("address",C1) The trouble is that MATCH just gives you a number, not a cell reference. Probably the easiest way is to use the ADDRESS function, so a first try might be =ADDRESS(1,MATCH(AU14,C1:AG1,0)+2) That would give you the right answer if...

TCL access array by reference/name

arrays,reference,tcl

The variable myvar is a simple variable that is holding the name of another variable. You can use a read from it (with $ or set) anywhere where you'd expect to use the name of the variable: foreach {key value} [array get $myvar] { puts "$key => $value" } What...

Github and Nuget packages

c#,git,github,reference,nuget

On AppVeyor you must add a pre-build step for restoring the nuget packages. Use the "Before Build script", Build tab, and add a "Nuget restore" command there. See details in the "Restoring NuGet packages before build" section on AppVeyor nuget docs Visual Studio default setup is to allow "Allow Nuget...

List of object references in python

python,list,reference

In Python, assignment operator binds the result of the right hand side expression to the name from the left hand side expression. So, when you say a = Foo(2) b = [a] you have created a Foo object and refer it with a. Then you create a list b with...

Function with constant reference as input

c++,string,reference

You can't perform the rotation in-place without violating the const contract on the parameter, so you should copy the input and return a new string: string rotate(const string &str){ string uno = str; rotate(uno.rbegin(), uno.rbegin() + 1, uno.rend()); return uno; } Another reasonable option would be to use std::rotate_copy...

Python: how to reference values in a def

python,reference,return

You don't you need to return them def example(value1, value2): value1 += 2 value2 += 4 return (value1, value2) >>> value1 = 0 >>> value2 = 0 >>> value1, value2 = example(value1, value2) >>> print(value1, value2) 2 4 You can only do what you are asking if the passed-in type...

Perl return array from multidimensional array

arrays,perl,multidimensional-array,reference,grep

The first element of @valid_values is accessed as $valid_values[0]. The value in the first element is an array reference. To dereference an array reference, you use @{ ... }. So to get the array referenced by the array reference in the first element of @valid_values you want @{ $valid_values[0] }....

create a reference to an array in Nim

arrays,pointers,reference,nim

In Nim refs are on the heap and have to be allocated with new. You can't just use a stack array as a ref because that would be unsafe: When the array disappears from the stack, the ref points to some wrong memory. Instead you have two choices: You can...

Writing C++ API - how to keep external references to API internal objects?

c++,vector,reference,typedef,encapsulation

You need to use an ID based on something that is both unique for each object and which remains constant for each object. Clearly an index into a vector you're continually rearranging does not qualify. You haven't described the properties of the objects so I can't say whether there's something...