Questions Tagged with #Sharepoint

For SharePoint-specific questions, please see the SharePoint Stack Exchange ( site. Use this tag for programming questions which may involve SharePoint. Microsoft SharePoint is a platform and a family of software products developed by Microsoft for collaboration and web publishing.

Reasons for a 409/Conflict HTTP error when uploading a file to sharepoint using a .NET WebRequest?

I've got a method that uses a WebRequest to upload a file to a sharepoint 2010 list/folder, using a PUT request, with the Overwrite Header set to T (overwrite). When several files are uploaded (metho..

How do I solve this error, "error while trying to deserialize parameter"

I have a web service that is working fine in one environment but not in another. The web service gets document meta data from SharePoint, it running on a server where I cant debug but with logging I ..

Bypass invalid SSL certificate errors when calling web services in .Net

We are setting up a new SharePoint for which we don't have a valid SSL certificate yet. I would like to call the Lists web service on it to retrieve some meta data about the setup. However, when I try..

Could not load file or assembly '' or one of its dependencies

Any help please? I have only one library and it is driving me crazy. this is the error that I receive. I am not using any other dependancies. Could not load file or assembly 'FOD.Intranet.Lib, Versi..

How to pass credentials to httpwebrequest for accessing SharePoint Library

I'm trying to read files from a SharePoint document library using HttpWebRequest. In order to do that I have to pass some credentials. I'm using the below request: HttpWebRequest request = (HttpWeb..

Best way to resolve file path too long exception

I created a app that downloads all document libraries in a SP Site , but at one point it giving me this error (I tried looking at google but couldn;t find anything, now if anyone knows any trick to so..

Powershell Error "The term 'Get-SPWeb' is not recognized as the name of a cmdlet, function..."

I just typed the follow to try and get my SharePoint site: $spWeb = Get-SPWeb -Identity "http://nycs00058260/sites/usitp" It gave me the following error The term 'Get-SPWeb' is not recognized a..

SharePoint : How can I programmatically add items to a custom list instance

I am really looking for either a small code snippet, or a good tutorial on the subject. I have a C# console app that I will use to somehow add list items to my custom list. I have created a custom c..

The HTTP request is unauthorized with client authentication scheme 'Ntlm' The authentication header received from the server was 'NTLM'

I know there's a lot of questions on SO similar to this, but I couldn't find one for this particular issue. A couple of points, first: I have no control over our Sharepoint server. I cannot tweak any..

How to edit default.aspx on SharePoint site without SharePoint Designer

On several occations, I have faced the situation that the default.aspx page on a Site doesn't work. More specifically, a reference to a WebPart and/or Control is throwing a error because the assembly ..

Sharepoint: How do I filter a document library view to show the contents of a subfolder?

A number of business areas I work with use a folder structure to organise their Sharepoint housed documents (not ideal I know, but we're stuck with it). I would like to use a web part page to prese..

How do you upload a file to a document library in sharepoint?

How do you programmatically upload a file to a document library in sharepoint? I am currently making a Windows application using C# that will add documents to a document library list...

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?..

CAML query with nested ANDs and ORs for multiple fields

I am working on proof-of-concept code to dynamically generate CAML based on keywords provided to a highly-specific search web service that I am writing. I am not using the SharePoint-provided search w..

How to open SharePoint files in Chrome/Firefox

In Internet Explorer, I can open Sharepoint files directly from their links so the file in Sharepoint is automatically updated when I save it. But in Chrome, it asks to download the file instead of ju..

Is it possible to create a 'link to a folder' in a SharePoint document library?

Is it possible to create a shortcut to a folder in a different document library in a document library?..

Get the content of a sharepoint folder with Excel VBA

Usually I use this piece of code to retrieve the content of a folder in VBA. But this doesn't work in the case of a sharepoint. How can I do ? Dim folder As folder Dim f As File Dim fs As New FileSys..

SharePoint 2013 get current user using JavaScript

How to get current user name using JavaScript in Script Editor web part?..

Filtering Sharepoint Lists on a "Now" or "Today"

I'm trying to find an effective method of filtering Sharepoint lists based on the age of an item. In other words, if I want to find list items that are 7 days old, I should be able to build a filtere..

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

How can you have SharePoint Link Lists default to opening in a new window?

In SharePoint, it is easy to set up a List webpart consisting of Links to other documents, folders, sites, etc. Unfortunately, when clicking these links, the default behavior is for the page to open ..

How Can I Bypass the X-Frame-Options: SAMEORIGIN HTTP Header?

I am developing a web page that needs to display, in an iframe, a report served by another company's SharePoint server. They are fine with this. The page we're trying to render in the iframe is givi..

Where is the default log location for SharePoint/MOSS?

I found the answer after digging and thought I'd store it here. C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS.. page without a code behind

I have an ASP.Net page with a C# code behind. However, I've been asked to not use a code behind - so that it will be easier to deploy in SharePoint. Is there a way to include the C# code in the ASP..

Can two or more people edit an Excel document at the same time?

I have a SharePoint 2010 site with a document library for storing Excel files. If someone is editing an Excel file (using stand-alone Excel, not Excel services), everyone else will be forced to open ..

Error :The remote server returned an error: (401) Unauthorized

I want get picture of internet and insert into word . I use this code . MainDocumentPart mainPart = wordprocessingDocument.MainDocumentPart; System.Net.WebRequest request = System.Net.HttpWebRe..

Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.

I have used xuggle library in my project to trans code the video from mp4 to flv. I have used slf4j libraries also to support logging end. import com.xuggle.mediatool.IMediaReader; import com.xuggle...

How to use a table type in a SELECT FROM statement?

This question is more or less the same as this In the package header : Declared the following row type: TYPE exch_row IS RECORD( currency_cd VARCHAR2(9), exch_rt_eur NUMBER, exch_rt_us..

Unable to install pyodbc on Linux

I am running Linux ( and trying to install pyodbc. I am doing pip install pyodbc and get a very long list of errors, which end in error: command 'gcc' failed with..

How to write error log or exception into file in java

Is there any way to write error log or exception into a file in java. i have gone through Log4j. I googled about it but diidnt find a good solution. I have written a simple code catch (Exception e) ..

How to set a Postgresql default value datestamp like 'YYYYMM'?

As title, how can I set a table's column to have the default value the current year and month, in format 'YYYYMM', like 200905 for today?..

Java error: Implicit super constructor is undefined for default constructor

I have a some simple Java code that looks similar to this in its structure: abstract public class BaseClass { String someString; public BaseClass(String someString) { this.someString ..

Difference in Months between two dates in JavaScript

How would I work out the difference for two Date() objects in JavaScript, while only return the number of months in the difference? Any help would be great :)..

Android Material Design Button Styles

I'm confused on button styles for material design. I'd like to get colorful raised buttons like in the attached link., like the "force stop" and "uninstall" buttons seen under the usage section. Are t..

In JPA 2, using a CriteriaQuery, how to count results

I am rather new to JPA 2 and it's CriteriaBuilder / CriteriaQuery API: CriteriaQuery javadoc CriteriaQuery in the Java EE 6 tutorial I would like to count the results of a CriteriaQuery without act..

Trim string in JavaScript?

How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and the end of the string in JavaScript?..

Serialize object to query string in JavaScript/jQuery

I'm trying to find information on how to serialize an object to query string format, but all my searches are drowning in results on how to go the other way (string/form/whatever to JSON). I have { o..

REST API 404: Bad URI, or Missing Resource?

I'm building a REST API, but I've encountered a problem. It seems that accepted practice in designing a REST API is that if the resource requested doesn't exist, a 404 is returned. However, to me, t..

T-SQL: Looping through an array of known values

Here's my scenario: Let's say I have a stored procedure in which I need to call another stored procedure on a set of specific ids; is there a way to do this? i.e. instead of needing to do this: exe..

Git on Bitbucket: Always asked for password, even after uploading my public SSH key

I uploaded my ~/.ssh/ to Bitbucket's SSH keys as explained, but Git still asks me for my password at every operation (such as git pull). Did I miss something? It is a private repository (fo..

MySQL Error: #1142 - SELECT command denied to user

I'm having troubles with a certain query on one of my servers. On all other places I've tested it it works completely fine but on the server i want to use it it isn't working. It's about the followin..

Send File Attachment from Form Using phpMailer and PHP

I have a form on that looks like this (simplified): <form method="post" action="process.php" enctype="multipart/form-data"> <input type="file" name="uploaded_fil..

ASP.NET MVC - Set custom IIdentity or IPrincipal

I need to do something fairly simple: in my ASP.NET MVC application, I want to set a custom IIdentity / IPrincipal. Whichever is easier / more suitable. I want to extend the default so that I can call..

How to get a pixel's x,y coordinate color from an image?

Is there any way to check if a selected(x,y) point of a PNG image is transparent?..

What is the difference between a .cpp file and a .h file?

Because I've made .cpp files then transfered them into .h files, the only difference I can find is that you can't #include .cpp files. Is there any difference that I am missing?..

Angularjs $http.get().then and binding to a list

I have a list that looks like this: <li ng-repeat="document in DisplayDocuments()" ng-class="IsFiltered(document.Filtered)"> <span><input type="checkbox" name="docChecked" id="doc..

Stack smashing detected

I am executing my a.out file. After execution the program runs for some time then exits with the message: **** stack smashing detected ***: ./a.out terminated* *======= Backtrace: =========* */lib/tl..

IIS Request Timeout on long ASP.NET operation

I am experiencing a request timeout from IIS when I run a long operation. Behind the scene my ASP.NET application is processing data, but the number of records being processed is large, and thus the o..

ASP.NET / C#: DropDownList SelectedIndexChanged in server control not firing

I'm creating a server control that basically binds two dropdown lists, one for country and one for state, and updates the state dropdown on the country's selectedindexchanged event. However, it's not ..

What is the difference between absolute and relative xpaths? Which is preferred in Selenium automation testing?

What is the difference between absolute and relative xpaths? Which is preferred in Selenium automation testing? I am preparing test scripts using Selenium and Robot framework...

Delete all duplicate rows Excel vba

I have a worksheet with two columns: Date and Name. I want to delete all rows that are exact duplicates, leaving only unique values. Here is my code (which doesn't work): Sub DeleteRows() Dim rng A..

Split string with multiple delimiters in Python

I found some answers online, but I have no experience with regular expressions, which I believe is what is needed here. I have a string that needs to be split by either a ';' or ', ' That is, it has ..

Post order traversal of binary tree without recursion

What is the algorithm for doing a post order traversal of a binary tree WITHOUT using recursion?..

How do I download and save a file locally on iOS using objective C?

I'm new to Objective-C and I want to download a file from the web (if it was changed on the webserver) and save it locally so it can be used by my application. Mainly I want to implement what wget --..

SQL Logic Operator Precedence: And and Or

Are the two statements below equivalent? SELECT [...] FROM [...] WHERE some_col in (1,2,3,4,5) AND some_other_expr and SELECT [...] FROM [...] WHERE some_col in (1,2,3) or some_col in (4,5) AND so..

What is the best way to seed a database in Rails?

I have a rake task that populates some initial data in my rails app. For example, countries, states, mobile carriers, etc. The way I have it set up now, is I have a bunch of create statements in fil..

How do I check my gcc C++ compiler version for my Eclipse?

I'm using Eclipse release version 3.7.0, but I can't find the gcc anywhere. How and where can I see the version of gcc I'm currently using?..

Catch multiple exceptions in one line (except block)

I know that I can do: try: # do something that may fail except: # do this if ANYTHING goes wrong I can also do this: try: # do something that may fail except IDontLikeYouException: ..

Check variable equality against a list of values

I'm checking a variable, say foo, for equality to a number of values. For example, if( foo == 1 || foo == 3 || foo == 12 ) { // ... } The point is that it is rather much code for such a trivial..

What is the naming convention in Python for variable and function names?

Coming from a C# background the naming convention for variables and method names are usually either camelCase or PascalCase: // C# example string thisIsMyVariable = "a" public void ThisIsMyMethod() ..

java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing

While running junit test in eclipse I am getting this Exception: java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing I've added junit.jar library file. I've tried different versions of jun..

Multiple aggregate functions in HAVING clause

Due to the nature of my query i have records with counts of 3 that would also fit the criteria of having count of 2 and so on. I was wondering is it possible to query 'having count more than x and les..

How to disable auto-play for local video in iframe

How to disable auto-play for video when src is from my local pc? <iframe width="465" height="315" src="videos/example.mp4"></iframe> I have tried the following, but it doesn't work: ..

How to set transparent background for Image Button in code?

I can set ImageButton background transparent in layout.xml using: android:background="@android:color/transparent" How I can acomplish same thing using java code? Something like ib.setBackgroundColo..

ip address validation in python using regex

In the following ip address validation i want to see if it a valid ip address or not how can i do this using the below re >>> ip="" >>> aa=re.match(r"\d{1,3}\.\d{1..

When use getOne and findOne methods Spring Data JPA

I have an use case where it calls the following: @Override @Transactional(propagation=Propagation.REQUIRES_NEW) public UserControl getUserControlById(Integer id){ return this.userControlRepository..

Java replace all square brackets in a string

I want to remove square brackets from a string, but I don't know how. String str = "[Chrissman-@1]"; str = replaceAll("\\[\\]", ""); String[] temp = str.split("-@"); System.out.println("Nickname: " ..

Joda DateTime to Timestamp conversion

I am trying to change the value of Timestamp by DateTimeZone in Joda : DateTime dt = new DateTime(rs.getTimestamp("anytimestampcolumn"), DateTimeZone.forID("anytimezone..

Counter increment in Bash loop not working

I have the following simple script where I am running a loop and want to maintain a COUNTER. I am unable to figure out why the counter is not updating. Is it due to subshell thats getting created? How..

socket connect() vs bind()

Both connect() and bind() system calls 'associate' the socket file descriptor to an address (typically an ip/port combination). Their prototypes are like:- int connect(int sockfd, const struct sockad..

inherit from two classes in C#

Possible Duplicate: Multiple Inheritance in C# I have two classes Class A and Class B. These two classes cannot inherit each other. I am creating new class called Class C. Now, I want to implement ..

join on multiple columns

I have two tables (Table A and Table B) which I want to join on multiple columns in both tables. Table A Col1 Col2 ================ A11 A..

Get values from an object in JavaScript

I have this object: var data = {"id": 1, "second": "abcd"}; These are values from a form. I am passing this to a function for verification. If the above properties exist we can get their values wi..

ASP.NET MVC Ajax Error handling

How do I handle exceptions thrown in a controller when jquery ajax calls an action? For example, I would like a global javascript code that gets executed on any kind of server exception during an aja..

"Javac" doesn't work correctly on Windows 10

the problem is that I upgraded to Windows 10 and now I'm installing my tools to programming and now that I installed the JDK 7 of Java, when I try to use in the cmd the command: - "javac" Th..

How to Lock/Unlock screen programmatically?

I am doing an application which Locks the screen on shake. Now it is locking and from there it going to a broadcast receiver from there if the screen is off its entering into a service which has to tu..

How to change Android version and code version number?

How to change Android version and code version number Android Studio? I want to change apk file (app) on Google Play and I need to change Android version and code version number. I tried with this in ..

How do I export (and then import) a Subversion repository?

I'm just about wrapped up on a project where I was using a commercial SVN provider to store the source code. The web host the customer ultimately picked includes a repository as part of the hosting pa..

Cross-browser window resize event - JavaScript / jQuery

What is the correct (modern) method for tapping into the window resize event that works in Firefox, WebKit, and Internet Explorer? And can you turn both scrollbars on/off?..

Java and HTTPS url connection without downloading certificate

This code connects to a HTTPS site and I am assuming I am not verifying the certificate. But why don't I have to install a certificate locally for the site? Shouldn't I have to install a certificat..

bootstrap 4 file input doesn't show the file name

I have a problem with the custom-file-input class in Bootstrap 4. after I chose which file I want to upload the filename do not show. I use this code: <div class="input-group mb-3"> <div ..

git: Switch branch and ignore any changes without committing

I was working on a git branch and was ready to commit my changes, so I made a commit with a useful commit message. I then absentmindedly made minor changes to the code that are not worth keeping. I no..

Spark difference between reduceByKey vs groupByKey vs aggregateByKey vs combineByKey

Can anyone explain the difference between reducebykey,groupbykey,aggregatebykey and combinebykey? I have read the documents regarding this , but couldn't understand the exact differences? If you can ..

'readline/readline.h' file not found

I have included: #include "stdio.h" #include <readline/readline.h> #include <readline/history.h> and my compiler includes the flag -lreadline but I am still receiving the error ..

Wordpress plugin install: Could not create directory

I'm using WordPress on centos 6. I try to install a plugin. But I got this error: Installing Plugin: bbPress 2.5.9 Downloading install package from

Printing pointers in C

I was trying to understand something with pointers, so I wrote this code: #include <stdio.h> int main(void) { char s[] = "asd"; char **p = &s; printf("The value of s is: %p\n"..

Find and kill a process in one line using bash and regex

I often need to kill a process during programming. The way I do it now is: [~]$ ps aux | grep 'python' user 5124 1.0 0.3 214588 13852 pts/4 Sl+ 11:19 0:00 python

How to use OAuth2RestTemplate?

I'm trying to understand how to use a OAuth2RestTemplate object to consume my OAuth2 secured REST service (which is running under a different project and let's assume also on a different server etc.....

Google Maps API Multiple Markers with Infowindows

I am trying to add multiple markers each with its own infowindow that comes up when clicked on. I am having trouble with getting the infowindows coming up, when I try it either shows up only one marke..

How to find nth occurrence of character in a string?

Similar to a question posted here, am looking for a solution in Java. That is, how to find the index of nth occurrence of a character/string from a string? Example: "/folder1/folder2/folder3/". In ..

FIFO class in Java

I want to implement FIFO through a class in Java. Does such a class already exist? If not, how can I implement my own? NOTE I found a class here

Print Currency Number Format in PHP

I have some price values to display in my page. I am writing a function which takes the float price and returns the formatted currency val with currency code too.. For example, fnPrice(1001.01) shou..

Can JavaScript connect with MySQL?

Can JavaScript connect with MySQL? If so, how?..

Resizing image in Java

I have a PNG image and I want to resize it. How can I do that? Though I have gone through this I can't understand the snippet...

Assert a function/method was not called using Mock

I'm using the Mock library to test my application, but I want to assert that some function was not called. Mock docs talk about methods like mock.assert_called_with and mock.assert_called_once_with, b..

How to update/refresh specific item in RecyclerView

I'm trying to refresh specific item in RecyclerView. Story: Whenever user clicks on item, it shows AlertDialog. User can type some text by clicking ok button. I want to show this text in this item an..

Angular 5 Service to read local .json file

I am using Angular 5 and I've created a service using the angular-cli What I want to do is to create a service that reads a local json file for Angular 5. This is what I have ... I'm a bit stuck... ..

How can I expose more than 1 port with Docker?

So I have 3 ports that should be exposed to the machine's interface. Is it possible to do this with a Docker container?..

Android getting value from selected radiobutton

I have a piece of code with three RadioButtons within a RadioGroup. I want to set an onCheckedListener that will show the value of the RadioButton in a Toast. However what I have gotten so far is not ..

How to place the "table" at the middle of the webpage?

I have a very basic Table structure to be placed in middle/center of the web page. I Have a code below, I know its incomplete to make this happen, as I am bad in structuring the HTML part, please help..

How to switch between frames in Selenium WebDriver using Java

I am using java with WebDriver.I have to switch between two frames. I have recorded the test case in selenium IDE and in that I got the values as selectFrame relative=top select Frame=middle Frame Bu..

How to Use -confirm in PowerShell

I'm trying to take user input and before proceeding I would like get a message on screen and than a confirmation, whether user wants to proceed or not. I'm using the following code but its not working..

Can I start the iPhone simulator without "Build and Run"?

I want to delete an app in the simulator before I "build and run". How can I start the simulator so I can do the deletion? If I start it by "build and run" I get a long log output that takes a while b..

Change default text in input type="file"?

I want to change default text on button that is "Choose File" when we use input="file". How can I do this? Also as you can see in image button is on left side of text. How can I put it on right sid..

OpenCV & Python - Image too big to display

I have an image that is 6400 × 3200, while my screen is 1280 x 800. Therefore, the image needs to be resized for display only. I am using Python and OpenCV 2.4.9. According to OpenCV Documentation, ..

How to get the Development/Staging/production Hosting Environment in ConfigureServices

How do I get the Development/Staging/production Hosting Environment in the ConfigureServices method in Startup? public void ConfigureServices(IServiceCollection services) { // Which environment a..

How to add /usr/local/bin in $PATH on Mac

When I do 'open .profile' in the terminal I have the following: export PATH=$PATH:/usr/local/git/bin Now I installed node.js for Mac and it says, Make sure that /usr/local/bin is in your $PAT..

TypeError: window.initMap is not a function

I am following this tutorial, basically copy all the code but got an error saying that the initMap function is not a function. I ..

How can I get the index from a JSON object with value?

This is my JSON string. [{ "name": "placeHolder", "section": "right" }, { "name": "Overview", "section": "lef..

Animation fade in and out

Using this code I only have a fade in, I'm looking for how to add a fade out as well. I've added another xml called "fadeout" but I can't integrate it in my code. ImageView imageView = (ImageView)fin..

What does 'public static void' mean in Java?

What does public static void mean in Java? I'm in the process of learning. In all the examples in the book I'm working from public static void comes before any method that is being used or created...

Is it possible to have a custom facebook like button?

Sometimes, clients want to have a custom "facebook button". I mean with a different image and design. I used to work with sharer.php : <a id="fb-share" style='text-decoration:none;' type="icon_li..

Android: ListView elements with multiple clickable buttons

I've a ListView where every element in the list contains a TextView and two different Buttons. Something like this: ListView -------------------- [Text] [Button 1][Button 2] -------------------- [Tex..

How can I use modulo operator (%) in JavaScript?

How can I use modulo operator (%) in calculation of numbers for JavaScript projects?..

TypeError: unsupported operand type(s) for /: 'str' and 'str'

name = input('Enter name here:') pyc = input('enter pyc :') tpy = input('enter tpy:') percent = (pyc / tpy) * 100; print (percent) input('press enter to quit') whenever i run this program i get this..

Progress Bar with HTML and CSS

I want to create a progress bar like in the below image: I have no idea about creating this. Should I use HTML5 techniques? Would you please give me some help about creating this progress bar?..


I am playing around with MongoDB trying to figure out how to do a simple SELECT province, COUNT(*) FROM contest GROUP BY province But I can't seem to figure it out using the aggregate function. I c..

How to Select Every Row Where Column Value is NOT Distinct

I need to run a select statement that returns all rows where the value of a column is not distinct (e.g. EmailAddress). For example, if the table looks like below: CustomerName EmailAddress Aaro..

node.js require all files in a folder?

How do I require all files in a folder in node.js? need something like: files.forEach(function (v,k){ // require routes require('./routes/'+v); }}; ..

Conversion failed when converting date and/or time from character string in SQL SERVER 2008

I have below SQL. UPDATE student_queues SET Deleted=0, last_accessed_by='raja', last_accessed_on=CONVERT(VARCHAR(24),'23-07-2014 09:37:00',113) WHERE std_id IN ('2144-384-11564') ..

Format date to MM/dd/yyyy in JavaScript

I have a dateformat like this '2010-10-11T00:00:00+05:30'. I have to format in to MM/dd/yyyy using JavaScript or jQuery . Anyone help me to do the same...

Counting the Number of keywords in a dictionary in python

I have a list of words in a dictionary with the value = the repetition of the keyword but I only want a list of distinct words so I wanted to count the number of keywords. Is there a way to count the ..

Angular 4.3 - HttpClient set params

let httpParams = new HttpParams().set('aaa', '111'); httpParams.set('bbb', '222'); Why this doesn't work? It only set the 'aaa' and NOT the 'bbb' Also, I have an object { aaa: 111, bbb: 222 } How c..

How do I "shake" an Android device within the Android emulator to bring up the dev menu to debug my React Native app

I am working on a cross-platform React Native mobile app. I am writing console.log statements as I develop. I want to see these logging statements in Chrome while I'm running the Android app in the de..

Lotus Notes email as an attachment to another email

This is in Notes 8.5 environment. I just wanted to know how to attach an email to another email as real attachment not a "Document Link". I intended to attach an email, so I drag & dropped an e..

How do you open an SDF file (SQL Server Compact Edition)?

I have an SDF file and I would like to retrieve its schema and query it with some UI. How can I do this? I have no Visual Studio installed on the machine and I would like to install as little software..

How to deep merge instead of shallow merge?

Both Object.assign and Object spread only do a shallow merge. An example of the problem: // No object nesting const x = { a: 1 } const y = { b: 1 } const z = { ...x, ...y } // { a: 1, b: 1 } The o..

How to Install Font Awesome in Laravel Mix

I've tried to install Font Awesome using Laravel Mix but when executing run npm dev I get the following message: ERROR Failed to compile with 1 errors error in ./~/font-awesome/scss/font-aweso..

How to remove package using Angular CLI?

Angular 6 has new CLI command ng add <package>. How can I remove the package using Angular CLI? UPDATE documentation ng add will use your package manager to download new dependencies and ..

Highlighting Text Color using Html.fromHtml() in Android?

I am developing an application in which there will be a search screen where user can search for specific keywords and that keyword should be highlighted. I have found Html.fromHtml method. But I will..

How to render a DateTime object in a Twig template

One of my fields in one of my entities is a "datetime" variable. How can I convert this field into a string to render in a browser? Here is a code snippet: {% for game in games %} ... &..

How to pass an array within a query string?

Is there a standard way of passing an array through a query string? To be clear, I have a query string with multiple values, one of which would be an array value. I want that query string value to ..

How to yum install Node.JS on Amazon Linux

I've seen the writeup on using yum to install the dependencies, and then installing Node.JS & NPM from source. While this does work, I feel like Node.JS and NPM should both be in a public repo so..

Update multiple rows in same query using PostgreSQL

I'm looking to update multiple rows in PostgreSQL in one statement. Is there a way to do something like the following? UPDATE table SET column_a = 1 where column_b = '123', column_a = 2 where col..

Disable mouse scroll wheel zoom on embedded Google Maps

I am working on a WordPress site where the authors usually embed Google Maps using iFrames in most posts. Is there a way to disable the zoom via mouse scroll wheel on all of them using Javascript?..

Server cannot set status after HTTP headers have been sent IIS7.5

Sometimes I get exception in my production environment: Process information Process ID: 3832 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception i..

Create table (structure) from existing table

How to create new table which structure should be same as another table I tried CREATE TABLE dom AS SELECT * FROM dom1 WHERE 1=2 but its not working error occurred ..

Loading resources using getClass().getResource()

I am trying to load an image to use as an icon in my application. The appropriate method according to this tutorial is: protected ImageIcon createImageIcon(String path, String description) { jav..

How to set selected value of jquery select2?

This belong to codes prior to select2 version 4 I have a simple code of select2 that get data from ajax $("#programid").select2({ placeholder: "Select a Program", allowClear: true, minimumInpu..

How can I delete derived data in Xcode 8?

The projects page seems to be disappeared from Xcode 8. I used this page for deleting the derived data. Any idea how can I delete derived data from within Xcode 8?..

Check whether an input string contains a number in javascript

My end goal is to validate an input field. The input may be either alphabetic or numeric...

rake assets:precompile RAILS_ENV=production not working as required

I am trying to precompile assets using the command rake assets:precompile RAILS_ENV=production, but I always get the error below. ** Invoke assets:precompile (first_time) ** Execute assets:precom..

What is attr_accessor in Ruby?

I am having a hard time understanding attr_accessor in Ruby. Can someone explain this to me?..

String Concatenation using '+' operator

Looking at the string class metadata, I only see the operators == and != overloaded. So how is it able to perform concatenation for the '+' operator? Edit: Some interesting notes from Eric Lippert ..

How to get the data-id attribute?

I'm using the jQuery quicksand plugin. I need to get the data-id of the clicked item and pass it to a webservice. How do I get the data-id attribute? I'm using the .on() method to re-bind the click ev..

How to set a cell to NaN in a pandas dataframe

I'd like to replace bad values in a column of a dataframe by NaN's. mydata = {'x' : [10, 50, 18, 32, 47, 20], 'y' : ['12', '11', 'N/A', '13', '15', 'N/A']} df = pd.DataFrame(mydata) df[df.y == 'N/A'..

How to create materialized views in SQL Server?

I am going to design a DW and I heard about materialized views. Actually I want to create a view and it should update automatically when base tables are changed. Can anyone explain with an query examp..

What is the point of "final class" in Java?

I am reading a book about Java and it says that you can declare the whole class as final. I cannot think of anything where I'd use this. I am just new to programming and I am wondering if programmer..

HtmlSpecialChars equivalent in Javascript?

Apparently, this is harder to find than I thought it would be. And it even is so simple... Is there a function equivalent to PHP's htmlspecialchars built into Javascript? I know it's fairly easy to i..

Already defined in .obj - no double inclusions

I happened to get that already defined in .obj error. This is structure of my project: main.cpp #include "main.h"; main.h #include <iostream> #include <string> #include <sstr..

Call PowerShell script PS1 from another PS1 script inside Powershell ISE

I want call execution for a myScript1.ps1 script inside a second myScript2.ps1 script inside Powershell ISE. The following code inside MyScript2.ps1, works fine from Powershell Administration, but do..

Is it possible to declare two variables of different types in a for loop?

Is it possible to declare two variables of different types in the initialization body of a for loop in C++? For example: for(int i=0,j=0 ... defines two integers. Can I define an int and a char in..

jQuery $.ajax(), $.post sending "OPTIONS" as REQUEST_METHOD in Firefox

Having trouble with what I thought was a relatively simple jQuery plugin... The plugin should fetch data from a php script via ajax to add options to a <select>. The ajax request is pretty gen..

SQL query with avg and group by

I have some problems with writing a SQL query for MySQL. I have a table with the following structure: mysql> select id, pass, val from data_r1 limit 10; +------------+--------------+--------------..

Make a directory and copy a file

In VBS how do you make a directory and then copy a file into it? Id like to make a folder in the root of C e.g. C:\folder and then copy a file from \server\folder\file.ext into that new folder..

SQL Server: how to select records with specific date from datetime column

I am pretty new to SQL and hope someone here can help me with this: I have a table with one column dateX formatted as datetime and containing standard dates. How can I select all records from this ..

Unable to open a file with fopen()

I've been trying to open a file and output text, but I keep getting errors. So I thought I would start at the very beginning and just try opening the file. This is my code: #include <stdio.h>..

Connection Java-MySql : Public Key Retrieval is not allowed

I try to connect MySql database with Java using connector 8.0.11. Everything seems to be ok but I have this exception: Exception in thread "main" java.sql.SQLNonTransientConnectionException: Publi..

Throwing exceptions from constructors

I'm having a debate with a co-worker about throwing exceptions from constructors, and thought I would like some feedback. Is it OK to throw exceptions from constructors, from a design point of view? ..

How to define global variable in Google Apps Script

I see most examples from Google is they use only functions in a single giant script. e.g. But in our style, we usually write all function..

Equivalent of .bat in mac os

I currently use a .bat file that is utilized to invoke a java file. If I wanted to utilize the same functionality on Mac OS what format changes would I make? (unless the .bat equivalent on Mac OS is t..

How to open a file for both reading and writing?

Is there a way to open a file for both reading and writing? As a workaround, I open the file for writing, close it, then open it again for reading. But is there a way to open a file for both reading ..

Resize to fit image in div, and center horizontally and vertically

I have an image in a div. I would like the image to resize to fit the div, and be horizontally and vertically centered. I would like a solution that works in ie >= 8...

80-characters / right margin line in Sublime Text 3

You can have 80-characters / right margin line in Netbeans, Text Mate and probably many, many more other IDEs. Is it possible to have it in Sublime Text 3 as well? Any option, plugin etc.?..

Java character array initializer

I tried to make a program that separates characters. The question is: "Create a char array and use an array initializer to initialize the array with the characters in the string 'Hi there'. Display..

How to reload a page after the OK click on the Alert Page

I need to reload the page after the OK button is clicked on the Alert box. I am using the following code for it alert("Successful Message"); window.location.reload(); But the window is reloaded im..

Importing from a relative path in Python

I have a folder for my client code, a folder for my server code, and a folder for code that is shared between them Proj/ Client/ Server/ Common/ ..

Getting the index of a particular item in array

I want to retrieve the index of an array but I know only a part of the actual value in the array. For example, I am storing an author name in the array dynamically say "author = 'xyz'". Now..

PHP: Split string

How do I split a string by . delimiter in PHP? For example, if I have the string "a.b", how do I get "a"? ..

Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

Since this question continues to attract responses that are either refuted by the question body or don't address the actual problem, please read this simple summary of what you need to know: ..

Can RDP clients launch remote applications and not desktops

Can RDP clients launch a remote application and then only display that application (and not the desktop)? The application would appear fullscreen within the client and if the application were closed t..

Does Notepad++ show all hidden characters?

In Notepad++ I have set "replace tab with 2 spaces". When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors..

Why do some functions have underscores "__" before and after the function name?

This "underscoring" seems to occur a lot, and I was wondering if this was a requirement in the Python language, or merely a matter of convention? Also, could someone name and explain which functions ..

How do I change the font color in an html table?

How do I change the font color in an html table? <table> <tbody> <tr> <td> <select name="test"> <option value="Basic">Basic : $30.00 USD - yearly</option> &l..

Fix CSS hover on iPhone/iPad/iPod

I want to fix the hover effect on iOS ( change to touch event ) but I dont have any idea . Let me explain this . You have a text in your page : <div class="mm">hello world</div> With st..

What is the minimum length of a valid international phone number?

I need to validate user input of an international phone number. According to E.164, the maximum length is 15 digits, but I was unable to find any information about the minimum. I consider digits only,..

How to fix nginx throws 400 bad request headers on any header testing tools?

I have my site which is using nginx, and testing site with header testing tools e.g. but every time it says 400 bad request below is the out put from the ..

Hidden Features of Java

After reading Hidden Features of C# I wondered, What are some of the hidden features of Java?..

How to find the size of integer array

How to find the size of an integer array in C. Any method available without traversing the whole array once, to find out the size of the array...

Importing larger sql files into MySQL

I have a 400MB large sql backup file. I'm trying to import that file into MySQL database using WAMP->import, but the import was unsuccessful due to many reasons such as upload file size is too large a..

Try-catch block in Jenkins pipeline script

I'm trying to use the following code to execute builds, and in the end, execute post build actions when builds were successful. Still, I get a MultipleCompilationErrorsException, saying that my try bl..

How to display (print) vector in Matlab?

I have a vector x = (1, 2, 3) and I want to display (print) it as Answer: (1, 2, 3). I have tried many approaches, including: disp('Answer: ') strtrim(sprintf('%f ', x)) But I still can't get it t..

Reasons for a 409/Conflict HTTP error when uploading a file to sharepoint using a .NET WebRequest?

I've got a method that uses a WebRequest to upload a file to a sharepoint 2010 list/folder, using a PUT request, with the Overwrite Header set to T (overwrite). When several files are uploaded (metho..

CALL command vs. START with /WAIT option

How is the START command with a WAIT option START /wait notepad.exe START /wait notepad.exe ...any different from using a CALL command? CALL notepad.exe CALL notepad.exe Is there a situati..

How to filter in NaN (pandas)?

I have a pandas dataframe (df), and I want to do something like: newdf = df[(df.var1 == 'a') & (df.var2 == NaN)] I've tried replacing NaN with np.NaN, or 'NaN' or 'nan' etc, but nothing evaluat..

How to verify if nginx is running or not?

After running an ASP.NET vNext project on my local machine I was trying to figure out how I can run it on nginx as it looks to be a recommended choice Following jsinh's blog, I installed it using: ..

angular js unknown provider

I'm trying to "customize" the mongolab example to fit my own REST API. Now I'm running into this error and I am not sure what I am doing wrong: Error: Unknown provider: ProductProvider <- Product ..

org.hibernate.MappingException: Could not determine type for: java.util.Set

Although this question asked many times and I have already used all the suggestion but still I am getting this error. The is @Entity @Table(name = "USER") public class User implements User..

How to configure multi-module Maven + Sonar + JaCoCo to give merged coverage report?

I've searched up and down the internet for this one. There's lots of half-answers out there, to do with Maven properties such as ${sonar.jacoco.reportPath}, or org.jacoco:jacoco-maven-plugin:prepare-a..

Add a new item to recyclerview programmatically?

I'm still trying to get my head around recyclerview. I have an arraylist, that I use to initialize a recycler view with. How can I add new items to the recycler view post setting an adapter and layo..

Is there any 'out-of-the-box' 2D/3D plotting library for C++?

I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces". Looking at what is ava..

SQL Server converting varbinary to string

I want to do conversion in T-SQL from a varbinary type to string type Here is an example : First I got this varbinary 0x21232F297A57A5A743894A0E4A801FC3 And then I want to convert it to 21232f2..

How to use PDO to fetch results array in PHP?

I'm just editing my search script after reading up on SQL injection attacks. I'm trying to get the same functionality out of my script using PDO instead of a regular mysql connection. So I've been rea..

How to override trait function and call it from the overridden function?

Scenario: trait A { function calc($v) { return $v+1; } } class MyClass { use A; function calc($v) { $v++; return A::calc($v); } } print (new MyClass())-..

jsonify a SQLAlchemy result set in Flask

I'm trying to jsonify a SQLAlchemy result set in Flask/Python. The Flask mailing list suggested the following method

Is there a better alternative than this to 'switch on type'?

Seeing as C# can't switch on a Type (which I gather wasn't added as a special case because is relationships mean that more than one distinct case might apply), is there a better way to simulate switch..

Android ADT error, dx.jar was not loaded from the SDK folder

I just downloaded Eclipse Galileo and installed ADT10 and tried to a phonegap app using this guide: But each time i try to build im getting this error: Unknown error: Una..

CSS transition fade on hover

I've encountered a problem with CSS transitions. I'm designing a CSS gallery for my portfolio and I need my images to fade in on hover. I've been playing around with this for over an hour and I was h..

Run a shell script with an html button

I want to launch a bash script when a button is pressed on a website. This is my first attempt: <button type="button" onclick="/path/to/">Click Me!</button> But no luck. Any sugg..

How do I measure execution time of a command on the Windows command line?

Is there a built-in way to measure execution time of a command on the Windows command line?..

List files recursively in Linux CLI with path relative to the current directory

This is similar to this question, but I want to include the path relative to the current directory in unix. If I do the following: ls -LR | grep .txt It doesn't include the full paths. For example,..

How to convert signed to unsigned integer in python

Let's say I have this number i = -6884376. How do I refer to it as to an unsigned variable? Something like (unsigned long)i in C...

jQuery vs document.querySelectorAll

I heard several times that jQuery's strongest asset is the way it queries and manipulates elements in the DOM: you can use CSS queries to create complex queries that would be very hard to do in regula..

Best way to randomize an array with .NET

What is the best way to randomize an array of strings with .NET? My array contains about 500 strings and I'd like to create a new Array with the same strings but in a random order. Please include a C..

HTML img align="middle" doesn't align an image

I want a image to be centered aligned. Image size is fixed in pixels. So what I want is like this- . What I have done is- <!DOCTYPE html> <html> <body> <img ..

textarea's rows, and cols attribute in CSS

I'd like to set the textarea's rows and cols attributes via CSS. How would I do this in CSS?..

Basic Apache commands for a local Windows machine

I have installed XAMPP on my Windows 7 machine and created a number of virtual servers. This part is straightforward enough. Each time I add a new virtual server I am having to reboot my computer in ..

How to show/hide JPanels in a JFrame?

The application I am developing is a game. What I want to do is have JPanels that appear in the JFrame, like a text or message window, and then disappear when they are no longer used. I have designe..

How to show hidden divs on mouseover?

How to show a set of hidden div's onmouseover? For example : <div id="div1">Div 1 Content</div> <div id="div2">Div 2 Content</div> <div id="div3">Div 3 Content</div&..

NuGet Package Restore Not Working

I checked in a project on one computer, checked out on another, and find that the binaries installed by NuGet are missing. I could check them in to source control as well, but it looks like there's a..

How to use Typescript with native ES6 Promises

I'm a complete beginner to Typescript and am wondering if it's possible to use ES6 promises in Typescript and what I would have to do to get them to work. I'm running node 0.11.14 and am getting an er..

How can I check whether Google Maps is fully loaded?

I’m embedding Google Maps into my web site. Once Google Maps is loaded, I need to kick off a few JavaScript processes. Is there a way to auto-detect when Google Maps has fully loaded, including til..

How to compare binary files to check if they are the same?

What is the easiest way (using a graphical tool or command line on Ubuntu Linux) to know if two binary files are the same or not (except for the time stamps)? I do not need to actually extract the dif..

C# event with custom arguments

I want to have an event that takes an enum only as the argument. For example public enum MyEvents{ Event1 } // how do I declare this to take enum MyEvents as argument public static event EventHan..

Change an image with onclick()

I want to change an image to some other image when i click on the object. the code is stacked in the following order: <li><img><some text></img></li> <li><img>..

What version of Python is on my Mac?

I have a mac, when I do: python --version I got: Python 2.7.6 but when I got to: /System/Library/Frameworks/Python.framework/Versions/3.3 where is 2.7.6 located ? any advice what should I do..

how to run command "mysqladmin flush-hosts" on Amazon RDS database Server instance?

I got a database server failure, says host is blocked because of many connection errors. It ask me to unblock with 'mysqladmin flush-hosts' how and where should I run this command to our amazon rds ..

How do I fetch lines before/after the grep result in bash?

I want a way to search in a given text. For that, I use grep: grep -i "my_regex" That works. But given the data like this: This is the test data This is the error data as follows . . . . ...

Pandas group-by and sum

I am using this data frame: Fruit Date Name Number Apples 10/6/2016 Bob 7 Apples 10/6/2016 Bob 8 Apples 10/6/2016 Mike 9 Apples 10/7/2016 Steve 10 Apples 10/7/2016 Bob 1 Orang..

php how to go one level up on dirname(__FILE__)

I have a folder structure as follows: ->Folder-A ->Folder-B I have a string from Database that is '../Folder-B/image1.jpg', which points to an image in Folder-B. Inside a s..

How to add parameters into a WebRequest?

I need to call a method from a webservice, so I've written this code: private string urlPath = ""; string request = urlPath + "index.php/org/get_org_form"; WebRequest we..

How to convert String object to Boolean Object?

How to convert String object to Boolean object?..

How to replace comma (,) with a dot (.) using java

I am having a String str = 12,12 I want to replace the ,(comma) with .(Dot) for decimal number calculation, Currently i am trying this : if( str.indexOf(",") != -1 ) { str.replaceAll(",","\\..

Replace last occurrence of a string in a string

Anyone know of a very fast way to replace the last occurrence of a string with another string in a string? Note, the last occurrence of the string might not be the last characters in the string. Examp..

How can I trigger another job from a jenkins pipeline (jenkinsfile) with GitHub Org Plugin?

How can I trigger build of another job from inside the Jenkinsfile? I assume that this job is another repository under the same github organization, one that already has its own Jenkins file. I als..

How do I check for equality using Spark Dataframe without SQL Query?

I want to select a column that equals to a certain value. I am doing this in scala and having a little trouble. Heres my code"state")==="TX").show() this returns the state column wit..