Tag: technology

  • Netflix’s full Avatar: The Last Airbender trailer nails the vibe of the cartoon

    Lawrence Bonk

    Hold onto your cabbages. Netflix just dropped a full trailer for its forthcoming live-action adaptation of Avatar: The Last Airbender. It actually looks pretty cool, surprising fans who have been dreading a repeat of the disastrous 2010 film adaptation. The vibe is on point, calling to mind the source material, and the casting department looks to have done a fantastic job. Just look at Sokka, as portrayed by Ian Ousley.

    This is the second trailer for the show, but the first was more of a teaser. The new trailer features two and a half minutes of footage, complete with jokes, action set-pieces and plenty of appearances by the franchise’s resident cutie-pies, the air bison Appa and winged lemur Momo. They are both CGI, but look pretty good to me.

    You also get a deeper glimpse into both the world itself and the show’s primary characters. Gordon Courmier and Kiawentiio Tarbell look great as Aang and Katara, respectively. The trailer also boasts a shirtless Firelord Ozai, as played by Lost’s Daniel Dae Kim. Of course, it wouldn’t be Avatar without Prince Zuko and General Iroh, both of whom are featured prominently. Iroh is played by Paul Sun-Hyung Lee, fresh off his stint in a galaxy far, far away (he’s in a bunch of Star Wars shows.)

    Netflix’s version of Avatar: The Last Airbender premieres with all episodes on February 22. Original series creators Michael Dante DiMartino and Bryan Konietzko aren’t involved with this adaptation, but are making an animated movie to further the adventures of Aang and the gang, in addition to more projects set in the Avatar universe.

    As for Netflix, this is just the latest live-action adaptation of a pre-existing cartoon. The anime One Piece got a show earlier this year, preceded by Cowboy Bebop, Death Note, Fullmetal Alchemist and several more.

    This article originally appeared on Engadget at https://www.engadget.com/netflixs-full-avatar-the-last-airbender-trailer-nails-the-vibe-of-the-cartoon-195539387.html?src=rss

    Go Here to Read this Fast!

    Netflix’s full Avatar: The Last Airbender trailer nails the vibe of the cartoon

    Originally appeared here:

    Netflix’s full Avatar: The Last Airbender trailer nails the vibe of the cartoon

  • Arrays in Python and Excel VBA

    Arrays in Python and Excel VBA

    Himalaya Bir Shrestha

    Learning about arrays through simple examples

    As someone without a formal education in programming, my journey has been shaped by self-learning. Recognizing the significance of revisiting basic programming concepts, I have found that a solid foundation enhances the overall programming experience. In this tutorial, we will delve into one such fundamental concept — arrays. Specifically, we’ll explore the concept of arrays in both Python and Excel VBA through simple examples. Let’s get started.

    Photo by Nathan Dumlao on Unsplash

    1. Arrays in Python

    An array is a special variable that can hold one or multiple values of any data type. In Python, there is no built-in support for arrays, unlike similar data types such as lists. However, one can create arrays using the array module of the numpy package. The index of a numpy array object always starts with a 0. The last item inside a numpy array can be accessed by referring to -1. A numpy array can hold variables of a particular data type or multiple data types.

    This is shown in the code snippet below. The snippet also shows how the shape (dimensions i.e., rows, columns), size (number of elements) and length (number of items in a container i.e., rows) can be accessed from a numpy array.

    import numpy as np

    simple_array = np.array([1, 2, 3])
    mixed_array = np.array([1, 2, 3, "a", "b", "c", 4.5])
    print ("Simple array: ", simple_array)
    print ("First element of simple_array: ", simple_array[0])
    print ("Shape of simple_array: ", simple_array.shape)
    print ("Size of simple_array; ", simple_array.size)
    print ("n")
    print ("Mixed array: ", mixed_array)
    print ("Last element of mixed_array: ", mixed_array[-1])
    print ("Length of mixed_array: ", len(mixed_array))

    1.1 Using numpy arrays for algebraic matrix operations

    Because of their flexible structure, numpy arrays are very handy in creating matrix objects of different dimensions and performing operations on them. The screenshot above has the examples of 1-dimensional array objects.

    Below, I have created two array objects a and b both of which are 2-dimensional arrays. They can be considered as 2*2 matrices. Performing the dot product of the two matrices is as simple as doing just np.dot(a, b). In dot product, a and b are regarded as vectors (objects having both magnitude and direction). In matrix multiplication, each element in matrix a is multiplied with the corresponding element in matrix b. For example, a11 (first row, first column item) is multiplied by b11, and so on.

    a = np.array([[0, 1],[2,3]])
    b = np.array([[3,4],[5,6]])
    print ("Dot Product of a and b: n", np.dot(a,b))
    print ("Matrix multiplication of a and b n",a*b)

    Furthermore, one can perform other matrix operations such as addition, subtraction, and transpose. To get the determinant of the matrix, one can use np.linalg.det(a). To get the multiplicative inverse of a matrix, one can use np.linalg.inv(a).

    print (“Addition of a and b:n”, np.add(a, b))
    print ("Also addition of a and b:n", a+b)
    print ("Transpose of a:n", a.T)
    print ("Determinant of a:n", np.linalg.det(a))
    print ("Inverse of a:n", np.linalg.inv(a))

    1.2 Creating a m*n shape numpy array from list objects

    I have two lists called countries_lived and capitals which contain the list of countries I have lived in and their corresponding capitals.

    countries_lived = [“Nepal”,”India”,”Germany”,”Netherlands”]
    capitals = [“Kathmandu”,”New Delhi”,”Berlin”,”Amsterdam”]

    To create an array containing these list objects, I can use np.array([countries_lived, capitals]). This will return me an array of shape 2*4 (i.e., 2 rows and 4 columns). If I want to have a single country and its corresponding capital in the same row, I can just transpose the same array.

    array1 = np.array([countries_lived, capitals])
    print ("array1:n", array1)
    print ("Shape of array1:n", array1.shape)
    print ("Size of array1:n", array1.size)

    array2 = np.array([countries_lived, capitals]).T
    print ("array2:n", array2)
    print ("Shape of array2:n", array2.shape)
    print ("Size of array2:n", array2.size)

    1.3 Appending an item to a numpy array and creating a dataframe

    Say I want to append an item France and Paris to array2 as an additional row, this can be done using the syntax np.append(arr, values, axis = None). The values must be of the same shape as arr, excluding the axis. If the axis is not given, both arr and values are flattened before use.

    As shown below, I appended the new item as a new row to the array. Finally, the array2 of shape (5,2) is used to create a dataframe object df with Country and Capital columns.

    array2 = np.append(array2, [[“France”,”Paris”]], axis = 0)
    print ("array2 after appening new row: n", array2)

    import pandas as pd

    df = pd.DataFrame(array2,
    columns = ["Country", "Capital"])

    df

    2. Arrays in Excel VBA

    Similar to Python, arrays are also a collection of variables in Excel VBA. The lower bound for arrays can start from either 0 or 1 in Excel VBA. The default lower bound is 0. However, the lower bounds for arrays can be specified by stating Option Base 0 or Option Base 1 on the top of each module.

    To detect the lower bound and upper bound used for an array, one can use Lbound(array_name) and Ubound(array_name) respectively.

    2.1 Declaring an array

    Arrays can be declared publicly (i.e. globally) by using the Public keyword. Declaring an array or any other variable publicly in Excel VBA allows it to be used in any module or subroutine without declaring again.

    Public countries(1 to 4) as String
    Public capitals(4) as String
    Public countries_visited() as String

    Alternatively, arrays can be declared locally inside a subroutine simply using the Dim keyword. These arrays can then be used only inside the specific subroutine.

    Dim countries(1 to 4) as String
    Dim capitals(4) as String

    In the above examples, the size of the arrays is also specified. Specifying 1 to 4 or only 4 both imply the array of size 4.

    2.2 One-dimensional array

    A one-dimensional array is assigned by declaring the number of rows (e.g., 1 to 5) i.e., the number of elements to be contained by an array. An example of creating a 1-dimensional array of the four countries I have lived in is given below. It will print the name of these countries in column A in the worksheet of the Excel file.

    Option Base 1

    Sub array_1d()

    countries(1) = "Nepal"
    countries(2) = "India"
    countries(3) = "Germany"
    countries(4) = "Netherlands"

    Dim i As Integer
    Range("A1").Value = "Country"

    For i = 1 To 4
    Range("A" & i + 1).Value = countries(i)
    Next i

    End Sub

    The output of the running the array_1d subroutine is as follows:

    Output of array_1d subroutine. Image by Author.

    2.2 2-dimensional array

    Two-dimensional arrays are defined by declaring the number of rows and columns. In the following example, I declare a 2-dimensional array called country_capital. The first element in each row corresponds to the element of the countriesarray declared in the previous section. The second element in each row corresponds to their capital cities which have been declared individually in the code below.

    Sub array_2d()

    Dim country_capital(4, 2) As String


    For i = 1 To 4
    country_capital(i, 1) = countries(i)
    Next i

    country_capital(1, 2) = "Kathmandu"
    country_capital(2, 2) = "New Delhi"
    country_capital(3, 2) = "Berlin"
    country_capital(4, 2) = "Amsterdam"

    Range("B1").Value = "Capital"

    For i = 1 To 4
    Range("A" & i + 1).Value = country_capital(i, 1)
    Range("B" & i + 1).Value = country_capital(i, 2)

    Next i

    End Sub

    Running this sub-routine returns the following:

    Output of array_2d subroutine. Image by Author.

    2.3 Dynamic arrays

    Dynamic arrays are useful in cases when one is not certain about the size of the array and the size of the array can change in the future. In the code below, I specify two arrays countries_visited and population without specifying the size of the arrays. Inside the dynamic_array subroutine, I specify the size of both of these arrays as 4 by using the ReDim statement. Next, I specify each element of the array individually based on the four countries I have visited and their populations.

    Option Base 1

    Public countries_visited() As String
    Public population() As Long

    Sub dynamic_array()

    Dim wb As Workbook
    Dim ws2 As Worksheet
    Set wb = ThisWorkbook
    Set ws2 = wb.Worksheets("Sheet2")

    ReDim countries_visisted(4)
    ReDim population(4)

    countries_visited(1) = "France"
    population(1) = 68

    countries_visited(2) = "Spain"
    population(2) = 48

    countries_visited(3) = "Iran"
    population(3) = 88

    countries_visited(4) = "Indonesia"
    population(4) = 274

    End Sub

    After a while, I realize that I have also visited one more country (Portugal). I redefine the size of the array while preserving the original contents/elements in these arrays. I increase the size of these arrays by 1. For this, I use the ReDim Preserve statement as shown below.

    ReDim Preserve countries_visited(1 to 5)
    ReDim Preserve population(1 to 5)

    The full code is given below:

    Option Base 1

    Public countries_visited() As String
    Public population() As Long

    Sub dynamic_array()

    Dim wb As Workbook
    Dim ws2 As Worksheet
    Set wb = ThisWorkbook
    Set ws2 = wb.Worksheets("Sheet2")

    ReDim countries_visisted(4)
    ReDim population(4)

    countries_visited(1) = "France"
    population(1) = 68

    countries_visited(2) = "Spain"
    population(2) = 48

    countries_visited(3) = "Iran"
    population(3) = 88

    countries_visited(4) = "Indonesia"
    population(4) = 274

    ws2.Range("A1").Value = "Countries visited"
    ws2.Range("B1").Value = "Population (million)"

    ReDim Preserve countries_visited(5)
    ReDim Preserve population(5)

    countries_visited(5) = "Portugal"
    population(5) = 10

    Dim i As Integer
    For i = 2 To 6
    Range("A" & i).Value = countries_visited(i - 1)
    Range("B" & i).Value = population(i - 1)

    Next i

    End Sub

    The output of the above code is as shown:

    Output of dynamic_array subroutine. Image by Author.

    2.4 Declaring arrays to store variables of different data types

    In the section above, the countries_visited array is declared to store the variables of the String data type and the population array is declared to store the variables of the Long data type. Similar to Python numpy arrays, it is also possible to store variables of different data types in arrays in Excel VBA. In that case, the array has be to declared as a Variant type.

    In the example below, an array test is declared as a Variant. Its size is specified as 3 using the ReDim statement. The three elements of types String, Integer, and Date are specified inside the test. The data types can be identified by passing the variable inside the TypeName() function.

    Option Base 0

    Sub variant_test()

    Dim test() As Variant
    ReDim test(3)

    test = Array("Germany population in million: ", 83, Date)

    Dim i As Integer
    For i = 0 To 2
    Debug.Print "Element " & i & " of test array is: " & test(i) & " of type " & TypeName(test(i))
    Next i

    End Sub

    The output is as shown below:

    Output of variant_test subroutine. Image by Author.

    Conclusion

    Arrays are a collection of values/variables of one or more data types. Each variable is associated with a particular index number in an array. Arrays can be of one-dimension, two-dimensions, or multiple dimensions. In Python, there is no built-in support for arrays, but one can create arrays using the numpy package. Besides storing the values, the numpy arrays are also very useful in performing matrix operations. In Excel VBA, arrays are very useful in working with large databases of elements. In Excel VBA, an array can be static where the size of the array is pre-defined. Or array can be dynamic where the size of the array is not pre-defined, but it can be specified as we move along and even resized while preserving the elements already stored in the array.

    The Python notebook, Excel workbook along with VBA scripts are available in this GitHub repository. Thank you for reading!


    Arrays in Python and Excel VBA was originally published in Towards Data Science on Medium, where people are continuing the conversation by highlighting and responding to this story.

    Originally appeared here:
    Arrays in Python and Excel VBA

    Go Here to Read this Fast! Arrays in Python and Excel VBA

  • 5 tech jobs with long-term staying power

    Elaine Burke


    While the tech sector suffered a downturn in 2023, leading to swathes of job cuts, there remains a high demand for certain tech jobs within the industry itself and beyond. Nonetheless, these job losses, alongside the rapid growth of generative AI tools in the past year sowed seeds of doubt for many, begging the question: do tech jobs offer good job security? In a recent interview, Nobel Prize-winning economist Prof Christopher Pissarides cautioned students on selecting to study STEM subjects for future roles in tech that may be more limited in availability than expected.  This, he clarified in a later…

    This story continues at The Next Web

    Go Here to Read this Fast! 5 tech jobs with long-term staying power

    Originally appeared here:
    5 tech jobs with long-term staying power

  • Macron convinces UK nuclear startup to build its first factory in France

    Siôn Geschwindt


    London-based nuclear energy startup Newcleo has scrapped plans to build its first power plant in Britain, opting to invest in France instead.  The move follows extensive lobbying by France’s president Emmanuel Macron, who has personally met with Newcleo’s chief executive and founder Stefano Buono several times, to convince him to build the company’s first modular nuclear reactor in France, the Telegraph reports.  Founded in 2021, Newcleo develops small nuclear reactors powered by radioactive waste. The company initially sought to tap the UK’s vast stockpile of nuclear waste at the former Sellafield site to power its reactors.  But after two years…

    This story continues at The Next Web

    Go Here to Read this Fast! Macron convinces UK nuclear startup to build its first factory in France

    Originally appeared here:
    Macron convinces UK nuclear startup to build its first factory in France

  • Apple Music enhances music parties with collaborative playlists

    Apple Music enhances music parties with collaborative playlists

    Apple Music’s latest feature, collaborative playlists, is a game-changer in how music lovers share and experience songs. The company released a video on how to use it.

    A white musical note symbol set against a bright red background.
    Apple Music listeners can collaborate in playlists

    Apple has steadily enhanced its Apple Music service, introducing various features to improve user experience and engagement. One of the notable updates in recent times has been the introduction of collaborative playlists, a feature that was much anticipated and has added a significant social dimension to the music streaming service.

    The addition of collaborative playlists, initially slated for release in late 2023 as part of the iOS 17 update, finally made its debut. The feature allows multiple users to add songs, modify the playlist order, and remove tracks from a shared playlist, transforming how people interact with music on the platform.

    Continue Reading on AppleInsider | Discuss on our Forums

    Go Here to Read this Fast! Apple Music enhances music parties with collaborative playlists

    Originally appeared here:
    Apple Music enhances music parties with collaborative playlists

  • Apple Maps ‘closed’ mistake costs restaurant thousands

    Apple Maps ‘closed’ mistake costs restaurant thousands

    An incorrect listing on Apple Maps may have cost a small business in Australia thousands of dollars, by mistakenly labeling it as “permanently closed,” as well as getting its location wrong.

    The corrected listing for Pum's Kitchen in Apple Maps
    The corrected listing for Pum’s Kitchen in Apple Maps

    Chris Pyatt, operator of Thai restaurant Pum’s Kitchen in Queensland, Australia, was asked by a regular customer why the restaurant had shut down. Pyatt was surprised by the question, as his restaurant was still operational, and with no intention of closure.

    He was then informed that Apple Maps shows the restaurant as “permanently closed,” reports ABC News. “We have no idea when this change went through” said Pyatt, but on further inspection, did see a “sudden and drastic change in customer behavior” from the end of November and throughout December.

    Continue Reading on AppleInsider | Discuss on our Forums

    Go Here to Read this Fast!

    Apple Maps ‘closed’ mistake costs restaurant thousands

    Originally appeared here:

    Apple Maps ‘closed’ mistake costs restaurant thousands