Questions tagged [local]

A tag for questions about accessing resources local to a given runtime environment or network.

Accessing data on a local network, or accessing files local to the computer can pose unexpected complications, especially when using languages that are not typically used for local resource access.

Additional exceptions, or hardware/firmware considerations, can come into play in these scenarios that are often abstracted away when accessing remote resources.

3710 questions
17
votes
10 answers

"Pythonic" way to "reset" an object's variables?

("variables" here refers to "names", I think, not completely sure about the definition pythonistas use) I have an object and some methods. These methods all need and all change the object's variables. How can I, in the most pythonic and in the best,…
user103798
17
votes
1 answer

Using ADB locally on device (loopback) shows no devices

I am trying to use ADB on an Android device itself, so without any host computer. This was working perfectly a couple of days ago, but it suddenly stopped working. As far as I know nothing changed since then (e.g. no apps (un)installed). I could use…
JayShortway
  • 266
  • 1
  • 3
  • 8
16
votes
2 answers

Why does pip fail when installing local egg repository?

I am working on Windows 7.I have created a python egg using distutils. Now I try to install this egg in a virtual environment using pip 1.0.2 using the following command: Then I create a virtual environment myVirtualEnv I activate it using…
dry
  • 831
  • 2
  • 8
  • 21
16
votes
4 answers

Remove local Docker images on macOS

I'm using Docker for Mac and for saving disk space I want to get rid of some unused local images. As far as I know the local files are stored in ~/Library/Containers/com.docker.docker. But even if I remove all images and containers from docker the…
Mountain
  • 1,039
  • 2
  • 10
  • 19
16
votes
3 answers

Returning static local variables as references

What happens to a static variable when returned as a reference and passed as a pointer directly to another function? Obviously, the variable persists after the function returns, but something about this whole concept just bothers me. At which point…
Byzantian
  • 3,208
  • 4
  • 27
  • 31
15
votes
3 answers

jQuery save local variable for use later on in the code

Is there anyway that I can save or access a local variable outside of it's function? Consider the code below: $( "#droppable2" ).droppable({ activeClass: "ui-state-hover", hoverClass: "ui-state-active", accept:…
Sol
  • 173
  • 1
  • 1
  • 5
15
votes
3 answers

PyCharm warns local variable might be referenced

Why does PyCharm highlight the boolean variable nearby the return with Local variable "boolean" might be referenced before assignment? This code checks whether a number is prime or not: import random import math import time def prime_t(x): …
Mikeros
  • 153
  • 2
  • 5
15
votes
4 answers

add local image file in R presentation

I'm trying to include one imaging file (.png) using R markdown for R presentation. I followed the suggestion from: How to import local image using knitr for markdown but by using ![title](my.png), I get this error: Error: unexpected '[' in…
ponyhd
  • 491
  • 1
  • 4
  • 19
15
votes
1 answer

convert local dateTime to UTC in R

How can I convert local DateTime in the following format "12/31/2014 6:42:52 PM" to UTC in R? I tried this as.POSIXct(as.Date("12/31/2014 6:42:52 PM", format="%m/%d/%Y %H:%M:%S"),tz="UTC") but it doesn't seem to be valid.
Sam
  • 155
  • 1
  • 1
  • 5
15
votes
5 answers

Javascript: Get access to local variable or variable in closure by its name

Possible Duplicate: How can I access local scope dynamically in javascript? Hi all. We all know that you can access a property of a javascript object by it's name using the [] syntax.. e.g. ob['nameOfProperty']. Can you do the same for a local…
Ben Clayton
  • 80,996
  • 26
  • 120
  • 129
15
votes
3 answers

How do I install Perl modules on machines without an Internet connection?

I need to install my Perl-based software on networked machines which aren't connected to the internet. Therefore, I would like to download specific versions and/or latest versions of the Perl modules and I would also like to know if there is an…
therobyouknow
  • 6,604
  • 13
  • 56
  • 73
15
votes
5 answers

Go to local URL with Javascript

Same question as here but I need to go to local URL's in Firefox I tried with code like var url = "file:///E:/Test/Test.htm"; window.location.href = url; but id didn't work. Tried to go with window.location = url; and also tried with url =…
BearCode
  • 2,734
  • 6
  • 34
  • 37
15
votes
4 answers

golang: go install tries /usr/local instead of GOPATH

This is somewhat a follow-up to my last question: golang: installing packages in a local directory I have GOPATH set to $HOME/prog/go/gopath and this path exists with three directories: ~/prog/go/gopath$ ls bin pkg src Now I try to install a…
topskip
  • 16,207
  • 15
  • 67
  • 99
14
votes
4 answers

buffer-local function in elisp

I would like to redefine an existing function foo, but for a specific buffer only. (defun foo () (message "Not done:(")) I was hopping this will do: (make-local-variable 'foo) (fset 'foo #'(lambda () (message "Done!"))) But it does not. Any…
VitoshKa
  • 8,387
  • 3
  • 35
  • 59
14
votes
2 answers

Bash local variable scope best practice

I've seen that some people when writing bash script they define local variables inside an if else statement like example 1 Example 1: #!/bin/bash function ok() { local animal if [ ${A} ]; then animal="zebra" fi echo…
Kalib Zen
  • 655
  • 1
  • 5
  • 16