What’s the cheapest way to get from downtown Taoyuan to downtown Taipei, other than hitchhiking?

I will probably hitchhike but it is winter and rain is not unlikely.

There are lots of discussions about getting from Taoyuan airport to Taipei, but I’ve actually been staying in Taoyuan for a few days. I’m quite close to Taoyuan station.

I don’t care about speed or efficiency. I’m in no hurry. I’m just looking for the cheapest way to get to Taipei. I’m guessing it would be the regular (non-HSR) train, or perhaps a private bus company.

If it makes a difference I’ll be heading to the area around “Small South Gate”.

What’s faster.. Multiple variables or single array?

I have a C-coded function that realizes a very long calculation on a microcontroller. I try to optimize it for speed at the moment. The function content is created automatically using Mathematica. It has hundreds of calculations and looks like this:

void calcResult(float *result, float arg1, float arg2, ... float argN){    float tmp1 = arg1 * 2 + arg2;    float tmp2 = tmp1/arg3 + tmp1;    ...    ...    float tmpN = tmp320 + tmp15 * 2;    *result = tmp2 + tmpN; } 

I asked myself if it could possibly be faster not use “tmp” variables but an array with the same size as the number of “tmp” variables or maybe to speed things up in such a function in another way (under the assumption, that the calculations to get the “result” are already “optimized” in terms of the necessary calculation time)?

Instagram – Whats considered good

So I launched an ecommerce business about 2 months ago and over the past few weeks I have been working on instagram posts with one of my partners "karriermtl".

Do you guys have any tips to improve my account. maybe examples of good instagram accounts I can look at?

I am working on building a following that could potentially drive sales to my business.

How can we know whats the data type of Data contained in a DataTable?

I want to check the data type of each data of excel data. But when i check the excel data it shows all data as string type.

C#,oleDb

  //For validating Datatype         public List<string> ValidateDataType(DataRow row, List<DataExchangeDefinition> dataExchangeDefinitionList, List<string> dataColumnList)         {             //var dataColumnString = String.Join(", ", dataColumnList.ToArray());              Dictionary<string, Type> types = new Dictionary<string, Type>();             types.Add("int", typeof(System.Int32));             //types.Add("int", typeof(System.Int64));             types.Add("DateTime", typeof(System.DateTime));             types.Add("decimal", typeof(System.Decimal));             types.Add("float", typeof(System.Double));             types.Add("String", typeof(System.String));               List<string> dataTypeErrorList = new List<string>();             foreach (DataExchangeDefinition dt in dataExchangeDefinitionList)             {                 if (dataColumnList.Any(str => str == dt.FieldName))                 {                     if (!row.IsNull(dt.FieldName))                     {                         var dat = row[dt.FieldName];                         var t = row[dt.FieldName].GetType().Name;                                        var conObj = Convert.ChangeType(dat,types[t]);                          string error = (from e in row.ItemArray                                         where conObj.GetType().Name.Contains(dt.DataType) == false                                         select dt.FieldName).DefaultIfEmpty("").FirstOrDefault();                         if (error != "")                         {                             dataTypeErrorList.Add(error);                         }                     }                                                         }             }              return dataTypeErrorList;         } 

In result im passing it as a list. List contains error column names. The checking is done using Linq

Here is the excel data im imported

This is the data in the datatable. Here i added number 2 instead of a string. But it actually takes as string. But here i want detect as int, otherwise my validation will fail. enter image description here

What’s wrong with my code?

I’ve written a simple code in c to convert Celsius to Fahrenheit:

#include<stdio.h> int main(){  float cel, fah;  printf("Enter tempreture in celsius.\n"); scanf("%f", &cel); 

Please let me know if this question is off-topic here, because I’ new to this community. fah=cel*(9/5)+32;

printf("Tempreture in fahrenheit is:%.2f\n", fah);  return 0; } 

The problem is in this part:

fah=cel*(9/5)+32; 

When I run it, with 100 as input, I get 132 as result.The section(9/5) is not calculated. How can I fix it?

what’s the proper way to interpret SREM results from REDIS

Background

I am writing a REST API that exposes a method that allows the caller to delete a resource from the REDIS database. Because I’m using a SET, when you try to do an SREM, it will just return the number of records that were deleted.

Please consider the following use cases and the REDIS results:

Delete a member that doesn't exist:  127.0.0.1:6379[5]> srem 123455 idontexist@yahoo.com (integer) 0  Delete multiple members at once:  127.0.0.1:6379[5]> srem 123455 iexist@yahoo.com iexisttoo@yahoo.com (integer) 2 127.0.0.1:6379[5]>  Delete multiple but it only finds one match: 127.0.0.1:6379[5]> srem 123455 iexist@yahoo.com idontexist@yahoo.com (integer) 1 127.0.0.1:6379[5]>  Delete email for an account that doesn't even exists 127.0.0.1:6379[5]> srem bogus idontexist@yahoo.com (integer) 0 127.0.0.1:6379[5]> 

Question

I’m wondering how I should interpret a return value from REDIS when I can the SREM command, as far as the REST API that I’m writing is concerned. (and ultimately what kind of a return value I send back to the caller)

For example, when the caller asks me to delete a list of email addresses, if no matches are found, REDIS returns 0. This could mean it failed because it didn’t do anything but from the business point of view, this is a successful request because I know those emails don’t exist.

For now, I always return a successful result, unless there is some unexpected behavior.

def delete_db_email(mailbox, profiledata):     try:                if DEBUG:  logging.info("delete_db_email debug started:")         count = len(profiledata)                if DEBUG:  logging.info("the number of emails to process is: " + str(count))         r = redis.Redis(connection_pool=POOL)         mailbox = str(mailbox)         keyname = mailbox + "-emails"                             response = r.srem(keyname, *set(profiledata))         return True, 200     except Exception as ex:         logging.error("delete_db_email() failed for mailbox:" + mailbox)         logging.error(ex)         return False, 500 

From a design / behavior point of view, can you give me some constructive criticism re: what is good / not good about this approach?

Thanks.

EDIT 1

One thing I could do is an explicit check for the mailbox number in question so I can return a 404 if the mailbox doesn’t exist, but that is an extra database call … which I’m not sure if it’s worth it.

What’s the best infrastructure to set permissions to user roles that controls who can see which Nodes and which Views?

I’m building a Drupal 8 website that needs pretty stringent permissions. I have already created the (4) user roles for the site, but not sure the best way to handle viewing permissions. I see that when creating Views it is pretty simple to assign which roles have permission to view, but what about for my content that is straight up page/nodes?