I was checking out someone .tsconfig file and there I spotted --esModuleInterop
This is his .tsconfig file
{
"compilerOptions": {
"moduleResolution": "node",
&q..
I'm trying to get rid of my tslint error Type declaration of 'any' loses type-safety. but I'm struggling to figure out what the correct type would be for the Event.
I'm working through the Lynda "Bu..
I am trying to download a PDF file from a website and save it to disk. My attempts either fail with encoding errors or result in blank PDFs.
In [1]: import requests
In [2]: url = 'http://www.hrecos...
I am trying to understand how the whole ecosystem of iOS works.
Until now, I could find an answer for most of my question (and trust me, there have been a lots of them), but for this one, there seems..
I am trying to enter a formula into a cell which contains variable called var1a?
The code that I have is:
Worksheets("EmployeeCosts").Range("B" & var1a).Formula = ""SUM(H5:H""& var1a)
B..
I see there are several ways we can start hadoop ecosystem,
start-all.sh & stop-all.sh
Which say it's deprecated use start-dfs.sh & start-yarn.sh.
start-dfs.sh, stop-dfs.sh and start-yarn.s..
In my stored procedure, I have three insert statements.
On duplicate key value insertion first two queries generate the error
Violation of PRIMARY KEY constraint
and third query runs as usual...
How do you multiply a BigDecimal by an integer in Java? I tried this but its not correct.
import java.math.BigDecimal;
import java.math.MathContext;
public class Payment {
int itemCost;
int ..
In my office, the mere mention of the word Xerces is enough to incite murderous rage from developers. A cursory glance at the other Xerces questions on SO seem to indicate that almost all Maven users ..
Despite knowing JavaScript quite well, I'm confused what exactly these three projects in Node.js ecosystem do. Is it something like Rails' Rack? Can someone please explain?..
I'm getting this error while building Maven project, I increased MAVEN_OPTS but all the same, I found some similar posts but they are refering to something else. How do I fix this?
The system is out..
How do I create a readonly textbox in ASP.NET MVC3 with the Razor view engine?
Is there an HTMLHelper method available to do that?
Something like the following?
@Html.ReadOnlyTextBoxFor(m => m.u..
I recently updated jQuery from 1.8 to 2.1. I suddenly discovered that the .live() stops working.
I get the error TypeError: $(...).live is not a function.
Is there any method I can use in place of .l..
How exactly do you make an auto-refreshing div with JavaScript (specifically, jQuery)?
I know about the setTimeout method, but is it really a good practice ? Is there a better method?
function updat..
In Angularjs 1 it is possible to sort and filter the following way:
<ul ng-repeat="friend in friends | filter:query | orderBy: 'name' ">
<li>{{friend.name}}</li>
</ul>
Bu..
I have tried some solutions but I am unable to get exact name and version:
I am trying following code:
$browserAgent = $_SERVER['HTTP_USER_AGENT'];
echo $browserAgent;
Output of above code:
Mozil..
You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is:
# File: ftplib-example-1.py
import ftplib
ftp = ftplib.FTP("www.python.org")
ftp.logi..
Can I control the HTTP headers sent by window.open (cross browser)?
If not, can I somehow window.open a page that then issues my request with custom headers inside its popped-up window?
I need some ..
I am trying to remove a string from a string in jQuery.
Here is the string:
username1, username2 and username3 like this post.
I would like to remove username1, from this list.
I tried adding the ..
I have made a program to send an UDP packets from a client to a server.
Here is the transmitter code:
import java.io.IOException;
import java.net.*;
public class JavaApplication9 {
public s..
I am trying to do some calculation but it is getting done as soon as I enter the amount. I just want this to happen on click of a button rather than automatically.
What I have done so far:
<!DOCT..
I can add streams or extra elements, like this:
Stream stream = Stream.concat(stream1, Stream.concat(stream2, Stream.of(element));
And I can add new stuff as I go, like this:
Stream stream = Strea..
I was working on my Spring boot app project and noticed that, sometimes there is a connection time out error to my Database on another server(SQL Server).
This happens specially when I try to do some..
How do I make the first option of selected with jQuery?
<select id="target">
<option value="1">...</option>
<option value="2">...</option>
</select>
..
I have two html text input, out of that what ever user type in first text box that need to reflect on second text box while reflecting it should replace all spaces to semicolon. I did to some extant a..
When the BACK button is pressed on the phone, I want to prevent a specific activity from returning to its previous one.
Specifically, I have login and sign up screens, both start a new activity calle..
Consider the following scenario:
I have developed a small experimental project A in its own Git repo. It has now matured, and I'd like A to be part of larger project B, which has its own big reposito..
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:
..
Is there an easy way to add padding between the checkbox in a CheckBox control, and the associated text?
I cannot just add leading spaces, because my label is multi-line.
As-is, the text is way too ..
I'd like to get an id unique to a computer with Java, on Windows, MacOS and, if possible, Linux. It could be a disk UUID, motherboard S/N...
Runtime.getRuntime().exec can be used (it is not an applet..
Hi I am using hibernate JPA with spring and mongodb and i am running my application on Glassfish-4.0.
My service class is :
@Component
public class Test {
@PersistenceContext
EntityManager e..
How do I test whether an object is an instance of a particular class in Objective-C? Let's say I want to see if object a is an instance of class b, or class c, how do I go about doing it?..
I want do the following
awk 'BEGIN {FS=" ";} {printf "'%s' ", $1}'
But escaping single quote this way does not work
awk 'BEGIN {FS=" ";} {printf "\'%s\' ", $1}'
How to do this? Thanks for help...
Which is more efficient for clearing all values in an array? The first one would require me to use that function each time in the loop of the second example.
foreach ($array as $i => $value) {
..
In my main page I have dropdowns that show v-show=show by clicking on link @click = "show=!show" and I want to set show=false when I change route. Advise me please how to realize this thing...
We have a crystal report that we need to send out as an e-mail, but the HTML generated from the crystal report is pretty much just plain ugly and causes issues with some e-mail clients. I wanted to e..
Following the example of TB, I have a navbar that is marked up as follows:
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<..
I researched first and couldn't find an answer to my question. I am trying to run multiple functions in parallel in Python.
I have something like this:
files.py
import common #common is a util class ..
Using the pause command I found that the error is in the first line of this code:
if %choice% == 1 if %energy% => %m2enc% set /a enemhp=%enemhp%-%m1hpd%+%earmr%
pause
set /a energy= %energy%-%m1en..
I get the following error running curl https://npmjs.org/install.sh | sh on Mac OSX 10.9 (Mavericks):
install npm@latest
curl: (60) SSL certificate problem: Invalid certificate chain
More details her..
I needed to reformat my computer and now I'm having trouble copying the settings/profiles over.
I copied the files in ~/Library/Application\ Support/iTerm/
I also copied ~/Library/Preferences/com.go..
I have the following code:
l = ['-1.2', '0.0', '1']
x = 100.0
for i in l:
if i < x:
x = i
print x
The code should find the lowest value in my list (-1.2) but instead when i print 'x..
I would like to programmatically add or remove some elements to a string array in C#, but still keeping the items I had before, a bit like the VB function ReDim Preserve...
I'm using this library to implement a learning agent.
I have generated the training cases, but I don't know for sure what the validation and test sets are.
The teacher says:
70% should be train c..
I created some data and stored it several times like this:
with open('filename', 'a') as f:
pickle.dump(data, f)
Every time the size of file increased, but when I open file
with open('file..
Ok so I'm trying to align an image(which is contained in a div) and some text(also contained in a div) on the same line, without setting width for the text, how can i do it? This is what I have so far..
About a year ago I asked about header dependencies in CMake.
I realized recently that the issue seemed to be that CMake considered those header files to be external to the project. At least, when gen..
I have 2 basic forms -- sign in and sign up, both on the same page. Now, I have no problem with the sign in form auto-filling, but the sign up form auto fills as well, and I don't like it.
Also, the ..
I want to group my dataframe by two columns and then sort the aggregated results within the groups.
In [167]:
df
Out[167]:
count job source
0 2 sales A
1 4 sales B
2 6 sales C
3 ..
I have uninstalled and installed Homebrew 3 times now because it seems to never allow me to install anything as it denies me permissions at the end of most installations.
As an example I will post th..
How do I get screen width in React native?
(I need it because I use some absolute components that overlap and their position on screen changes with different devices)..
I am trying to get a sentence using input from the user in Java, and i need to make it lowercase and remove all punctuation. Here is my code:
String[] words = instring.split("\\s+");
for (int..
I am new in Asp.net MVC and i researched about Ajax.BeginForm but when i apply codes it did not work. Can you share very simple example with Ajax.Beginform with View, Controller, Model?
Thanks...
I am trying to determine if a textarea is empty if a user deletes what is already pre-populated in the textarea using jQuery.
Anyway to do this?
This is what I have and its not working
$(textarea)...
I need to use certain font for my entire application. I have .ttf file for the same.
Is it possible to set this as default font, at application start up and then use it elsewhere in the application? W..
These if ... then statements are getting the wrong results in my opinion. The first is returning the value 'false' when it should be 'true'. The fourth returns the right value. The second and third re..
When I'm using a rooted Android device as ADB host to send adb command "adb devices" to Samsung S4, I received device unauthorized error message. However when I tried adb to Samsung Galaxy Nexus, it i..
I want to convert the first character of a string to Uppercase and the rest of the characters to lowercase. How can I do it?
Example:
String inputval="ABCb" OR "a123BC_DET" or "aBcd"
String output..
I am using MS SQL SERVER 2008 and I have following data:
select * from account;
| PERIOD | ACCOUNT | VALUE |
----------------------------
| 2000 | Asset | 205 |
| 2000 | Equity | 365 |
|..
I'm trying to send an email to several recipients when a new row is inserted into a table. The list of recipients varies. I would like to be able to set this list using a select statement.
I also ha..
I'm familiar with the issue behind ORA-01775: looping chain of synonyms, but is there any trick to debugging it, or do I just have to "create or replace" my way out of it?
Is there a way to query t..
I've got a list in a Python program that contains a series of numbers, which are themselves ASCII values. How do I convert this into a "regular" string that I can echo to the screen?..
I'm trying to write a jQuery plugin that will provide additional functions/methods to the object that calls it. All the tutorials I read online (have been browsing for the past 2 hours) include, at th..
How to pass the parameters to the EXEC sp_executesql statement correctly?
This is what I have now, but i'm getting errors:
alter PROCEDURE [dbo].[usp_getReceivedCases]
-- Add the parameters for..
I am trying to make the to_string(NUMBER) function work in my Ubuntu computer for weeks but it never ever works in the QT environment or anywhere else. My code works perfectly on my Mac osx, but when ..
Is there a quick way to copy a list of filenames as text into the clipboard from Windows Explorer?
I can do it from the command prompt with dir > filenames.txt, but I am looking for something alon..
I want to use something similar to:
git checkout -- <path>/<file>
but I want to checkout the file to some folder I choose, rather than the overwriting the local <path>/<file>..
I would like to change the thickness/width of the line samples featured in the pyplot legend.
Line width of line samples within legend are the same as the lines they represent in the plot (so if lin..
I have question, that maybe someone here wouldn't mind to help me with. I have lets say 3 datatables, each one of them has the following columns:
size, quantity, amount, duration
Name of datatables an..
I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificationException. What is causing it and how do I fix this probl..
Before going much further i'll mention I have tried solutions in following:
How do I set the icon for my application in visual studio 2008?
Set application icon from resources in VS 05
I am trying ..
In Qt, I can get the selected text of a QComboBox by using the
combobox->currentText() method.
How can I get the selected value?
I searched for help but I couldn't find a method currentData() whi..
I am trying to do a simple JSON return but I am having issues I have the following below.
public JsonResult GetEventData()
{
var data = Event.Find(x => x.ID != 0);
return Json(data);
}
I..
I wanted to know how to iterate through a string word by word.
string = "this is a string"
for word in string:
print (word)
The above gives an output:
t
h
i
s
i
s
a
s
t
r
i
n
g
But ..
I'm trying to store the files listing into an array and then loop through the array again.
Below is what I get when I run ls -ls command from the console.
total 40
36 -rwxrwxr-x 1 amit amit 36720 20..
I have a web project (C# Asp.Net, EF 4, MS SQL 2008 and IIS 7) and I need to migrate it to IIS 7 locally (at the moment works fine with CASSINI).
Locally in IIS I have my Default Web Site with my dep..
We are using Visual Studio and a database project to generate our database.
I just made a number of database changes (including adding a new table named Correspondence) imported those changes into th..
I have this structure of files (directory and after arrow files):
model -> py_file.py
report -> other_py_file.py
main __init__.py:
import model
import report
model directory:
import py_f..
I am working on this angular2 project in which I am using ROUTER_DIRECTIVES to navigate from one component to other.
There are 2 components. i.e. PagesComponent & DesignerComponent.
I want to na..
I want to calculate the number of days passed between past date and a current date. My past date is in the format dd/mm/yyyy format. I have used below mentioned formulas but giving the proper output.
..
I have a combo box named "Make". In that combo box I'm loading vehicle manufacturer names. When I click SEARCH button I want to display the selected manufacturer name. Below is part of my HTML code.
..
In fopen("myfile", "r+") what is the difference between the "r+" and "w+" open mode? I read this:
"r" Open a text file for reading. "w" Open a text file for writing,
truncating an an existing ..
I'm writing a simple server for Node.js and I'm using my own class called User which looks like:
function User(socket) {
this.socket = socket;
this.nickname = null;
/* ... just the typic..
I want to execute a batch file
D:\apache-tomcat-6.0.20\apache-tomcat-7.0.30\bin\shutdown.bat
Which is on my server inidsoasrv01.
How should I write my .bat file?..
I launched my program in the foreground (a daemon program), and then I killed it with kill -9, but I get a zombie remaining and I m not able to kill it with kill -9. How to kill a zombie process?
If ..
Follow-up from my post yesterday (Enabling cURL with PHP)
The problem is that PHP isn't able to load php_curl.dll. I've tried several steps including uncommenting extension=php_curl.dll, making sure..
I have created a web system using Java Servlets and now want to make JUnit testing. My dataManager is just a basic piece of code that submits it to the database. How would you test a Servlet with JUni..
I am trying to get my node environment set up on a new Ubuntu 12.04 instance, with Node 0.8.14 already installed, but I ran into problems when I try to run npm install.
So when I try npm install, it s..
I am trying to make a Panel scrollable, but only vertically (so AutoScroll won't work because the child controls go past the left edge and must).
So how is this done?..
How do i escape text for html use in C#? I want to do
sample="<span>blah<span>"
and have
<span>blah<span>
show up as plain text instead of blah only with the tags part ..
How to detect Safari browser using JavaScript? I have tried code below and it detects not only Safari but also Chrome browser.
function IsSafari() {
var is_safari = navigator.userAgent.toLowerCase..
How can I configure Visual Studio Code to compile typescript files on save?
I see it is possible to configure a task to build the file in focus using the ${file} as an argument. But I would like th..
What is the quickest and most pragmatic way to combine all *.txt file in a directory into one large text file?
Currently I'm using windows with cygwin so I have access to BASH.
Windows shell command..
I know this is a rather simple question, but I can't figure it out for the life of me. I have two links which I've applied a background image to. Here's what it currently looks like (apologies for ..
I think this should be simple, but I am facing some trouble on how to import and use an image in Vue single file component. Can someone help me how to do this? Here is my code snippet:
<template la..
I had a repository that had some bad commits on it (D, E and F for this example).
A-B-C-D-E-F master and origin/master
I've modified the local repository specifically with a git reset --hard. I..
I am calling a SQL Server stored procedure from my C# code:
using (SqlConnection conn = new SqlConnection(connstring))
{
conn.Open();
using (SqlCommand cmd = new SqlCommand("InsertQuerySPROC", ..
I have a table in this form (this is just the partial view, the table contains more than 100 columns).
LOAN NUMBER DOCUMENT_TYPE DOCUMENT_ID
992452533663 Voters ID ..
Given:
a1 = [5, 1, 6, 14, 2, 8]
I would like to determine if it contains all elements of:
a2 = [2, 6, 15]
In this case the result is false.
Are there any built-in Ruby/Rails methods to identify..
What's the difference between a REST system and a system that is RESTful?
From a few things I've read most so called REST services are actually RESTful services. So what is the difference between the..
I recently got into node and I installed it on my localhost. I am using WAMP. I am on Windows Vista.
Anwyay, I installed it. I made a new file in my localhost directory with this being called server...
I have problem when trying to parse with minimum value to map in Android.
There some sample JSON format with more information ex:
[{id:"1", name:"sql"},{id:"2",name:"android"},{id:"3",name:"mvc"}]
..
Why this works
if (mycontrol.GetType() == typeof(TextBox))
{}
and this do not?
Type tp = typeof(mycontrol);
But this works
Type tp = mycontrol.GetType();
I myself use is operator for checkin..
I'm setting an ad to my Android application using DoubleClick and can't manage to show the final ad, can someone help me?
When I test an ad by adding ".addTestDevice("xxx...")" I g..
In Python, is there a way to call a class method from another class? I am attempting to spin my own MVC framework in Python and I can not figure out how to invoke a method from one class in another cl..
I just downloaded the Tomcat 7.0.23 package on my Ubuntu 11.10.
I followed the instructions on a Google API website to deploy their example webapp. It basically consists of jar files placed in the W..
I want to create a picture chooser from gallery. I use code
intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, T..
The following is the overall structure of my typical python tkinter program.
def funA():
def funA1():
def funA12():
# stuff
def funA2():
# stuff
def funB():
..
I'm starting to learn python and loving it. I work on a Mac mainly as well as Linux. I'm finding that on Linux (Ubuntu 9.04 mostly) when I install a python module using apt-get it works fine. I can im..
I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any in..
How do I remove an element of an array and shift the remaining elements down. So, if I have an array,
array[]={1,2,3,4,5}
and want to delete 3 and shift the rest so I have,
array[]={1,2,4,5}
H..
I have a legacy database system (not web accessible) on a server which generates CSV or XLS reports to a Google Drive folder. Currently, I am manually opening those files in Drive web interface and c..
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..
I'm trying to run the sample "Hello World" from the LWJGL website
From this link: LWJGL "Getting Started"
I'm trying to do this via the command line, just so I understand the "behind the scenes" a b..
Suppose we have an application that acts as a middleman, allowing Company A to send reports to their customers.
Company A --> Company B (me)--> Company A's customers
After getting the report we ..
After reading this article about elapsed time, I wrote a simple code to calculate the execution time of a loop:
#include <stdio.h>
#include <sys/time.h>
int main (int argc, char** argv) ..
I have done some web based projects, but I don't think too much about the load and execution sequence of an ordinary web page. But now I need to know detail. It's hard to find answers from Google or S..
I want to get a string from a user, and then to manipulate it.
testVar = input("Ask user for something.")
Is there a way for testVar to be a string without me having the user type his response in q..
I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end. I've got a good set of input/output messa..
Is it possible to make an array a session variable in PHP?
The situation is that I have a table (page 1) with some cells having a link to a particular page. The next page will have a list of names (p..
I am a Python beginning self-learner, running on MacOS.
I'm making a program with a text parser GUI in tkinter, where you type a command in a Entry widget, and hit a Button widget, which triggers my p..
How can I change the following code to look at all the .log files in the directory and not just the one file?
I need to loop through all the files and delete all lines that do not contain "step4" or ..
In Yii2 I'm trying to construct hidden input
echo $form->field($model, 'hidden1')->hiddenInput()->label(false);
But I also need it to have some value option, how can I do that ?..
While searching for an implementation of the Barnsley's Fern fractal I came across a implementation that has .pde extension. Which programming language uses this extension?
Implementation Page..
How can I use homebrew cask to install Sublime Text 3? I only see sublime text 2 in the repos. I even tried tapping homebrew/versions, but no luck.
Thanks!
EDIT: Answered by my answer below..
I am trying to get my friend name and ids with Graph API v2.0, but data returns empty:
{
"data": [
]
}
When I was using v1.0, everything was OK with the following request:
FBRequest* friendsRe..
Let's assume I have the following multidimensional array (retrieved from MySQL or a service):
array(
array(
[id] => xxx,
[name] => blah
),
array(
[id] =>..
lets assume this URL...
http://www.example.com/page.php?id=10
(Here id needs to be sent in a POST request)
I want to send the id = 10 to the server's page.php, which accepts it in a PO..
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..
I'm trying to perform some offline maintenance (dev database restore from live backup) on my dev database, but the 'Take Offline' command via SQL Server Management Studio is performing extremely slowl..
The 'id' field of my table auto increases when I insert a row. I want to insert a row and then get that ID.
I would do it just as I said it, but is there a way I can do it without worrying about the ..
I'm unclear as to what benefits I get from EBS vs. instance-store for my instances on Amazon EC2. If anything, it seems that EBS is way more useful (stop, start, persist + better speed) at relatively ..
I have a set of HTML files and a SQLite database, which I would like to access from the browser, using the file:// scheme. Is it possible to access the database and create queries (and tables) using J..
Im creating pdfs server side with lots of graphics so maximizing real estate is a must but at the same time ensuring users printers can handle the tight margins is a must.
Does anyone have an idea w..
The function more() is supposed to return an Observable from a get request
export class Collection{
public more = (): Observable<Response> => {
if (this.hasMore()) {
re..
I have very recently started to work on oracle databases. Generally I have many sqlplus windows open to different oracle databases. When switching from one sqlplus session to another, how can i view t..
I have a checkbox in android which has the following XML:
<CheckBox
android:id="@+id/item_check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClic..
I was going through Questions every good .Net developer should be able to answer and was highly impressed with the content and approach of this question and so in the same spirit, I am asking this que..
I've a page where a dynamic message box has to be displayed without disturbing the actual page. This message box has to appear at the top right corner of the page overlapping the existing contents.
I..
Is there a truncate modifier for the blade templates in Laravel, pretty much like Smarty?
I know I could just write out the actual php in the template but i'm looking for something a little nicer to ..
I'm trying to write a simple program to read a file and search for a word then print how many times that word is found in the file. Every time I type in "test.rtf" (which is the name of my ..
I am doing the angular2 tutorial at this address: https://angular.io/docs/ts/latest/tutorial/toh-pt3.html I have put the hero interface in a single file under the app folder, in the console I have thi..
I was studying the python threading and came across join().
The author told that if thread is in daemon mode then i need to use join() so that thread can finish itself before main thread terminates.
..
I would like to use $resource to call my RESTful web service, (which I am still working on) but I would like to find out if I got my AngularJS script correct first.
The todo DTO has: {id, order, cont..
I just installed the python modules: construct and statlib with setuptools like this:
# Install setuptools to be able to download the following
sudo apt-get install python-setuptools
# Install statl..
I'm looking for a definitive list of HTML elements which are allowed to take focus, i.e. which elements will be put into focus when focus() is called on them?
I'm writing a jQuery extension which wor..
I don't want to see so long parameters string in the URI. So, can GET method use json data?
In my situation, I need to filter the result given kind of parameters. If there are a lot of parameter, the..
How do I make a textbox that has a grayed out content, and when I click on it to enter text, the grayed out portion, it disappears and allows me to enter the desired text?
Example:
A "First Name" te..
I am trying to convert from an int to a string but I am having trouble. I followed the execution through the debugger and the string 'myT' gets the value of 'sum' but the 'if' statement does not work..
I'm trying to create a proxy server to pass HTTP GET requests from a client to a third party website (say google). My proxy just needs to mirror incoming requests to their corresponding path on the ta..
I want to use the filter in angular and want to filter for multiple values, if it has either one of the values then it should be displayed.
I have for example this structure:
An object movie which..
I tried to write the following inner join query using an Oracle database:
SELECT Employee.EMPLID as EmpID,
Employee.FIRST_NAME AS Name,
Team.DEPARTMENT_CODE AS TeamID,
Team..
I have a folder full of files and they don't have an extension. How can I check file types? I want to check the file type and change the filename accordingly. Let's assume a function filetype(x) retur..
I want to return a simple html page from controller, but I get only the name of the file not its content. Why?
This is my controller code:
@RestController
public class HomeController {
@Request..
I would like to know if there is a way to use an order by clause when updating a table. I am updating a table and setting a consecutive number, that's why the order of the update is important. Using t..
I am new to Android development.
I need to read a text file from the SD card and display that text file.
Is there any way to view a text file directly in Android or else how can I read and display th..
I am in the process of making my own java socket game. My game is painting alright to the full screen (where it says "paint graphics here", but im painting to the whole jframe at the moment). I want..
I want to get the value of HashMap based on key.
HashMap<String, ArrayList<String>> map
= new HashMap<String, ArrayList<String>>();
ArrayList<String> arrayList = ne..
I am working out some tutorials in R. Each R code is contained in a specific folder. There are data files and other files in there. I want to open the .r file and source it such that I do not have to ..
I am trying to write a regular expression that will only allow lowercase letters and up to 10 characters. What I have so far looks like this:
pattern: /^[a-z]{0,10}+$/
This does not work or compil..
I'm currently creating a right-click context menu by instantiating a new JMenu on right click and setting its location to that of the mouse's position... Is there a better way?..
Can anyone help me?
example
A {1,2,3}
B {1,4,5}
Code snippet:
a.intersect(b).print()
// Result 1 . twin between two object
a.merge(b).print()
// Result 1,2,3,4,5
It is valid if I write code be..
There are a few questions on the topic but none of them seem to cover my case, thus I'm creating a new one.
I have JSON like the following:
{"foo":{ "bar": "1", "baz": "2" }, "more": "text"}
Is th..
I have two columns:
<div class="col-md-6"></div>
<div class="col-md-6"></div>
How can I add a space between them?
The output would simply be two columns ri..
I've got a pandas DataFrame filled mostly with real numbers, but there is a few nan values in it as well.
How can I replace the nans with averages of columns where they are?
This question is very si..
I currently do my textfile manipulation through a bunch of badly remembered AWK, sed, Bash and a tiny bit of Perl.
I've seen mentioned a few places that python is good for this kind of thing. How can..
I'm trying to make a .bat script for windows 7 x64 to create a folder, unzip a file into that folder without having to use additional addons like 7zip or unzip. Been searching and it seemed like windo..
I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages o..
I would like to control when to reply an error message and when a success message but I am always get the error message:
here is what I am trying to do:
$.ajax({
type: "POST",
..
I need to debug a GLSL program but I don't know how to output intermediate result.
Is it possible to make some debug traces (like with printf) with GLSL ?..
I'm new to the admin side of DBMS and was setting up a new database tonight (using MySQL) when I noticed this. After granting a user a privilege for the first time, another grant is created that looks..
I'm trying to break down a program line by line. Y is a matrix of data but I can't find any concrete data on what .shape[0] does exactly.
for i in range(Y.shape[0]):
if Y[i] == -1:
This program..
I have a form that if a checkbox is false enforces validation on a text input using the ng-required directive. If the checkbox is true, the field is hidden and the ng-required is set to false.
The p..
The MySQL reference manual does not provide a clearcut example on how to do this.
I have an ENUM-type column of country names that I need to add more countries to. What is the correct MySQL syntax to..
We are building a new REST API.
I was arguing that error code 500 (Internal Server Error) should never be returned.
Now, of course if you know the client's params are wrong or something you have eve..
I am trying to use the youtube data api to generate a video playlist.
However, the video urls require a format of:
youtube.com/watch?v=3sZOD3xKL0Y
but what the api generates is:
youtube.com/watc..
Let's say I am trying to remove elements from array a = [1,1,1,2,2,3]. If I perform the following:
b = a - [1,3]
Then I will get:
b = [2,2]
However, I want the result to be
b = [1,1,2,2]
i.e...
Does anyone know why a client-side javascript handler for asp:CheckBox needs to be an OnClick="" attribute rather than an OnClientClick="" attribute, as for asp:Button?
For example, this works:
<..
I want to develop a sorting demo for car list. I am using data table to display car list. Now actually I want to sort the list by car color. Here it is not sort by alphabetic order. I want to use my c..
I am creating my first project in Subversion. So far I have
branches
tags
trunk
I think I immediately need to make branches singular and start over. Update branches is the norm.
I have been do..
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..
I have an mp4 video that I want to play in IE9 using HTML5 <video> tag. I added the MIME type to IIS 7 so if I browse http://localhost/video.mp4 it plays in both Chrome and IE9 but not in HTML5,..