2018-10-22         Tabitha

changing variables inside of addEventListener

This is my problem, I am trying to add new coordinates into a 2D array when the mouse is pressed, but I can not find out how to successfully access variables inside the event listener. I have tried a few methods, but I could not find out how to make it work.myGameArea.canvas.addEventListener('click', function(){ var MousesX = event.clientX+55; var MousesY = event.clientY+55; }, false);ConnectionAdd(MouseX,MouseY,Connections,viewH);Here is what it says ReferenceError: MouseX is not defined at draw Btw that was the most basic test, but it best describes...

 javascript                     2 answers                     32 view
 2018-10-22         Tabitha

What's the point of freezing your Rails version/gems?

What does that mean?In the instructions for a project, it said to "freeze the Rails gems". Is that different from freezing the Rails version?What's freezing about? If one of the authors of a gem you use introduce a new version of the gem, there is a possibility the new version introduces backwards incompatible changes that would break your code.Freezing a gem puts it into the vendor folder of your application, and it will not be automatically updated on its own. Rails will use this version of the gem instead.This allows you to update the gem on your system for other apps...

 ruby-on-rails                     4 answers                     93 view
 2018-10-22         Tabitha

Kill a batch file containing the python script within

I have a problem. I need to kill the batch file using the python script residing within the same batch file. The batch file has abc.py script as the first one along with other scripts. So I need to kill the batch file so that others don't get executed. Here is what I have tried:for proc in psutil.process_iter(): if proc.name() == "python.exe" and len(proc.cmdline()) > 1 and "abc.py" in proc.cmdline()[1]: proc.terminate()But this only kills the python script, not the batch file. Tried killing the pid with the same effect.os.system("taskkill /F /PID " + st...

 python                     2 answers                     3 view
 2018-10-22         Tabitha

Django API not uploading large json data from Android OkkHttp Client

I am trying to upload a large json data from android retrofit client to django rest api view.For example(Json Data):{'post_data': [{'x':'asdkdadlf fdsfsd','y':'This is a paragraph........ Ending paragraph', 'created_on':'2018-22-08'}, {'x':'asdkdadlf fdsfsd','y':'This is a paragraph........ Ending paragraph', 'created_on':'2018-22-08'}, {'x':'asdkdadlf fdsfsd','y':'This is a paragraph........ Ending paragraph', 'created_on':'2018-22-08'},.... {'x':'asdkdadlf fdsfsd','y':'This is a paragraph........ Ending paragraph', 'created_on':'2018-22-08'},...

 django                     1 answers                     30 view
 2018-10-22         Tabitha

python os.mkfifo() for Windows

Short version (if you can answer the short version it does the job for me, the rest is mainly for the benefit of other people with a similar task):In python in Windows, I want to create 2 file objects, attached to the same file (it doesn't have to be an actual file on the hard-drive), one for reading and one for writing, such that if the reading end tries to read it will never get EOF (it will just block until something is written). I think in linux os.mkfifo() would do the job, but in Windows it doesn't exist. What can be done? (I must use file-objects).Some extra details:...

 python                     3 answers                     75 view
 2018-10-22         Tabitha

Using selenium wait until to wait some query finished in python

This question already has an answer here: How can I make sure if some HTML elements are loaded for Selenium + Python? 2 answers Do we have any generic funtion to check if page has completely loaded in Selenium 4 answers If the query is being run with Ajax and you are using JQuery, you could try using the javascript executor in order to wait for all ajax requests in flight to finish after intitiating the reques...

 python-3.x                     2 answers                     83 view
 2018-10-22         Tabitha

react-router does not work in production and surge deployments

My react application is working fine on localhost but when after i deployed it in gh-pages or surge it does not give me to move among pages using URL.This is the project repo link Demo url hereusers can go to signup page by clicking menuItem of top right corner. but If user use http://chat.susi.ai/signup/ URL, it gives 404 pageI tried several solutions from internet but didn't work.Next question is : I created a 404 page to show up when user tries to move to broken links.It works fine in localhost. but not in production. I tried this solution but nothing changed.this is par...

 javascript                     1 answers                     50 view
 2018-10-22         Tabitha

How to call a Database function using spring data jpa?

I want to call a database function from spring boot application which will return a decrypted value. Is it possible to call database functions using spring data jpa? If possible how? If not possible using spring data jpa, Is there any alternatives to call functions from spring boot?Here is my functionIF OBJECT_ID('fn_MASK_CARD') IS NOT NULL DROP FUNCTION fn_MASK_CARDGOCREATE FUNCTION fn_MASK_CARD ( @CARD_NUMBER VARCHAR(19) ) RETURNS VARCHAR(19)ASBEGIN RETURN SUBSTRING(@CARD_NUMBER,1,6)+REPLICATE('#',LEN(@CARD_NUMBER)-10)+ ...

 java                     1 answers                     52 view
 2018-10-22         Tabitha

AdjustResize not working For Second EditText

i have Two EditText in login page.Only one visible at first Time.when we open the Activity request focus to first EditText and next button Comes below EditText.When we Click next button Second Edittext will be Visible.button is not Showing below the Second EditText.it hiding the Second Edittext. i want to show below the Second Editext here is my Code :<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context="com.valai.school.a...

 android                     1 answers                     80 view
 2018-10-22         Tabitha

PostGIS: bounding box of a multipolygon

SELECT id, ST_Box2D(areas) AS bbox FROM mytable;In this example, the table "mytable" contains two columns: "id" is the unique id number of the row and "areas" is a geometry field containing one MULTIPOLYGON per row.This works fine for multipolygons containing only one polygon, but some rows have polygons very spread apart, hence the bounding box is not relevant when the multipolygon contains one polygon in Europe and one in Canada for example.So I would need a way to get one box2d per polygon per multipolygon, but I haven't found how just yet.More exactly, my goal is to ret...

 sql                     2 answers                     45 view
 2018-10-22         Tabitha

SQL Script to take a Microsoft Sql database online or offline?

If I wish to take an MS Sql 2008 offline or online, I need to use the GUI -> DB-Tasks-Take Online or Take Offline.Can this be done with some sql script? ALTER DATABASE database-name SET OFFLINEIf you run the ALTER DATABASE command whilst users or processes are connected, but you do not wish the command to be blocked, you can execute the statement with the NO_WAIT option. This causes the command to fail with an error.ALTER DATABASE database-name SET OFFLINE WITH NO_WAITCorresponding online:ALTER DATABASE database-name SET ONLINE [XXX]Here's a note that just might be ve...

 sql                     4 answers                     22 view
 2018-10-22         Tabitha

Qt winId() forcing 32bit values

Im trying to embed a display from an alien application (python OCC) into (Py)Qt using the winId of the widget. But when i pass it to OCC i get an overflow error.Inspecting the winId qt returns its 4318283408 which is more than a 32bit number. Im running 64bits (osx) and both libraries are compiled for 64bit, but i have a hunch that OCC only likes 32bit numbers still. So my question is, is there any way to control the range of the winId that Qt return?ThanksHenrik Looking in Qt's source code, in the file src/gui/kernel/qwindowdefs.h, you'll find that WId is typedef'd to ...

 python                     1 answers                     50 view
 2018-10-22         Tabitha

"BCP copy in failed" on TSV

Note: this is very similar to the question I posted here ("BCP copy in failed" on tsv (no further error message info)), but I resolved that question with a different solution that does not appear to work in this case. (Title of question similar so that anyone else having these same vague errors can find multiple potential solutions to their problem).Trying to use BCP utility (https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-2017) on linux CentOS7 to copy tsv files into remote MSSQL Server DB (in a Windows Server 2012 machine), getting the fru...

 sql-server                     1 answers                     29 view
 2018-10-22         Tabitha

Can I save a bitmap in memory directly to Azure as a jpeg

I would like to be able to resample a jpeg loaded into memory from the local network and then save the resulting bitmap file as a jpeg directly to the Azure cloud (without first having to save the jpeg to the local network then uploading). I cannot find any methods for doing so, but I thought I would check here JIC. Here's my high-level code, which is missing the part where the bitmap is saved to the blob as a jpeg:Bitmap img = ImageMethods.ResampleImage(Image.FromFile(imageFileNames(i)), ImageMethods.ImageSize.Small_800x600)var blobContainer = GetBlobContainer(Properties...

 c#                     1 answers                     38 view
 2018-10-22         Tabitha

Cannot connect to AzureVM gives error as "An internal error occured"

I tried redeploy option on azure vm. tried to reset configuration. It gave error as failed to reset rdp configuration. Stopped and restarted 3-4 times but same issue.I see that azure vm agent is also unresponsive.In boot diagnostics I see an exclamation mark in image.Please help.click to see boot diagnostics image There must be some network configuration issue, try to reset network config of VM using portal and do cross check with your VNet too. [XXX]Just changed IP address of my VM.I was able to connect after that.Thanks for your replies. [XXX]

 azure                     2 answers                     41 view
 2018-10-22         Tabitha

How to make a curved fill in SVG

I can make half an arc like this:<svg viewBox="0 0 100 200" xmlns="http://www.w3.org/2000/svg"> <g> <path d=" M 50, 100 m 25, 0 a 25,25 0 1,0 -50,0" fill="none" stroke="#000" stroke-width="10px" /> </g></svg>Is this what you are looking for?<svg viewBox="0 0 100 200" width="300" xmlns="http://www.w3.org/2000/svg"> <g> <path d=" M 50, 100 m 25, 0 a 25,25 0 1,0 -50,0 h 10 A20,20 0 0,1 75,100z" /> </g></svg>[XXX]

 svg                     1 answers                     8 view

Page 1 of 146  |  Show More Pages:  Top Prev Next Last