2018-10-22         Phoenix

Converting nested tibble to character vector in R

I have a nested dataframe tb which looks like that:>tb# A tibble: 26 x 3 league fdj_data five38_data <chr> <list> <list> 1 Ch.D1 Danemark <tibble [14 x 1]> <tibble [14 x 1]> 2 Ch.D1 Ecosse <tibble [10 x 1]> <tibble [14 x 1]> 3 Ligue 2 <tibble [20 x 1]> <tibble [19 x 1]> 4 Serie B <tibble [18 x 1]> <tibble [21 x 1]> 5 Liga Segunda <tibble [20 x 1]> <tibble [20 x 1]> 6 Ch.D1 Pays-Bas <tibble [18 x 1]> <tibble [21...

 r                     1 answers                     16 view
 2018-10-22         Phoenix

CSS background-color transition is not working with other transitions

I have an element that toggles between two classes when the user clicks on it. The two properties that change between classes are margin and background-color.When I add transition to only one element, either one, the transition works well but when I use both transitions the background-color one does not work. I tried doing individual transitions for each property and combining both properties in one transition but I can't get it to work. When I disable the margin transition, the background-color transition works fine, but as soon as I enable the margin transition again, the...

 css                     2 answers                     53 view
 2018-10-22         Phoenix

How to efficiently use Django query and Q to filter each object in a queryset and return 1 field value for each unique field in the queryset

I have query that returns the following queryset:results = <QuerySet [<Product: ItemA>, <Product: ItemA>, <Product: ItemB>, <Product: ItemB>, <Product: ItemB>, <Product: ItemC>, <Product: ItemC>]>The __str__ representation of the model is name and each Product variation likely has a different value for the price field. After this query, I need to search my database for each Product in the queryset and return the lowest price for each unique name so like:Lowest price for all in database where name is == to ItemALowest price for...

 python-3.x                     1 answers                     34 view
 2018-10-22         Phoenix

Error 403 because Google Cloud Vision client points to wrong project

I'm trying to work through the Google Cloud Vision Pyhon example but I'm getting an authentication error.This is not my only Google Cloud project, and my GOOGLE_APPLICATION_CREDENTIALS environment variable is set to the path to my bigquery project. I thought I could override this by using this statement:client = vision.ImageAnnotatorClient.from_service_account_json(key_path)where key_path is the path of the json key file associated with my (Cloud Vision API-enabled) vision project. However, I'm getting the 403 error from thisresponse = client.label_detection(image=image)App...

 google-cloud-vision                     1 answers                     4 view
 2018-10-22         Phoenix

How to insert string into a string as a variable?

I'm trying to create a program and one thing I'm trying to do is add variables to a string like so.EnemyHealth = 0 EnemyIs = 'dead'print("The Enemy's health is %d. The Enemy is %d." % (EnemyHealth,EnemyIs)But everytime I try that it won't let me use a string as one of the variables. How would I insert a variable string into another string?P.S. I am using python 3.7.0 There are 4 approaches I am aware of for achieving this on python (Python 3):1) Concatenation:You can do this using + for joining 2 strings, however you can only concatenate string type data, meaning non st...

 python                     7 answers                     46 view
 2018-10-22         Phoenix

Same Django templates getting rendered differently?

I have this in urlconf(r'^places/(\w+)/(\w+)/$', shopinfo),View codes:def shopinfo(request,c,s): if c == 'eat': shop=Eat.objects.get(slug=s) nearby = Eat.objects.filter(location=shop.location.all()[0]).exclude(id=shop.id) return render_to_response('shopinfo.html',{'s':shop,'c':c,'nearby':nearby,}) if c == 'shop': shop=Shop.objects.get(slug=s) nearby = Shop.objects.filter(location=shop.location.all()[0]).exclude(id=shop.id) return render_to_response('shopinfo.html',{'s':shop,'c':c,'nearby':nearby,})As you can see both of the view defs direct to that same ...

 python                     1 answers                     39 view
 2018-10-22         Phoenix

Async support in ServiceStack and OrmLite

Currently there exists an async branch of ServiceStack which will make it possible to create async services. But to get all benefits of async, all IO bound operations should be async and therefore all database requests should also be async. I am currently using OrmLite with Postgresql and I would therefore like to know if OrmLite supports async queries/operations? If not, what other .Net Micro-Orms supports async operations? OrmLite has Async support in .NET v4.5 builds for SQL Server and MySql ADO.NET providers. pseudo async API support was also added for SQLite as it's...

 asynchronous                     3 answers                     78 view
 2018-10-22         Phoenix

what is the best xhtml-css editor with emmbeded browser (under GPL) in your opinion?

what is the best xhtml-css editor with emmbeded browser (under GPL) in your opinion?note: must be work under linux os. Quanta Plus. [XXX]I was pleasantly surprised by Netbeans and after trying a bunch of others. Web browser and web server baked in just the way you like :) [XXX]Eclipse (with the web tools project) should be able to handle this, although it may be more heavy weight than you need. As far as I know the browser included is based on Mozilla. [XXX]Aptana ... well, some people really like it, other people really dislike it.It's certainly capable of doi...

 css                     6 answers                     98 view
 2018-10-22         Phoenix

Defining two SpriteSortModes?

In DirectX it is possible to set the D3DXSPRITE parameters to be a combination of both:D3DXSPRITE_SORT_DEPTH_BACKTOFRONTandD3DXSPRITE_SORT_TEXTUREMeaning that sprites are sorted first by their layer depth and then secondly by the texture that they are on. I'm trying to do the same in XNA and i'm having some problems. I've tried:SpriteBtch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront & SpriteSortMode.Texture, SaveStateMode.None);But it doesn't work and just seems to do them in Texture ordering, ignoring the textures layer depth. Am I doing something wrong...

 xna                     2 answers                     41 view
 2018-10-22         Phoenix

Jquery select onClick

I want to add a background overlay on my webpage to darken the website when a selectbox is opened.This needs to be triggered when the select is opened I tried using onClick but that doesn't work. onChange only works if there is something selected other than the dfault value but this is not what I want. I want it to trigger whenever the select is clicked. Nvm, I use select2 and I found it in their documentation:select2:close Triggered whenever the dropdown is closed. select2:closing is fired before this and can be prevented.select2:open Triggered whenever the dropdow...

 jquery                     1 answers                     24 view
 2018-10-22         Phoenix

SQL Server - why the foreign keys aren't connecting to the primary key

I want to insert the primary keys to all their foreign keys. I changed my procedure and still get nulls or empty rows: [1The other connected tables are all empty.My procedure:CREATE PROCEDURE insertText @UserID [INT], @story [NVARCHAR](120), @img [VARCHAR](MAX)ASBEGIN INSERT INTO Stories ([StoryText]) VALUES (@story) INSERT INTO Images ([img]) VALUES (@img) SELECT dbo.Table_Users.UserID , dbo.Stories.StoryID, dbo.Images.imgID FROM dbo.Images INNER JOIN dbo.imagesInStories ON dbo.Images.imgID = dbo...

 sql                     2 answers                     69 view
 2018-10-22         Phoenix

WebClient.DownloadFile requires what exactly for the URI?

I'm good with the code, it works great for other solutions of mine. I have a knowledge gap as I do not understand what constitutes a URI. This should work, but does not:https://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=downloadNow I'm thinking that this is not a file right? Throwing the above at a browser provides a file though. The exception message is "The underlying connection was closed: An unexpected error occurred on a receive." String address = "https://www.nasdaq.com/screening/companies-by-name.aspx?letter=0&...

 c#                     1 answers                     80 view
 2018-10-22         Phoenix

How to measure geographical access time of a web hosting?

I'm building a website targeted for US visitors; and this question came up while shopping around for reliable web hosting there. Since I'm located in the UK, a simple "ping" wouldn't represent the average access time from a US visitor's point of view -which is critical, since a new visitor spends around 3 seconds to evaluate a website.How to measure the average access time needed to get the full response, from a US visitor's point of view? SiteUptime.com might be useful for you. They maintain data centers around the globe and offer simple inexpensive checks that also inc...

 networking                     1 answers                     81 view
 2018-10-22         Phoenix

SetContentView for main page

In Xamarin.Android I can write:SetContentView(Resource.Layout.Main);for set the activity content from Main.axmlHow I can do the same for Xamarin.Forms? How I can move data from Main.axml on main page?Page page = App.GetMainPage();page.SetContentView(Resource.Layout.Main); // page doesn't contain method SetContentView You should check out Custom Renderers. That is the way we can include platform specific view in Xamarin.Forms. You will need to implement PageRenderer to implement an Activity layout. [XXX]A Xamarin.Forms.Page is platform independent. You try to call the...

 c#                     2 answers                     92 view
 2018-10-22         Phoenix

C TCP cannot detect broken connection

This question already has an answer here: Detecting TCP Client Disconnect 13 answers If the peer of a TCP connection closes the connection, it will lead to a recv call on your end to return 0. That's the way to detect closed (but not broken) connections.If you don't currently receive anything from the peer, you need to make up a protocol on top of TCP which includes receiving data.Furthermore, sending might not detect broken connections (like missing cables etc.) directly, as there are ...

 c                     1 answers                     73 view
 2018-10-22         Phoenix

Public types cant be declared in class modules

I want to create a function in a VBA (access) class module which returns a result type. Like this:Public Type CheckResult isOk As Boolean errorText As StringEnd TypePublic Function Check() As CheckResult ...end functionThis function is used in a lot of different places. But the compiler tells me, that it is not allowed to declare public types in class modules? Why is this? Where to put my Type instead? Should I create a new module just for this type? Or is it better to create a "AllTypes"-Module to put all Type-declarations in? As for the Why question:Class modules ...

 vba                     2 answers                     17 view

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