FAQ Database Discussion Community


xmllint : how to validate an XML using a local DTD file

xml,file,local,dtd,xmllint
I have a local DTD file test.dtd. Content is : <!DOCTYPE coord [ <!ELEMENT coord (date)> <!ELEMENT date (#PCDATA)> ]> I'd like to validate an XML using xmllint. This XML has no DOCTYPE in it : <?xml version="1.0" encoding="x-mac-roman"?> <coord> <date>20150312</date> </coord> No problem if I insert the DTD block...

Amount of local memory per CUDA thread

memory,cuda,limit,local
I read in NVIDIA documentation (http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#features-and-technical-specifications, table #12) that the amount of local memory per thread is 512 Ko for my GPU (GTX 580, compute capability 2.0). I tried unsuccessfully to check this limit on Linux with CUDA 6.5. Here is the code I used (its only purpose is to...

Declaring a local variable within class scope with same name as a class attribute

c++,class,variables,attributes,local
While observing another person's code, i realized that within class A's method he declared a local int with the same name as an attribute of class A. For example: //classA.h class A{ int Data; void MethodA(); }; //classA.cpp #include "classA.h" using namespace std; void A::MethodA(){ int Data; //local variable has...

C++ error C2440 when getting native pointer

c++,pointers,native,local,command-line-interface
Haven't write C++ code for long, and what I am trying to do is very simple. I'd like to create a local instance of a native class. Then pass a point to that class to another method. The code is as following: someclass instance(); someclass* pInstance = &instance; I am...

Uploading a database to server

database,upload,server,local,host
How do I upload to my local host database to a server uses direct admin. I tried to take a .gz file from my local host database and when uploading it to the server It said that it is not a backup database. So do I have to create the...

“missing value where TRUE/FALSE needed” Error in if statement in R [duplicate]

r,function,variables,local,variable-declaration
This question already has an answer here: Error in if/while (condition) {: missing Value where TRUE/FALSE needed 1 answer I am trying to count and print the cases in which the values in second and third columns of my dataframe named 'DATA'. But I have "missing value where TRUE/FALSE...

How to use values of local variable in another function in C

c,variables,local
Suppose there are two function i.e., function1() and function2() int function1() { int F; printf("enter any value"); scanf("%d",&F); printf("Value is %d",F); } In function1() variable F is used which is local variable. How can I use the value of this local variable F in another function function2()?...

Unable to load assets when testing website localy

html,file,debugging,local
I have tested website on my server where everything works fine, its a simple html/css/js based website without any backend functionality, usually I am able to test these without any problems by simply opening pages in browser, however I encountered an issue where this time it only loads up html...

Netbeans git can't checkout local branch - Conflicts during checkout

git,netbeans,repository,branch,local
Here is my problem: I have cloned project from remote server (branches develop & master) I checked out develop after changes, commited & pushed to remote, everything is fine pull from remote while still in develop commit after pull switch or checkout to new created branch Page from develop -...

local file system access - solutions?

javascript,vba,file,system,local
2nd question I've posted. still very new to web programming so excuse my ignorance. I have a web based javascript which accesses a users Gmail account and downloads attachments to the local downloads folder as assigned in Chrome. These files are then manually transferred to another directory and an Excel...

AssemblyInfo.vb change Log4NetAssembly1.exe.log4net path to user's local folder

vb.net,log4net,local,.net-assembly
My vb.net project used for different users, I am lost in how to set the Log4NetAssembly1.exe.log4net file path to user's local folder in AssemblyInfo.vb. The Log4NetAssembly1.exe.log4net file is located in C:\Users\UserName\AppData\Local\Temp\DeskApp\DeskApp\Log4NetAssembly1.exe.log4net for each user. I have tried to use the following way but it not work: <Assembly: AssemblyTitle("DeskApp")> <Assembly: AssemblyDescription("")>...

how to gulp rsync locally

gulp,local,rsync
I'm working on site files outside of my local htdocs that I want to deploy to the local site. I will use gulp-watch to watch for changes, but I'm stumbling on just the rsync set up. File structure: sitename/ -- --htdocs/sites/all/themes/themename --source/themes/themename And here's the gulpfile: var gulp = require('gulp');...

Django change local datetime format

django,datetime,format,local
I have a Django app in which I use the translation system. I want Django to print datetime objects in local format, but not in the default format in currently print for me. Example, for english translation, I get the datetime objects in this format: May 14, 2015, 1:26 p.m....

what happens to a “local” var after expression?

swift,local,var
Note: "local" meaning contained with in {} What happens to localVar after func has been expressed? var constantVarHolder = Int() func NameOfFunc(){ var localVar = Int() if X = 0 { localVar = 3 } else { localVar = 4 } constantVarHolder = localVar } Does it become de-initialized, as...

Where are the local variables of an Android app stored?

android,variables,local
The Dalvik Virtual Machine (DVM) has a register-based architecture, as opposed to the Java Virtual Machine (JVM) which is stack-based. So I assume that the local variables of an Android app are stored in the registers. Am I correct? If not, please correct me. If yes, what kind of memory...

global and local variable execution context in javascript

javascript,variables,global,local
Trying to understand fundamentals of javascript I ran into a following code and expected value of variable named "foo" would be 7 and 5 however it came out as 7 and 7. Not sure why.... var foo = 5; (function Test() { foo = 7; console.log("foo=" + foo); })(); console.log("foo="...

Why is it faster to allocate memory in the heap for a local array compared to a global array?

c++,memory-management,global,local
Below is a simple experiment that I decided to run. test1() is a function that allocates memory for the global array g and then has a for loop that updates all the elements of this array. Finally it releases the allocated memory for g. Exactly the same thing is happening...

When does my function will go to previous scopes to look for a variable?

python,python-3.x,scope,local,python-nonlocal
in python 3.0 from what i know when i'm using variables that aren't found in the local scope it will go all the way back until it reaches the global scope to look for that variable. I have this function: def make_withdraw(balance): def withdraw(amount): if amount>balance: return 'insuffiscient funds' balance=balance-amount...

How can I use local absolute path as a src attribute for an image

javascript,html,path,local,absolute
I'm trying to make the source of my image like this <img id="testImage" src="C:\images\1.jpg"> but this doesn't work, i also tried changing all the \ with / but it gave me the same not working result the reason for this is that i want to make a web page that...

Can't convert D3 to use local data instead of remote

json,d3.js,local
I've got a page working nicely using remote data here. This uses the following code to load the JSON: treeJSON = d3.json("./data/data.json", function(error, treeData) { ... // Append a group which holds all nodes and which the zoom Listener can act upon. var svgGroup = baseSvg.append("g"); // Define the root...

Python: access variable in a function in another file

python,variables,import,global,local
I have two files: lib.py global var def test(): var = "Hello!" return test.py from lib import * test() print(var) But despite having them in the same folder, when I run test.py, I get the following error: Traceback (most recent call last): File "C:\Test\test.py", line 5, in <module> print(var) NameError:...

How include JSON data in local brunch app

json,jade,local,offline,brunch
I'm not much of a web developer yet. I want to create a local (yes, really offline) html/js (coffeescript/jade) app, using brunch. I would like to have some JSON files with data like { "title": "My title", "content": "Lorem ipsum dolor..." } Now this data should be included in the...

Undefined local variable post

ruby-on-rails,ruby,variables,undefined,local
I write this code: <% @user.posts.each do |post| %> <%= render 'post', locals: { post: post, user: @user} %> <% end %> Then in _post.htm.erb I write follow code: <div class="post-title"> <img src="<%= @user.avatar.url%>" class="img-rounded post-image"> <h4 id="post-name"><%= @user.first_name + ' ' [email protected]_name %> </h4> <div id="post-date"><%= post.created_at.strftime('%d %b -...

Git checkout — recover lost files

git,local,checkout,undo,changes
I accidentaly deleted local file changes on git repository. They were NOT commited or even pushed. What I did: git status (then files not staged for commit showed and I accidentaly removed whole folder called "smdr" by this comand): git checkout -- smdr Then files changes disappeared. How can I...

How can I change the value stored in local macro from string to numeric in Stata?

types,macros,global,local,stata
I want to generate a variable with lagged year depending on the year stored in "$S_DATE" macro I have stored the year in date macro: . local date substr("$S_DATE",8,.) . display `date' 2015 And I want to generate the new variable with gen start_year =`date'- y_passed where y_passed is a...

How should a global (module) object be created in a Python function?

python,url,import,global,local
I am trying to write a function to "import" a Python module from a URL (as an experiment -- there are, of course, security concerns with such an approach). In doing so, I am attempting to create the module object in the function and then to modify it with the...

Parallel.ForEach with Dictionary and multiple local variables in C#

c#,variables,dictionary,parallel-processing,local
I'm trying to convert a normal function to a parallel function. The function checks if the coordinates given are close enough to consider them duplicated, checking one by one in a full list of coordinates. I need access to 3 local variables: Coordinates to be tested (poi_data) the list of...

PHP script runs loca but no from server

php,path,server,local
I have the following script: <?php #ini_set('include_path', "c://mylocalserver//htdocs//mydirec//"); #include ('list.php'); ini_set('include_path', "http://xx.xx.xxx.xx/"); include ("http://xx.xx.xxx.xx/list.php"); foreach ($items as $mylist) { $output=$mylist['name']; echo 'NAME'.''." ".''.$output."<br>"; } When the ini_set and inlcude is used for the mylocalserver the script runs and echos out the file content and the name and $output as desired,...

Ajax request in PhantomJs script

jquery,ajax,phantomjs,local
Problem: Ajax request within phantomJs script to a local page doesn't work (no response) Question: How can I make it work? Any ideas or possible solutions? Description: I'm running a phantomJs script and I need to access some data that is provided by a php function in another page (local)....

Convert local coordinates to scene coordinates in SceneKit

global,local,scenekit,coordinate
I have a node attached to a node and I want to convert it's coordinates to coordinates of scene. I really don't know how to do that. I've been searching on Apple's documentation and I haven't found a method that fits my need. Any suggestions?

Setting up catchall email for testing purposes

email,imap,local,catch-all
Is there a way to set up test email server that would have catchall mail, without actual owned domain (e.g some fake domain)? If so, can someone write it how I would like to have such server for testing purposes, because I don't want to use real email server with...

jqGrid - how to delete row from local data?

javascript,jquery,jqgrid,local
I am really new to the jqGrid. I'm loading local file (I'm parsing csv file into json and then transfer the array to jqGrid). Table generated through jqGrid should allow user to modify, add and delete the data in the grid. I tried to resolve my problem using various answers...

How to save select option in localStorage with jQuery?

jquery,storage,selection,local
I am trying to save selected option in localStorage in HTML, so if you refresh page, the selection stays selected. I have try this: HTML: <select id="edit"> <option>1</option> <option>2</option> <option>3</option> </select> jQuery: $(function() { $('#edit').change(function() { localStorage.setItem('todoData', this.innerHTML); }); if(localStorage.getItem('todoData')){ localStorage.getItem('todoData'); } }); But this seems not to work, any...

What is the best practice for the scope of variables in a class

java,variables,static,scope,local
My teachers source code was published and i was confused when i saw this: New local variables where instantiated from a static variable, the variable was then used in a method and passed as an argument to another method, to then set its new value to the same static variable...

Assigning a value from a looped column name variable in a SELECT statement

tsql,variables,select,local
I'm having a hard time trying to assign a field name and then place that into a SELECT statement in T SQL. First - I want to get the SELECT statement to work without the convert error popping up, then I want the field value to be assigned to another...

How to get App delegate to display a specific UIViewController after PushNotification

uiviewcontroller,notifications,local,appdelegate
I have a TabBarController as the App entry point. After a receiving Local-Notification, I want to display a specific UIViewController. Depending on the actual App-state (frontmost / not-frontmost, not running), I am able to catch the push notification by e.g. application:willFinishLaunchingWithOptions: or application:didReceiveLocalNotification: in the appdelegate. However, I am not...

Breeze Fetch Strategy always goes remote

caching,breeze,local
Im having a problem where breeze always goes to the server even though I've specified FetchStrategy.FromLocalCache. I created a test script below. Th initial query goes remote as as expected. The second query also goes remote(FetchStrategy.FromLocalCache). The third query(ExecuteQueryLocally) goes to local cache. From developer tools I can see there...

Local file existence condition in bash FTP script

bash,scripting,ftp,local
I want to get a file from a server conditional on the non-existence of the file in the local directory. In the final script there will be many files but here is an example just using one. I'm trying this: #!/bin/bash HOST='a.b.c.d' USER='anonymous' PASSWD='pass' ftp -n -v $HOST << EOT...

int for timer error: Local variable ans defined in an enclosing scope must be final or effectively final

java,swing,variables,local
I have some code for a timer as follows: JLabel label = new JLabel(); JButton btnNewButton = new JButton("Stop Server after X Seconds"); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { int ans = functions.secC(); Timer t = new Timer(1000, new ActionListener() { public void actionPerformed(ActionEvent e) { label.setText("Server will...

Haskell local function Is not in scope

function,haskell,where,local
The following function is supposed to return the sum of all the polynomials in a list having a polynomial as a list of floats. (ie: 4x²+2x+1 would be [4,2,1] and 5x⁵+x+2 [5,0,0,0,1,2]) psum :: [[Float]] -> [Float] psum (x1:x2:xs) = psum (binpsum (x1, x2)):xs psum x = x where binpsum...

select2 filter local JSON data results with query term

json,filter,local,jquery-select2
I am implementing select2 version 3.5.0. I am using the following jQuery inside my document ready function: jQuery.getJSON('/rest/call/to/retrieve/JSON').done( function( data ) { jQuery('#byProductName').select2({ placeholder: 'Type any portion of a single product name...', allowClear: true, minimumInputLength: 0, multiple: true, id: function(data){ return data.product; }, data: data, formatResult: function(data){ return data.product; },...