Data Annotations are used by frameworks such as ASP.NET MVC to enable a model-based validation approach and enforce consistent validation throughout the application, both on client and server side. They were first introduced in ASP.NET MVC 2. In addition to ASP.NET MVC, they can also be used with other technologies such as Entity Framework, either through manual placement of attributes on properties, or automatic generation with T4 templates.
I would like to specify that a decimal field for a price must be >= 0 but I don't really want to impose a max value.
Here's what I have so far...I'm not sure what the correct way to do this is.
[Ran..
I have the following MVC 5 Razor HTML helper:
@Html.TextBoxFor(m => m.ShortName,
new { @class = "form-control", @placeholder = "short name"})
I need this field to be required (i.e. have a red..
I have a Model with 4 properties which are of type string. I know you can validate the length of a single property by using the StringLength annotation. However I want to validate the length of the 4 ..
I have this attribute in my view model:
[DataType(DataType.DateTime)]
public DateTime? StartDate { get; set; }
If I want to display the date, or populate a textbox with the date, I have these:
<..
On my MVC3 project, I store score prediction for football/soccer/hockey/... sport game. So one of properties of my prediction class looks like this:
[Range(0, 15, ErrorMessage = "Can only be between ..
I was wondering if it is possible to disable the Required validation attribute in certain controller actions. I am wondering this because on one of my edit forms I do not require the user to enter val..
I am using Entity Framework 4.3 and using Code Fist.
I have a class
public class User
{
public int UserId{get;set;}
public string UserName{get;set;}
}
How do I tell Entity Framework that Us..
I'm trying to use DataAnnotations in my WPF project to specify a maximum length of strings, with the following:
using System.ComponentModel.DataAnnotations;
However, I get the error
The type or..
In ASP.MVC 3, how do I specify the columns and rows for a multiline EditorFor (textarea)? I am using [UIHint("MultilineText")], but can't find any documentation on how to add attributes for the text a..
The DataAnnotations validator not working in asp.net mvc 4 razor view, when using the special characters in the regular expression.
Model:
[StringLength(100)]
[Display(Description = "First Name")]
[..
When I run the ant file in verbose mode, I got an error like the one below. Does anyone have any ideas what is going wrong? I am new to this
antlib:org.apache.tools.ant] Could not load definitions fr..
I'm trying to figure out the right way to use a custom font for the toolbar title, and center it in the toolbar (client requirement).
At the moment, i'm using the good old ActionBar, and I was settin..
I have a pandas dataframe and I wish to divide it to 3 separate sets. I know that using train_test_split from sklearn.cross_validation, one can divide the data in two sets (train and test). However, I..
There is a property, it's named ImageFullPath1
public string ImageFullPath1 {get; set; }
I'm going fire an event whenever its value changed. I am aware of changing INotifyPropertyChanged, but I wan..
I'm trying to convert a Python dictionary into a Python list, in order to perform some calculations.
#My dictionary
dict = {}
dict['Capital']="London"
dict['Food']="Fish&Chips"
dict['2012']="Olym..
I am trying to a make custom InfoWindow after a click on a marker with the new Google Maps API v2. I want it to look like in the original maps application by Google. Like this:
When I have ImageBut..
The short version of my issue at hand,
Windows 7 Professional x64
Java JDK 1.6.0_17 x64
Eclipse Galileo w\ADT Plugin installed
Android SDKtools r04
Since the Android SDK download now only include..
I'm unable to build a project that uses CocoaPods. I get the following errors:
diff: /../Podfile.lock: No such file or directory
diff: Manifest.lock: No such file or directory error:
The sandbox is ..
I am new to C#, literally on page 50, and i am curious as to how to write these variables in one line of code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
n..
Suppose i have table with some rows and column,so i want to rotate text in cells something like this:
problem is when i rotate text using style :
#rotate {
-moz-transform: rotate(-90.0deg); ..
I just installed SQL Server Express 2012 on my home server. I'm trying to connect to it from Visual Studio 2012 from my desktop PC, and repeatedly getting the well-known error:
A network-related ..
I have to create an SP that returns a value if it's valid or not. But it doesn't return anything and I don't know, why?
CREATE DEFINER=`root`@`localhost` PROCEDURE `validar_egreso`(
IN codigo_pro..
I have to implement the multiple markers functionality from array of addresses. The string of addresses are being fetched from the database.
My array of addresses looks like this
var address = &..
Possible Duplicate:
What is the meaning of “$” sign in JavaScript
Now this must seem to be an easy and stupid question to ask but I must know why we use the dollar ($) symbol in..
I have folder run in folder system32. When I run cmd from within Total Commander opening a command prompt window with C:\Users\admin as current directory and want to go into that folder, the following..
I am using the PyQt library to take a screenshot of a webpage, then reading through a CSV file of different URLs. I am keeping a variable feed that incremements everytime a URL is processed and theref..
Our professor is making us do some basic programming with Java, he gave a website and everything to register and submit our questions, for today I need to do this one example I feel like I'm on the ri..
I am using debian linux.
I have a linux machine on which mysql is install.
I can log in to my linux machine using root user as well as other user.
I can connect to mysql database on linux machine from..
I've added facebook login to my site. However, when I click the button, I get a red box that says:
Invalid Argument
Given URL is not allowed by the Application configuration.
If I continue to log..
I have a wrapper positioned to center with an y-repeated background image:
<body>
<div id="wrapper">
...some content
</div>
</body>
#wrapper{
width: 900px;
ma..
What's the main difference between length() and char_length()?
I believe it has something to do with binary and non-binary strings. Is there any practical reason to store strings as binary?
mysql&g..
I have a Bash script that builds a string to run as a command
Script:
#! /bin/bash
matchdir="/home/joao/robocup/runner_workdir/matches/testmatch/"
teamAComm="`pwd`/a.sh"
teamBComm="`pwd`/b.sh"
inc..
:vsplit (short form: :vs) split the Vim viewport vertically. :30vs splits the viewport, making the new window 30 characters wide. Once this 30 char window is created, how would one change it's size to..
I have a .war file of a Java Web Application. Now I want to upload it to my ftp server so that I can execute it.
What steps I should perform to run it?
The context path of the webapp is /mywebapp
E..
I am having an issue with my API Service. This service connects to my nodejs backend api.
The error says
ERROR TypeError: res.json is not a function
I am getting this error after recently updated..
I want to use order by with union in mysql query.
I am fetching different types of record based on different criteria from a table based on distance for a search on my site.
The first select query ret..
In my error log i get
[emerg] 10619#0: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/mysite.com:4
on Line 4 I have:
server_name mysite.com www.mysite.com;
Any sugge..
I'm new to php and I have executed below code.
<?php
class my_class{
var $my_value = array();
function my_class ($value){
$this->my_value[] = $value;
}
function set_va..
The server is sending a string in this format: 18:00:00. This is a time-of-day value independent of any date. How to convert it to 6:00PM in Javascript? I could prepend today's date as a string to the..
Due to some bad cherry-picking, my local Git repository is currently five commits ahead of the origin, and not in a good state. I want to get rid of all these commits and start over again.
Obviously,..
I'm attempting to print the contents of a collection to the Spark console.
I have a type:
linesWithSessionId: org.apache.spark.rdd.RDD[String] = FilteredRDD[3]
And I use the command:
scala> li..
How can I use a Foreach Statement to do something to my TextBoxes?
foreach (Control X in this.Controls)
{
Check if the controls is a TextBox, if it is delete it's .Text letters.
}
..
There are a lot of questions here related to Bootstrap. I see a lot of people using it. So I tried to research it, and I found the official Bootstrap site, but there was only a download section and a ..
I have a class full of utility functions. Instantiating an instance of it makes no semantic sense, but I still want to call its methods. What is the best way to deal with this? Static class? Abstract?..
I want to evaluate a string with a switch but when I read the string entered by the user throws me the following error.
#include<iostream>
using namespace std;
int main() {
string ..
From a text file containing three columns of data I want to be able to just take a slice of data from all three columns where the values in the first column are equal to the values defined in above. I..
This is my code
<script>
var body = "dddddd"
var script = "<script>window.print();</scr'+'ipt>";
var newWin = $("#printf")[0].contentWindow.document;
newWin.open();
newWin.clo..
Can't figure out why the columns aren't being structured with this HTML:
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="col..
What exactly is the technical difference between console.writeline and System.out.println?
I know that System.out.println writes to standard output but is this not the same thing as the console?
I ..
In my angular2 app i want to create a map which takes a number as key and returns an array of objects. I am currently implementing in following way but no luck. How should i implement it or should i u..
I put an Image control on a Window and I would like to display an image that is stored in a project resource file named "Resources.resx". The name of the image in the resource file is 'Search'.
Coul..
Once I change the DEBUG = False, my site will generate 500 (using wsgi & manage.py runserver), and there is no error info in Apache error log and it will run normally when I change debug to True ...
I'm executing a script connecting via password-less SSH on a remote host. I want to set a timeout, so that if the remote host is taking an infinite time to run, I want to come out of that ssh session ..
When implementing Quicksort, one of the things you have to do is to choose a pivot. But when I look at pseudocode like the one below, it is not clear how I should choose the pivot. First element of li..
I'm trying to get (not print, that's easy) the list of files in a directory and its sub directories.
I've tried:
def folder = "C:\\DevEnv\\Projects\\Generic";
def baseDir = new File(folder);
files =..
Suppose I have a directory /dir inside which there are 3 symlinks to other directories
/dir/dir11, /dir/dir12, and /dir/dir13. I want to list all the files in dir including the ones in dir11, dir12 a..
Can anyone show me some absolutely minimal ASP.NET code to understand Eval() and Bind()?
It is best if you provide me with two separate code-snippets or may be web-links...
This is currently what I have to delete the file but it's not working. I thought it may be permission problems or something but it wasn't. The file that I am testing with is empty and exists, so not s..
During the development of a Java webservice client I ran into a problem. Authentication for the webservice is using a client certificate, a username and a password. The client certificate I received f..
I am using the randomSplitfunction to get a small amount of a dataframe to use in dev purposes and I end up just taking the first df that is returned by this function.
val df_subset = data.randomSpli..
I thought this was a n00b thing to do. And, so, I've never done it. Then I saw that FriendFeed did this and actually made their DB scale better and decreased latency. I'm curious if I should do this. ..
I want to get the first letter of a string and I've noticed that $str[0] works great. I am just not sure whether this is 'good practice', as that notation is generally used with arrays. This feature d..
Is there a way to use javascript and JQuery to add some additional fields to be sent from a HTTP form using POST?
I mean:
<form action="somewhere" method="POST" id="form">
<input type="su..
I have this error message:
Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered.
What is the best way to write SQL code so that I will never see this error message again?
I coul..
I have a private git repository and I would like to extend its access to a member of my team. Will I be able to do it through the Github website? I have the username of my member.
I have tried to do ..
I want to reopen the stdin and stdout (and perhaps stderr while I'm at it) filehandles, so that future calls to printf() or putchar() or puts() will go to a file, and future calls to getc() and such w..
How can I configure windows command dialog to run different python versions in it? For example when I type python2 it runs python 2.7 and when I type python3 it runs python 3.3? I know how to configur..
I've seen a bunch of tutorials that seem do the same thing I'm trying to do, but for some reason my Docker containers exit. Basically, I'm setting up a web-server and a few daemons inside a Docker con..
While working on a system I'm creating, I attempted to use the following query in my project:
SELECT
topics.id,
topics.name,
topics.post_count,
topics.view_count,
COUNT( posts.solved_post ) AS solved..
I have the following code.
#include <iostream>
int * foo()
{
int a = 5;
return &a;
}
int main()
{
int* p = foo();
std::cout << *p;
*p = 8;
std::cout <<..
What is the difference between Divide and Conquer Algorithms and Dynamic Programming Algorithms? How are the two terms different? I do not understand the difference between them.
Please take a simple..
Is there a command in Microsoft SQL Server T-SQL to tell the script to stop processing?
I have a script that I want to keep for archival purposes, but I don't want anyone to run it...
I need to get the latest file of a folder using python. While using the code:
max(files, key = os.path.getctime)
I am getting the below error:
FileNotFoundError: [WinError 2] The system cannot f..
I want to import foo-bar.py. This works:
foobar = __import__("foo-bar")
This does not:
from "foo-bar" import *
My question: Is there any way that I can use the above format i.e., from "foo-bar" ..
Consider the following piece of LaTeX code:
\begin{tabular}{p{1in}p{1in}}
A & B\\
C & D\\
\end{tabular}
How can I make the contents of each cell aligned in the center of the cell rather t..
I have this button image:
I was wondering whether it would be possible to make a simple <a href="">some words</a> and style that link to appear as that button?
If it is possible, how do..
This is the usual SVG mime type:
image/svg+xml
And it works great. However, when embedding an SVG font, chrome tells you the mime type is incorrect, obviously because you return a font instead of a..
I'm getting the following exception.
Caused by:
java.lang.ClassCastException: java.math.BigInteger cannot be cast to
java.lang.Integer
with the following code
List queryResult = query.list..
How do I modify the owner of all tables in a PostgreSQL database?
I tried ALTER TABLE * OWNER TO new_owner but it doesn't support the asterisk syntax...
Can someone please help me with the issue.I want my activity as full screen and want to remove title from the screen.I have tried several ways but not able to remove it.
Activity Code :
public clas..
My web application uses sessions to store information about the user once they've logged in, and to maintain that information as they travel from page to page within the app. In this specific applicat..
I'm getting the error:
parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xED 0x6E 0x2C 0x20
When trying to process an XML response using simplexml_load_string from a 3rd party so..
When I use npm install fancyapps/fancybox#v2.6.1 --save, so fancybox package at v2.6.1 tag will be installed. This behavior is described in docs
I want to ask, how to do this with yarn?
Is this comm..
I want imagebutton with two states i) normal ii) touch(or click).
I have set normal image in the imagebutton background and I am trying to change image(pressed) from onclick method, but it doesn't ch..
I'd like to convert an Int in Swift to a String with leading zeros. For example consider this code:
for myInt in 1 ... 3 {
print("\(myInt)")
}
Currently the result of it is:
1
2
3
But I want..
I have a value cookie that is returned from a POST call using Python.
I need to check whether the cookie value is empty or null.
Thus I need a function or expression for the if condition.
How can I do..
I have a node.js script which need to start at boot and run under the www-data user. During development I always started the script with:
su www-data -c 'node /var/www/php-jobs/manager.js
I saw exa..
What are the uses for **kwargs in Python?
I know you can do an objects.filter on a table and pass in a **kwargs argument.
Can I also do this for specifying time deltas i.e. timedelta(hours = ..
I have been given a Source Folder (src) of a Java Project. I have created a .project file, kept it inside that folder and imported that Project into Eclipse 3.6 through the Import Existing Projects in..
I don't understand why R gives me a warning about "Longer object length is not a multiple of shorter object length"
I have this object which is generated by doing an aggregate over an xts se..
My application is working as a client application for a bank server. The application is sending a request and getting a response from the bank. This application is normally working fine, but sometimes..
From the Udacity's deep learning class, the softmax of y_i is simply the exponential divided by the sum of exponential of the whole Y vector:
Where S(y_i) is the softmax function of y_i and e is th..
I want to collect the items in a stream into a map which groups equal objects together, and maps to the number of occurrences.
List<String> list = Arrays.asList("Hello", "Hello&qu..
I have a table called products with primary key Id. I want to select all items in the table. This is the code is I'm using:
$batch_get_response = $dynamodb->batch_get_item(array(
'RequestItems..
I use both result() and result_array().
Usually i like to get my result as array thats why i use result_array() mostly..
But i want to know which is the better approach that i should follow,
Which o..
OK so I have a string that has this:
Dan|warrior|54
I'm trying to make so I can use python and split it using | as the delimiter. Here's what I have so far:
#!/usr/bin/env python
dan = 'dan|warrio..
I have built a component in React which is supposed to update its own style on window scroll to create a parallax effect.
The component render method looks like this:
function() {
let sty..
I've defined my div's height in a stylesheet:
.topbar{
width:100%;
height:70px;
background-color:#475;
}
But as soon as text is entered into the div, the divs height changes.
Any ideas?..
I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error..
No cached version of com.android.tools.build..
I am building a custom shopping cart where CC numbers and Exp date will be stored in a database until processing (then deleted). I need to encrypt this data (obviously).
I want to use the RSACryptoSe..
I have a text string stored as a BLOB data type in a database. I want to extract it by an SQL select query, but I have problems converting/casting from BLOB to readable text.
I've tried e.g.
select ..
What is the prefered method for creating a byte array from an input stream?
Here is my current solution with .NET 3.5.
Stream s;
byte[] b;
using (BinaryReader br = new BinaryReader(s))
{
b = ..
Like the title says, I'm looking for some simple way to run JUnit 4.x tests several times in a row automatically using Eclipse.
An example would be running the same test 10 times in a row and reporti..
What is the keyboard shortcut to expand the little red line that gives you the menu where you can choose to have the necessary using statement added to the top of the file?..
How do I limit os.walk to only return files in the directory I provide it?
def _dir_list(self, dir_name, whitelist):
outputList = []
for root, dirs, files in os.walk(dir_name):
for f ..
I'm using win8 previously I had been running Eclipse Juno on my pc but from now on I wanted to start using STS, I am getting the below error as soon as I create a new project. I deleted my .m2 folder ..
I want to add a new blank row to the gridview after binding as seen in the picture when clicking the link button below. The textboxes inside the gridview should remain the same if there is any data ..
I would like to rename the columns in the results of a SELECT expression. Of course, the following doesn't work:
SELECT * AS foobar_* FROM `foobar`
As I'm new to SQL, I think I'm just missing a co..
Javadoc of Collector shows how to collect elements of a stream into a new List. Is there an one-liner that adds the results into an existing ArrayList?..
Is there a way to send ZPL (Zebra Programming Language) to a printer in .NET?
I have the code to do this in Delphi, but it is not pretty and I would rather not try to recreate it in .NET as it is...
Coming from mercurial, I use branches to organize features.
Naturally, I want to see this work-flow in my history as well.
I started my new project using git and finished my first feature. When mergi..
Read the Following Code:
public class selectTable {
public static ResultSet rSet;
public static int total=0;
public static ResultSet onLoad_Opetations(Connection Conn, int rownum,String sql)
{
int r..
I need to write a batch file that copies a file to a new folder and renames it.
At the moment, my batch file consists of only this command:
COPY ABC.PDF \\Documents
As you can see, it only copies..
I am generally familiar with the technique of flushing a footer using css.
But I am having some trouble getting this approach to work for Twitter bootstrap, most likely due to the fact that Twitter b..
I would like to clarify the differences between by value and by reference.
I drew a picture
So, for passing by value,
a copy of an identical object is created with a different reference, and the..
I am trying to get my cron to only get Projects that are due to recur/renew in the next 7 days to send out reminder emails. I've just found out my logic doesn't quite work.
I currently have the query..
imagine I have a 3 columns matrix
x, y, z
where z is a function of x and y.
I know how to plot a "scatter plot" of these points with
plot3d(x,y,z)
But if I want a surface instead I must use other co..
Possible Duplicate:
how does one rename a schema in MySQL
Is there a MySQL statement for renaming a schema? I know about RENAME {DATABASE | SCHEMA} db_name TO new_db_name;, but that stateme..
Does anyone know how I can do an inner joins and alias values within so they won't overwrite each other? It might look more clear if you see my code:
SELECT home, away, g.network, g.date_start
..
How do you view ALL text from an NTEXT or NVARCHAR(max) in SQL Server Management Studio? By default, it only seems to return the first few hundred characters (255?) but sometimes I just want a quick ..
I'm into a quite strange position (from my java-newbie point of view):
using Eclipse I wrote a "java program" (some .java files with classes into) which essentially (batch) reads a text *.csv file, ..
I start planning a REST API with node.js ,express and mongodb. The API provides data for a website (public and private area) and maybe later a mobile app. The frontend will be developed with AngularJS..
Is it possible to insert into a BLOB column in oracle using sqldeveloper?
i.e. something like:
insert into mytable(id, myblob) values (1,'some magic here');
..
I am trying to parse an XML response, but I am failing miserably. I thought initially
that the xml was just not being returned in the response, so I crafted up the code below with a direct link to my..
I have a folder in my C: drive as C:\app_config\java_app
This folder contains some locale specific property files.
I have a java class (PrjPropertilesLocator) that loads the property files based on d..
On our internal network, we use a self-signed CA certificate. This has worked fine for years, in both Safari and our iOS product, all the way through iOS 10. We simply install the CA certificate on an..
I need to know the default port settings for the following services
SQL Server
SQL Browser
SQL Reporting services
SQL Analysis services
I neeed to know the port settings for these services for di..
I am trying to run this basic JPA/EJB code:
public static void main(String[] args){
UserBean user = new UserBean();
user.setId(1);
user.setUserName("name1");
user...
I'm trying to find files with specific extensions.
For example, I want to find all .pdf and .jpg files that's named Robert
I know I can do this command
$ find . -name '*.h' -o -name '*.cpp'
but ..
Lets suppose I have a list like this:
mylist = ["a","b","c","d"]
To get the values printed along with their index I can use Python's enumerate function like this
>>> for i,j in enumerate(..
I have a program which writes a user's highscore to a text file. The file is named by the user when they choose a playername.
If the file with that specific username already exists, then the program..
I'm wondering how I could create one of those nifty console counters in Python as in certain C/C++-programs.
I've got a loop doing things and the current output is along the lines of:
Doing thing 0
..
I want to play my song (mp3) from python, can you give me a simplest command to do that?
This is not correct:
import wave
w = wave.open("e:/LOCAL/Betrayer/Metalik Klinik1-Anak Sekolah.mp3","r")
..
I have a problem with Python threading and sending a string in the arguments.
def processLine(line) :
print "hello";
return;
.
dRecieved = connFile.readline();
processThread = threading.Th..
I want to prompt the user for a series of inputs, including a password and a filename.
I have an example of using host.ui.prompt, which seems sensible, but I can't understand the return.
Is there a ..
Is there a way to extract month and day using isoformats? Lets assume today's date is March 8, 2013.
>>> d = datetime.date.today()
>>> d.month
3
>>> d.day
8
I want:
>..
I would like to convert tab to spaces in gVim. I added the following line to my _vimrc:
set tabstop=2
It works to stop at two spaces but it still looks like one tab key is inserted (I tried to use ..
Is there a folder to keep programs to run while doing starting of the system. As like this "C:\Users\All Users\Microsoft\Windows\Start Menu\Programs\Startup"??.
Thanks,
Varun..
I'm trying to make login with Facebook available in my script. I've done everything, but when I attempt to login with a Facebook account I get this error from Facebook:
Error
App Not Setup: T..
I'd like to generate a MongoDB ObjectId with Mongoose. Is there a way to access the ObjectId constructor from Mongoose?
This question is about generating a new ObjectId from scratch. The generated I..
I am trying to create a 2 column grid, with literally a 50% with no margins or padding.
How do I achieve this with Bootstrap 3 I tried this but end up with negative margins at tablet/desktop break p..
Fragments seem to be very nice for separation of UI logic into some modules. But along with ViewPager its lifecycle is still misty to me. So Guru thoughts are badly needed!
Edit
See dumb solution b..
I have to do something like this in C. It works only if I use a char, but I need a string. How can I do this?
#define USER "jack" // jack or queen
#if USER == "jack"
#define USER_VS "queen"
#elif US..
I am trying to read an Excel file into a list of Data.DataTable, although with my current method it can take a very long time. I essentually go Worksheet by Worksheet, cell by cell, and it tends to ta..
I am trying out the @Cacheable annotation support for Spring 3.1 and wondering if there is any way to make the cached data clear out after a time by setting a TTL?
Right now from what I can see I need..
I am trying to display a "leaderboard" table based on JSON data.
I have read a lot about the JSON format and overcome some initial obstacles, but my Javascript knowledge is very limited and I need he..
Is it possible to center a background image in a div? I have tried just about everything - but no success:
<div id="doit">
Lorem Ipsum ...
</div>
//CSS
#doit { background-image: url(im..
I have this code
import json
from pprint import pprint
json_data=open('bookmarks.json')
jdata = json.load(json_data)
pprint (jdata)
json_data.close()
How can I search through it for u'uri': u'http..
How can I create a java.nio.file.Path object from a String object in Java 7?
I.e.
String textPath = "c:/dir1/dir2/dir3";
Path path = ?;
where ? is the missing code that uses textPath...
I have RedHat Enterprise Linux Server 7, and I downloaded the linux kernel version 4.12.10 which I am trying to compile but when I execute the following command:
make modules
I get the following er..
Let's say I have pulled the official mysql:5.6.21 image.
I have deployed this image by creating several docker containers.
These containers have been running for some time until MySQL 5.6.22 is rel..
Hello I'm having some trouble with the following code within my Index.html file:
<SCRIPT LANGUAGE="JavaScript" SRC="clock.js"></SCRIPT>
This works when my Index.html file is in the same..
I do not have access to the HTML or PHP for a page and can only edit via CSS. I've been doing modifications on a site and adding text via the ::after or ::before pseudo-elements and have found that es..
Seems like Google services are increasingly harder to manage.
Now i want to delete a project ID that was previously created in another test account.
Assuming that I could recreate it in another accou..
I have created a layout that contains two buttons, Next and Previous. In between the buttons I'm generating some dynamic views. So when I first launch the application I want to disable the "Previous" ..
I have a DataTable with 30+ columns and 6500+ rows.I need to dump the whole DataTable values into an Excel file.Can anyone please help with the C# code.I need each column value to be in a cell.To be p..
When a class in Java doesn't override hashCode(),
printing an instance of this class gives a nice unique number.
The Javadoc of Object says about hashCode():
As much as is reasonably practical, ..
Without routing, HttpContext.Current.Session is there so I know that the StateServer is working. When I route my requests, HttpContext.Current.Session is null in the routed page. I am using .NET 3.5 s..
I am wondering why the method String.valueOf(int i) exists ? I am using this method to convert int into String and just discovered the Integer.toString(int i) method.
After looking the implementation..
I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.
Is there a function that can do this easily?
For example:
$string1 = "I am ..
I am trying to get blue container in the middle of pink one, however seems vertical-align: middle; doesn't do the job in that case.
<div style="display: block; position: absolute; left: 50px; top:..
I am using the z Shell (zsh) instead of the default bash, and something wrong happen so that all commands who used to work are no longer recognized:
ls
zsh: command not found: ls
open -e .zshrc
zsh:..
Is it possible to get the start time of an old running process? It seems that ps will report the date (not the time) if it wasn't started today, and only the year if it wasn't started this year. Is th..
I am looking for a way to wrap APIs around default functions in my PHP-based web applications, databases and CMSs.
I have looked around and found several "skeleton" frameworks. In addition to the an..
I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ??? for special cases.
My setup is the fo..
The question is how to convert wstring to string?
I have next example :
#include <string>
#include <iostream>
int main()
{
std::wstring ws = L"Hello";
std::string s( ws.begin(),..
I have a tabular data which I need to export to csv without using any external plugin or api. I used the window.open method passing the mime types but faced issues like below:
How to determine whethe..
I'm used to writing PHP code, but do not often use Object-Oriented coding. I now need to interact with SOAP (as a client) and am not able to get the syntax right. I've got a WSDL file which allows me ..
Is there a way to build a forEach method in Java 8 that iterates with an index? Ideally I'd like something like this:
params.forEach((idx, e) -> query.bind(idx, e));
The best I could do right no..
I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error:
pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/eloque..
I'm trying to get the child span that has a class = 4. Here is an example element:
<div id="test">
<span class="one"></span>
<span class="two"></span>
<span class=..
I always mess up how to use const int*, const int * const, and int const * correctly. Is there a set of rules defining what you can and cannot do?
I want to know all the do's and all don'ts in terms ..
I have an object x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted pro..
I am using matplotlib to create the plots. I have to identify each plot with a different color which should be automatically generated by Python.
Can you please give me a method to put different colo..
When programming in Node.js and referencing files that are located somewhere in relation to your current directory, is there any reason to use the __dirname variable instead of just a regular ./? I've..
I have a simple TCP server that listens on a port.
var net = require("net");
var server = net.createServer(function(socket) {
socket.end("Hello!\n");
});
server.listen(7777);
I start it with ..
Downloaded Xamarin Android Player and with >>next>> progress installed Virtual Box.
When I tried to start an emulator I got
Failed to initialized device (name Of the emulator)
VboxManager Commendt ..
I am trying to list out duplicate elements in the integer list say for eg,
List<Integer> numbers = Arrays.asList(new Integer[]{1,2,1,3,4,4});
using Streams of jdk 8. Has anybody tried out..
I accidently checked the "disable alerts from this site" box in Chrome, and now I cannot get any window.alert to work on my localhost.
I have tried resetting the settings in advanced but no luck...
Is there a way to delete the newline at the end of a line in Vim, so that the next line is appended to the current line?
For example:
Evaluator<T>():
_bestPos(){
}
I'd like to put this a..
I'm trying to get latitude and longitude from Autocomplete Google Maps API without showing the map. In my script autocompletion works well, but I can't get the latitude and longitude.
_x000D_
_x000D_..
Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something..
I want my html file to show the code, but not the output of this chunk:
```{r echo=True, include=FALSE}
fun <- function(b)
{
for(a in b)
{print(a)
return(a * a)}
}
y &l..
I want to disable writing in an input field of type text using JavaScript, if possible.
The input field is populated from a database; that is why I don't want the user to modify its value...
By mistake, I did git add . and git commit in the develop branch. But luckily, I did not do git push.
So I wanted to revert it back to original state.
I tried git reset --soft and git reset HEAD --h..
I want to include a css file in my Laravel blade template.
I've tried:
@include(public_path('css/styles.css'))
But it says view does not exist. It does exist.
How can I include a css file?
Pleas..
How do I print the indicated div (without manually disabling all other content on the page)?
I want to avoid a new preview dialog, so creating a new window with this content is not useful.
The page ..
I have a JSP page with an HTML form:
<form action="SERVLET">
<input type="text" name="name"/><br>
<input type="text" name="group"/>
<input type="text" n..
I am currently writing a deployment script that installs a number of Windows services.
The services names are versioned, so I want to delete the prior Windows service version as part of the installs ..
I've been looking at passing arrays, or lists, as Python tends to call them, into a function.
I read something about using *args, such as:
def someFunc(*args)
for x in args
print x
Bu..
I have a dataframe in pandas where each column has different value range. For example:
df:
A B C
1000 10 0.5
765 5 0.35
800 7 0.09
Any idea how I can normalize the columns of this ..