Questions Tagged with #Dotfuscator

Dotfuscator provides application self-protection and obfuscation for any type of .NET app through a combination of binary obfuscation/hardening, detection, defense and alert controls. A lite version (Dotfuscator CE) is included inside Visual Studio.

.NET obfuscation tools/strategy

My product has several components: ASP.NET, Windows Forms App and Windows Service. 95% or so of the code is written in VB.NET. For Intellectual Property reasons, I need to obfuscate the code, and unt..

Error Importing SSL certificate : Not an X.509 Certificate

I am trying to Update the SSL certificate in accordance with this post . I am noob in certificates, so i followed this guide. But, when i enter keytool -keystore mycacerts -storepass changeit -i..

How can I declare optional function parameters in JavaScript?

Can I declare default parameter like function myFunc( a, b=0) { // b is my optional parameter } in JavaScript?..

Asyncio.gather vs asyncio.wait

asyncio.gather and asyncio.wait seem to have similar uses: I have a bunch of async things that I want to execute/wait for (not necessarily waiting for one to finish before the next one starts). They u..

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

I just want to install to my project which is located on folder. But when I run following command it shows following Warnings.And its not created a node_modules directory inside my pr..

GET parameters in the URL with CodeIgniter

I know that codeIgniter turns off GET parameters by default. But by having everything done in POST, don't you get annoyed by the re-send data requests if ever you press back after a form submission..

Highlight Bash/shell code in Markdown files

How can I highlight the Bash/shell commands in Markdown files? For example, to highlight js, I write: ```js function () { return "This code is highlighted as Javascript!"} ``` To highlight..

Struct Constructor in C++?

Can a struct have a constructor in C++? I have been trying to solve this problem but I am not getting the syntax...

How to read all files in a folder from Java?

How to read all the files in a folder through Java?..

How do I select an entire row which has the largest ID in the table?

How would I do something like this? SQL SELECT row FROM table WHERE id=max(id) ..

Is there a way to create key-value pairs in Bash script?

I am trying to create a dictionary of key value pair using Bash script. I am trying using this logic: declare -d dictionary defaults write "$dictionary" key -string "$value" ...where $dictionary is..

How do you log all events fired by an element in jQuery?

I'd like to see all the events fired by an input field as a user interacts with it. This includes stuff like: Clicking on it. Clicking off it. Tabbing into it. Tabbing away from it. Ctr..

Change a Rails application to production

How can I change my Rails application to run in production mode? Is there a config file, environment.rb for example, to do that?..

Why does my favicon not show up?

The following is used to set the favicon in my html code: <link rel="icon" type="img/ico" href="img/favicon.ico"> However, the icon does not show. Why? Note: I have confirmed that the file..

Javascript array declaration: new Array(), new Array(3), ['a', 'b', 'c'] create arrays that behave differently

Consider this example Javascript code: a = new Array(); a['a1']='foo'; a['a2']='bar'; b = new Array(2); b['b1']='foo'; b['b2']='bar'; c=['c1','c2','c3']; console.log(a); console.log(b); console.lo..

Running PHP script from the command line

How can I run a PHP script from the command line using the PHP interpreter which is used to parse web scripts? I have a phpinfo.php file which is accessed from the web shows that German is installed...

Always pass weak reference of self into block in ARC?

I am a little confused about block usage in Objective-C. I currently use ARC and I have quite a lot of blocks in my app, currently always referring to self instead of its weak reference. May that be t..

Merge two dataframes by index

I have the following dataframes: > df1 id begin conditional confidence discoveryTechnique 0 278 56 false 0.0 1 1 421 18 false 0.0 ..

Split Spark Dataframe string column into multiple columns

I've seen various people suggesting that Dataframe.explode is a useful way to do this, but it results in more rows than the original dataframe, which isn't what I want at all. I simply want to do the ..

What are the pros and cons of parquet format compared to other formats?

Characteristics of Apache Parquet are : Self-describing Columnar format Language-independent In comparison to Avro, Sequence Files, RC File etc. I want an overview of the formats. I have already ..

Bad Request - Invalid Hostname IIS7

When I try to hit my web app on port 8080 I get the following error Bad Request - Invalid Hostname HTTP Error 400. The request hostname is invalid. I don't even know where to begin to diagnose..

How to fix "The ConnectionString property has not been initialized"

When I start my application I get: The ConnectionString property has not been initialized. Web.config: <connectionStrings> <add name="MyDB" connectionString="Data Source=loca..

How to fetch data from local JSON file on react native?

How can I store local files such as JSON and then fetch the data from controller?..

Arrays in type script

I am finding difficulty declaring array in typescript and accessing it. below is the code working for me class Book { public BookId: number; public Title: string; public Author: string; ..

'ls' in CMD on Windows is not recognized

When I tried to use list ls on a Windows command prompt, the system doesn't recognize it. I already added C:\Windows\System32 in the path...

How to parse JSON array in jQuery?

EDIT I checked the jQuery documentation and using $.ajax with the json datatype specified returns an evaluated javascript object, so eval() isn't the answer here. I knew that anyway, since I am able ..

Developing C# on Linux

I'd like to know if there are effective and open source tools to develop C# applications on Linux (Ubuntu). In particular, I have to develop Windows Forms applications. I know about the Mono project,..

Node update a specific package

I want to update my Browser-sync without updating all my node packages. How can I achieve this? My current version of Browser-sync does not have the Browser-sync GUI :( +-- [email protected] ¦ +-- ..

Matplotlib color according to class labels

I have two vectors, one with values and one with class labels like 1,2,3 etc. I would like to plot all the points that belong to class 1 in red, to class 2 in blue, to class 3 in green etc. How can ..

Fork() function in C

Below is an example of the Fork function in action. Below is also the output. My main question has to to do with the a fork is called how values are changed. So pid1,2 and 3 start off at 0 and get cha..

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

I can push by clone project using ssh, but it doesn't work when I clone project with https. The error message that shows me is: server certificate verification failed. CAfile: /etc/ssl/certs/cacerti..

java IO Exception: Stream Closed

This is the code I currently have: public class FileStatus extends Status{ FileWriter writer; public FileStatus(){ try { writer = new FileWriter("status.txt",true); } catch (IOExcepti..

Can a class member function template be virtual?

I have heard that C++ class member function templates can't be virtual. Is this true? If they can be virtual, what is an example of a scenario in which one would use such a function?..

What do URLs represent?

I want to learn how to use to serve other applications from So we have a usual way to download and install homebrew on osx. ruby -e "$(curl -fsSL https://raw.githubusercontent...

How to compare oldValues and newValues on React Hooks useEffect?

Let's say I have 3 inputs: rate, sendAmount, and receiveAmount. I put that 3 inputs on useEffect diffing params. The rules are: If sendAmount changed, I calculate receiveAmount = sendAmount * rate I..

How to make nginx to listen to server_name:port

In my nginx conf file, I have : listen 80; server_name $hostname; however if I do netstat I see that it is listening on what I want to happen, is the nginx to listen to $h..

Is there an equivalent to the SUBSTRING function in MS Access SQL?

I want to do something like this within an MS Access query, but SUBSTRING is an undefined function. SELECT DISTINCT SUBSTRING(LastName, 1, 1) FROM Authors; ..

Regex pattern to match at least 1 number and 1 character in a string

I have a regex /^([a-zA-Z0-9]+)$/ this just allows only alphanumerics but also if I insert only number(s) or only character(s) then also it accepts it. I want it to work like the field should a..

How much does it cost to develop an iPhone application?

How much can a developer charge for an iPhone app like Twitterrific? I want to know this because I need such an application with the same functionality for a new community website. I can do Ruby but ..

Basic authentication with fetch?

I want to write a simple basic authentication with fetch, but I keep getting a 401 error. It would be awesome if someone tells me what's wrong with the code: let base64 = require('base-64'); let url ..

Storing integer values as constants in Enum manner in java

I'm currently creating integer constants in the following manner. public class Constants { public static int SIGN_CREATE=0; public static int SIGN_CREATE=1; public static int HOME_SCREEN=..

What is the difference between URI, URL and URN?

What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it. URI: URL: URN:

What does "collect2: error: ld returned 1 exit status" mean?

I see the error collect2: error: ld returned 1 exit status very often. For example, I was executing the following snippet of code: void main() { char i; printf("ENTER i"); scanf("%c",&i); ..

C# 4.0 optional out/ref arguments

Does C# 4.0 allow optional out or ref arguments?..

How to get a unix script to run every 15 seconds?

I've seen a few solutions, including watch and simply running a looping (and sleeping) script in the background, but nothing has been ideal. I have a script that needs to run every 15 seconds, and si..

Find a file by name in Visual Studio Code

How can I find a file by name in Visual Studio Code? A Visual Studio shortcut I'm used to is CTRL+,, but it does not work here...

Create an array of strings

Is it possibe to create an array of strings in MATLAB within a for loop? For example, for i=1:10 Names(i)='Sample Text'; end I don't seem to be able to do it this way...

Multiple files upload in Codeigniter

I want to upload multiple files using single element. So I try this example. Multiple files upload (Array) with CodeIgniter 2.0 This is my form <form enctype="multipart/form-data" class="jNice"..

Merge data frames based on rownames in R

How can I merge the columns of two data frames, containing a distinct set of columns but some rows with the same names? The fields for rows that don't occur in both data frames should be filled with z..

How to get raw text from pdf file using java

I have some pdf files, Using pdfbox i have converted them into text and stored into text files, Now from the text files i want to remove Hyperlinks All special characters Blank lines headers footers..

JQuery post JSON object to a server

I create a json that needs to be posted in jersey, a server running by grizzly that has a REST webservice gets incoming json object which need to be outputed. I'm giving a try but not sure how to impl..

How do I add a ToolTip to a control?

I would like to display a ToolTip for when the mouse is hovering over a control. How does one create a tooltip in code, but also in the designer?..

PostgreSQL: insert from another table

I'm trying to insert data to a table from another table and the tables have only one column in common. The problem is, that the TABLE1 has columns that won't accept null values so I can't leave them e..

How can I get the current contents of an element in webdriver

I must be thinking about this wrong. I want to get the contents of an element, in this case a formfield, on a page that I am accessing with Webdriver/Selenium 2 Here is my broken code: Element=dr..

Text-decoration: none not working

Totally baffled! I've tried rewriting the text-decoration: none line several different ways. I also managed to re-size the text by targeting it but the text-decoration: none code will not take. Help ..

How can I regenerate ios folder in React Native project?

So a while ago I deleted the /ios directory in my react native app (let's call it X). I've been developing and testing using the android emulator but now I'd like to make sure it works on ios with xco..

What causes a SIGSEGV

I need to know the root cause of the segmentation fault (SIGSEGV), and how to handle it...

CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found

I'm trying make a Visual Studio solution with CMake to compile the latest version of aseprite and CMake keeps giving me the: No CMAKE_C_COMPILER could be found. No CMAKE_CXX_COMPILER could be found. ..

Changing the text on a label

I am having trouble with using a key binding to change the value of a label or any parameter. This is my code: from tkinter import* class MyGUI: def __init__(self): self.__mainWindow = Tk() ..

Styles.Render in MVC4

In a .NET MVC4 project how does @Styles.Render works? I mean, in @Styles.Render("~/Content/css") which file is it calling? I dont have a file or a folder called "css" inside my Content folder...

PHP array delete by value (not key)

I have a PHP array as follows: $messages = [312, 401, 1599, 3, ...]; I want to delete the element containing the value $del_val (for example, $del_val=401), but I don't know its key. This might hel..

C++ - Assigning null to a std::string

I am learning C++ on my own. I have the following code but it gives error. #include <iostream> #include <string> using namespace std; int setvalue(const char * value) { string mVal..

How to show loading spinner in jQuery?

In Prototype I can show a "loading..." image with this code: var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} ); function showLoa..

Soft keyboard open and close listener in an activity in Android

I have an Activity where there are 5 EditTexts. When the user clicks on the first EditText, the soft keyboard opens to enter some value in it. I want to set some other View's visibility to Gone when t..

how do I change text in a label with swift?

I'm trying to change the text on a label in a simple iOS app. The idea is to write a message in a textField and have it change the label once I press a button. the objective-c code states the follow..

Bootstrap Element 100% Width

I want to create alternating 100% colored blocks. An "ideal" situation is illustrated as an attachment, as well as the current situation. Desired setup: Currently: My first idea was to create..

jquery function setInterval

$(document).ready(function(){ setInterval(swapImages(),1000); function swapImages(){ var active = $('.active'); var next = ($('.active').next().length > 0) ? $('.active'..

Python read in string from file and split it into values

I have a file in the format below: 995957,16833579 995959,16777241 995960,16829368 995961,50431654 I want to read in each line but split the values into the appropriate values. For example the firs..

Array or List in Java. Which is faster?

I have to keep thousands of strings in memory to be accessed serially in Java. Should I store them in an array or should I use some kind of List ? Since arrays keep all the data in a contiguous chunk..

Return anonymous type results?

Using the simple example below, what is the best way to return results from multiple tables using Linq to SQL? Say I have two tables: Dogs: Name, Age, BreedId Breeds: BreedId, BreedName I want t..

How to trim a string to N chars in Javascript?

How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example: var string = "this is a string"; var length = 6; va..

Easiest way to pass an AngularJS scope variable from directive to controller?

What is the easiest way to pass an AngularJS scope variable from directive to controller? All of the examples that I've seen seem so complex, isn't there a way I can access a controller from a direct..

Android Studio : Failure [INSTALL_FAILED_OLDER_SDK]

Today I have downloaded Android Studio v 0.8.0 beta. I am trying to test my app on SDK 17 . Android studio error Failure [INSTALL_FAILED_OLDER_SDK] Here is my android manifest <?xml version="..

stringstream, string, and char* conversion confusion

My question can be boiled down to, where does the string returned from stringstream.str().c_str() live in memory, and why can't it be assigned to a const char*? This code example will explain it bett..

VBA - Range.Row.Count

I have written a simple code to illustrate my predicament. Sub test() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Sheet1") Dim k As Long k = sh.Range("A1", sh.Range("A1").End..

How to printf a 64-bit integer as hex?

With the following code I am trying to output the value of a unit64_t variable using printf(). Compiling the code with gcc, returns the following warning: warning: format ‘%x’ expects argument..

Increase max_execution_time in PHP?

I'm trying to upload large files to my server (my server support post_max_size 192mb and max_execution_time 600 sec). When I upload 100mb files execution will stop after 600 sec so files are not uploa..

Object not found! The requested URL was not found on this server. localhost

I have a typical set up A,M,P and i am just doing some testing on my localhost server for setting up a webpage. I'm a bit new to php and dynamic sites so I'm muddling my way though. So I am at an impa..

Get age from Birthdate

Possible Duplicate: Calculate age in JavaScript In some point of my JS code I have jquery date object which is person's birth date. I want to calculate person's age based on his birth date...

How to read one single line of csv data in Python?

There is a lot of examples of reading csv data using python, like this one: import csv with open('some.csv', newline='') as f: reader = csv.reader(f) for row in reader: print(row) I only wa..

JPA OneToMany and ManyToOne throw: Repeated column in mapping for entity column (should be mapped with insert="false" update="false")

I have three classes one of the names is User and this user has other classes instances. Like this; public class User{ @OneToMany(fetch=FetchType.LAZY, cascade = CascadeType.ALL) public List&l..

MySQL LIMIT on DELETE statement

I put together a test table for a error I recently came across. It involves the use of LIMIT when attempting to delete a single record from a MySQL table. The error I speak of is "You have an error i..

How to listen for changes to a MongoDB collection?

I'm creating a sort of background job queue system with MongoDB as the data store. How can I "listen" for inserts to a MongoDB collection before spawning workers to process the job? Do I need to poll ..

Local package.json exists, but node_modules missing

I am trying to start a Redux application I just cloned from a GitHub repository. I tried to run it with the following command npm start I am getting this error > [email protected] start ..

How to print last two columns using awk

All I want is the last two columns printed...

How to stop console from closing on exit?

I'm using Visual Studio 2010 and Windows 7 x64 The command prompt closes after exit, even though I used "Start without debug". Is there a setting somewhere that I can use?..

Visual Studio debugger error: Unable to start program Specified file cannot be found

I have a solution in C:\full path here\VS2010\blender.sln This solution contains many projects(around 100). When I compile them, they all work fine. I can run them without any problem, and (quite) ev..

Removing duplicate rows in Notepad++

Is it possible to remove duplicated rows in Notepad++, leaving only a single occurrence of a line?..

Error:(1, 0) Plugin with id '' not found

This is my first attempt at Android Studio. I installed 0.8.0 and updated to 0.8.2. As soon as a project is created I get the error message: Error:(1, 0) Plugin with id ''..

Convert file: Uri to File in Android

What's the easiest way to convert from a file: to a File in Android? Tried the following but it doesn't work: final File file = new File(Environment.getExternalStorageDirectory(), "..

Twitter Bootstrap add active class to li

Using twitter bootstrap, and I need to initiate active class to the li portion of the main nav. Automagically. We use php not ruby. Sample nav : <ul class="nav"> <li><a href="/"&g..

How to convert string to double with proper cultureinfo

I have two nvarchar fields in a database to store the DataType and DefaultValue, and I have a DataType Double and value as 65.89875 in English format. Now I want the user to see the value as per the ..

Android ADB device offline, can't issue commands

I can't connect to my device anymore using ADB through the command line or in Eclipse. Running the command adb devices returns the device name, but it says it's offline. Things I've tried. Togg..

Can't import Numpy in Python

I'm trying to write some code that uses Numpy. However, I can't import it: Python 2.6.2 (r262, May 15 2009, 10:22:27) [GCC 3.4.2] on linux2 Type "help", "copyright", "credits" or "license" for more..

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

I'm setting up a new server and keep running into this problem. When I try to login to the MySQL database with the root user, I get the error: ERROR 1698 (28000): Access denied for user 'root'@'..

Prevent a webpage from navigating away using JavaScript

How to prevent a webpage from navigating away using JavaScript?..

How to restore the menu bar in Visual Studio Code

I disabled the menu bar in preferences and it disappeared as expected. Now there's no way to get to the preferences menu again. How do I get it back? ..

Difference between core and processor

What is the difference between a core and a processor? I've already looked for it on Google, but I'm just having multi-core and multi-processor definition, but it doesn't match what I am looking for...

What's a good IDE for Python on Mac OS X?

I'm about to start a new job where the coding practices are heavily centered around TDD and refactoring, and whose primary development language is Python. I come from the Java world, and have been a ..

How to access the services from RESTful API in my angularjs page?

I am very new to angularJS. I am searching for accessing services from RESTful API, but I didn't get any idea. How can I do that?..

Removing a Fragment from the back stack

I have a 3 fragments in an activity when the a tablet is held in portrait. However I only have 2 of these fragments when in landscape. The problem I am having is when going from portrait to landscape ..

What are the best practices for using a GUID as a primary key, specifically regarding performance?

I have an application that uses GUID as the Primary Key in almost all tables and I have read that there are issues about performance when using GUID as Primary Key. Honestly, I haven't seen any proble..

jquery .html() vs .append()

Lets say I have an empty div: <div id='myDiv'></div> Is this: $('#myDiv').html("<div id='mySecondDiv'></div>"); The same as: var mySecondDiv=$("<div id='mySecondDiv'&..

How to deal with certificates using Selenium?

I am using Selenium to launch a browser. How can I deal with the webpages (URLs) that will ask the browser to accept a certificate or not? In Firefox, I may have a website like that asks me to accept..

Regular Expression with wildcards to match any character

I am new to regex and I am trying to come up with something that will match a text like below: ABC: (z) jan 02 1999 \n Notes: text will always begin with "ABC:" there may be zero, one or more spac..

How to convert hashmap to JSON object in Java

How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?..

How do I set path while saving a cookie value in JavaScript?

I am saving some cookie values on an ASP page. I want to set the root path for cookie so that the cookie will be available on all pages. Currently the cookie path is /v/abcfile/frontend/ Please help..

python pandas remove duplicate columns

What is the easiest way to remove duplicate columns from a dataframe? I am reading a text file that has duplicate columns via: import pandas as pd df=pd.read_table(fname) The column names are: T..

PHP get dropdown value and text

<select id="animal" name="animal"> <option value="0">--Select Animal--</option> <option value="1">Cat</option> <option value="2">Dog</optio..

How to get absolute path to file in /resources folder of your project

Assume standard maven setup. Say in your resources folder you have a file abc. In Java, how can I get absolute path to the file please?..

How can I store and retrieve images from a MySQL database using PHP?

How can I insert an image in MySQL and then retrieve it using PHP? I have limited experience in either area, and I could use a little code to get me started in figuring this out...

How to check that Request.QueryString has a specific value or not in ASP.NET?

I have an error.aspx page. If a user comes to that page then it will fetch the error path in page_load() method URL using Request.QueryString["aspxerrorpath"] and it works fine. But if a user direct..

Make 2 functions run at the same time

I am trying to make 2 functions run at the same time. def func1(): print 'Working' def func2(): print 'Working' func1() func2() Does anyone know how to do this?..

How to shrink temp tablespace in oracle?

How can we shrink temp tablespace in oracle? And why it is increasing so much like upto 25 GB since there is only one schema in the database for the application and data table space size is 2 GB and i..

How to load image files with webpack file-loader

I am using webpack to manage a reactjs project. I want to load images in javascript by webpack file-loader. Below is the webpack.config.js: const webpack = require('webpack'); const path = require('pa..

How to get parameters from the URL with JSP

In JSP how do I get parameters from the URL? For example I have a URL I want to get the 5. Is there a request.getAttribute( "accountID" ) like there..

A simple algorithm for polygon intersection

I'm looking for a very simple algorithm for computing the polygon intersection/clipping. That is, given polygons P, Q, I wish to find polygon T which is contained in P and in Q, and I wish T to be max..

Printing a 2D array in C

how would I print a 2d array in c using scanf for user input, array called grid[ ][ ] and a for loop? say if the user types in 3 5, the output will be: ..... ..... ..... Here is the code that I ha..

How to pass IEnumerable list to controller in MVC including checkbox state?

I have an mvc application in which I am using a model like this: public class BlockedIPViewModel { public string IP { get; set; } public int ID { get; set; } public bool Checked { get;..

List(of String) or Array or ArrayList

Hopefully a simple question to most programmers with some experience. What is the datatype that lets me do this? Dim lstOfStrings as *IDK* Dim String0 As String = "some value" Dim String1 As Strin..

Stop fixed position at footer

I'm looking for a solution to the popular issue of stopping a fixed object at the footer of the page. I basically have a fixed "share" box in the bottom left corner of the screen and I don't want it ..

Fastest JSON reader/writer for C++

I need a C++ JSON parser & writer. Speed and reliability are very critical, I don't care if the interface is nice or not, if it's Boost-based or not, even a C parser is fine (if it's considerably ..

Read/write to file using jQuery

Is there a way to get jQuery to get information to and from a file? Is it possible? How?..

Making RGB color in Xcode

I am using RGB values of a color from Photoshop and using the same in Xcode the values are.Color-R-160,G-97,B-5...the color in Photoshop appears yellowish but in Xcode when I used myLabel.textColor =..

how to add <script>alert('test');</script> inside a text box?

This is strange requirement! I want to <script>alert('test');</script> in an input type text but it should not execute the alert(). I just need to set the text <script>alert('t..

How can I retrieve a table from stored procedure to a datatable?

I created a stored procedure so as to return me a table. Something like this: create procedure sp_returnTable body of procedure select * from table end When I call this stored procedure on the fro..

Why did Servlet.service() for servlet jsp throw this exception?

I get the following error, what could be the problem? My context descriptor: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="" xmlns="htt..

How do you serialize a model instance in Django?

There is a lot of documentation on how to serialize a Model QuerySet but how do you just serialize to JSON the fields of a Model Instance?..

Display rows with one or more NaN values in pandas dataframe

I have a dataframe in which some rows contain missing values. In [31]: df.head() Out[31]: alpha1 alpha2 gamma1 gamma2 chi2min filename ..

How to count down in for loop?

In Java, I have the following for loop and I am learning Python: for (int index = last-1; index >= posn; index--) My question is simple and probably obvious for most of people who are familiar w..

Run a command over SSH with JSch

I'm trying to run a command over SSH with JSch, but JSch has virtually no documentation and the examples I've found are terrible. For example, this one doesn't show code for handling the output stream..

Difference between two lists

I Have two generic list filled with CustomsObjects. I need to retrieve the difference between those two lists(Items who are in the first without the items in the second one) in a third one. I was t..

How to style child components from parent component's CSS file?

I've got a parent component: <parent></parent> And I want to populate this group with child components: <parent> <child></child> <child></child> <ch..

HTML5: camera access

I am quite new to HTML5. I try the following HTML5 code to access camera on my mobile phone. It always display "Native web camera not supported". It seems that my mobile browser (safari and android 2...

Mongoose's find method with $or condition does not work properly

Recently I start using MongoDB with Mongoose on Nodejs. When I use Model.find method with $or condition and _id field, Mongoose does not work properly. This does not work: User.find({ $or: [ ..

How to create a pulse effect using -webkit-animation - outward rings

I have found this article: on css3 animations. I am trying to create a similar effect seen on the site above but on personal si..

The zip() function in Python 3

I know how to use the zip() function in Python 3. My question is regarding the following which I somehow feel quite peculiar: I define two lists: lis1 = [0, 1, 2, 3] lis2 = [4, 5, 6, 7] and I use ..

How to include js and CSS in JSP with spring MVC

I want to include js and css files in my jsp, but I'm not able to do so. I'm new to the concept of spring MVC. For a long time, I've been working on this same topic. My index Page is like this <!D..

How to show progress bar while loading, using ajax

I have a dropdown box. When the user selects a value from the dropdown box, it performs a query to retrieve the data from the database, and shows the results in the front end using ajax. It takes a li..

How do you sort a dictionary by value?

I often have to sort a dictionary, consisting of keys & values, by value. For example, I have a hash of words and respective frequencies, that I want to order by frequency. There is a SortedList ..

How to assign a value to a TensorFlow variable?

I am trying to assign a new value to a tensorflow variable in python. import tensorflow as tf import numpy as np x = tf.Variable(0) init = tf.initialize_all_variables() sess = tf.InteractiveSession(..

Vue is not defined

I am trying to build a demo app with Vue.js. What I am getting is an odd error that Vue is not defined. <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> ..

405 method not allowed Web API

This error is very common, and I tried all of the solutions and non of them worked. I have disabled WebDAV publishing in control panel and added this to my web config file: <handlers> <r..

Javascript change font color

I need to change the font color. I have the following: var clr="green"; <font color=clr>' + onlineff + ' </font> The font color does not change to green. Just wondering how thi..

Center a DIV horizontally and vertically

Is there a way to CENTER A DIV vertically and horizontally but, and that is important, that the content will not be cut when the window is smaller than the content The div must have a background colo..

Make a nav bar stick

Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav bar stick Make a nav ..

How to make a movie out of images in python

I currently try to make a movie out of images, but i could not find anything helpful . Here is my code so far: import time from PIL import ImageGrab x =0 while True: try: x+= 1 ..

Django {% with %} tags within {% if %} {% else %} tags?

So I want to do something like follows: {% if age > 18 %} {% with patient as p %} {% else %} {% with patient.parent as p %} ... {% endwith %} {% endif %} But Django is telling me tha..

How to ignore certain files in Git

I have a repository with a file, When I compile it, an additional Hello.class file is generated. I created an entry for Hello.class in a .gitignore file. However, the file still appears t..

Change the background color in a twitter bootstrap modal?

When creating a modal in twitter bootstrap, is there any way to change the background color? Remove the shading entirely? NB: For removing shading, this doesn't work, because it also changes the cli..

Why doesn't Java support unsigned ints?

Why doesn't Java include support for unsigned integers? It seems to me to be an odd omission, given that they allow one to write code that is less likely to produce overflows on unexpectedly large ..

Exit while loop by user hitting ENTER key

I am a python newbie and have been asked to carry out some exercises using while and for loops. I have been asked to make a program loop until exit is requested by the user hitting <Return> only..

Change tab bar item selected color in a storyboard

I want to change my tab bar items to be pink when selected instead of the default blue. How can i accomplish this using the storyboard editor in Xcode 6? Here are my current setting which are not wo..

Git merge develop into feature branch outputs "Already up-to-date" while it's not

I checked out a feature branch from develop called branch-x. After a while other people pushed changes to the develop branch. I want to merge those changes into my branch-x. However if I do git me..

Convert hex to binary

I have ABC123EFFF. I want to have 001010101111000001001000111110111111111111 (i.e. binary repr. with, say, 42 digits and leading zeroes). How?..

phpMyAdmin - configuration?

With this configuration i found the error The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. To find out why click here. W..

"Object doesn't support this property or method" error in IE11

I am getting the error Critical Error: Object doesn't support this property or method addeventlistener while accessing the InfoPath form page (using InfoPath enabled list form e.g.

SVN: Folder already under version control but not comitting?

mark@mark-ubuntu:~/myproject$ svn stat ? ? media/images/icons ? apps/autocomplete mark@mark-ubuntu:~/myproject$ svn add apps/autocomplete svn: warning: 'apps/autocomplet..

How do you overcome the svn 'out of date' error?

I've been attempting move a directory structure from one location to another in Subversion, but I get an Item '*' is out of date commit error. I have the latest version checked out (so far as I can..

Get human readable version of file size?

A function to return human readable size from bytes size: >>> human_readable(2048) '2 kilobytes' >>> How to do this?..

MomentJS getting JavaScript Date in UTC

I am not able to get the JavaScript Date string for MongoDB record via the following. It keeps using my local time. var utc = moment.utc().valueOf(); console.log(moment.utc(utc).toDate()); Output: ..

CSS to stop text wrapping under image

I have the following markup: <li id="CN2787"> <img class="fav_star" src="images/fav.png"> <span>Text, text and more text</span> </li> I want it so that if the text..

Why does Math.Round(2.5) return 2 instead of 3?

In C#, the result of Math.Round(2.5) is 2. It is supposed to be 3, isn't it? Why is it 2 instead in C#?..

Better techniques for trimming leading zeros in SQL Server?

I've been using this for some time: SUBSTRING(str_col, PATINDEX('%[^0]%', str_col), LEN(str_col)) However recently, I've found a problem with columns with all "0" characters like '00000000' because..

Split string with PowerShell and do something with each token

I want to split each line of a pipe on spaces, and then print each token on its own line. I realise that I can get this result using: (cat someFileInsteadOfAPipe).split(" ") But I want more flexib..

python: unhashable type error

Traceback (most recent call last): File "<pyshell#80>", line 1, in <module> do_work() File "C:\pythonwork\", line 14, in do_work populate_frequency5(e,data)..

How return error message in spring mvc @Controller

I am using methods like this @RequestMapping(method = RequestMethod.GET) public ResponseEntity<UserWithPhoto> getUser(@RequestHeader(value="Access-key") String accessKey, ..

Find html label associated with a given input

Let's say I have an html form. Each input/select/textarea will have a corresponding <label> with the for attribute set to the id of it's companion. In this case, I know that each input will onl..

What are alternatives to ExtJS?

So what I'm looking for is a javascript framework I can use that has several UI controls. I have taken a look at jQuery but those controls are very basic compared to ExtJS. Are there any other competi..

jQuery SVG vs. Raphael

I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to decide between Raphael and jQuery SVG. I'd like to know What the trade-offs are between the two Where the ..

Using Math.round to round to one decimal place?

I have these two variables double num = 540.512 double sum = 1978.8 Then I did this expression double total = Math.round((num/ sum * 100) * 10) / 10; but I end up with 27.0. In fact I have man..

How to handle change of checkbox using jQuery?

I have some code <input type="checkbox" id="chk" value="value" /> <label for="chk">Value </label> <br/> <input type="button" id="But1" value="set value" /> <br /> ..

Compiler error: memset was not declared in this scope

I am trying to compile my C program in Ubuntu 9.10 (gcc 4.4.1). I am getting this error: Rect.cpp:344: error: ‘memset’ was not declared in this scope But the problem is I have already included..

Does JavaScript guarantee object property order?

If I create an object like this: var obj = {}; obj.prop1 = "Foo"; obj.prop2 = "Bar"; Will the resulting object always look like this? { prop1 : "Foo", prop2 : "Bar" } That is, will the propertie..

How to search for a string in text files?

I want to check if a string is in a text file. If it is, do X. If it's not, do Y. However, this code always returns True for some reason. Can anyone see what is wrong? def check(): datafile = fil..

Spring MVC Controller redirect using URL parameters instead of in response

I am trying to implement RESTful urls in my Spring MVC application. All is well except for handling form submissions. I need to redirect either back to the original form or to a "success" page. @Con..

How to convert an address to a latitude/longitude?

How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can "rent" this service from? This would be used in a commercial desktop application on a Win..

How do I use brew installed Python as the default Python?

I try to switch to Homebrew (after using fink and macport) on Mac OS X 10.6.2. I have installed python 2.7 with brew install python The problem is that, contrary to Macport, it seems that there i..

Using the star sign in grep

I am trying to search for the substring "abc" in a specific file in linux/bash So I do: grep '*abc*' myFile It returns nothing. But if I do: grep 'abc' myFile It returns matches correctly. No..

Android: How to open a specific folder via Intent and show its content in a file browser?

I thought this would be easy but as it turns out unfortunately it's not. What I have: I have a folder called "myFolder" on my external storage (not sd card because it's a Nexus 4, but that should no..

How to check if a python module exists without importing it

I need to know if a python module exists, without importing it. Importing something that might not exist (not what I want): try: import eggs except ImportError: pass ..

MongoDB: How to update multiple documents with a single command?

I was surprised to find that the following example code only updates a single document: >{"_id":1, "foo":"bar"}); >{"_id":2, "foo":"bar"}); > db.test.update({"fo..

Execute an action when an item on the combobox is selected

I have a jcombobox containing item1 and item2, also I have a jtextfield.. when I select item1 on my jcombobox I want 30 to appear on my jtextfield while 40 if Item2 was selected... How do I do that?..

I want to convert std::string into a const wchar_t *

Is there any method? My computer is AMD64. ::std::string str; BOOL loadU(const wchar_t* lpszPathName, int flag = 0); When I used: loadU(&str); the VS2005 compiler says: Error 7 error C2664..

close fxml window by code, javafx

I need to close the current fxml window by code in the controller I know stage.close() or stage.hide() do this in fx how to implement this in fxml? I tried private void on_btnClose_clicked(Acti..

should use size_t or ssize_t

At my code, I do not use int or unsigned int. I only use size_t or ssize_t for portable. For example: typedef size_t intc; // (instead of unsigned int) typedef ssize_t uintc; // (instead of int)..

Remove leading and trailing spaces?

I'm having a hard time trying to use .strip with the following line of code. Thanks for the help. f.write(re.split("Tech ID:|Name:|Account #:",line)[-1]) ..

FailedPreconditionError: Attempting to use uninitialized in Tensorflow

I am working through the TensorFlow tutorial, which uses a "weird" format to upload the data. I would like to use the NumPy or pandas format for the data, so that I can compare it with scikit-learn re..

CSS: How to remove pseudo elements (after, before,...)?

I would like to use a switch for the layout of paragraph tags on a webpage. I use the after pseudoelement: p:after {content: url("../img/paragraph.gif");} Now I need to remove this CSS code from t..

Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)

I have a development database that re-deploy frequently from a Visual Studio Database project (via a TFS Auto Build). Sometimes when I run my build I get this error: ALTER DATABASE failed because a ..

Nullable type as a generic parameter possible?

I want to do something like this : myYear = record.GetValueOrNull<int?>("myYear"), Notice the nullable type as the generic parameter. Since the GetValueOrNull function could return null my ..

Image re-size to 50% of original size in HTML

I'm trying to re-size a image in HTML, it's got width 314px and height 212px. I want to re-size it to 50%... but using this I still get a bigger image instead of a half-size image. <img src="ima..

Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate

I am using Git on Windows. I installed the msysGit package. My test repository has a self signed certificate at the server. I can access and use the repository using HTTP without problems. Moving to H..

How to run eclipse in clean mode? what happens if we do so?

If something is not working properly or some plug-ins are not loaded properly in my Eclipse I often get suggestion to open Eclipse in clean mode. So, how to run in clean mode? And what happens if I d..

Typescript interface default values

I have the following interface in TypeScript: interface IX { a: string, b: any, c: AnotherType } I declare a variable of that type and I initialize all the properties let x: IX = { ..

How to make 'submit' button disabled?

How to disable the "Submit" button until the form is valid? Does angular2 have an equivalent to ng-disabled that can be used on the Submit button? (ng-disabled doesn't work for me.)..

Need a good hex editor for Linux

I need a good HEX editor for Linux, and by good I mean: Fast Search/replace features Can display data not only in hex, but also binary, octal, etc. Can work with huge (> 1 gb) files without becoming..

Losing Session State

I have an application where Users aren't able to successfully complete certain actions, for reasons, I'm assuming, can only be related to losing their session (which is where I maintain their ..

What are the -Xms and -Xmx parameters when starting JVM?

Please explain the use of Xms and Xmx parameters in JVMs. What are the default values for them?..

Visual Studio Code: How to show line endings

How can i display lineendings (CR,LF) in Visual Studio Code (not in Visual Studio). I use following settings, but non of them show the line endings. "editor.renderWhitespace": true, "editor.renderCo..

Call a python function from jinja2

I am using jinja2, and I want to call a python function as a helper, using a similar syntax as if I were calling a macro. jinja2 seems intent on preventing me from making a function call, and insists ..