FAQ Database Discussion Community


mysqli_query() expects parameter 1 to be mysqli, i cant use a variable?

php,oop,mysqli
index.php <?php if(!defined('ROOT')) { define('ROOT','C:/Apache/htdocs/website/inc'); } require_once ROOT. '/config/db.php'; require_once ROOT. '/library/classes/class.User.php'; $checkUser = new userFunction(); if($_SERVER["REQUEST_METHOD"] == "POST") { $username = $_POST["username"]; $password = $_POST["password"]; $user = $checkUser->userLogin($username, $password); if($user) { echo "Succes"; } else { echo "Failed"; } } db.php <?php class dbConnect { function __construct() { require_once('config.php');...

SSD performance benefit in OLTP vs OLAP

olap,ssd,oltp
In which system is SSD disk better over HDD as far as performance is concerned ? An OLTP or an OLAP system ? My guess is that in OLTP an SSD disk is more valuable, because transactions are constantly occurring and we need the non-sequential read-write speeds. Is this correct...

Group nodes in hiera by hiera-defined fact

puppet,configuration-files,hiera
I have a hierachy like this: - "nodes/%{::certname}" - (what's here is my question) - common I'd like to assign a group to my nodes in their individual configuration in hiera, like this in nodes/hostname.yaml : --- group: alpha Now, I'd like to have a file alpha.yaml, where I state...

How to get a button's ID when clicked in Windows 8 apps?

javascript,html,javascript-events,click,windows-8.1
I'm trying to get the ID of the button I clicked but I can't do it. I tried everything but it doesn't work. How can I do this? ...

Delivery optimization with limits

algorithm,optimization
I have the following problem to solve: There are N cities. Each of them has some count of test samples which are needed to be processed in laboratories (labs). There are M labs. They process samples, but each has limits. We need to process all the samples. Optimization by the...

Get current rotation in degrees of group in snap.svg

svg,rotation,snap.svg
how do i get the current rotation in degrees of a element in snap.svg? I can set a tranform but i find no easy way of getting a value. A typical group looks like this. <g transform="matrix(0.5154,0.5154,-0.5154,0.5154,64.3512,5.239)"><text x="0" y="0" style="font-size: 12px;">Change text</text></g> ...

Run a loop over a callback, node js

javascript,node.js,asynchronous
I need to resize some images. Problem is the library I'm using do one resize per callback. I want to resize several images so I put it in a loop: exports.resizeImages = function (req, res) { var images = fs.readdirSync('uploads/'); for (var n = 0; n < files.length; n++) {...

How can I use a non-const type on my ARC code?

ios,objective-c
Following one of Apple's examples I'm getting an Pointer to non-const type 'id' with no explicit ownership And a few other errors... This is my snippet: NSArray *mArray = argsList; id *objects; NSRange range = NSMakeRange(2, [argsList count]); objects = malloc(sizeof(NSString *) * range.length); [mArray getObjects:objects range:range]; for (i =...

MySQL table linking 1:n

mysql,jointable
So first up I'm not sure if this is a double post or not because I don't know how the exact approach or feature is called and if it even exist. I know that MySQL has a feature called joints My plan is to link two MySQL tables in relation...

Last pid process linux

linux,pid
I'm trying to get the last pid of a process (for example sleep). I do this: # sleep 10 & [1] 14115 But when I use this command to get the last pid: # ps aux --sort +start_time | tail -n 4 | awk 'NR==1{print $2 " " $11}' 14125...

ODE - Solving Parameter Dependent on Variable [Matlab]

matlab,parameter-passing,ode
Lets say I have a function file of the ODE that goes like this function xprime = RabbitTemp(t,X) % Model of Rabbit Population % where, % Xo = Initial Population of Rabbits % X(1) = Population density of Rabbit % X(2) = Temperature T (that varies with time) % a...

Is TcpClient a single connection use? How do I send a second message?

c#,sockets,tcpclient
I have a TcpClient object which can connect to a foreign program. I can send one message (xml serialized message). But as soon as I close my network stream my TcpClient closes and disposes. And the second time I try to send a message via my TcpClient I get an...

What could cause a Java TCP socket to close?

java,sockets,tcp
I'm trying to use an implementation of an MQTT client specifically Paho Java client in Android, and trying to trace where I get an EOFException error. Specifically this happens on in.readByte();. public final byte readByte() throws IOException { int temp = in.read(); if (temp < 0) { throw new EOFException();...

Extending Highmaps Side Effect

javascript,jquery,highcharts,geojson
I am trying to create a dot density map of the state of Florida. While I know that Highmaps doesn't support color axis with mappoints. I extended it and it works but it comes with a side affect. When I click on one of the categories in the legend no...

Keep form feed characters in CSS-string unchanged in javascript

javascript
How can I avoid form feed characters to be parsed in a javascript string? I have a variable holding this string var css = 'content: "\f005"'; but the string is not left unchanged when I use it. E.g. console.log(css) gives content: "005" My "solution" so far is this lille hack...

Strange npm behavior when installing packages like grunt

node.js,gruntjs,npm,gulp,bower
I run the following command in my bash and I get the related results: [email protected]:~$ sudo npm install -g grunt-cli /usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt [email protected] /usr/local/lib/node_modules/grunt-cli ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected]) and [email protected]:~$ grunt /usr/bin/env: node: No such file or directory I also have try to install...

Problems with check if GPS, and bluetooth is activated

java,android,bluetooth,gps
I have some problems with a check if user has turned on bluetooth, and gps. If the GPS is turned off the "OK" icon allways display status as the gps is activated. If the bluetooth is turned on the "OK" icon will show. But not the "notOK" icon when it's...

Java - Unloading classes

java
I'm loading classes with the standard Java classloader: ClassLoader loader = new MemoryClassLoader(s.toByteArray()); Class<?> myClass = loader.loadClass(className); MemoryClassLoader is directly derived from ClassLoader and overrides the findClass()-method: Override protected Class<?> findClass(String name) throws ClassNotFoundException { return defineClass(name, byteArray, 0, byteArray.length); } What I would like to know is if it...

Add a space after comma using VBA regex

regex,excel,vba,excel-vba
I'm trying to use a regex to find cells in a range that have a comma, but no space after that comma. Then, I want to simply add a space between the comma and the next character. For example, a cell has Wayne,Bruce text inside, but I want to turn...

vertical bar chart with with user input and validation

javascript,html,validation,charts
i need a make a code where the user can add the max points, achieved points and his name. this is my code..most things are already working, i just need a function to change the max points, right now its a static number. <head> <title>examAnalysis</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" />...

Whats wrong with this query? Using ands

php,mysql
I've got no errors, nothing, but for some reason my page is blank, thanks to this: $userBusca = mysqli_query($conn, "SELECT * FROM account.login_admin WHERE login='".$login."' AND password='".$password."' AND key='".$key_load."'") or die(mysql_error()); The login and password are froma form, and the key_load is a string from a text file. Is there...

Conditional Logic for links in ACF

php,wordpress,if-statement,conditional,acf
So here is what im trying to do. Im using Advanced Custom Fields for this and am outputting a title with a link, But sometimes their is NO link. When there is NO link I don't want this to be wrapped in a tag but I can't seem to figure...

Why would my Mule project suddenly start complaining about “Invalid keystore format”

mule,mule-studio
While trying to learn how to use the Imap connector in Mule studio, I came across this tutorial. I downloaded it and imported it into AnyPoint studio as a project, and as it were in that tutorial, it worked great (after sending the connector to the right host/port etc.) I...

c++ unsigned char array allocation - segmentation fault

c,segmentation-fault,malloc,memset,unsigned-char
I can't figure out what seems to be the problem that I get a segmentation fault from this: #include <stdio.h> #include <stdlib.h> #include <cstring> void alloc(unsigned char *data) { data = (unsigned char *) malloc(20); memset(data, 0, 20); } void main() { unsigned char *data = NULL; int i; alloc(data);...

Does compiler optimize operation on const variable and literal const number?

c#,.net,optimization
Let's say I have class with field: const double magicalConstant = 43; This is somewhere in code: double random = GetRandom(); double unicornAge = random * magicalConstant * 2.0; Will compiler optimize my code so that it doesn't calculate magicalConstant * 2.0 every time it calcuates unicornAge? I know that...

Why does saveInBackgroundWithBlock only work *once* in my Parse-enabled class?

ios,objective-c,parse.com
I have a class with this code which gets called a few times per minute on average, and only runs on the main thread: PFObject* eventObj = [PFObject objectWithClassName:@"AdminConsoleEvent"]; eventObj[kACParseEventName] = event; eventObj[kACParseEventUrgency] = urgency; if( param1 ) eventObj[kACParseEventParam1] = param1; eventObj[kACParseEventPointerToAdminConsole] = self.adminConsole; === [eventObj saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error)...

Iterating Through multiple dropdowns in jquery

javascript,jquery
Hi I have for loop which iterates and set the multiple dropdowns. I want to iterate through each dropdown and set the background color onload . For some reason, only the first list populates the color and that too only in Chrome. here is the fiddle code. How do I...

Variable passed through environment not available in script

linux,bash,shell
I'm trying to write an if/elif/else statement where if a variable equals "Full" it will cat a file and if the same variable equals "Quick" it will read a different, smaller file. The variable is being set outside of the script and is being exported by export var1=Quick I have...

Two Assert.AreEqual() comparisons, depending on the input value

c#,unit-testing
I want to check for equality between an enum I created and an input value from a file. It should be one of 3 values and in one case, 2 of these values essentially mean the same thing. enum myEnum { ver1, ver2, ver3}; The code is simplified a bit,...

Delete a column and a row in a square matrix in C

c,matrix
I had a square matrix typed dynamically, correctly allocated double **matrix; I want to delete a "x" row and "x" column from that matrix, in a way like that: SOURCE MATRIX: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 I want to...

How to delay the disappearance of an element on mouseout

html,css,css3
I got a li element on my page which is <li class="basket last items">. If the user hovers over that li another div is shown which is <div class="articles">. I want to delay the disappearance of the div on mouseout. My current css rules: #headlinks li.basket div.articles { padding:5px; width:380px;...

Issues with relative/absolute path

php,path,relative-path,realpath,pathinfo
I've searched ways to do it so it would work but none of them seemed to work for all paths, so I was wondering if you could give me a direction on how to do this: This is the structure: Home Directoy config.php index.php includes/ user_login.php applicant_track.php ucp/ index.php When...

Access Query for Averaging based on Dates

sql,date,ms-access
I have a table that looks like this: ╔═════╦═══════════╦══════╦═══════╗ ║ ID ║ Attribute ║ Year ║ Month ║ ╠═════╬═══════════╬══════╬═══════╣ ║ 1 ║ 15.2 ║ 2014 ║ 11 ║ ║ 1 ║ 13.1 ║ 2014 ║ 12 ║ ║ 1 ║ 5.6 ║ 2015 ║ 1 ║ ║ 2 ║ 7.9...

Can't get Zurb Foundation accordion to work

javascript,zurb-foundation,accordion
I'm using Zurb's Foundation, attempting to build a FAQ page using the accordion js. But it's not working and I have no idea why. All the js files are in the js folder. Here's my whole page: <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link...

sort a list of strings with name and number in

python-2.7,sorting
I am trying to sort a list of 100 filenames so they will used in the right order in later calculations. All the filenames have 'name_1' in the beginning of the name and '_out.txt' at the end. The difference is a number in between, going from 1-100 The list looks...

Downloading and interpreting data from a URL using HTML [closed]

javascript,html
Okay let me preface this by saying that I know next to nothing about HTML. I need to download information from a URL, and print it out onto an HTML webpage. The URL is more-or-less nothing but raw text data. How would I go about extracting the information from the...

AngularJS how to use $q in Typescript

javascript,angularjs,typescript,q
I am new at AngularJs and very new at Typescript. I included Typescript in my AngularJs project but couldn't handle a service where i return a $q(function(){...}) my code looks like: function foo(request, monitor, currentMonitorPropertys) { var currentChart; return $q(function (resolve) { $http(request).success(function (chartResponse) { ... resolve(monitor); }).error(function(response){ ... });...

Oracle BI (OBIEE) - Wildcard search for numeric values only

obiee
I need to set up a query that returns only the values that would match a pattern {Any character & digit} I've tried setting up a filter criteria to ' %_ [0-9] but it doesn't work...I want to exclude any results that have two letters as the first two characters...

Android - Center Gallery elements vertically

android,android-gallery
I'm using a library called FancyCoverFlow which extends Gallery. I tried adding : android:gravity="center" in the layout to center child elements with no luck. The gallery is stretched on the entire screen, I made its background red to make sure. How do you center Gallery child elements vertically ?...

Killing a process spawned by another thread

python,multithreading,multiprocessing
I have a Python process which is spawning another process from a separate thread, e.g. class MyClass(unittest.TestCase): def setup(self): def spawn_proc(): subprocess.call("test_process") thread = threading.Thread(target=spawn_proc, args=(), daemon=True) thread.start() def cleanup(self): # @@@ kill test_process So calling MyClass.setup() means the test_process will be spawned in second thread. What I want is...

Problems adding DataTable as datasource in C1Report (VB) ComponentOne

vb.net,report,componentone
I'm having troubles to assign a datasource to a code-generated c1report. This is the datatable data. This is the output result pdf view. I'm using Visual Studio 2008 with ComponentOne 2009. The result pdf file as not the correct data, only the titles repeated to bottom. Then, this is the...

iOS: SWRevealViewController opening WebView control without Navigation bar

ios,objective-c,swrevealviewcontroller
The app has a navigation bar that is included in all the scenes within the app. SWRevealViewController has been used to create a slide out menu, also appearing in all scenes. It contains a tableview that initiates the segues to other scenes. Two of the links in this menu segue...

invoking function for each variadic template arguments and passing the result as constructor arguments

c++,c++11
So i want to generate a lambda that will invoke a constructor by retrieving the constructor's parameters from a factory. I want to convert this code that works right now into a variadic template so it will work with any number of constructor parameters. Any idea how to do this?...

Akka cluster and OpenShift

scala,akka,openshift
I'm new to Akka Clusters, however as I am understanding its documentation, I need to know at least one "seed node" to join an existing cluster. So when using clusters with OpenShift I would need to know if the current gear is the first node - then I would create...

Delete the extra space after special character in all the lines of text file

bash,shell,text,awk,sed
Following data represents 2 lines of text file: 1 2340: 2 1930: 1 1 9: 3 4501: 1 45: 1 5620: 2 I want to delete the space after ":". So the output of above text file should be 1 2340:2 1930:1 1 9:3 4501:1 45:1 5620:2 ...

Do executable files always open a terminal window on MacOS?

osx,terminal,executable,app-bundle
I'm on MacOS X, and I'm pretty new to app-bundle-type things. I am writing a program that opens a window and registers mouse input -- not a command line tool. When I compile my code (written in C, if that is important) into an executable file (a "unix executable file")...

I cannot assign a value to a variable after call a function in javascript

javascript,function,variables,global-variables
I am making a modification of the popular game rock-paper-scissors-lizard-spock based on a algorithm proposed by someone on this site. Here is my Js: //¿Es obligatorio declarar las variables? var Elementos = ["AIRE", "OSCURIDAD", "AGUA", "FUEGO", "TIERRA"]; var resultados = [" empata con ", " derrota a ", " pierde...

Why bash functions use round brackets, if those are never filled with arguments?

bash
The function definition syntax for various languages is: C (the godfather of all scripting languages): func_type myfunc_c (arg_type arg_name , ...) { /* arguments explicitly specified */ } TCL: proc myfunc_tcl {arg1 arg2 args} { # arguments explicitly specified } Perl: sub myfunc_perl { # no arguments explicitly specified &&...

pyqtgraph ignores some of my data and add some random data

python,pyqt4,pyqtgraph
I am using pyqt4 and PlotWidget for viewing some plots. I have some datetime values in y-axis data. but the problem is that pyqtgraph ignores some of datetime values and add some random data into them. I used setRange method but because some specific data may exists between min and...

Large Neo4j graph not showing up

database,graph,neo4j,cypher,graph-databases
I created a large neo4j graph connecting users to the videos they watch like user -> video in a social graph or network type of graph. There are about 9000 user nodes and 20000 video nodes. If I try: MATCH (u)-[:VIEW]->(v) RETURN u,v The graph says "Displaying 300000 nodes, 0...

White space under image

html,css
I can't remove white space under my images after i added boarder. How do i get rid of this? <div style="width: 1200px;"> <div style="float: left; width: 358 px; margin: 0px 7px 0px 0px; border: 1px solid #021a40;"><img src="{{media url="wysiwyg/3row/3row-no-boarder_07.jpg"}}" alt="" /></div> <div style="float: left; width: 358 px; margin: 0px 7px...

SQL Query - Order by String (which contains number and chars)

sql,sql-server
I need some help with a sql query which I can't get it work. I need to order these values by number then by letter. Any suggestion how to do it? I am working on Sql Server 2014, but I think it's irrelevant. Cod_Turma Turma 1 11-A 2 11-F 3...

looking for help in configuring .emacs file for python (python.el),

emacs,python.el
My emacs version is 24.5, using in built python. I have written these lines in my .emacs for it: (require 'python) (setq python-shell-interpreter "C:/Python34") The problem is none of the commands (when I am trying to run test.py) are working. I have tried several commands named like M-x python-shell-* and...

Beautifulsoup: Getting a new line when I tried to access the soup.head.next_sibling value with Beautifulsoup4

python,python-2.7,web,web-scraping,beautifulsoup
I am trying an example from the BeautifulSoupDocs and found it acting weird. When I try to access the next_sibling value, instead of the "body" a '\n' is coming in to picture. html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p class="title"><b>The Dormouse's story</b></p> <p class="story">Once upon a time there were...

How to avoid concurrent access to a resource?

java,multithreading,synchronization,completable-future
I have four threads runs asynchronously using CompletableFuture as shown below in the code. and all of them should access "grownSeedXYList". sometime when i run the code i receive no errors, but some time i receive "java.util.concurrent.completionexception" and i thinkk this is because the "grownSeedXYList" is not synchronized. please let...

php Variable name must change in for loop

php
On my form I've got a select from a table. I've put it in a for loop so that each time the name of the select changes to option0, option1, etc. Then on the action page of the form I need to get the info for each option selected, eg...

Cakephp: How to use migration to insert records

php,sql,cakephp,cakephp-3.0
I'm using CakePHP v3.x and I'm trying to figure out how to insert some records via the migrations tool. The documentation only lists methods for modifying the schema. Will I need to insert records manually with raw SQL?

HttpServlet in IBM Java?

bluemix,ibm-jdk
I'm trying to build an app using IBM Bluemix that takes user input in an HTML form, processes it in a server-side Java application, and returns the processed data to the user. This kind of thing is really simple to implement using HttpServlet, but that class doesn't seem to exist...

How to bind multiple properties in a UserControl

c#,wpf,xaml,binding,user-controls
Let's say we have a UserControl like this: <UserControl x:Class="...> <StackPanel> <TextBlock Name="TextBlock1" /> <TextBlock Name="TextBlock2" /> <TextBlock Name="TextBlock3" /> ... <TextBlock Name="TextBlock10" /> </StackPanel> </UserControl> And we have properties defined like this: public string Text1 { get; set; } public string Text2 { get; set; } public string Text3...

How to sort a multi-dimensional array by the second array in descending order?

javascript,arrays,sorting,multidimensional-array
I have an array in JavaScript. var array = [[12,3],[10,2],[8,1],[12,3],[7,1],[6,1],[4,1],[10,2],[12,3]] I would like to sort this array by the second value in descending order. The expected output is [[12,3],[12,3],[12,3],[10,2][10,2],[8,1],[7,1],[6,1],[4,1] I've tried array.sort(function(array) { return array[1] - array[1] } Unfortunately, that didn't work. Sorting single-dimensional arrays is easy but I'm not...

C++ won't read in scientific notation data from a .txt file

c++,arrays,notation
I am writing a program which is reading in an array from a text file which has both normal integers, and also multiple numbers that are in scientific notation, of the form: #.#####E##. Here is a few sample lines of the input .txt file: 21 -1 0 0 501 502...

JSON error: Expecting 'STRING'

json
[ { votes: "3449", title: "The Martian | Official Trailer [HD] | 20th Century FOX", post_url: "https://www.youtube.com/watch?v=Ue4PCI0NamI", inner_url: "https://www.reddit.com/r/movies/comments/390vcp/the_martian_official_trailer_hd_20th_century_fox/" }, { votes: "4582", title: "The Easter Island heads have detailed bodies", post_url: "http://imgur.com/a/vDFzS", inner_url: "https://www.reddit.com/r/pics/comments/390cfz/the_easter_island_heads_have_detailed_bodies/" } ] There's a problem in line 2, but I don't see anything wrong with...

Output bash variable with multiple lines to curl json

json,bash,curl,github-api
I'm trying to create a script that will use the Github API to post a comment containing the output of a command. This output has multiple lines. Here's what I'm trying to do: curl -H "Authorization: token oauthtoken" \ -H "Content-Type: application/json" \ -X POST [email protected] \ https://api.github.com/repos/company/repo/issues/14/comments <<EOF {...

Extend dataframe by adding start and end date and fill it with timestamps and NaN

python,pandas,timestamp
I have got the following data: data timestamp 2012-06-01 17:00:00 9 2012-06-01 20:00:00 8 2012-06-01 13:00:00 9 2012-06-01 10:00:00 9 and would like to sort it descending by time, add a start and end date on top and bottom of the data, so that it looks like this: data timestamp...

Getting linux system UUID which changes after reboot

linux
I'm looking for a linux system session id which is constant over the full runtime of the linux session (as long as uptime is increasing). After each reboot, it should be reset to another (random) value, probably formatted as a uuid. I need this for logging in a global context,...

How to check button clicked in new UI button of unity 5.0

button,unity3d
I added the new UI buttons of unity 5.0 in place of the old GUI texture buttons in these buttons how to i check when the button has been pressed and released and how to make the Onclick event keep repeating itself...

Disable variable in eval

javascript
Is there a way to disable some variables for an eval? var test = 'example'; eval('console.log(test)'); // here I would like test null console.log(test); // here test should display 'example' ...

Replacement of temporary tables for UDF

sql-server,tsql
I tried to create a temporary table variable, but do not know how to pass it to the procedure such that procedure could make operation insert into @temp_table CREATE FUNCTION dbo.function1 ( @DocId int ) RETURNS @ret TABLE ( [Id] int , [DocId] int , [EatId] int , [WasteCold] decimal(5,...

Cannot find InvalidCastException in C# Application

c#,winforms,visual-studio,visual-studio-2012,webforms
I'm getting a strange error in Visual Studio, and of course this great software is unable to tell me where the error is, just that I'm getting an error. I guess the best I can do is paste my code. using (SQLiteCommand cmd = new SQLiteCommand(query, con)) { using (SQLiteDataReader...

Display images on Django Template Site

python,django,image,static
I read a lot about including image files, but i still don't get it :( my models.py class Movie(models.Model): image_url = models.URLField(max_length=1024, blank=True, null=True) image_file = models.ImageField(upload_to='poster/', blank=True) my index.html {% load staticfiles %} <img src="{% static "{{movie.image_file}}" %}" /> The pictures are saved on harddisk /myapp/poster Thanks for helping....

fftw of 16bit Audio :: peak appearing wrong at 2f

c++,audio,fft,fftw,portaudio
I am taking 32bit float audio(44.1Khz) on my PC(between -1 and +1) using Port Audio and taking fft of it with fftw. Now I need to take the 16bit int Audio and take its fft. I have converted the Audio samples to float between -1 and +1. The fft works...

Oracle sql- replace null with next and p

sql,oracle,sql-update
I am trying to UPDATE a table and replace NULL values but with certain conditions. I created an example below and order it by cases to help illustrate where my conditions apply. 1º - In case there is a NULL value it is supposed to replace with the previous known...

Google Maps API Re-size

javascript,android,mysql,google-maps
Completly new to Google Maps API. At the moment I have it pulling in data from my mySQL database and adding in a marker. However I want to change the size of the map to fit my sites layout. This is the code I have at the moment. <!DOCTYPE html...

CSS Class is not applying to element (border width,color,and style attributes)

html,css
Hello working on a course over at freecodecamp.com and I am supposed to add border width color and style to an image via a class. I am not having luck getting it to take though. I cannot see what I am doing wrong. .thick-green-border { border-width: 10px border-color: green border-style:...

how can I reduce the digits after the decimal point to only 5 digit latitude longitude in string?

javascript,jquery,leaflet
I have this string generated with terraformer-wkt using leaflet: POLYGON((-66.85271859169006 10.488056634656399,-66.85351252555847 10.486178802289459,-66.85342669487 10.485250431517958,-66.84864163398743)) I want reduce the decimal digits only 5 digit after the point . POLYGON((-66.85271 10.48805,-66.85351 10.48617,-66.85342 10.48525,-66.84864)) I saw in javascrips how reduce Convert a number into a string, keeping only 5 decimals but I dont know...

Generating Difficult Classification Data Sets using scikit-learn

scikit-learn
I am trying to generate a range of synthetic data sets using make_classification in scikit-learn, with varying sample sizes, prevalences (i.e., proportions of the positive class), and accuracies. Varying the sample size and prevalence is fairly straightforward, but I am having difficult generating any data sets that have less than...

jQuery event.keyCode for Enter (13) is skipped if there are required fields in the HTML

jquery,keyup,required-field
I am using the required="yes" attribute in a few fields within my form. I have a search box within the form to auto-populate a drop-down list if the item they are looking for is not already on there. In my jQuery, I watch the keyup event for the field. $("input#search-input-text").keyup(function(event){}....

Different cakephp datasource for local and live

cakephp,cakephp-3.0
My MySQL connection details are different for both my local connection and my deployed live hosted. I am using CakePHP 3 At the moment I have to keep changing the default datasource which is not really the best way to do it. I have not added two datasources but I...

Exporting and Importing a array from python

python,arrays,python-3.x,export
I currently have the array below and I am trying to export it to a .txt file and then importing it back into python, how would i go about doing this. data = [ {"score": "10", "grade": "E", "music": "song5", "maxcombo": "1", "perfect": "20", "great": "1", "good": "20", "miss": "1"},...

having spring integration tcpserver to manage clients and send them messages

java,tcp,spring-integration
I have already created a simple tcp server with spring integration which keeps a connection alive and responses to each request during the connection. In that requestMethod, I'm also able to read the MessageHeder to get the connectionId. Now I want to send messages from the server to the client....

TypeScript export imported interface

typescript
I use AMD modules and I want to hide a complex interface behind one file that loads several other files and chooses what to expose and how. It works, I use this solution but it feels kinda ugly, mostly with the interfaces. import Types = require('./message-types'); import MessageBaseImport = require('./message-base');...

Pure CSS3 or SVG animated Doughnut Chart

html,css,css3,svg,charts
I am looking for a pure CSS3 or SVG animated doughnut chart. Need to have the middle circle fill colour the outer circle to be split with a grey and a blue ie: blue 80% complete, grey 20% left remaining. need text in the middle of the circle. I have...

Exception “Procedure or function expects parameter, which was not supplied.” thrown even after supplying the parameter

c#,.net,sql-server,stored-procedures,sql-server-2012
I am trying insert some entries in the database using a stored procedure which is called by a C# method as shown below: public int addProfile(UserProfile NewUserPro) { DataSet ds = ExecuteStoredProcedure("AddNewPro", new SqlParameter[]{ new SqlParameter("@UserID", NewUserPro.UsrId), new SqlParameter("@Type", NewUserPro.Type), new SqlParameter("@Phone", NewUserPro.Phone), new SqlParameter("@Name", NewUserPro.Name), new SqlParameter("@FatherName", NewUserPro.FatherName), new...

DataTable().ajax.reload() not reloading table

jquery,ajax,datatables
I am populating rows into table body by using jQuery append function this works fine, but when I try to search any data from table then the table gets cleared. Here is my code. for (i = 0; i < mapping.length; i++) { var tr = $('<tr>' + '<td>' +...

Take different actions depending on jTextField value

java,if-statement,jtextfield
I have many more cases, but I'm wondering if there is a simpler way to do this. If the user enters 1 the program will convert from inches to cm, if the user enters 2, the program will convert from cm to feet, etc. if (jTextField1.getText() == 1) { InchesToCm();...

How to load page with accordion open based on external link

jquery,accordion,external-links
I am working on a FAQ/Helpcenter page for my company. One of the last things we are trying to accomplish is a "top questions section" where users can just click on the question and it opens a link to the page the question is on and the accordion is open...

c3p0 connection pooling, DataSources factory, how do I close the pool?

java,postgresql,sqlite,connection-pooling,c3p0
I'm trying to use C3P0 for connection pooling with both PostgreSQL and SQLite. The PostgreSQL side works no problem. I've followed the directions here, but I don't understand how to close the SQLite side down when I'm done with it. In other words, on the PostgreSQL side, where I'm using...

Why are the aliases for string and object in lowercase?

c#,alias,naming,primitive-types,complextype
Here are a list of aliases in C# (compliments of What's the difference between String and string?): object: System.Object string: System.String bool: System.Boolean byte: System.Byte sbyte: System.SByte short: System.Int16 ushort: System.UInt16 int: System.Int32 uint: System.UInt32 long: System.Int64 ulong: System.UInt64 float: System.Single double: System.Double decimal: System.Decimal char: System.Char I can see...

Is there a way to make a field label in forms datasheet mode to be multi-line?

forms,ms-access
I need a reasonably long label name but don't want to make the datasheet column unnecessarily large since the corresponding data is not large. Is there a way to get Access to break the label into multiple lines? Thanks...

INNER JOIN clause ignoring NULL values

sql-server,sql-server-2008,join
I am looking to query some data that pertains to medications a patient has been prescribed that are in a certain category. But I also want to show patients that do not have any medications. My query so far: SELECT pd.fname, pd.lname, pp.drug_name, pp.drug_strength FROM patient_data pd FULL OUTER JOIN...

Why async code is run on worker thread in C#

c#,multithreading,asynchronous,async-await
I am playing with the async/await in the C# and while I think that I understand most of the concepts, I can not explain why the code line "var rxres = await ..." first time runs on my UDP thread, and after further receptions of the packets runs on the...

Disable Swipe for position in RecyclerView using ItemTouchHelper.SimpleCallback

android,recyclerview
I am using recyclerview 22.2.0 and the helper class ItemTouchHelper.SimpleCallback to enable swipe-to-dismiss option to my list. But as I have a type of header on it, I need to disable the swipe behavior for the first position of the adapter. As RecyclerView.Adapter doesn't have a isEnabled() method, I tried...

GET var from php to use in javascript function

javascript,php
i want to get a var from a php script and use it in a function .. so if i call the var simply with $.get (and document.write) i got an result but how can i integrate this into a function ? $.get( 'http://www.domain.de/content/entwicklung/verdienst.php', function(verdienst_php) { //document.write(verdienst_php); }); function sendview...

Column displays each count

sql,oracle,multiple-columns
I am trying to run a query to count records based on a time stamp year to year. Here is a query that I currently have: SELECT plocation AS GROUP_NUMBER, count(DISTINCT UMEMBERID) AS YEAR_ONE FROM HEALTH_ASSESSMENT WHERE PUBLICATIONDT > '31-DEC-13'AND PUBLICATIONDT < '01-JAN-15' GROUP BY PLOCATION It counts exactly what...

Form Briefly Clones and then Disappears

javascript,jquery,html,forms
While I managed to get my example to work, the code that I was testing it for doesn't seem to like it. When I click the add button, the duplicated form will appear on screen for a second then immediately vanish. I basically does the same thing in JSFiddle, though...

How to use awk regex sort by query string value?

regex,linux,awk
I have a log file with example row: xxx.xxx.xxx.xxx - - [07/Jun/2015:14:18:39 +0000] "GET /file/?t=70 HTTP/1.1" 200 35 "http://1234.com/p/talk-about-owning-it/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome" The 7th column of each row looks like this: /file/?t=70 /file/?t=4785&k=1 /file/?t=120 /file/?t=95&k=0 /file/?t=120 /file/?t=120&k=0 /file/?t=95&k=1 ... Output is arranged according...

why float right is not working also used important?

javascript,angularjs,css3,angularjs-directive,ionic-framework
I have three image buttons in my header which is in right side as show in image ,I am trying to add three buttons on header .But it is not taking float:right and margin-right .I need to make like this please check image ![enter image description here][1] I have "+"...

Add onclick listener by button class name for table class referred to by class name

javascript,jquery,html,css,twitter-bootstrap
EDIT: This jsfiddle might be easier to work with to understand the heart of my problem: jsfiddle.net/rzdhm6xe I am developing a site which handles creation of events. I am using: Parse.js: 1.4.2 JQuery: 1.11.2 and 1.10.3 (U.I.) Twitter Bootstrap: 3.3.4 I cannot post the entire html file because I am...

How to list merge conflicts on origin that are not on local?

git,git-merge,merge-conflict-resolution,atlassian-stash
Stash is rejecting my pull request due to merge conflicts. So I create a merge branch, merge destination into the merge branch, (there's nothing to commit), push anyway and open the pull request again. Still rejected for conflicts. I've deleted and recreated 3 times, and getting the same results each...

Can't seem to target #document selector

javascript,jquery
I'm using embedly to embed a YouTube video on a page. When the iFrame is embedded, I'm attempting to target the video which is deeply nested within this iframe. I'm not sure how to target the #document so that I can continue to drill down (within its HTML tags) and...