Questions Tagged with #Mod rewrite

URL rewriting module for the Apache web server. It is commonly used for so-called "pretty" URLs, but also provides the power and flexibility to perform various request handling tasks beyond simple substitutions.

Permission denied: /var/www/abc/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable?

Hi all I'm using PHP for my website and ubuntu linux on my system. I got the above error in error.log file of apache, even after configurating everything properly. I did a lot of research on this but ..

.htaccess - how to force "www." in a generic way?

This will change domain.com to www.domain.com: # Force the "www." RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] How do I replace the "domai..

Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04

I have installed Laravel many times on Windows OS but it never occurred this type of problem. This 500 internal server usually occurs when your "mod_rewrite" module is not turned on. However, on Ubu..

.htaccess redirect all pages to new domain

Which redirect rule would I use to redirect all pages under olddomain.example to be redirected to newdomain.example? The site has a totally different structure, so I want every page under the old dom..

How to remove "index.php" in codeigniter's path

How do I remove the "index.php" sticking out in every path in codeigniter somewhere in the center? I want clean non index.php-fied URLs?..

No input file specified

I'm running Anchor CMS and I just upgraded to version 0.8. When I try and run the installer I get a 'No input file specified' error. I believe it's more than likely a .htaccess problem but I'm not sur..

How to use .htaccess in WAMP Server?

I searched in web for 2 days and I try to use htaccess in my local wamp but I can't! I know there is something wrong but I don't know where... First: I activated "rewrite_module" in the apache menu, ..

Forbidden You don't have permission to access / on this server

All I wanted to do today was to write a redirect rule to a subfolder, e.g.: You enter the URL: example.com and you get redirected to example.com/subfolder Such a simple wish. I tried to find a soluti..

Force SSL/https using .htaccess and mod_rewrite

How can I force to SSL/https using .htaccess and mod_rewrite page specific in PHP...

How to prevent a file from direct URL Access?

I'm using Apache and I have a sample web folder on my Local Host, like: http://localhost/test/ Files in the test folder: index.html sample.jpg .htaccess Samp..

How does RewriteBase work in .htaccess

I have seen this in a few .htaccess examples RewriteBase / It appears to be somewhat similar in functionality to the <base href=""> of HTML. I believe it may automatically prepend its value..

Header set Access-Control-Allow-Origin in .htaccess doesn't work

I can't figure out why my .htaccess header settings doesn't work. My .htaccess file content: Header set Access-Control-Allow-Origin * Header always set Access-Control-Allow-Methods "POST, GET, OPTIO..

404 Not Found The requested URL was not found on this server

I'm having small troubles and was wondering if someone can help me over the hump. I pulled a copy of a website down from Hostgator and I'm trying to set it up on my local machine using WAMP but, I ke..

How to check whether mod_rewrite is enable on server?

Currently I am using the hosting with lightspeed server. Hosting says mod_rewrite is enabled but I can't get my script working there. Whenever I try to access the URL, it returns 404 - not found page...

How to enable mod_rewrite for Apache 2.2

I've got fresh install of Apache 2.2 on my Vista machine, everything works fine, except mod rewrite. I've uncommented LoadModule rewrite_module modules/mod_rewrite.s but none of my rewrite rules ..

.htaccess rewrite to redirect root URL to subdirectory

Trying to get www.example.com to go directly to www.example.com/store I have tried multiple bits of code and none work. What I've tried: Options +FollowSymlinks RewriteEngine on RewriteCond %..

How to check if mod_rewrite is enabled in php?

I was wondering if it is possible to check if mod_rewrite is enabled on Apache AND IIS in PHP. ModRewrite for IIS exists. Check it here. So, I'm looking for a PHP script that checks for mod_rewrite on..

how to use "AND", "OR" for RewriteCond on Apache?

Is this how to use AND, OR for RewriteCond on Apache? rewritecond A [or] rewritecond B rewritecond C [or] rewritecond D RewriteRule ... something becomes if ( (A or B) and (C or D) ) rewrite_it. S..

htaccess remove index.php from url

I have a problem whereby google has indexed some pages with the wrong url. The url they are indexing is: http://www.example.com/index.php/section1/section2 I need it to redirect to: http://www.ex..

How to debug Apache mod_rewrite

I have two main problems with mod_rewrite: 1) There is no meaningful error reported when I have an invalid rule 2) To reliably test each modification, I have to erase chrome's cache. This isn't ro..

apache mod_rewrite is not working or not enabled

I have installed rewrite_module and modified php.ini on Apache. I create rewrite.php and .htaccess files, but it's not working. My filesystem folders like: /var/www/html /var/www/html/test /var/www..

Redirect all to index.php using htaccess

I am writing a simple PHP-based MVC-ish framework. I want this framework to be able to be installed in any directory. My PHP script grabs the request uri and breaks it off into segments. It makes segm..

Generic htaccess redirect www to non-www

I would like to redirect www.example.com to example.com. The following htaccess code makes this happen: RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=..

deny direct access to a folder and file by htaccess

Here is the scenario: There is a index.php file in root folder some files are included in index.php which are in the includes folder. 1 other file (submit.php) is in the root folder for form submit ..

How do you enable mod_rewrite on any OS?

If I understand correctly, I need to put something in httpd.config to enable mod_rewrite. If this is true, what do I need to put in httpd.conf or apache.conf? Please be OS specific...

.htaccess mod_rewrite - how to exclude directory from rewrite rule

I have 8 lines of rewrite rules in my .htaccess file. I need to exclude two physical directories on my server from these rules, so they can become accessible. For now all requests are sent to index.ph..

URL rewriting with PHP

I have a URL that looks like: url.com/picture.php?id=51 How would I go about converting that URL to: picture.php/Some-text-goes-here/51 I think WordPress does the same. How do I go about making..

How to debug .htaccess RewriteRule not working

I have a RewriteRule in a .htaccess file that isn't doing anything. How do I troubleshoot this? How can I verify if the .htaccess file is even being read and obeyed by Apache? Can I write an echo "i..

apache redirect from non www to www

I have a website that doesn't seem to redirect from non-www to www. My Apache configuration is as follows: RewriteEngine On ### re-direct to www RewriteCond %{http_host} !^www.example.com [nc] Rewri..

htaccess redirect to https://www

I have the following htaccess code: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond !{HTTPS} off RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HO..

.htaccess not working on localhost with XAMPP

i m using XAMPP but i m not able to use .htaccess file at local host. i m trying so many times.. Online working good. but local host showing [The requested URL was not found on this server] My root ..

Tips for debugging .htaccess rewrite rules

Many posters have problems debugging their RewriteRule and RewriteCond statements within their .htaccess files. Most of these are using a shared hosting service and therefore don't have access to the..

Htaccess: add/remove trailing slash from URL

My website runs a script called -> WSS wallpaper script My Problem -> I have been trying to force remove or add trailing slash to the end of my URL to prevent duplicated content and also to clean up ..

Select From all tables - MySQL

I have a mySQL database called listDB that contain several tables with column name Product etc. I want to SELECT from all tables where Product Like %XYZ%, and display the search result in a separate t..

Formatting MM/DD/YYYY dates in textbox in VBA

I'm looking for a way to automatically format the date in a VBA text box to a MM/DD/YYYY format, and I want it to format as the user is typing it in. For instance, once the user types in the second nu..

Run all SQL files in a directory

I have a number of .sql files which I have to run in order to apply changes made by other developers on an SQL Server 2005 database. The files are named according to the following pattern: 0001 - abc..

Eclipse interface icons very small on high resolution screen in Windows 8.1

The various icons and buttons in the Eclipse (Kepler) interface are very, very small on a laptop with a 3200x1800px screen. The red error decoration that appears to indicate errors on files is diffic..

Exclude property from type

I'd like to exclude a single property from the type. How can I do that? For example I have interface XYZ { x: number; y: number; z: number; } And I want to exclude property z to get type XY = {..

Append Char To String in C?

How do I append a single char to a string in C? i.e char* str = "blablabla"; char c = 'H'; str_append(str,c); /* blablablaH */ ..

Android RecyclerView addition & removal of items

I have a RecyclerView with an TextView text box and a cross button ImageView. I have a button outside of the recyclerview that makes the cross button ImageView visible / gone. I'm looking to remove a..

R apply function with multiple parameters

I have a function f(var1, var2) in R. Suppose we set var2 = 1 and now I want to apply the function f() to the list L. Basically I want to get a new list L* with the outputs [f(L[1],1),f(L[2],1),...,..

java.util.Date to XMLGregorianCalendar

Isn't there a convenient way of getting from a java.util.Date to a XMLGregorianCalendar?..

Fetching data from MySQL database using PHP, Displaying it in a form for editing

I'm a newbie to this and wrote the code below to fetch user data from a MySQL Database and display it in a form for editing and saving. Problem is, it does not work. Any help will be appreciated. <..

How do I install chkconfig on Ubuntu?

I am running Ubuntu 13.10, and I'm pretty new to Linux. I tried: $ sudo apt-get install chkconfig Package chkconfig is not available, but is referred to by another package. This may mean that..

How do I get the number of days between two dates in JavaScript?

How do I get the number of days between two dates in JavaScript? For example, given two dates in input boxes: <input id="first" value="1/1/2000"/> <input id="second" value="1/1/2001"/> &..

Ranges of floating point datatype in C?

I am reading a C book, talking about ranges of floating point, the author gave the table: Type Smallest Positive Value Largest value Precision ==== ======================= ============..

How can I extract all values from a dictionary in Python?

I have a dictionary d = {1:-0.3246, 2:-0.9185, 3:-3985, ...}. How do I extract all of the values of d into a list l?..

How to drop rows from pandas data frame that contains a particular string in a particular column?

I have a very large data frame in python and I want to drop all rows that have a particular string inside a particular column. For example, I want to drop all rows which have the string "XYZ" as a su..

Making a request to a RESTful API using python

I have a RESTful API that I have exposed using an implementation of Elasticsearch on an EC2 instance to index a corpus of content. I can query the search by running the following from my terminal (Mac..

What is the significance of #pragma marks? Why do we need #pragma marks?

What is the purpose of #pragma marks in Xcode? Does their location in .m files matter? Should some #pragma come before all others? Do they have to be present? Can new marks be added? Why would they..

C# Timer or Thread.Sleep

I am running a windows service and using a loop and Thread.Sleep to repeat a task, would it be better to use a timer method? If yes a code example would be great I am currently using this code to r..

auto run a bat script in windows 7 at login

I have recently acquired a windows 7 laptop from my late grandmother. I have been using it for work and other things. I decided to create a VM using VirtualBox And now I want to create a user on the (..

Gradle task - pass arguments to Java application

I have a Java application that runs with a custom gradle task and the application requires some arguments upon being invoked. These are: programName ( string | -f filename | -d key | -h) Options: ..

What do two question marks together mean in C#?

Ran across this line of code: FormsAuth = formsAuth ?? new FormsAuthenticationWrapper(); What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google...

How to ignore HTML element from tabindex?

Is there any way in HTML to tell the browser not to allow tab indexing on particular elements? On my page though there is a sideshow which is rendered with jQuery, when you tab through that, you get ..

Can't find how to use HttpContent

I am trying to use HttpContent: HttpContent myContent = HttpContent.Create(SOME_JSON); ...but I am not having any luck finding the DLL where it is defined. First, I tried adding references to Micr..

How to rename array keys in PHP?

When I var_dump on a variable called $tags (a multidimensional array) I get this: Array ( [0] => Array ( [name] => tabbing [url] => tabbing ) [1] => A..

How do I install an R package from source?

A friend sent me along this great tutorial on webscraping NYtimes with R. I would really love to try it. However, the first step is to installed a package called RJSONIO from source. I know R reasona..

Quick easy way to migrate SQLite3 to MySQL?

Anyone know a quick easy way to migrate a SQLite3 database to MySQL?..

"401 Unauthorized" on a directory

I assume this is an IIS error, as this doesn't happen if I run the project on my local machine. I have my stylesheets at ~/Content/css Any files in that directory won't load on the page, and when I na..

SQLDataReader Row Count

I am trying to get the number of rows that were returned by iterating the reader. But I always get 1 when I run this code? Did I screw up something in this? int count = 0; if (reader.HasRows) { w..

View not attached to window manager crash

I am using ACRA to report app crashes. I was getting a View not attached to window manager error message and thought I had fixed it by wrapping the pDialog.dismiss(); in an if statement: if (pDialog!..

How to add a downloaded .box file to Vagrant?

How do I add a downloaded .box file to Vagrant's list of available boxes? The .box file is located on an external drive. I tried running vagrant box add my-box d:/path/to/box, but Vagrant interprets ..

How can I declare a Boolean parameter in SQL statement?

How can I declare a Boolean parameter in SQL statement?..

Does Java have a path joining method?

Exact Duplicate: combine paths in java I would like to know if there is such a method in Java. Take this snippet as example : // this will output a/b System.out.println(path_join("a","b..

What is a NoReverseMatch error, and how do I fix it?

I have some code and when it executes, it throws a NoReverseMatch, saying: NoReverseMatch at /my_url/ Reverse for 'my_url_name' with arguments '()' and keyword arguments '{}' not found. n pattern(..

TypeError: $.browser is undefined

I am using msdropdown image combo box to create dropdown select options. when i run this code locally on my PC, everything works great. But when i run it on go daddy servers, the msdropdown becomes d..

c# search string in txt file

I want to find a string in a txt file if string compares, it should go on reading lines till another string which I'm using as parameter. Example: CustomerEN //search for this string ... some text whi..

Should ol/ul be inside <p> or outside?

Which is standard compliant between these two? <p>Text text text ... <ol> <li>First element</li> </ol> </p> <p> Other text text ... </..

Enable vertical scrolling on textarea

I have a textarea that I want to enable vertical scrolling. When I exceed the height of the textarea, it increases in size. The scroll bar does not appear. I want that a vertical scroll bar appears an..

Does bootstrap 4 have a built in horizontal divider?

Does bootstrap 4 have a built in horizontal divider? I can do this, <style type="text/css"> .h-divider{ margin-top:5px; margin-bottom:5px; height:1px; width:100%; border-top:1px solid gray..

JQuery get all elements by class name

in the process of learning javscript and jquery, went through pages of google but can't seem to get this working. Basically I'm trying to collect innerhtml of classes, jquery seems to be suggested tha..

Getting the text from a drop-down box

This gets the value of whatever is selected in my dropdown menu. document.getElementById('newSkill').value I cannot however find out what property to go after for the text that's currently displaye..

Get remote registry value

I have the below script that I want it to go out to multiple servers and get the value of a registry. Unfortunately it is currently just posting back the local registry value of the machine that I am ..

How to set component default props on React component

I use the code below to set default props on a React component but it doesn't work. In the render() method, I can see the output "undefined props" was printed on the browser console. How can I define ..

How to get a vCard (.vcf file) into Android contacts from website

I'm trying to add a vCard from a web link to the user's contact list on Android 2.2. When I direct the user to .vcf file, all I get is text output in the mobile browser. I have confirmed that the fi..

Difference between RegisterStartupScript and RegisterClientScriptBlock?

Is the only difference between the RegisterStartupScript and the RegisterClientScriptBlock is that RegisterStartupScript puts the javascript before the closing </form> tag of the page and Regist..

What is Options +FollowSymLinks?

I am using a Lamp server on my computer. I started to use Laravel php framework. In my .htaccess , If I use Options +FollowSymLinks , I get 500 error. And If I comment out , I have to use index.php ..

Saving images in Python at a very high quality

How can I save Python plots at very high quality? That is, when I keep zooming in on the object saved in a PDF file, why isn't there any blurring? Also, what would be the best mode to save it in? png,..

How to generate random positive and negative numbers in Java

I am trying to generate random integers over the range (-32768, 32767) of the primitive data type short. The java Random object only generates positive numbers. How would I go about randomly creating ..

How can I get relative path of the folders in my android project?

How can I get the relative path of the folders in my project using code? I've created a new folder in my project and I want its relative path so no matter where the app is, the path will be correct. ..

jQuery: How can I create a simple overlay?

How can I create a really basic overlay in jQuery without UI? What is a lightweight plugin?..

Difference between webdriver.get() and webdriver.navigate()

What is the difference between get() and navigate() methods? Does any of this or maybe another method waits for page content to load? What do I really need is something like Selenium 1.0's WaitForPage..

HashMap with multiple values under the same key

Is it possible for us to implement a HashMap with one key and two values. Just as HashMap? Please do help me, also by telling (if there is no way) any other way to implement the storage of three val..

npm install won't install devDependencies

On windows for some reason when I run npm install it won't install devDependencies. AFAIK it should. If I run npm install --dev devDependencies are installed. I don't understand why npm install doesn'..

Tooltip on image

I am using the tooltip. But I want that on image tag, like when I mouseover the image then the tooltip should work. I have tried but not working for me on image tag...

Export DataBase with MySQL Workbench with INSERT statements

I am trying to export the DataBase i have at MySQL Workbench but I am having troubles to generate the INSERT statements on the .sql file. I order to export the data, I do the reverse engineering for ..

How to pass object with NSNotificationCenter

I am trying to pass an object from my app delegate to a notification receiver in another class. I want to pass integer messageTotal. Right now I have: In Receiver: - (void) receiveTestNotification..

How to use css style in php

Im using php to display data from mysql. Here are my css statements: <style type=”text/css”> table { margin: 8px; } th { font-family: Arial, Helvetica, sans-serif; font-size: ...

How to parseInt in Angular.js

Probably, it is the simplest thing but I couldn't parse a string to Int in angular.. What I am trying to do: <input type="text" ng-model="num1"> <input type="text" ng-model="num2"> Tota..

How to create .ipa file using Xcode?

Please tell me the complete procedure to build my app & use it on a real iPhone...

How does one make random number between range for arc4random_uniform()?

so my goal in this codebit is to randomly roll two dice and as we all know your regular die only has 6 sides so I imported Foundation for access to arc4random_uniform(UInt32). I attempted using the ra..

How to call asynchronous method from synchronous method in C#?

I have a public async void Foo() method that I want to call from synchronous method. So far all I have seen from MSDN documentation is calling async methods via async methods, but my whole program is ..

Python multiprocessing PicklingError: Can't pickle <type 'function'>

I am sorry that I can't reproduce the error with a simpler example, and my code is too complicated to post. If I run the program in IPython shell instead of the regular Python, things work out well. ..

How to implement a binary search tree in Python?

This is what I've got so far but it is not working: class Node: rChild,lChild,data = None,None,None def __init__(self,key): self.rChild = None self.lChild = None self..

Changing API level Android Studio

I want to change the minimum SDK version in Android Studio from API 12 to API 14. I have tried changing it in the manifest file, i.e., <uses-sdk android:minSdkVersion="14" android:targetSd..

Cast Object to Generic Type for returning

Is there a way to cast an object to return value of a method? I tried this way but it gave a compile time exception in "instanceof" part: public static <T> T convertInstanceOfObject(Object o) {..

How does HTTP_USER_AGENT work?

Possible Duplicate: Why navigator.appCodeName returning Mozilla? When I get the PHP server variable HTTP_USER_AGENT with this code: <?php $useragent = $_SERVER ['HTTP_USER_AGENT']; ..

How to have comments in IntelliSense for function in Visual Studio?

In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box explaining what it does. How can I have that for functions and properties I write?..

What is difference between XML Schema and DTD?

I have googled this question, but I do not understand clearly what is an XML schema and DTD (document type definition), and why the XML schema is more powerful compared to DTD. Any guidance would be..

"Rate This App"-link in Google Play store app on the phone

I'd like to put a "Rate This App"-link in an Android App to open up the app-listing in the user's Google Play store app on their phone. What code do I have to write to create the market:// or http:/..

Using command line arguments in VBscript

How can I pass and access command line arguments in VBscript?..

How to insert a new line in strings in Android

This may seem like a stupid question, but I've been searching and can't find an answer. I'm creating an android application and within it there is a button that will send some information in an email..

MVC4 StyleBundle not resolving images

My question is similar to this: ASP.NET MVC 4 Minification & Background Images Except that I want to stick with MVC's own bundling if I can. I'm having a brain crash trying to figure out wha..

Python DNS module import error

I have been using python dns module.I was trying to use it on a new Linux installation but the module is not getting loaded. I have tried to clean up and install but the installation does not seem to ..

web-api POST body object always null

I'm still learning web API, so pardon me if my question sounds stupid. I have this in my StudentController: public HttpResponseMessage PostStudent([FromBody]Models.Student student) { if (DBManag..

Git: See my last commit

I just want to see the files that were committed in the last commit exactly as I saw the list when I did git commit. Unfortunately searching for git "last commit" log in Google gets me nowhere. And..

JPA COUNT with composite primary key query not working

In my db, I have a table (Defaults), and when I generate an entity from table, I get these two classes: @Entity public class Defaults implements Serializable { private static final long serialVer..

Send mail via Gmail with PowerShell V2's Send-MailMessage

I'm trying to figure out how to use PowerShell V2's Send-MailMessage with Gmail. Here's what I have so far. $ss = New-Object Security.SecureString foreach ($ch in "password".ToCharArray()) { $ss..

Read .doc file with python

I got a test for job application, my deal is read some .doc files. Does anyone know a library to do this? I had started with a raw python code: f = open('test.doc', 'r') f.read() but this does not ..

Vuejs: v-model array in multiple input

I have an input text field with a v-model attached, and every time someone hits the "Add" button, another input text get added to the DOM with the same v-model attached. I thought I'd then get an arra..

Handle Button click inside a row in RecyclerView

I am using following code for handling row clicks. (source) static class RecyclerTouchListener implements RecyclerView.OnItemTouchListener { private GestureDetector gestureDetector; private ..

Create a .txt file if doesn't exist, and if it does append a new line

I would like to create a .txt file and write to it, and if the file already exists I just want to append some more lines: string path = @"E:\AppServ\Example.txt"; if (!File.Exists(path)) { File.C..

Return string Input with parse.string

I'm having an issue with a java program trying to get a string input from a joptionpane menu with a prompt box. With returning a string input. I don't know if im going about it all wrong by trying to..

How to count items in JSON object using command line?

I'm getting this kind of JSON reply from a curl command: [ { "cid": 49, "pyn": "yi4", "hans": "?", "hant": "?", "tid": 68, "l10n": "cent million", "pid": 1, "pos": "..

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102

I am receiving the error of SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102 in comments.php below: <?php /** * Class to handle ar..

How can I execute a python script from an html button?

I have a number of python scripts that I have saved on my computer, out of curiosity I have created a html file that just has one button. Instead on going into the terminal and running python <path..

Redirecting to a page after submitting form in HTML

I'm fairly new to coding in HTML. After hours of searching the internet for a way to do this, I failed and so I'm here. I was setting up a CSRF Proof of concept page here, I want it to redirect to ano..

Add Whatsapp function to website, like sms, tel

I have a website that a lot of people view on mobile. I have link for : Call and SMS and I want to add one for Whatsapp, so a user can click the whatsapp link I create and start a conversation with me..

Why are my PowerShell scripts not running?

I wrote a simple batch file as a PowerShell script, and I am getting errors when they run. It's in a scripts directory in my path. This is the error I get: Cannot be loaded because the execution ..

How to automatically generate unique id in SQL like UID12345678?

I want to automatically generate unique id with per-defined code attach to it. ex: UID12345678 CUSID5000 I tried uniqueidentifier data type but it generate a id which is not suitable for a user ..

Calling a method every x minutes

I want to call some method on every 5 minutes. How can I do this? public class Program { static void Main(string[] args) { Console.WriteLine("*** calling MyMethod *** "); Cons..

How to push both value and key into PHP array

Take a look at this code: $GET = array(); $key = 'one=1'; $rule = explode('=', $key); /* array_push($GET, $rule[0] => $rule[1]); */ I'm looking for something like this so that: print_r($GET..

Label word wrapping

Is there a way to do a word wrap in a .NET label control? I know there is an alternate way of using a TextBox, make property BorderStyle to none, property ReadOnly to true and set property WordWrap a..

Undefined Symbols for architecture x86_64: Compiling problems

So I am trying to start an assignment, my professor gives us a Main.cpp, Main.h, Scanner.cpp, Scanner.h, and some other utilities. My job is to create a Similarity class to compare documents using th..

How to show Page Loading div until the page has finished loading?

I have a section on our website that loads quite slowly as it's doing some intensive calls. Any idea how I can get a div to say something similar to "loading" to show while the page prepares..

Button inside of anchor link works in Firefox but not in Internet Explorer?

Everything else in my site seems to be compatible with all browsers except for my links. They appear on the page, but they do not work. My code for the links are as follows- <td bgcolor="#ffff..

Force div element to stay in same place, when page is scrolled

I created a div element, that I placed all the way on the right of my site. The only problem is that its at the top of the site, so if i scroll down it remains there. How can I force it to remain in ..

Reduce size of legend area in barplot

I can't reduce the size of the legend in this plot. Could someone help me out? I want it to appear topright, but with no more than 20% of the height of plot area a <- c(3, 2, 2, 2, 1, 2 ) barplot(..

Getting TypeError: __init__() missing 1 required positional argument: 'on_delete' when trying to add parent table after child table with entries

I have two classes in my sqlite database, a parent table named Categorie and the child table called Article. I created first the child table class and addes entries. So first I had this: class Articl..

What's the difference between passing by reference vs. passing by value?

What is the difference between a parameter passed by reference a parameter passed by value? Could you give me some examples, please?..

How to execute multiple SQL statements from java

I want to execute the multiple queries or job in one execute. Something like this eg: String query="select * from tab1;insert into tab1 values(...);update tab1..;delete from tab1...;" Statement st =..

WPF Datagrid Get Selected Cell Value

I want to get value for selected cell in datagrid , please anyone tell how to do this. i used SelectedCell changed event , how can i do that? dataGrid1.CurrentCell ..

'heroku' does not appear to be a git repository

When I try to push my app to Heroku I get this response: fatal: 'heroku' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct ac..

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 ..

Kill a postgresql session/connection

How can I kill all my postgresql connections? I'm trying a rake db:drop but I get: ERROR: database "database_name" is being accessed by other users DETAIL: There are 1 other session(s) using the d..

Flutter - Wrap text on overflow, like insert ellipsis or fade

I'm trying to create a line in which center text has a maximum size, and if the text content is too large, it fits in size. I insert the TextOverflow.ellipsis property to shorten the text and inserti..

How to find all tables that have foreign keys that reference particular table.column and have values for those foreign keys?

I have a table whose primary key is referenced in several other tables as a foreign key. For example: CREATE TABLE `X` ( `X_id` int NOT NULL auto_increment, `name` varchar(255) NOT NULL, ..

Can I restore a single table from a full mysql mysqldump file?

I have a mysqldump backup of my mysql database consisting of all of our tables which is about 440 megs. I want to restore the contents of just one of the tables from the mysqldump. Is this possible? T..

How do malloc() and free() work?

I want to know how malloc and free work. int main() { unsigned char *p = (unsigned char*)malloc(4*sizeof(unsigned char)); memset(p,0,4); strcpy((char*)p,"abcdabcd"); // **deliberately sto..

Max parallel http connections in a browser?

I am creating some suspended connections to an HTTP server (comet, reverse ajax, etc). It works ok, but I see the browser only allows two suspended connections to a given domain simultaneously. So if ..

How can you float: right in React Native?

I have an element that I want to float right, for example <View style={{width: 300}}> <Text style={{backgroundColor: "#DDD"}}>Hello</Text> </View> How can the Text be floa..

Is it possible to import modules from all files in a directory, using a wildcard?

With ES6, I can import several exports from a file like this: import {ThingA, ThingB, ThingC} from 'lib/things'; However, I like the organization of having one module per file. I end up with import..

What is the most efficient way to create HTML elements using jQuery?

Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery. The method that I used to create the new elements on the page has overwhelmingly been along the lines of: ..

Redis: Show database size/size for keys

My redis instance seems to being growing very large and I'd like to find out which of the multiple databases I have in there consumes how much memory. Redis' INFO command just shows me the total size ..

Java 8 Stream API to find Unique Object matching a property value

Find the object matching with a Property value from a Collection using Java 8 Stream. List<Person> objects = new ArrayList<>(); Person attributes -> Name, Phone, Email. Iterate throu..

Determining image file size + dimensions via Javascript?

As part of a web app, once images have been downloaded and rendered on a web page, I need to determine an image's file size (kb) and resolution within the browser context (so I could, for example, dis..

Execution failed for task :':app:mergeDebugResources'. Android Studio

I've just installed android studio and there's an error I don't know how to fix ..

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

I've jared my latest classes up and included it in my WEB-INF/lib directory and since then I've been getting this error and cannot run my project. I have tried adding the commons jar into my project ..

How can I check Drupal log files?

How can I check Drupal log files? I'm using Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL and Drupal 7...

Change UITableView height dynamically

I want to change the height of my tableview from another viewcontroller based on the sum of its cells' heights, as they are dynamic. Is it at all possible? Thanks Add-on: What I basically have is a ..

Purge or recreate a Ruby on Rails database

I have a dev Ruby on Rails database full of data. I want to delete everything and rebuild the database. I'm thinking of using something like: rake db:recreate Is this possible?..

Printing Lists as Tabular Data

I am quite new to Python and I am now struggling with formatting my data nicely for printed output. I have one list that is used for two headings, and a matrix that should be the contents of the tabl..

The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

I am deploying a desktop application to my clients that uses the Crystal Reports API to display and print forms. I am building my installer using InstallShield 2012. I have also included the .NET 4.0 ..

React img tag issue with url and class

I have the following simple react code in my JSX file: /** @jsx React.DOM */ var Hello = React.createClass({ render: function() { return <div><img src='http://placehold.it/400x2..

How to resize an image with OpenCV2.0 and Python2.6

I want to use OpenCV2.0 and Python2.6 to show resized images. I used and adopted this example but unfortunately, this code is for OpenCV2.1 and does not seem to be working on 2.0. Here my code: import..

How to make method call another one in classes?

Now I have two classes allmethods.cs and caller.cs. I have some methods in class allmethods.cs. I want to write code in caller.cs in order to call a certain method in the allmethods class. Example o..

how to download file in react js

I receive file url as response from api. when user clicks on download button, the file should be downloaded without opening file preview in a new tab. How to achieve this in react js? ..

Git stash pop- needs merge, unable to refresh index

I can't pop my stash because I merged a branch which apparently conflicts with my stash and now my stash is seemingly unable to be popped. app.coffee: needs merge unable to refresh index Anyone kno..

Removing duplicates from a String in Java

I am trying to iterate through a string in order to remove the duplicates characters. For example the String aabbccdef should become abcdef and the String abcdabcd should become abcd Here is what I ..

Eclipse executable launcher error: Unable to locate companion shared library

I had Eclipse Indigo installed on my computer with the Android plugin and it was working perfectly for about two weeks. Today, I updated java and quicktime then restarted my computer. When it booted b..

How to get just the date part of getdate()?

I have a SQL table that has a CreationDate field. I have getdate() in the computed column specification formula. I would like to know how to get just the date portion, that is, '2012-08-24' instead ..

Regular Expressions: Is there an AND operator?

Obviously, you can use the | (pipe?) to represent OR, but is there a way to represent AND as well? Specifically, I'd like to match paragraphs of text that contain ALL of a certain phrase, but in no p..

Multiple scenarios @RequestMapping produces JSON/XML together with Accept or ResponseEntity

I am working with Spring 4.0.7 About Spring MVC, for research purposes, I have the following: @RequestMapping(value="/getjsonperson", method=RequestMethod.GET, pro..

Select2() is not a function

So i have downloaded select2 i have "installed it" by putting it into my folder and then loaded it on my site when i check the console (where i can see all of the scripts being loaded) i can see the f..

How does inline Javascript (in HTML) work?

I know this is bad practice. Don't write code like this if at all possible. Of course, we'll always find ourselves in situations where a clever snippet of inline Javascript can address an issue quic..

LDAP filter for blank (empty) attribute

I have searched on this topic, but all I find are filters that return entries where a certain attribute is not present, like: (!(manager=*)) However, I want to find entries where the attribute is p..

Set width of a "Position: fixed" div relative to parent div

I'm trying to give a div (position: fixed) the width of 100% (relating to it's parent div). But I've got some problems... EDIT: The first problem is sovled by using inherit, but it still doesn't work..

CSS3 Continuous Rotate Animation (Just like a loading sundial)

I am trying to replicate an Apple style activity indicator (sundial loading icon) by using a PNG and CSS3 animation. I have the image rotating and doing it continuously, but there seems to be a delay ..

Powershell send-mailmessage - email to multiple recipients

I have this powershell script to sending emails with attachments, but when I add multiple recipients, only the first one gets the message. I've read the documentation and still can't figure it out. Th..

C#: what is the easiest way to subtract time?

I'm trying to put together a tool that will help me make work schedules. What is the easiest way to solve the following? 8:00am + 5 hours = 1:00pm and 5:00pm - 2 hours = 3:00pm and 5:30pm - :45 ..

Permutation of array

For example I have this array: int a[] = new int[]{3,4,6,2,1}; I need list of all permutations such that if one is like this, {3,2,1,4,6}, others must not be the same. I know that if the length of..

Compiler warning - suggest parentheses around assignment used as truth value

When I try to compile the piece of code below, I get this warning: warning: suggest parentheses around assignment used as truth value Why does this happen? This is a rather common idiom, I believe. ..

Laravel 4: how to run a raw SQL?

I want to rename a table in Laravel 4, but don't know how to do that. The SQL is alter table photos rename to images. If there is an Eloquent solution, I'd also like to know how to run a raw SQL, cau..

Hive load CSV with commas in quoted fields

I am trying to load a CSV file into a Hive table like so: CREATE TABLE mytable ( num1 INT, text1 STRING, num2 INT, text2 STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; LOAD DATA LOCAL INPAT..

Initializing entire 2D array with one value

With the following declaration int array[ROW][COLUMN]={0}; I get the array with all zeroes but with the following one int array[ROW][COLUMN]={1}; I don’t get the array with all one value. The..

How to write the Fibonacci Sequence?

I had originally coded the program wrongly. Instead of returning the Fibonacci numbers between a range (ie. startNumber 1, endNumber 20 should = only those numbers between 1 & 20), I have written ..

SOAP client in .NET - references or examples?

Background: I am creating a webservices site which will provide many types of simple services over SOAP and possibly other protocols too. The goal is to make it easy to do for example conversions, RS..

Why Visual Studio 2015 can't run exe file (ucrtbased.dll)?

I have installed the Visual Studio 2015 and created Win32 project with some code. I compiled it successfully, but I can't launch exe file, because I don't have some ucrtbased.dll...So how can I solve ..

Convert R vector to string vector of 1 element

Im working with the programming language R now. I have a vector: a <- c("aa", "bb", "cc") And I want to paste these to a system command, I'm trying it this way now: args <- paste(a, sep=" ")..

How to fix "Headers already sent" error in PHP

When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 2..

$(...).datepicker is not a function - JQuery - Bootstrap

I'm trying to include the datepicker for Bootstrap but am getting the following error: Uncaught TypeError: $(...).datepicker is not a function I don't see why it's there. I've looked at other cases ..

What's the best mock framework for Java?

What's the best framework for creating mock objects in Java? Why? What are the pros and cons of each framework?..

Alternative to Intersect in MySQL

I need to implement the following query in MySQL. (select * from emovis_reporting where (id=3 and cut_name= '?????' and cut_name='??') ) intersect ( select * from emovis_reporting where (id=3) and (..

Why is a primary-foreign key relation required when we can join without it?

If we can get data from two tables without having primary and foreign key relation, then why we need this rule? Can you please explain me clearly, with suitable example? It's a test database, don't mi..

How to replace special characters in a string?

I have a string with lots of special characters. I want to remove all those, but keep alphabetical characters. How can I do this?..

Get selected row item in DataGrid WPF

I have a DataGrid, bound to Database table, I need to get the content of selected row in DataGrid, for example, I want to show in MessageBox content of selected row. Example of DataGrid: So, if I ..

How do you declare an object array in Java?

Possible Duplicate: How to declare an array in Java? Suppose I have an object car (class vehicle) and I want to create an array of N number of cars . How do I declare that in Java? vehic..

Referencing system.management.automation.dll in Visual Studio

I am beginning to look into the PowerShell model and snap-in development. The first thing I notice is to reference System.management.automation.dll. However in Visual Studio, the .NET tab does not hav..

How do I prevent an Android device from going to sleep programmatically?

How do I prevent an Android device from going to sleep programmatically?..

How to get my Android device Internal Download Folder path

It is possible to get the Android device Internal Download Folder path?..

How to remove all ListBox items?

I created two RadioButton (Weight and Height). I will do switch between the two categories. But the they share the same ListBox Controllers (listBox1 and listBox2). Is there any good method to clear ..

How do I create a pause/wait function using Qt?

I'm playing around with Qt, and I want to create a simple pause between two commands. However it won't seem to let me use Sleep(int mili);, and I can't find any obvious wait functions. I am basically..

How to find text in a column and saving the row number where it is first found - Excel VBA

I have the following column (column A) named project (rows column is just displaying the row number): rows project 1 14 2 15 3 16 4 17 5 18 6 19 7 ProjTem..

List of Java processes

How can I list all Java processes in bash? I need an command line. I know there is command ps but I don't know what parameters I need to use...

Uninitialized Constant MessagesController

I'm building a simple chat app based on this rails cast. I'm following along fine, but when I go to localhost, I get an error "uninitialized constant MessagesController::Message". This is generally a ..

Searching for file in directories recursively

I have the following code to recursively search for files through a directory, which returns a list of all xml files to me. All works well, except that xml files in the root directory are not include..

In SQL Server, how do I generate a CREATE TABLE statement for a given table?

I've spent a good amount of time coming up with solution to this problem, so in the spirit of this post, I'm posting it here, since I think it might be useful to others. If anyone has a better scrip..

Page redirect with successful Ajax request

I have a form that uses Ajax for client-side verification. The end of the form is the following: $.ajax({ url: 'mail3.php', type: 'POST', data: 'contactName=' + name + '&c..

How do you know a variable type in java?

Let's say I declare a variable: String a = "test"; And I want to know what type it is, i.e., the output should be java.lang.String How do I do this?..

PHP Regex to get youtube video ID?

Can someone show me how to get the youtube id out of a url regardless of what other GET variables are in the URL. Use this video for example: http://www.youtube.com/watch?v=C4kxS1ksqtw&feature=re..

PHP removing a character in a string

My php is weak and I'm trying to change this string: http://www.example.com/backend.php?/c=crud&m=index&t=care ^ to be: http://www.example.com/backend.ph..

java.lang.NoClassDefFoundError:failed resolution of :Lorg/apache/http/ProtocolVersion

I'm encountering this error when I use Android Studio to build my app. The APK is compiled, but when I attempt to run the app on Android P emulator, it will crash and throw the following error. Please..

nginx error "conflicting server name" ignored

server { #listen 80; ## listen for ipv4; this line is default and implied #listen [::]:80 default ipv6only=on; ## listen for ipv6 #root /usr/share/nginx/www; root /home/ubuntu/node-l..

Cannot read property 'addEventListener' of null

I have to use vanilla JavaScript for a project. I have a few functions, one of which is a button that opens a menu. It works on pages where the target id exists, but causes an error on pages where t..

How can I increase the JVM memory?

HI, I like to know can I increase the memory of the JVM depending on my application.If yes how can I increase the JVM memory? And how can I know the size of JVM?..

MySQL load NULL values from CSV data

I have a file that can contain from 3 to 4 columns of numerical values which are separated by comma. Empty fields are defined with the exception when they are at the end of the row: 1,2,3,4,5 1,2,3,,..

Angular (4, 5, 6, 7) - Simple example of slide in out animation on ngIf

What is the bare minimum and Angular4's native way to slide in and slide out a container element? e.g. <div ngIf="show"> <!-- Content --> </div> Slide In Content (from top to..

Laravel 5: Retrieve JSON array from $request

I'm a Laravel newbie and I'm converting a php/jquery app to Laravel. The original code used a JSON array with an ajax POST, which was retrieved like this: $json = file_get_contents('php://input'); $d..

Maximum filename length in NTFS (Windows XP and Windows Vista)?

I'm designing a database table which will hold filenames of uploaded files. What is the maximum length of a filename in NTFS as used by Windows XP or Vista?..

Tomcat 8 Maven Plugin for Java 8

Is the tomcat7-maven-plugin working with a tomcat 8 server and java 8? I can't find any tomcat8-maven-plugin. ..

Delete directory with files in it?

I wonder, what's the easiest way to delete a directory with all its files in it? I'm using rmdir(PATH . '/' . $value); to delete a folder, however, if there are files inside of it, I simply can't del..

How to add a custom HTTP header to every WCF call?

I have a WCF service that is hosted in a Windows Service. Clients that using this service must pass an identifier every time they're calling service methods (because that identifier is important for w..

How to run or debug php on Visual Studio Code (VSCode)

I can't find a way to run or debug php on Visual studio code, Does anyone know how?..

How to set a bitmap from resource

This seems simple, I am trying to set a bitmap image but from the resources, I have within the application in the drawable folder. bm = BitmapFactory.decodeResource(null, R.id.image); Is this corre..

The character encoding of the plain text document was not declared - mootool script

I just noticed that there is a warning message pops up when I view my mootool.js script on FireFox browser. The warning message is "The character encoding of the plain text document was not declared..

Passing a 2D array to a C++ function

I have a function which I want to take, as a parameter, a 2D array of variable size. So far I have this: void myFunction(double** myArray){ myArray[x][y] = 5; etc... } And I have decla..

How to sort an array of associative arrays by value of a given key in PHP?

Given this array: $inventory = array( array("type"=>"fruit", "price"=>3.50), array("type"=>"milk", "price"=>2.90), array("type"=>"pork", "price"=>5.43), ); I would like..

Include php files when they are in different folders

Most of my website is in my root directory. And In that directory there is "css", "functions", "images" folder. Everything works fine when I include php files within index.php or any other root file. ..

Read the package name of an Android APK

I need to get the package name of an Android APK. I have tried to unzip the APK and read contents of AndroidManifest.xml, but seems it's not a text file. How can I extract the APK's package name?..

What is the JavaScript equivalent of var_dump or print_r in PHP?

I would like to see the structure of object in JavaScript (for debugging). Is there anything similar to var_dump in PHP?..

How to use XMLReader in PHP?

I have the following XML file, the file is rather large and i haven't been able to get simplexml to open and read the file so i'm trying XMLReader with no success in php <?xml version="1.0" encodi..

How to convert date format to milliseconds?

How to get the millisecond time from date? I have the following code. Date beginupd = new Date(cursor1.getLong(1)); This variable beginupd contains the format Wed Oct 12 11:55:03 GMT+05:30 20..

Detecting locked tables (locked by LOCK TABLE)

Is there a way to detect locked tables in MySQL? I mean tables locked by the LOCK TABLE table WRITE/READ command. (Note that readers interested in detecting named locks acquired with GET_LOCK should ..

ADB not responding. You can wait more,or kill "adb.exe" process manually and click 'Restart'

I have installed Android Studio. Then I have updated the Android SDK. Now when I start Android Studio, this message pops up: ADB not responding. You can wait more,or kill "adb.exe" process manuall..

Changing the git user inside Visual Studio Code

The user for my git commits has changed, but I am not able to change that inside of Visual Studio Code. I changed the global settings in git, but when I want to push or sync via Visual Studio Code in..

HTML5 Video Stop onClose

I'm using jQuery tools for an overlay. Inside the overlay I have an HTML5 video. However, when I close the overlay, the video keeps playing. Any idea how I might get the video to stop when I close the..

AWS ssh access 'Permission denied (publickey)' issue

How to connect to a AWS instance through ssh? I have: Signed up at AWS; Created a public key and a certificate at AWS website and saved them to disk; Went to my console and created environment vari..

LINQ-to-SQL vs stored procedures?

I took a look at the "Beginner's Guide to LINQ" post here on StackOverflow (Beginners Guide to LINQ), but had a follow-up question: We're about to ramp up a new project where nearly all of our databa..

A potentially dangerous Request.Path value was detected from the client (*)

I am receiving the rather self explanatory error: A potentially dangerous Request.Path value was detected from the client (*). The issue is due to * in the request URL: https://stackoverflow.co..

Execute a large SQL script (with GO commands)

I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program. These statements need to be separated by GO statements, but SqlComm..

How to insert a large block of HTML in JavaScript?

If I have a block of HTML with many tags, how do insert it in JavaScript? var div = document.createElement('div'); div.setAttribute('class', 'post block bc2'); div.innerHTML = 'HERE TOO MUCH HTML tha..

ORA-12560: TNS:protocol adaptor error

I Google[d] for this error ORA-12560: TNS:protocol adaptor error but not able to find the actual reason and how to solve this error ? Can anyone tell me a perfect solution to solve login problem...