À um dia que estou a tentar colocar um Charts.js na minha página web. Já lá está, mas não consigo estilizá-lo com pretendo. Onde devo proceder a alteração da largura, altura e proporção do gráfico? Como podem ver na imagem, o gráfico está fora do background-color:#FFFFFF. A Largura coloquei um css width:1200px na tag <canvas>, mas este não é o resultado que pretendo. Alguém me consegue ajuda? Em baixo o HTML, CSS e JS do mesmo. <script> var options = { responsive:true }; Chart.defaults.global.legend = { enabled: false }; // Line chart var ctx = document.getElementById("lineChart"); var lineCha
i have written a small function which calculates factorial for a number in C as follows: int factNnumbers(int n) { if(n == 1) return 1; else return (n*factNnumbers(--n)); } I call the function shown above as: factNnumbers(takeInputN()); where the function to take the input (takeInputN) is defined as: int takeInputN() { int n; printf("\n\nHow many numbers ?? \n "); scanf("%d", &n); return n; } If I change one line in my factorial code as shown below , my program works perfectly. Otherwise with the above code it prints the factorial of the number input -1 (example if number input is 5, it will p
I'm trying out TDD on some side project and already encountered this a couple of times. As an example, my program needs to take a number X, and find out the date string that was X days ago, in order to perform certain date-based queries. So I figured I need a test that validates the date computation is correct. But, since the test depends on the current date, how can create such a test? I can have the test method implement this exact functionality by itself, but that would just make it redundant... Edit: I've seen Setting time and date in JUnit test fixture but the answers there seem quite an
EDITI: by removing the conf setting in the app for 'setMaster' I'm able to run yarn-cluster successfully - if anyone coudl help with spark master as cluster deploy - that'd be fantastic I'm trying to set up spark on a local testmachine so that I can read from an s3 bucket and then write back to it. Running the jar/application using client works fine, well, fine in that it goes off to the bucket and creates a file and comes back again. However I need this to work in cluster mode so that it more closely resembles our prod environment yet it's constantly failing - no real sensible messages in the
If I use the following to select a certain node var Link = document.querySelector('table .ctrlcLink'); I get the first column value for the column with class ctrlLink, which is what I expected. However, since I have an onclick event set to an other column in the same table, I would like to get the value of the .ctrlLink column that is on the same row as my clicked element. So I tried something like this: var Link = document.querySelector($(this).closest('tr').children('td.ctrlcLink')); But then I get "Failed to execute 'querySelector' on 'Document': '[object Object]' is not a valid selector."
I have access to server (SQL Server 2008R2) in database in MS, but I don't have it in SSIS. When I created Connection Manager (Native OLE DB), put server name and clicked "Test Connection", I gave: Test connection failed because of an error in initializing provider. Login failed for user 'xxxxxxxxxxx'. I have access to other servers and databases in SSIS. What could cause the problem?
I work with a fair number of data sets that have many records -- often in the millions of records. It seems to me that not all of these records are equally useful for building an effective model of the data, e.g., because there are duplicates in the data set. These data sets could be much easier and faster to analyze if they were reduced to a better set of records. What preprocessing methods are there for reducing data set size (e.g., removing records) without losing information for machine learning problems? I know one simple transformation is to summarize duplicate records and weight them ac
I recently followed some tutorials and learnt how to create and program batch files. I started making a game meant to simulate fighting monsters. One of the mechanics of this game was to be an inventory where once programmed, you'd be able to buy certain items from a store and put them in your inventory which you can already access in battle. The only programmed level so far is the tutorial and only the start of it. What you should be able to do is select an inventory slot when asked, then the computer should run the inventory function which it doesn't seem to do. Some error shows up, then clo
First up: I'm not looking for a way to fix the dreaded tablespace exists InnoDB error found here, rather I'm looking for a way to prevent it! Over the past few weeks we've had a table dissapear from our database at random, with no way to re-create it (because it gives a tablespace exists error). We've narrowed it down to the following table: CREATE TABLE product_localised ( id INT (10) UNSIGNED NOT NULL AUTO_INCREMENT, product_id INT (10) UNSIGNED NOT NULL, language_id INT (10) UNSIGNED NOT NULL, slug VARCHAR (255) COLLATE utf8_unicode_ci NOT NULL, title TEXT COLLATE utf8_unicode_ci, descripti
I want to give thickness effect when the image flips and another image occurs. I want to give it thickness to look like a coin. Here is a link where some one has tried something similar but I am not able to integrate in my code: function switchVisible() { if (document.getElementById('mapButtons')) { if (document.getElementById('mapButtons').style.display == 'none') { document.getElementById('mapButtons').style.display = 'block'; document.getElementById('modelButtons').style.display = 'none'; } else { document.getElementById('mapButtons').style.display = 'none'; document.getElementById('modelBu
I've seen a lot of threads and discussions about that but I'm not getting to fix the issue. This is my post from some days ago. One of the purposes of typings is to avoid the use of <reference> tags, right? But if I don't use it, Visual Studio complains: Visual Studio stops complaining once I reference browser.d.ts. Here is my tsconfig: { "compilerOptions": { "noImplicitAny": false, "noEmitOnError": true, "removeComments": false, "sourceMap": true, "target": "es5" }, "files": [ ], "exclude": [ "node_modules", "wwwroot" ] } I also tried removing the "files" property from the tsconfig as suggest
on OSX, when I run top sometimes I see some different colors, namely black text.... What does it mean? What bash setting do I need to change to make these a different color? black is too hard to read with my setup.
In React Native I use fetch to perform network requests, however fetch is not an explicitly required module, so it is seemingly impossible to mock in Jest. Even trying to call a method which uses fetch in a test will result in: ReferenceError: fetch is not defined Is there a way to test such API requests in react native with Jest?
I am using Spotfire to build a line graph. The data set consists of the following fields: Requirement Project Name Period Score Project Spend Req 1 Project 1 3/1/2016 2 750000 Req 2 Project 1 3/1/2016 3 750000 Req 3 Project 1 3/1/2016 2 750000 Req 4 Project 1 3/1/2016 2 750000 Req 1 Project 1 6/1/2016 2 750000 Req 2 Project 1 6/1/2016 3 750000 Req 3 Project 3 6/1/2016 2 500000 Req 4 Project 3 6/1/2016 2 500000 In the line chart, I have Period on X axis and I need SUM(Project Spend) by Project on Y axis. For example: for 3/1/2016 on X axis, the value on Y should be 750000 as only one project is
I have two activities. MainActivity.java and HomeActivity.java. I am trying to create a ListView in HomeActivity.java just with "One", "Two", "Three", and "Four" as the List items but the ListView is not showing up at all. HomeActivity.java: public class HomeActivity extends AppCompatActivity { String personName; String email; String rfid; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); populateListView(); Bundle extras
I'm trying to return an array but got 'null pointer exception'. I suppose it's because my method returns an array with elements that are null. How to properly return an empty array? In main class main method: public class Test{ public static void main(String[] args){ int s = 0; Project arr[] = new Project[3]; for(int i = 0; i!=3; i++){ Project var = Project.getProject(arr, "Programming"); if (var == null){ var = new Project(); var.setName("Programming"); arr[s]= var; s=s+1; } } } } Method in separate class: static Project getProject(Project[] a, String n) { for (int i = 0; i != a.length; i++)
I've had a search around, and found some solutions which should work, but for some reason just aren't working for me. Here is the sample CSV i'm working with: "Org. Code","Hubspot Ref","Company Name","Contact First Name","Contact Last Name","Job Title","Address","City","Phone","Email","Last Update" "2h34h234h","12345678","A Random Company","John","Smith","Developer","300 PARK AVE SOUTH, 4TH FL","NEW YORK","+123456789","[email protected]","10/03/2016 12:00" I'm trying to parse it with this snippet of code: with open(os.path.basename(theCSV),"r") as f: reader = csv.reader(f) data = list(read
I am trying to train a haar cascade using opencv_traincascade executable in opencv 3.1.0. For the moment I want to do this using only one positive even though the result is inconsistent, in order to be sure that I am passing the right parameters to opencv_createsamples and opencv_traincascade. bg.txt content: negatives/img_04436_c1.pgm negatives/img_04437_c1.pgm Negatives resolution: width: 1176 height: 640 Positives resolution: width: 40 height: 70 I am using the following command parameters: For opencv_createsamples: ./opencv_createsamples -img img_04569_c1.pgm -vec samples -bg bg.txt -maxxa
I am working in python + Appium to automate an Android App. I have created 7 scripts and imported all the scripts in a single script named Main_module_testing.py. Now I want to generate an HTML Report for my test. In which it automatically creates Pass/Fail result. I have tried HTMLTestRunner.py, but its throwing so many error related to IOString, Unicode, decode etc. Can anyone please tell how to fix it or generate an automatic HTML test report?
I'm using ora2pg migration tool for migrate table schema and data from ORACLE database to Postgres Database. Using the following query, I can export the entire schema and data from the ORACLE database and Import the data into Postgres Database. To export database schema: ./export_schema.sh To export data: ora2pg -t COPY -o data.sql -b ./data -c ./config/ora2pg.conf Import the exported data using this: ./import_all.sh -d MyDB -o postgres(Owner) -U User But I've no idea, how to migrate a particular table schema and data using this. Anybody knows about it, answer.It helps me a lot. Thanks in advi
I have to check difference between two versions for a file for many files. to get the diff b/w i need to dssc vhist and then i have to check what's latest versions and last but one version. then i'll get the diff b/w the versions. it will consume more time. any other way to in simple manner this thing. dssc diff file_name -ver latest -ver 1.10 it's working fine. but i want to get the diff b/w latest and last but one verion like. dssc diff file_name -ver latest -ver last_but_one do we have any command like the above.
I want to run my ionic project in android device.So I ran following commands Ionic add ionic-platform-web-client ionic plugin add phonegap-plugin push ionic io init ionic platform add android All the above commands were successfully executed.When I tried to run following command: ionic run android It gives me error: 'ANDROID_HOME' environment variable is set to non-existent path. Try update it manually to point to valid SDK directory. You may not have the required environment or OS to run this project. How do i fix it now?
As we all know, some CSS properties can have multiple values simultaneously. A good example is CSS3's box-shadow. However, sometimes it may be desirable for a class or ID to add to these values. For example, if I have an element with an inset box-shadow value, I may want to add an outer glow to the box with an .active class. Unfortunately, this overwrites the previous value. Is it possible to inherit a value and simultaneously add to it? Below is a non-working example of what I am hoping can be accomplished. Notice how the end-result does not glow. div { background-color: #09F; border-radius:
I am searching for a faster way to blur an image than to use the GaussianBlur. The solution I am looking for can be a command line solution, but I prefer code in perl notation. Actually, we use the Perl image magick API to blur images: # $image is our Perl object holding a imagemagick perl image # level is a natural number between 1 and 10 $image->GaussianBlur('x' . $level); This works fine, but with the level height the amount of time it consumes seems to grow exponentially. Question: How can I improve the time used for the bluring operation? Is there another faster approach to blur images?
I am searching for a faster way to blur an image than to use the GaussianBlur. The solution I am looking for can be a command line solution, but I prefer code in perl notation. Actually, we use the Perl image magick API to blur images: # $image is our Perl object holding a imagemagick perl image # level is a natural number between 1 and 10 $image->GaussianBlur('x' . $level); This works fine, but with the level height the amount of time it consumes seems to grow exponentially. Question: How can I improve the time used for the bluring operation? Is there another faster approach to blur images?
I have a C# application that exports an Excel file. When I run it from Visual Studio, it is working fine. However, when I schedule it to run from SQL Server Agent, it failed with the following error: Unhandled Exception: System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. To make more memory available, close workbooks or programs you no longer need. To free disk space, delete files you no longer need from the disk you are saving to. I have searched many links, and the
Github recently announced the addition of pull request templates. This is an awesome feature that has been heavily requested in the community for some time. These templates are added by including a special file named PULL_REQUEST_TEMPLATE.md to the root of the project or within the .github directory. I have multiple projects for which I would like to use the same template. What is the best way to keep these templates in sync across projects? (Git submodules are the only thing I can think of, but that seems pretty heavy-handed and complexity-prone for such a simple use case).
I am new to HDL and just wanted to confirm whether these lines of code are written in VHDL or Verilog: DE0_SOPC DE0_SOPC_inst( // 1) global signals: .clk(CLOCK_50), .pll_cpu(), .pll_sdram(DRAM_CLK), .reset_n(system_reset_n)); This code is in a file with a .v extension.