javascript,csv,d3.js,graphingRelated issues-Collection of common programming errors
Andrew Whitaker
javascript regex
I am trying to build a regexp from static text plus a variable in javascript. Obviously I am missing something very basic, see comments in code below. Help is very much appreciated:var test_string = “goodweather”;// One regexp we just set: var regexp1 = /goodweather/;// The other regexp we built from a variable + static text: var regexp_part = “good”; var regexp2 = “\/” + regexp_part + “weather\/”;// These alerts now show the 2 regexp are completely identical: alert (regexp1); alert (regexp2);/
DOTang
javascript regex
I am searching for text inside of website resources (html and javascript), and need to identify 3 regular expressions that will locate this text under certain circumstances:some string of text when it is contained inside of a javascript single-quoted string some string of text when it is contained inside of a javascript double-quoted string some string of text when it is not contained inside of a javascript stringHere are some scenarios that are likely to occur (searching for the string “somestr
Andy E
javascript html
I’m building up a row to insert in a table using jQuery by creating a html string, i.e.var row = “”; row += “<tr>”; row += “<td>Name</td>”; row += “<td><input value='”+data.name+”‘/></td>”; row += “</tr>”;data.name is a string returned from an ajax call which could contain any characters. If it contains a single quote, ‘, it will break the HTML by defining the end of the attribute value. How can I ensure that the string is rendered correctly in the brow
sameer
javascript angularjs maven yeoman
I have recently integrated maven yeoman plugin with my app. I followed https://github.com/trecloux/yeoman-maven-plugin/blob/master/TUTORIAL.md My angular version is v1.2.3 . When I run the mvn clean install command, I get the following error . [email protected] node_modules\grunt-contrib-imagemin ?ö£?öÇ?öÇ [email protected] ?ö£?öÇ?öÇ [email protected] ([email protected], [email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ [email protected] ([email protected]) ?ö£?öÇ?öÇ p
Ronald Yeung
javascript jquery ajax json cors
What I am trying to do is to have a page on the HTTP protocol sending an AJAX call to the same Web server but using HTTPS. Both the requesting page and the AJAX handler are on the same server, having the same domain and port. (I.e., only difference is the protocol.) To illustrate,Fromhttp://www.example.com/index.phpTriggers a jQuery AJAX call tohttps://www.example.com/authenticate.php?user=123&password=456(I am hoping to pass the password through HTTPS to make it encrypted over the Internet.
stanleyhope
javascript ajax ssl internet-explorer-8
The problem: I have a site with a recently installed SSL certificate that is very dependent on POST calls over AJAX. The site worked fine on Internet Explorer 8 before the SSL certificate, but now does not.Since I haven’t been able to get a good way to read any error messages, I haven’t been able to pin down where the bug is coming from. I will try to list as much as I know/ have figured out, and I greatly appreciate any suggestions.What I know:On IE8, the site will not perform any AJAX POST cal
Mac-Gon
javascript jquery html5 css3 navigation
I’ve been reading lots of the other posts, and no doubt it’s my inexperience with jQuery that is giving me trouble, but there are lots of things close to what I’m trying to accomplish. I have a div where I have a vertical navigation set of buttons. Inside that I want the other divs (child divs) that will be shown or hidden based on the navigation button clicked by the user. I want all of these divs to be in the same location on the screen…so, basically like a tabbed form but with vertical navi
user2520224
java javascript file comparison
QUESTION : Is there a better way to compare two low size(100Kb) files, while selectively ignoring a certain portion of text. and report differencesLooking for default/existing java libraries or any windows native appsBelow is scenario: Expected file 1 located at D:\expected\FileA_61613.txt ..Actual file 2 located at D:\actuals\FileA_61613.txtContent in expected File Some first line hereThere may be whitespaces, line breaks, indentation and here is another lineKey : SomeValue Date
Liam Bailey
javascript jquery history.js
On this page: http://www.kastenreus.nl/onze-kasten/ we have the filters down the left hand side, we are having a problem with the link filters under Verfijn uw wensen, if you watch the console you can see it is firing 2 requests, the first one is what the content is loading in from, when it is the second we actually need.This is the click binded event:jQuery(“.codenegar_product_filter_wrap ul li a”).live(“click”, function(e){e.preventDefault();var $this = jQuery(this);if($this.attr(“data-key”) =
honestann
javascript firefox firefox-addon 32bit-64bit jsctypes
I am creating a firefox extension for linux firefox on 64-bit ubuntu. The extension is a javascript program that calls functions in my shared library (libcog.so) written in C via the js-ctypes mechanism.I got the basics of the extension working, but now that I need to call functions in the libcog.so shared library via the js-ctypes mechanism, several issues are unclear.I can’t make the firefox browser tell me whether it is a 32-bit or 64-bit mode application!Later: I think I figured out this fi
user3319818
android xml sqlite csv
Okay I’m working with SQLiteHelper class to load a CSV File from a URL resource and then load into my SQLite DB. However I’m getting a LogCat error that doesn’t stop the application, but also doesn’t load the data into my application. This is my first experience with SQLite so could any provide any advice where am I going wrong? I’ve provided a LogCat printout for reference.MYSQliteHelper.javapublic class MySQLiteHelper extends SQLiteOpenHelper {String filename;FileReader file; //Database Versio
Community
java android eclipse csv
I want this fragment to write to a csv file when a button is clicked but I keep getting java.io.IOException: open failed:ENOENT (No such file or directory). Any help would be greatly appreciated.public class AddFragment extends Fragment {static EditText spent,saved,coupons;Button writeExcelButton;String data;Spinner spinner;@Overridepublic View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {View view = inflater.inflate(R.layout.add_layout, container, false
ChangeMyName
c++ sql csv upload permissions
I am working with Visual Studio 2012 Express version under Windows 7. On the other hand, the SQL server is “SQL Server 2008 R2”.I’ve tried following C++ codes:#include <iostream> #include <windows.h> #include <string> #include <sql.h> #include <sqltypes.h> #include <sqlext.h> using namespace std;void main() {clock_t start = clock();SQLHANDLE sqlevent, sqlconnection, sqlstatement;if(SQL_SUCCESS != SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &sqlevent))
user2520445
c# csv hdf5
I am very new to programming and was tasked with creating a program capable of taking a HDF5 file and converting it into a CSV file. I have looked around and found multiple blocks of code (Convert DataTable to CSV stream) (c# datatable to csv) (C# HDF5 Example code) , but I am at a loss for exactly how to go about this. My knowledge includes basic functions, loops, arrays, and a fairly good understanding of complex math (multivariable calc, basic diff-eq, basic matrix operations). I just have 0
Derek Reynolds
php csv quotes quoting
Is there a native function or solid class/library for writing an array as a line in a CSV file without enclosures? fputcsv will default to ” if nothing is passed in for the enclosure param. Google is failing me (returning results for a whole bunch of pages about fputcsv), and PEAR’s libraries do more or less the same things as fputcsv.Something that works exactly like fputcsv, but will allow the fields to remain unquoted.currently: “field 1″,”field 2”,field3hasNoSpacesdesired: field 1,field 2,fi
Ganesh Sittampalam
unit-testing csv automated-tests tibco
Im using Parasoft SOA test tool and I get the error : Failed to open Tibrv in native implementation while running my tests using TIBCO. I have added the jar file in the soa classpath and also in the environment variables. can some one please help
BRValentine
node.js mongodb csv coffeescript mongoose
I’m using node-csv-parser to read in csv data and store it in mongodb using mongoose. However I’m trying to speed up the import, and I want to evaluate using the native save method exposed by node-mongodb-native, accessed in mongoose using Model.collection. (This at the advice of a mongo engineer I spoke to at office hours at Mongo HQ).node-csv-parser fires a data event every time it reads in a new line of the csv. Inside this event I read in the line of data, create a new data point from it, an
Ben
database csv bulk
I try to load my database with tons of data from a .csv file sized 1.4 GB. But when I try to run my code I get errors. Here’s my code:USE [Intradata NYSE] GO CREATE TABLE CSVTest1 (Ticker varchar(10) NULL, dateval date NULL, timevale time(0) NULL, Openval varchar(10) NULL, Highval varchar(10) NULL, Lowval varchar(10) NULL, Closeval varchar(10) NULL, Volume varchar(10) NULL ) GOBULK INSERT CSVTest1 FROM ‘c:\intramerge.csv’ WITH ( FIELDTERMINATOR = ‘,’, ROWTERMINATOR = ‘\n’ ) GO –Check the conte
mnel
r csv
I am stumped. Normally, read.csv works as expected, but I have come across an issue where the behavior is unexpected. It most likely is user error on my part, but any help will be appreciated.Here is the URL for the filehttp://nces.ed.gov/ipeds/datacenter/data/SFA0910.zipHere is my code to get the file, unzip, and read it in:URL <- “http://nces.ed.gov/ipeds/datacenter/data/SFA0910.zip”download.file(URL, destfile=”temp.zip”)unzip(“temp.zip”)tmp <- read.table(“sfa0910.csv”, header=T, strin
Layla
r csv
I have a table in csv format, the data is the following:1 3 1 2 1415_at 1 8.512147859 8.196725061 8.174426394 8.62388149 1411_at 2 9.119200527 9.190318548 9.149239039 9.211401637 1412_at 3 10.03383593 9.575728316 10.06998673 9.735217522 1413_at 4 5.925999419 5.692092375 5.689299161 7.807354922When I read it with:m <- read.csv(“table.csv”)and print the values of m, I notice that they change to:X X.1 X1 X3 X1.1 X4 1 1415_at 1
Zikes
javascript svg d3.js
I’m using the SVG located at http://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg in a project and interacting with it with d3.js. I’d like to create a click to zoom effect like http://bl.ocks.org/2206590, however that example relies on path data stored in a JSON object to calculate the centroid. Is there any way to load path data in d3 from an existing SVG to get the centroid?My (hackish) attempt so far:function get_centroid(sel){var coords = d3.select(sel).attr(‘d’);coords = c
xiaohan2012
javascript d3.js
Here is my confusion(jsfiddle-demo) about the category10 function in D3:> var a = d3.scale.category10() > a(0) “#1f77b4” > a(10) //the expected different color value “#2ca02c”If I call directly the returned function of calling category10 , things go like this> d3.scale.category10()(0) “#1f77b4” > d3.scale.category10()(10) //the SAME color! Why? “#1f77b4″In my opinion, calling d3.scale.category10()(10) should yield the same value as calling a(10).What is going wrong here?
Jetson John
javascript svg d3.js
I am starting with d3.js, and am trying to create a network graph each circle of which contains a label.What I want is a line break an svg text.What I am trying to do is to break the text into multiple <tspan>s, each with x=”0″ and variable “y” to simulate actual lines of text. The code I have written gives some unexpected result.var text = svg.selectAll(“text”).data(force.nodes()).enter().append(“text”);text .text(function (d) {arr = d.name.split(” “);var arr = d.name.split(” “);if
ckersch
javascript google-chrome d3.js google-chrome-devtools
While working on a JavaScript application, I came across something unexpected while using the Chrome developer tools. I have, within a function, the following block of code:var b = bins + 1,selectValues = [],selectedPoints = [],n = numVals;while(b–){selectValues.push(0)};//Main selection iteratorif (range_min == range_max){mainSVG.selectAll(“.sim-ui-scatter-points”).each(function(){d3.select(this).call(addClass,[“foo”]);d3.select(this).call(removeClass,[“bar”,”foobar”]) });} else {do some othe
Jeroen Moons
javascript layout svg stack d3.js
I successfully mapped y values, but I’m having trouble mapping an x value to an arbitrary field on my values when creating a stacked bar graph using the stack layout. I’m not really familiar with Javascript and d3; so I’m probably missing something basic here.A value in my array of data looks like { “xInit”: 0, “yInit”: 91 }. I want to map xInit to x in the graph and yInit to y.This works (suggested by Bryan Clark):var st = d3.layout.stack().values(function (d) { return d.values; }).y(function (
musically_ut
javascript csv d3.js
I am new to d3.js any help is much appreciated csv file is Year,Make,Model,Length 1997,Ford,E350,2.34 2000,Mercury,Cougar,2.38code is d3.csv(“../test/car.csv”, function(d) {return {year: new Date(+d.Year, 0, 1), // convert “Year” column to Datemake: d.Make,model: d.Model,length: +d.Length // convert “Length” column to number}; }, function(error, rows) {console.log(rows); });expected result is [{“Year”: “1997”, “Make”: “Ford”, “Model”: “E350”, “Length”: “2.34”},{“Year”: “2000”, “Make”: “Mercury”
VividD
d3.js tree nodes hierarchy
I have created a collapsible tree to represent some biological data.In this tree the size of the node represents the importance of the node. As I have a huge data and also the sizes of the nodes vary,they overlap over each other. I need to specify the distance between the sibling nodes.I tried tree.separation() method but it didn’t work.Code is as follows :tree.separation(seperator);function seperator(a, b) {if(a.parent == b.parent){if((a.abundance == (maxAbd)) || (b.abundance == (maxAbd))){retu
Sam Selikoff
javascript d3.js
I am following Mike Bostock’s pattern for reusable charts – closures with getter/setters. But somehow, when I instantiate a new chart object with new properties, existing charts are being updated with these properties:var chart1 = new StackedAreaChart(); d3.select(‘#chart1’).data([data]).call(chart1); // a new chart – whose properties end up in chart1! var chart2 = new StackedAreaChart().colors([‘green’, ‘blue’]);Here’s an example: http://jsfiddle.net/samselikoff/YZ6Ea/3/. Resize the window
Peter
jquery node.js express d3.js requirejs
I have been struggling with this for a while now but I am not making any progress. I always run into something unexpected.I want to support browser code in node.js (express) that uses require.js, jquery and d3.js to build up a graph (svg), based on http request input parametersThe problem I am having is that once requirejs is initialized it will always return the same jquery and d3.v2 modules and these will all (for each of the client http request) start doing their thing on the same DOM (jsdom)
user1840255
javascript csv graph d3.js
I have a variable called final csv which looks like and is stored in a CSV format. The lines are separated by a \n. I’m using the statement D3.csv.parse. Can anyone tell me why nothing appears on the page at all? :- String, Floatvalue, 1value2, 2 function generateGraph(finalcsv) {var finaldata = finalcsv;var margin = {top: 20, right: 20, bottom: 30, left: 40},width = 960 – margin.left – margin.right,height = 500 – margin.top – margin.bottom;var formatPercent = d3.format(“.0”);var x = d3.scale.or
Jason
java graphing
My professor gave us an assignment to test the difference in runtimes and search sizes using linear & binary algorithms, and the data is to be graphed.I have the search methods put the runtime & array sizes as Points in an ArrayList, which is then sent to the GraphResults class for plotting. I need to convert those data points into xy coordinates before. The search size is the x-axis and the runtime is the y axisAs the search sizes are fixed as a multiple of 128 and there are only 8 si
Owen Kelly
java android graphing achartengine
I wrote a practice app that solves quadratic equations and now I want to have the option to graph them with a button. Yet when I press the button the application crashes. Here is the code for the main program and the graphing one(located beneath): Main class: *note: I do have the necessary classes imported and the .jar.package com.test.quad; import java.text.DecimalFormat;import java.util.List; import android.util.Log;import android.app.Activity; import android.content.Intent; import android.os.
Gordon
php graph graphing php-frameworks
As an example making an line graph, with a transparent background behind the plot…preferably with anti aliased lines… This way the generated .png graphs can be more useful and easier to blend in with other content etc….I know php gd etc can output transparent background images… that’s not exactly what I’m asking for here: the closest I’ve come is using jpgraph for php, and then taking the image output back to php gd and making the white background transparent and outputting that as a .pn
calccrypto
c++ graphing lightweight platform-independent
What is the simplest to use c++ library that graphs functions like matlab and octave do? I have looked over several and have found similar major problems with all of them: i cannot compile an empty program that only has#include <iostream>#include “header_to_include.h”int main(){return 0; }i have found koolplot, some wxwidget stuff, sdl_graph, gnuplot++, and something with Qt. ive looked at some of the ones on the list here, but some are for other languages while others use installers or de
cdietschrun
javascript csv d3.js graphing
I have csv files that are generated, and I am trying to load them into d3 to graph them. The column names are based on the data, so I essentially can’t know them in advance. With testing, I am able to load this data and graph it all well and nice if I know the names of the columns…but I don’t in my use case. How can I handle this in d3? I can’t seem to find anything to help/reference this online or in the documentation. I can see when I log to the console data[0] from d3.csv that there are two
Web site is in building