2018-10-22         Baldwin

update_attribute vs update_attributes Rails 4

I am trying to update attributes of an object after a certain action. If I use update_attribute everything saves correctly to the db but I have many things I need updated so it gets very repetitive. This works fine:order.update_attribute(:order_completed, "true")order.update_attribute(:stripe_email, params[:stripeEmail])However when I try to use update_attributes my data does not save to the db.Here is that code:order.update_attributes(order_completed: "true", stripe_email: params[:stripeEmail])Does anyone see where my mistake is? From everything I've read that should ha...

 ruby-on-rails                     2 answers                     44 view
 2018-10-22         Baldwin

HBase Anti-Patterns

What tasks should one not use HBase for?My understanding is that HBase and HDFS should be treated as transient data stores, holding data only for the duration of time that a map/reduce job needs them for.Is it inappropriate to use HBase as a canonical data store? Its random-access latency spikes make this pretty impractical anyway, but this could be mitigated with caching and other badn-aids. HBase is supposed to be used as a canonical data store (like Big Table, which is used heavily in many Google services). HDFS is made for MapReduce, but HBase is built on HDFS for al...

 architecture                     1 answers                     95 view
 2018-10-22         Baldwin

Writing a "find and replace for certain empty cells" function in R

I have a dataframe that looks roughly like this:March_created_at March_email March_type April_created_at April_email April_type3/11/12 7:28 jeremy@asynk.ch PushEvent 4/1/12 4:03 PushEvent3/11/12 7:28 jeremy@asynk.ch PushEvent 4/1/12 4:03 PushEvent3/11/12 7:28 jeremy@asynk.ch PushEvent 4/1/12 4:03 PushEvent3/11/12 7:28 jeremy@asynk.ch PushEvent 4/1/12 7:03 high IssuesEvent3/11/12 11:06 medium PushEvent 4/1/12 13:57 medium PushEvent3/11/12 11:06 med...

 r                     1 answers                     15 view
 2018-10-22         Baldwin

From Django project achieve an asynchronous request to external API?

In my Django project, I have to implement an asynchronous HTTP request to the external API and get the result. I found that by using Django channels and celery we can do. There is a package in the tornado simpleAsynchronousHttp package is there anything in Django. please, can anyone suggest which is the better way to achieve asynchronous HTTP call to external API and get data in Django? Requests is a python package, which makes it pretty easy to do HTTP requests. In order to do it asynchronously, you can leverage Celery. For celery setup, you can follow the docs. You can...

 python                     1 answers                     90 view
 2018-10-22         Baldwin

How smartphone app usage effects on its website vesion rank?

We are developing a website alongside an android app version with SDK, we are coding the website in standard PHP and creating a RESTful Web Service for our android app. The question is how our app could influence on our website's rank?e.g: The most if not all of the Instagram's users use the smartphone app version not the actual website, however their website's rank in Alexa is 35 in world. Isn't the ranking based on some tools that are hidden in browser's toolbars extension!!? Your RESTful Web Service will have no effect on your websites search rank.The Alexa rank is ba...

 php                     1 answers                     44 view
 2018-10-22         Baldwin

Why does IN not evaluate my regular expression?

Using Python 3.x, I am parsing through log files, and on most lines there are one of three key words (INFO, ERROR, or WARN).I am defining the regular expression to see if a line contains either of these words as:INFO|ERROR|WARNI was certain that this was the correct way to go about this, but it does not seem to be working. Does anybody know what I am missing here?I am checking to see if the regular expression is in the line simply by printing it:Properties.py status = "INFO|ERROR|WARN"Runner.py import properties as p import re line = "[time stamp] INFO [other in...

 python                     1 answers                     44 view
 2018-10-22         Baldwin

How can I temporarily prevent a scrollable div from scrolling?

Here is my current situation:I have a web page containing a couple scrollable divs. Each of those divs contains a number of objects. I am using YUI to display popup menus of actions that can be performed on each object. Each object has its own menu associated with it that is constructed and displayed dynamically. The popup menus can be large and can overlap the bounds of the scrollable div.From what I believe are issues with focus (the menus must be accessible), when I hover the mouse over an action that lies on top of an edge of the scrollable div, the div automatically sc...

 javascript                     5 answers                     19 view
 2018-10-22         Baldwin

Add conda to path in fish

~> conda install pandasfish: Unknown command 'conda'I understand that I need to add conda to PATH, but no matter what combinations of commands I tried, I could get it to work. I still get the above error. Where is conda installed? If it's in ~/anaconda/bin, then you want to run this:Try set -U fish_user_paths ~/anaconda/bin $fish_user_pathsModifying PATH is discussed in the fish tutorialHope that helps! [XXX]

 fish                     1 answers                     29 view
 2018-10-22         Baldwin

How do I get arguments in a form application?

I can find many examples on how to get arguments in a console application, but I can't seem to find an example of how to get arguments in a windows form application.I would like to following things.whenever I open a jpg file, windows launches my application.I would like to know path and name of the jpg file from my application.How do i do that? Environment.GetCommandLineArgs [XXX]Open up program.cs, on a file > new > winform project, you'll get static class Program{ [STAThread] static void Main() { Application.EnableVisualStyles(); Application.S...

 c#                     2 answers                     9 view
 2018-10-22         Baldwin

SQL 2005 sp_GetAppLock --- When to call sp_ReleaseAppLock?

Sorry about the last message. I did a paste over my question. Long question short, when using sp_GetAppLock inside of a try / catch block, should I call sp_ReleaseAppLock when an exception is caught?SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTEDBEGIN TRAN DECLARE @res INTEXEC @res = sp_getapplock @Resource = 'This a Lock ID 3', @LockMode = 'Exclusive', @LockOwner = 'Transaction', @LockTimeout = 60000, @DbPrincipal = 'public'if @res < 0begin declare @errorMessage nvarchar(200) set @errorMessage = case...

 sql                     2 answers                     16 view
 2018-10-22         Baldwin

Delete selected row dgv

I have a problem on deleting a data from datagridview. I don't know why on how to fix it. So, after I press the delete button and select the yes button on dialogresult. I got this error; "Error: Invalid column name EMP". Help me guys. Thanks id advance!!Codes:Public Sub deleteEmployee() employeesView.btnDelete.Text = MessageBox.Show("Are you sure you want to delete the selected employee?", "WARNING: DELETION OF EMPLOYEE!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) If employeesView.btnDelete.Text = DialogResult.Yes Then employeesView.btnDelete...

 sql-server                     1 answers                     67 view
 2018-10-22         Baldwin

Cursor disappears in vim when switching windows between vertical and horizontal split

I've been switching some windows in VIM from vertical to horizontal splits and back using:CTRL-W + KCTRL-W + LCTRL-W + JCTRL-W + HAfter doing this a few times the cursor disappeared. I can still type, and the status bar at the bottom still shows me my location, but there's no blinking cursor. Any ideas regarding:Why does this happen?How do I get the cursor back?I'm using vim 7.2 on Linux I have the same problem and I have used couple of work-arounds that work for me:Maximize gvim window and then click on the maximize button again to bring it to original size. This brin...

 vim                     11 answers                     88 view
 2018-10-22         Baldwin

@KafkaListener method not work with spring @Profile annotation

I have 2 @KafkaListener methods listening on the same tipic TopicA,but they are also annotated with different @Profile("dev") and @Profile("prod"),I set spring.profiles.active=dev ,and send messages to TopicA, both 2 methods can consume the message.is it a known bug for @KafkaListener with @Profile ? or there are something wrong with my config ? That's correct, because @KafkaListener doesn't present a bean. The @Profile can restrict only beans - factory methods in the @Configuration classes or scanned @Services: http://docs.spring.io/spring/docs/current/spring-framework...

 spring-boot                     1 answers                     49 view
 2018-10-22         Baldwin

Error creating a webhook with a scope = project id but works with top folder

When creating a webhook for a BIM360 Team project, I get the error "Access denied for the scope a.123456789 that you are trying to create hook on" when creating with the project id with the below json body and request:https://developer.api.autodesk.com/webhooks/v1/systems/data/events/dm.version.added/hooks { "callbackUrl": "http://test.com/callback", "scope": { "folder": "a.123456789" } }This does succeed if a top folder URN is replaced in the json. I have tried with both 2-legged and 3-legged OAuth with data:create scope. Is there some...

 webhooks                     2 answers                     15 view
 2018-10-22         Baldwin

Using Fonts in an Azure-Function

I try to get PdfSharp working in an Azure FunctionBut I have some problems with fonts // Create a new PDF document PdfDocument document = new PdfDocument(); document.Info.Title = "Created with PDFsharp"; // Create an empty page PdfPage page = document.AddPage(); // Get an XGraphics object for drawing XGraphics gfx = XGraphics.FromPdfPage(page); // Create a font XFont font = new XFont("Verdana", 20, XFontStyle.BoldItalic); // Draw the text gfx.DrawString("Hello, World!", font, XBrushes.Black, new XRect(0, 0, page.Width, page.Height), XStringFormats.Center);Th...

 azure                     1 answers                     97 view
 2018-10-22         Baldwin

How can I put two divs alongside each other keeping the second one centered using flexbox?

This question already has an answer here: How to get a div centered with another div on the right of it? 4 answers Children of flex container will follow his parent alignment rules. As you said, you need the left element to be sticked on the left of the centered one. So le left element should not be related to the container, but instead, to the centered element..Container { display: flex; justify-content: center;}.Left { background-color: red; position: absolute; right: 100%; top:...

 html                     1 answers                     99 view

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