Posts

Showing posts from August 29, 2018

SSIS 2017 Upgrade issue

Image
Clash Royale CLAN TAG #URR8PPP SSIS 2017 Upgrade issue We are upadating the packages(packages are in package deployment model) from SSIS 2012 to SSIS 2017. There are lots of script components in all the packages. When we are upgrading the packages we are having an error Description: CS0234 - The type or namespace name 'Dts' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?), ScriptMain.cs, 14, 26 End Error Configurations: SQLserver 2017 Visual studio enterprise 2015 + SSDT 2015 We have tried different options of deleting and re-adding the assemble file in the script component. Looks like the Microsoft.Sqlserver.ManagedDts assemble file is having issues for 2017 version. When we upgrade the packages to SSIS 2016 the packages work fine. When we try to run the SSIS 2016 packages from Sqlserver agent job in SQLSERVER 2017 it is trying to upgrade the packages to 2017 and throw up the similar error as above. Any solutions wou

Fade text out on hover

Image
Clash Royale CLAN TAG #URR8PPP Fade text out on hover I am working with Bootstrap 3, and have made the below fade in paragraf text when a person is hovering over the picture. paragraf It is not gonna look good if the head and subline is there, therefore I would like the head and sub-headline is fading out, when a person hover the image, so it is only the paragraf text there is shown. paragraf I am not quite sure how to do that, or how to get started on it. Can somebody give me some advice on this? A live demo can be seen here. body background-color: #f5f5f5; .mk.row [class*="col-"] padding-right: 5px; padding-left: 5px; .mk.row margin-left: -5px; margin-right: -5px; background-color: #fff .img-responsive height: 100%; /* Position of buttons/text in a single grid element */ .inner-wrapper background: none; .bottom-left position: absolute; bottom: 2%; left: 6%; .light-font color: #fff; text-transform: uppercase; /* Hover for grid elements

TS2339: Property 'includes' does not exist on type 'string'

Image
Clash Royale CLAN TAG #URR8PPP TS2339: Property 'includes' does not exist on type 'string' I have seen this error mentioned in regards to string arrays but not actual strings. I have a TypeScript file with the line if (!bus.lineInfo.PublishedLineName.includes(input)) { This gives me an error of TS2339: Property 'includes' does not exist on type 'string'. bus is a variable that implements the bus interface: bus bus interface bus "lineInfo": string // false if this is "FFFFFF", otherwise it's the color , "warnings": boolean lineInfo.PublishedLineName is declared as a string , and String.prototype.includes() is a function according to MDN, so why does the TypeScript compiler complain about the missing property/method? lineInfo.PublishedLineName string String.prototype.includes() What is includes or what do you think it is? – rmlan Aug 12 at 17:34 I believe it is a string method; I've updated my pos

Fast way to save lines from coordinate groupings in R

Image
Clash Royale CLAN TAG #URR8PPP Fast way to save lines from coordinate groupings in R I'm generating paths from jogging coordinates. A sample like what I have can be reproduced below: #Reproduce Data library(data.table) library(sf) dt <- data.table(lon=sample(c(380:390), 1000000, replace = TRUE)/10,lat=sample(c(80:90), 1000000, replace = TRUE)/10, pgrp=rep(c(1:100),10000)) tpathline <- st_as_sf(dt, coords = c("lon","lat"),crs=4326) The below to compile the points in groups of lines takes FOREVER. I have a bunch of these to do, is there a faster/better way to compile lines than the dplyr pipe below? #Works but slowest thing ever library(dplyr) baseline <- tpathline %>% dplyr::group_by(pgrp) %>% dplyr::summarise(do_union=F) %>% sf::st_cast("MULTILINESTRING") Thanks in advance!!! 2 Answers 2 This is my general approach when working with sf and data.table , and it's pretty quick too. sf data.table library(data.table) libra

full Background image Mouse Move Coverage

Image
Clash Royale CLAN TAG #URR8PPP full Background image Mouse Move Coverage I have a small script to tilt the background image when mouse is moving. I have tried 3 different images and no matter what size they are there is a white gap when the image moves. the background image follows the mouse without issue. is just shows white gaps , I have tried setting the image in every what to no avail. $(function() // Init var container = document.getElementById("container"), inner = document.getElementById("inner"); // Mouse var mouse = _x: 0, _y: 0, x: 0, y: 0, updatePosition: function(event) , setOrigin: function(e) this._x = e.offsetLeft + Math.floor(e.offsetWidth / 2); this._y = e.offsetTop + Math.floor(e.offsetHeight / 2); , show: function() return "(" + this.x + ", " + this.y + ")"; ; // Track the mouse position relative to the center of the container. mouse.setOrigin(container); //-----------------------------------

neo4j - index creation failure and subsequent file lock exception preventing from starting up

Image
Clash Royale CLAN TAG #URR8PPP neo4j - index creation failure and subsequent file lock exception preventing from starting up I am using Neo4J (version 3.4) for importing 100 000 records. After that I tried to create an index on a field "pid" using the create index on :label(property) When I checked the status, it says index failed. But I was still able to access the data. But once I shut down the instance and tried start again, it fails with the below error. No matter how many times I try, I get the same exception in the logs. 2018-08-10 05:28:01.349+0000 INFO ======== Neo4j 3.4.0 ======== 2018-08-10 05:28:01.381+0000 INFO Starting... 2018-08-10 05:28:04.007+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@3aacf32a' was successfully initialized, but failed to start. Please see the attached cause exception "null". Starting Neo4j failed: Component 'org.neo4j.server.database.Lifecycle

Does a texture with data and a texture with no data consume the same amount of memory?

Image
Clash Royale CLAN TAG #URR8PPP Does a texture with data and a texture with no data consume the same amount of memory? In my application I create textures, render to them and delay reading from them until absolutely needed by the CPU. I'd like to know (and I still don't know how) given that I guess and monitor the consumed GPU memory would the call to readPixels() alleviate the memory consumption of the GPU by transferring data to the CPU? Or would that memory still be occupied until I destroy the texture? readPixels() 1 Answer 1 readPixels just copies the data. It does not remove it from the GPU. readPixels Textures that you don't pass data to (you passed null ) take the same amount of memory as textures you pass no data to. The browser just fills the texture with zeros for you. null The only way for a texture to stop using memory is for you to delete it with gl.deleteTexture . You also need to remove every reference to it (unbind it from any texture units it

Accessing local MySQL server from my docker container

Image
Clash Royale CLAN TAG #URR8PPP Accessing local MySQL server from my docker container I have a mysql server and a docker container running on my machine. In the docker container, I run a django website. I want to connect to the local mysql server from the docker container. How can I do that? can you add your docker-compose file? – JPG Aug 12 at 12:58 Possible duplicate of From inside of a Docker container, how do I connect to the localhost of the machine? – David Maze Aug 12 at 14:04 1 Answer 1 I usually do ( for testing purposes ) : docker network create -d my-bridge docker run --network my-bridge --name app-db -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=myapp -e MYSQL_USER=myapp_user -e MYSQL_PASSWORD=myapp_secret mysql:latest docker run --network my-bridge --name app -p 80:80 -e DB_HOST=app-db -e DB_USER=myapp_user -e DB_PASS=myapp_secret -e DB_NAME=myapp myapp:latest In my app Dockefile I am using in entrypoint something like envsubst, or if code language c

Time complexity of finding kth largest element in n sorted arrays using quickselect

Image
Clash Royale CLAN TAG #URR8PPP Time complexity of finding kth largest element in n sorted arrays using quickselect If you have J sorted arrays of length N , find the kth smallest element among them. There are a few potential solutions here, some involving a min heap or binary search, but I want to know what the time complexity would be for using quickselect. If we simply concatenated each of the arrays together and used quickselect on the combined array. J N kth Quickselect runs in linear time in the average case, but the combining of arrays does expand the search space, but it is more efficient than using a merging strategy because quickselect necessarily allows some elements to be ignored if you choose good pivots. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

LISP Appropriate Way to Return Value From Function

Image
Clash Royale CLAN TAG #URR8PPP LISP Appropriate Way to Return Value From Function So I am working my way through Paul Graham's Common Lisp and one questions asks to create a union function that maintains the order of the elements in the lists being unionized. To that end I have written the following function: (defun new-union (listA listB) (setq retset (list (car listA))) (loop for el in (append (cdr listA) listB) do (if (not(member el retset)) (push el (cdr (last retset))))) (return-from new-union retset)) This returns the unique elements of each list while maintaining the order so if I create and run: (setq listA '(a b c a)) (setq listB '(c d e)) (new-union listA listB) The return is: (A B C D E) So the first things is I get a compiler warning: "undefined variable: RETSET" on this line: (setq retset (list (car listA))) . The other thing is that the above method seems to be a more "object-oriented" way of doing things rather than the LISP way

Why having assert before main() causing syntax error “error: expected ')' before numeric constant”?

Image
Clash Royale CLAN TAG #URR8PPP Why having assert before main() causing syntax error “error: expected ')' before numeric constant”? Why assert is causing compilation error if I use it before main() call? It causes compilation error (Syntax error): test.cpp:4:8: error: expected ')' before numeric constant Note: I'm trying to understand why I'm a getting a syntax error for calling it outside main. That too related to something like "numeric constant", but not like function / macro called out side main function. If the error was simpler like function / macro called out side main, then my question wouldn't have made any sense. #include <stdio.h> #include <assert.h> assert(0); //If I comment assert from here, then it compiles fine. int main() assert(0); return 0; Because you can't call assert from outside of main / a function. – Sombrero Chicken Aug 12 at 17:56 assert main Or more accuratelly, you can't call anythi

Requesting a function from another file in a class not working

Image
Clash Royale CLAN TAG #URR8PPP Requesting a function from another file in a class not working I have 2 .cpp files called "FactoringProgram.cpp" and "FactoringProgram2nd.cpp", also 1 header file called "FactoringProgram.h". I've already tried searching for this problem on StackOverflow and a couple other sites and haven't found a solution that worked for me. When I try to run this command: "g++ FactoringProgram.cpp FactoringProgram2nd.cpp" I get this error: FactoringProgram.cpp: In function ‘int main()’: FactoringProgram.cpp:8:11: error: request for member ‘InitialMessage’ in ‘Problem1’, which is of non-class type ‘Factoring()’ Problem1.InitialMessage(); The code for "FactoringProgram.h" is: #ifndef FactoringProgram_h #define FactoringProgram_h #include <stdio.h> #include <iostream> class Factoring private: int m_FirstCoefficent; char m_FirstOperator; int m_SecondCoefficent; char m_SecondOperator; int m_3rd

Clicking divs in correct order

Image
Clash Royale CLAN TAG #URR8PPP Clicking divs in correct order How can I make it so that when you press the divs in the correct order something happends. Here's my code so far. Now something only happends if you click on all of the teal colored divs. var one = false; var two = false; var three = false; var four = false; function mm(x) var y = x.id; switch (y) case "one": one = true; break; case "two": two = true; break; case "three": three = true; break; case "four": four = true; x.style.background = "aqua"; if (one == true && two == true && three == true && four == true) alert("WOW"); one = false; two = false; three = false; four = false; var x = document.getElementsByClassName("dev"); var i; for (i = 0; i < x.length; i++) x[i].style.backgroundColor = "teal"; body, html height: 100%; background: #333; * margin: 0; padding: 0; .dev backgroun