Embedded web parts in sharepoint

So I made a link to a document from one subsite to another subsite in sharepoint. I have used the embed web part and have inserted the link to the document instead of the iframe code. The document is an excel file but only half of the document is shown and there are no side bars to scroll across. how do I adjust the size of the embedded web part or the excel file? Any suggestions would be much appreciated.

Preemptive vs Run To Completion scheduling in Embedded Systems

Programming in embedded systems usually means working within tight memory, processing, timing and power constraints. (malloc()? Forget it…)

Schedulers for embedded systems

For all but the simplest applications, it’s often helpful to have a scheduler to handle timed events, and for the embedded systems programmer, FreeRTOS is a popular choice. It’s a preemptive scheduler that handles tasks with multiple priorities and periodically checks to see if there’s a task with a higher priority that’s available for running.

Another approach is a “run to completion” scheduler, in which the scheduler runs a task until it completes before running the next. For the embedded systems engineer it’s not particularly difficult to write non-blocking tasks, though it does take some extra thought.

Advantages of a preemptive scheduler

The primary advantages of a preemptive scheduler are that you don’t have to write non-blocking tasks, and higher-priority tasks will always get serviced soon (where “soon” is determined by the scheduler tick rate).

Advantages of a run-to-completion scheduler

Some advantages of a run-to-completion scheduler is that the implementation can be very compact and efficient and it’s easy to put the system to sleep when there are no tasks to run. And since you don’t have to save and restore each task’s stack state: switching tasks is fast; the code is more portable; and you don’t have to declare the size of each task’s stack a priori.

Which would you choose: why and when?

Given all the above, I’m leaning towards a run-to-completion architecture. But what’s your experience? When would you choose a preemptive scheduler over a run-to-completion scheduler?

Power Apps form embedded in Power BI to update Sharepoint List

I created a Sharepoint online list that tracks cases. Users review and update cases through a power apps form on the site. I also have a power bi visualization that is querying the Sharepoint list to display graphs. Is there a way to put the existing power apps form into the power bi so that users can update the cases from there? I want users to be able to update the power apps form in the power bi and have those updates reflected in the sharepoint online list.

How to secure embedded code containing REST api call

I am making a Google Analytics like service where you embed generated code into your website and it tracks certain data. I have a backend REST api, but I am not sure how to securely implement a call to it in the frontend without all the authentication data being exposed. I am worried that if a user embeds this code into their website with authentication, such as a session ID or a user ID, anybody would be able to just take that data and make a call to the api before the session times out and mess with the user’s data. Is there any way to prevent this risk and safely design the backend api and the call so that it is much more difficult or impossible for people to make calls to a user’s private api?

States and behaviour for progress bars embedded in tables

These days it is not uncommon for data tables to contain more complex UI elements (i.e. not just data), with things like pills (or tags), call-to-action buttons, icons, and even graphs & charts (e.g. sparklines) to be embedded.

However, I haven’t actually seen the specific behaviour for these embedded UI elements specified in the context of an child element in a table cell.

So the question is, what happens to a progress bar (and other UI elements) when the table row cycles through different states (e.g. hover-over, active, selected, etc.) and how does the styling and behaviour change compared to when they are outside of a table?

enter image description here

A specific example of this is to consider what happens to a table cell containing a progress bar (which is actually not an uncommon thing to see) if it is selected. Should it be:

  1. Unchanged (even though there might be some contrast issues with the table cell’s selected state).
  2. Modified by making changes to the colour or styling
  3. A custom rule to the behaviour of the table to accommodate the interaction

If you can include any screenshots of actual examples of applications (rather than CodePen or design concepts) that would be very useful for illustrating the answer.

How to do TLS on embedded devices in a home network?

If you have a router or webcam with a web interface on a home network, can the connection between the browser and the device be secured against a man in the middle attacker? What should device manufacturers do to offer transport level security?

Assume the device gets some DHCP assigned RFC1918 address, like 192.168.1.123, and that a dedicated attacker with physical access can access all files on his own device.

If this is impossible, are there any other ways to offer secure access to an embedded device on a home network?

Access embedded resources with REST API

I am currently working on my very first REST API with embedded/nested resources and need some advice about the general workflow and implementation. Some hints about best practices and useful resources, docs etc. are very much appreciated since all I found so far was dealing with rather simple examples.

Assume having different document types customer, order and article like this (pseudo-code):

# customer {     "_id": <uuid>,     "_created" : <timestamp>,     "_edited": <timestamp>,     "name": <string>,     ... }  # order {     "_id": <uuid>,     "_created" : <timestamp>,     "_edited": <timestamp>,     "customer": <customer id>,     "paid_on": <timestamp or null>,     "articles": <array of article ids>,     ... }  # article {     "_id": <uuid>,     "_created" : <timestamp>,     "_edited": <timestamp>,     "name": <string>,     "description": <string>,     "price": <integer>,     ... } 

My API endpoints for fetching the data are:

/api/customer/<id> /api/article/<id> /api/order/<id> 

As you can see from my document structure above, an order document references both article documents and a customer document. However, when requesting an order document via a GETrequest, the retrieved data still contains un-serialized nested documents for the customer and the articles fields which are referenced by their ids.

It is quite obvious that the referenced documents need to be serialized in order to retrieve a “complete” set of data. How should that serialization be implemented according to best practices?

As a beginner I came up with the following approaches:

  • Request order document and “fill in” needed documents in front-end by performing additional requests (seems to be ugly since I this would result in many individual requests for more complex documents).
  • Implement query arguments like ?serialize="articles"&serialize="customer" or a more general ?serialize="all" (feels more elegant since it would require a single request to get the desired data, but would lead to bulky handling of query arguments in back-end when dealing with complex documents).
  • Use GraphQL to request big/complex documents (might be the Swiss-army knife for requesting nested documents, but gathering some decent REST experience before moving to advanced technologies seems to be more appropriate since I am a beginner).
  • Build REST API based on OData Protocol (might give some guide-lines about implementing “pure” REST APIs since the format/protocol is defined and eliminates one degree-of-freedom/decision in the implementation).

Some databases or database connectors might have nested document serialization implemented by default like python-eve. However, I am currently reading data from a file-based source (TinyDB which is basically a big json file), so I need to implement this on my own (final decision about database/datastorage not done yet)

Accessing the GPIO pins on the Dell Embedded Box PC 5000 from Windows

I am having trouble accessing the GPIO pins on my machine. It was pretty straightforward to achieve this on ubuntu through straightforward C code using functions like ioperm(),outb()andinb()from the <unistd.h> library but alas I require this to work on windows too.

According to the manual, to control the GPIO pins I need to write/read to certain IO ports located at different addresses like 2Eh,2Fh and so on.

I am a complete novice in systems programming so I may be wrong here, but from what I’ve understood this is not possible through assembly code ( I tried) as the code is run in user mode and windows doesn’t permit accessing IO ports in user mode.

Which means I have to write when in kernel mode so I need to write a kernel mode driver for these operations. I have tried looking at online code and tutorials for help but I cannot find anything comprehensible to my basic knowledge on the subject.

Any help on how I can start writing my driver or some explanation if I am wrong in my understanding (and there is another way to achieve this),anything at all would be deeply appreciated.

Matplotlib embedded in tkinter

Investigating how to use tkinter controls with buttons and sliders and to combine these with matplotlib, I have come to the following code. Suggestions for improvements and tips are most welcome. Ultimate goal is to make some apps showing behavior of pendulums, springs and other physical systems where I can interactively change parameters like velocity, angle, weight, length, and so on.

import tkinter as tk import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import math import numpy as np   FIG_SIZE = (8, 6) PLOT_LIMIT = 12 TICK_INTERVAL = 1.5  def transform_point(point, angle):         alpha = - angle/180 * math.pi         x_t = point[0] * math.cos(alpha) - point[1] * math.cos(math.pi/2 - alpha)         y_t = point[0] * math.sin(alpha) + point[1] * math.sin(math.pi/2 - alpha)         return x_t, y_t  class MplMap():      @classmethod     def settings(cls, root, fig_size, plot_limit):         # set the plot outline, including axes going through the origin         cls.fig, cls.ax = plt.subplots(figsize=fig_size)         cls.plot_limit = plot_limit         cls.ax.set_xlim(-cls.plot_limit, cls.plot_limit)         cls.ax.set_ylim(-cls.plot_limit, cls.plot_limit)         cls.ax.set_aspect(1)         tick_range = np.arange(             round(-cls.plot_limit + (10*cls.plot_limit % TICK_INTERVAL*10)/10, 1),              cls.plot_limit + 0.1,              step=TICK_INTERVAL)         cls.ax.set_xticks(tick_range)         cls.ax.set_yticks(tick_range)         cls.ax.tick_params(axis='both', which='major', labelsize=6)         cls.ax.spines['left'].set_position('zero')         cls.ax.spines['right'].set_color('none')         cls.ax.spines['bottom'].set_position('zero')         cls.ax.spines['top'].set_color('none')         cls.canvas = FigureCanvasTkAgg(cls.fig, master=root)      @classmethod     def get_canvas(cls):         return cls.canvas   class PlotRectangle(MplMap):      def __init__(self):         self._facecolor = 'none'         self._edgecolor = 'green'         self._lw = 5         self.alpha = 0         c1 = (-1, +1)         c2 = (-2, +4)         c3 = (+2, +4)         c4 = (+1, +1)         self.a_shape = np.array([c1, c2, c3, c4])         self.plot_shape()      def plot_shape(self):         self.clear_map()         trsfd_shape = []         for point in self.a_shape:             trsfd_shape.append(transform_point(point, self.alpha))          trsfd_shape = np.array(trsfd_shape)             self.ax.fill(trsfd_shape[:, 0], trsfd_shape[:, 1],                       fc=self._facecolor,                      ec=self._edgecolor,                      lw=self._lw)         self.canvas.draw()      def clear_map(self):         for patch in self.ax.patches:             patch.remove()      def set_color(self, color):         self._edgecolor = color         self.plot_shape()      def set_angle(self, alpha):         self.alpha = alpha         self.plot_shape()      def set_line_width(self, width):         self._lw = width/10         self.plot_shape()   class Tk_Handler():      def __init__(self, root, canvas, shape):         self.root = root         self.shape = shape          self.root.wm_title("Embedding MPL in tkinter")         sliders_frame = tk.Frame(self.root)         slider_frame_1 = tk.Frame(sliders_frame)         label_slider_1 = tk.Label(slider_frame_1, text='\nAngle: ')         slider_1 = tk.Scale(slider_frame_1, from_=-180, to=180, orient=tk.HORIZONTAL,                             command=lambda angle: self._tilt_shape(angle))         slider_1.set(0)         label_slider_1.pack(side=tk.LEFT)         slider_1.pack(side=tk.LEFT)         slider_frame_1.pack()          slider_frame_2 = tk.Frame(sliders_frame)         label_slider_2 = tk.Label(slider_frame_2, text='\nWidth: ')         slider_2 = tk.Scale(slider_frame_2, from_=0, to=10, orient=tk.HORIZONTAL,                             command=lambda width: self._lw_shape(width))         slider_2.set(5)         label_slider_2.pack(side=tk.LEFT)         slider_2.pack(side=tk.LEFT)         slider_frame_2.pack()          button_frame = tk.Frame(self.root)         quit_button = tk.Button(button_frame, text="Quit", command=self._quit)\             .pack(side=tk.LEFT)         green_button = tk.Button(button_frame, text="Green",\             command=lambda *args: self._color_shape('green', *args))\             .pack(side=tk.LEFT)         red_button = tk.Button(button_frame, text="Red",\             command=lambda *args: self._color_shape('red', *args))\             .pack(side=tk.LEFT)          # fill the grid         tk.Grid.rowconfigure(self.root, 0, weight=1)         tk.Grid.columnconfigure(self.root, 0, weight=1)         sliders_frame.grid(row=0, column=0, sticky=tk.NW)         button_frame.grid(row=2, column=0, columnspan=2, sticky=tk.W)         canvas.get_tk_widget().grid(row=0, column=1, rowspan=1, columnspan=1,                                     sticky=tk.W+tk.E+tk.N+tk.S)          tk.mainloop()      def _quit(self):         self.root.quit()     # stops mainloop         self.root.destroy()  # this is necessary on Windows to prevent                              # Fatal Python Error: PyEval_RestoreThread: NULL tstate      def _color_shape(self, color):         self.shape.set_color(color)      def _lw_shape(self, width):         self.shape.set_line_width(float(width)*4)      def _tilt_shape(self, angle):         self.shape.set_angle(float(angle))   def main():     root = tk.Tk()     MplMap.settings(root, FIG_SIZE, PLOT_LIMIT)     Tk_Handler(root, MplMap.get_canvas(), PlotRectangle())   if __name__ == "__main__":     main()