how to run a GPU application via SSH on a “virtual” display

i’m currently working with the vulkan-api on a remote machine (linux). now i wondered if there might be a possibility to run the same application, i’m currently working on, which has a graphical output via GLFW on the remote machine and capture screenshots per screenshot layer of the running application.

i know i could rewrite the code, do the rendering offscreen without the need for glfw and a swapchain, and then write the image to a file. but that’s a lot of work which i would like to avoid.

basically i’d need some sort of “virtual display, which i can start per ssh on which i can render the output. i did try setting the env variable “DISPLAY” to 0, which didn’t work. i guess that’s because the user as whom i’m connected with the ssh has no open x session running.

so is there an easy way to do this? or do i have to write some code for offscreen rendering?

Display a custom attribute below product name in the front-end Magento 1.9.3.8

I need to display a custom attribute bellow the product name and I don’t know how can I call this attribute.

I am editing the file /app/design/frontend/templatemela/MAG100219_1/template/catalog/product/view.phtml But how can I call this attribute in php? I tried calling a string echo with the name I put in the attribute, but it didn’t work.

Code is as below:

<div class="page-title product-title">  <h1><?php echo $  _helper->productAttribute($  _product, $  _product->getName(), 'name') ?></h1> </div>  <div class="codigoinmetro">  <h2><?php echo $  _helper->productAttribute($  _product, $  _product->getName(), 'registroinmetro') ?></h2> </div> 

Display the exclude dates on a node

I have a Drupal 7 site with a content type called Weekly Repeating Event, and events of this type repeat at the same time and day each week. I use a custom template file to display this node type by printing the fields, e.g.

print render($  content['field_event_date'])

I understand how to use display types and how to make the repeat rule display, but for the life of me I cannot figure out how to display ONLY the dates that we list as “Exclude Dates.”

I want the node to have a heading that says “No Meetings on the Following Dates” and to display any future dates from NOW (date the node was viewed) that the group is not meeting.

I can’t figure out how to create a view of this, nor can I figure out how to make this happen within the template file.

All help appreciated.

YouTube Default Player Display Size

Looking for a way to tell YouTube to ALWAYS load my videos in the nice expanded view (not fullscreen, but the one where it’s the width of the page and actually visible on a decent sized monitor instead of this tiny thing).

Size Button

^ Hitting the highlighted button will return your view to the small one.

I’ve found options to set what quality to try to view, I’m already set to the highest. I don’t care if it starts @ 240p, as long as the viewport is wide. YouTube used to remember this setting when it first came out, but it doesn’t now and I’m going crazy.

Anyone?

Display Template: Retrieving user properties from person field

I’ve been searching high and low for a couple of days for a solution, but can’t find anything that fits. I’ve seen a lot of blogs refer to the Srch.U object and then using various methods. I’ve seen articles that point readers to the default item_person template. I’ve also seen the REST API mentioned, but am more confused than ever.

My current setup:

I’m using SharePoint Online. I have a very simple list called Team Members on a sub site with a few columns:

  • Title (default column – contains a plain text version of the user’s display -name typed in manually)
  • TeamMember (People or Group currently set to Work Email so I can hook up the profile picture from Delve)
  • Job Title (Text field).

I then very simply grab this information and do some stuff to make it all look pretty.

What I would like:

I’d like to be able to use the Person field to pull through a user’s email, phone number and any other properties I might want in the future and display them in the template as required.

My current code:

<mso:ManagedPropertyMapping msdt:dt="string">'Title'{Title}:'Title','TeamMember'{TeamMember}:'TeamMember','JobTitle'{JobTitle}:'JobTitle,JobTitleOWSTEXT'</mso:ManagedPropertyMapping>        <div> <!--#_  var Title = $  getItemValue(ctx, "Title"); var TeamMember = $  getItemValue(ctx, "TeamMember"); var JobTitle = $  getItemValue(ctx, "JobTitle");   _#-->                     <div class="row">                         <div class="col-xs-4">                                 <a href="https://mydomain-my.sharepoint.com/_layouts/15/me.aspx?p=_#= TeamMember =#_"><img class="img-responsive thumbnail" src="https://mydomain.sharepoint.com/_layouts/15/userphoto.aspx?size=L&accountname=_#= TeamMember =#_" alt="_#= JobTitle =#_" /></a>                         </div>                         <div class="col-xs-8">                             <h2 class="media-heading comrole"><a style="color: #CC0000;" href="https://mydomain-my.sharepoint.com/_layouts/15/me.aspx?p=_#= TeamMember =#_">_#= Title =#_</a></h2>                             <h2 class="media-heading comUserName" data-membersip="_#= TeamMember =#_">_#= JobTitle =#_</h2> <p><a href="mailto:_#= TeamMember =#_">_#= TeamMember =#_</a></p>                         </div>                     </div>                 </div> 

Any help as to what option to set my person field to and how to hook into the user’s profile would be very much appreciated.

Thanks a lot,

Tom

Eliminating noise from Cinema Display [on hold]

I’ve a 30″ Apple Cinema Display that, when brightness is at minimum, makes a weak noise. Usually, the noise is unnoticeable, but suddenly it gets a bit louder, which is obnoxious.

Gently slamming the side of the screen makes the noise go away, at least for a while, but obviously this Donald Duck method is not a sane, long term solution.

I assume the proper solution involves a hardware guy opening the display. My question is: Do I need to replace a part to fix this, or can I be so lucky that just doing cleaning etc. is enough?

If the prior, what part likely causes the noise? Please provide a part number or link if possible.

WxPython GUI to display data from Adafruit IO

I need to create a GUI using WxPython in the form of a Speedometer to display 9 different data values fetched from Adafruit IO. My code is shown below:

import wx import wx.lib.agw.speedmeter as SM import time from math import pi import numpy as np from Adafruit_IO import Client  aio = Client(NAME, PASSWORD)  global ap1 global ap2 global ap3 global lc1 global lc2 global lc3 global lv1 global lv2 global lv3  ap1 = 0 ap2 = 0 ap3 = 0 lc1 = 0 lc2 = 0 lc3 = 0 lv1 = 0 lv2 = 0 lv3 = 0  class PanelOne(wx.Panel):     def __init__(self, parent):         global ap1         global ap2         global ap3         global lc1         global lc2         global lc3         global lv1         global lv2         global lv3         wx.Panel.__init__(self, parent=parent)         panel = wx.Panel(self, wx.ID_ANY)         panel1 = wx.Panel(panel, wx.ID_ANY, style=wx.SUNKEN_BORDER)          self.speed1 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed2 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed3 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed4 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed5 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed6 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed7 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed8 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)         self.speed9 = SM.SpeedMeter(panel1, -1, agwStyle=SM.SM_DRAW_HAND|SM.SM_DRAW_SECTORS|SM.SM_DRAW_MIDDLE_TEXT|SM.SM_DRAW_SECONDARY_TICKS, size = (200,200), mousestyle=1)          self.speed1.SetAngleRange(-pi/6, 7*pi/6)         self.speed2.SetAngleRange(-pi/6, 7*pi/6)         self.speed3.SetAngleRange(-pi/6, 7*pi/6)         self.speed4.SetAngleRange(-pi/6, 7*pi/6)         self.speed5.SetAngleRange(-pi/6, 7*pi/6)         self.speed6.SetAngleRange(-pi/6, 7*pi/6)         self.speed7.SetAngleRange(-pi/6, 7*pi/6)         self.speed8.SetAngleRange(-pi/6, 7*pi/6)         self.speed9.SetAngleRange(-pi/6, 7*pi/6)          interval1 = [0, 0.00001, 0.00002, 0.00003, 0.00004, 0.00005, 0.00006, 0.00007, 0.00008, 0.00009, 0.0001]         interval2 = [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1]         interval3 = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]         interval4 = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300]         interval5 = [0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008, 0.0009, 0.001]          self.speed1.SetIntervals(interval1)         self.speed2.SetIntervals(interval1)         self.speed3.SetIntervals(interval2)         self.speed4.SetIntervals(interval1)         self.speed5.SetIntervals(interval5)         self.speed6.SetIntervals(interval3)         self.speed7.SetIntervals(interval4)         self.speed8.SetIntervals(interval4)         self.speed9.SetIntervals(interval4)          colour1 = [wx.BLACK]*10          self.speed1.SetIntervalColours(colour1)         self.speed2.SetIntervalColours(colour1)         self.speed3.SetIntervalColours(colour1)         self.speed4.SetIntervalColours(colour1)         self.speed5.SetIntervalColours(colour1)         self.speed6.SetIntervalColours(colour1)         self.speed7.SetIntervalColours(colour1)         self.speed8.SetIntervalColours(colour1)         self.speed9.SetIntervalColours(colour1)          tick1 = [str(interval) for interval in interval1]         tick2 = [str(interval) for interval in interval2]         tick3 = [str(interval) for interval in interval3]         tick4 = [str(interval) for interval in interval4]         tick5 = [str(interval) for interval in interval5]          self.speed1.SetTicks(tick1)         self.speed1.SetTicksColour(wx.WHITE)         self.speed1.SetNumberOfSecondaryTicks(5)         self.speed1.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed1.SetMiddleText("Active Power 1")         self.speed1.SetMiddleTextColour(wx.WHITE)         self.speed1.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed1.SetHandColour(wx.Colour(255, 50, 0))         self.speed1.DrawExternalArc(False)         self.speed1.SetSpeedValue(0)          self.speed2.SetTicks(tick1)         self.speed2.SetTicksColour(wx.WHITE)         self.speed2.SetNumberOfSecondaryTicks(5)         self.speed2.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed2.SetMiddleText("Active Power 2")         self.speed2.SetMiddleTextColour(wx.WHITE)         self.speed2.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed2.SetHandColour(wx.Colour(255, 50, 0))         self.speed2.DrawExternalArc(False)         self.speed2.SetSpeedValue(0)          self.speed3.SetTicks(tick2)         self.speed3.SetTicksColour(wx.WHITE)         self.speed3.SetNumberOfSecondaryTicks(5)         self.speed3.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed3.SetMiddleText("Active Power 3")         self.speed3.SetMiddleTextColour(wx.WHITE)         self.speed3.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed3.SetHandColour(wx.Colour(255, 50, 0))         self.speed3.DrawExternalArc(False)         self.speed3.SetSpeedValue(0)          self.speed4.SetTicks(tick1)         self.speed4.SetTicksColour(wx.WHITE)         self.speed4.SetNumberOfSecondaryTicks(5)         self.speed4.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed4.SetMiddleText("Line Current 1")         self.speed4.SetMiddleTextColour(wx.WHITE)         self.speed4.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed4.SetHandColour(wx.Colour(255, 50, 0))         self.speed4.DrawExternalArc(False)         self.speed4.SetSpeedValue(0)          self.speed5.SetTicks(tick5)         self.speed5.SetTicksColour(wx.WHITE)         self.speed5.SetNumberOfSecondaryTicks(5)         self.speed5.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed5.SetMiddleText("Line Current 2")         self.speed5.SetMiddleTextColour(wx.WHITE)         self.speed5.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed5.SetHandColour(wx.Colour(255, 50, 0))         self.speed5.DrawExternalArc(False)         self.speed5.SetSpeedValue(0)          self.speed6.SetTicks(tick2)         self.speed6.SetTicksColour(wx.WHITE)         self.speed6.SetNumberOfSecondaryTicks(5)         self.speed6.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed6.SetMiddleText("Line Current 3")         self.speed6.SetMiddleTextColour(wx.WHITE)         self.speed6.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed6.SetHandColour(wx.Colour(255, 50, 0))         self.speed6.DrawExternalArc(False)         self.speed6.SetSpeedValue(0)          self.speed7.SetTicks(tick4)         self.speed7.SetTicksColour(wx.WHITE)         self.speed7.SetNumberOfSecondaryTicks(5)         self.speed7.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed7.SetMiddleText("Line Voltage 1")         self.speed7.SetMiddleTextColour(wx.WHITE)         self.speed7.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed7.SetHandColour(wx.Colour(255, 50, 0))         self.speed7.DrawExternalArc(False)         self.speed7.SetSpeedValue(0)          self.speed8.SetTicks(tick4)         self.speed8.SetTicksColour(wx.WHITE)         self.speed8.SetNumberOfSecondaryTicks(5)         self.speed8.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed8.SetMiddleText("Line Voltage 2")         self.speed8.SetMiddleTextColour(wx.WHITE)         self.speed8.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed8.SetHandColour(wx.Colour(255, 50, 0))         self.speed8.DrawExternalArc(False)         self.speed8.SetSpeedValue(0)          self.speed9.SetTicks(tick4)         self.speed9.SetTicksColour(wx.WHITE)         self.speed9.SetNumberOfSecondaryTicks(5)         self.speed9.SetTicksFont(wx.Font(7, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))         self.speed9.SetMiddleText("Line Voltage 3")         self.speed9.SetMiddleTextColour(wx.WHITE)         self.speed9.SetMiddleTextFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))         self.speed9.SetHandColour(wx.Colour(255, 50, 0))         self.speed9.DrawExternalArc(False)         self.speed9.SetSpeedValue(0)          vsizer1 = wx.BoxSizer(wx.VERTICAL)         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)         hsizer2 = wx.BoxSizer(wx.HORIZONTAL)         hsizer3 = wx.BoxSizer(wx.HORIZONTAL)          hsizer1.Add(self.speed1, 0, wx.EXPAND)         hsizer1.Add(self.speed2, 0, wx.EXPAND)         hsizer1.Add(self.speed3, 0, wx.EXPAND)         vsizer1.Add(hsizer1, 0, wx.EXPAND)         hsizer2.Add(self.speed4, 0, wx.EXPAND)         hsizer2.Add(self.speed5, 0, wx.EXPAND)         hsizer2.Add(self.speed6, 0, wx.EXPAND)         vsizer1.Add(hsizer2, 0, wx.EXPAND)         hsizer3.Add(self.speed7, 0, wx.EXPAND)         hsizer3.Add(self.speed8, 0, wx.EXPAND)         hsizer3.Add(self.speed9, 0, wx.EXPAND)         vsizer1.Add(hsizer3, 0, wx.EXPAND)          panel1.SetSizer(vsizer1)         panel1.Fit()         mainSizer = wx.BoxSizer(wx.VERTICAL)         mainSizer.Add(panel, 1, wx.EXPAND)         self.SetSizer(mainSizer)         mainSizer.Layout()          self.timer = wx.Timer(self)         self.Bind(wx.EVT_TIMER, self.on_timer, self.timer)         self.timer.Start(1)         self.Show(True)      def on_timer(self,event):         global ap1         global ap2         global ap3         global lc1         global lc2         global lc3         global lv1         global lv2         global lv3          ap1 = float((aio.receive('activepower-kt1')).value)         ap2 = float((aio.receive('activepower-kt2')).value)         ap3 = float((aio.receive('activepower-kt3')).value)         lc1 = float((aio.receive('linecurrent-i1')).value)         lc2 = float((aio.receive('linecurrent-i2')).value)         lc3 = float((aio.receive('linecurrent-i3')).value)         lv1 = float((aio.receive('linevoltage-v1')).value)         lv2 = float((aio.receive('linevoltage-v2')).value)         lv3 = float((aio.receive('linevoltage-v3')).value)          self.speed1.SetSpeedValue(ap1)         self.speed2.SetSpeedValue(ap2)         self.speed3.SetSpeedValue(ap3)         self.speed4.SetSpeedValue(lc1)         self.speed5.SetSpeedValue(lc2)         self.speed6.SetSpeedValue(lc3)         self.speed7.SetSpeedValue(lv1)         self.speed8.SetSpeedValue(lv2)         self.speed9.SetSpeedValue(lv3)  class MyApp(wx.App):     def OnInit(self):         title = "Energy Meter GUI"         pos = (200,200)         size =(570,280)         self.frame = class_myframe(title, pos , size)         self.frame.Show(True)         self.SetTopWindow(self.frame)         return True  class class_myframe(wx.Frame):     def __init__(self,title,pos,size):         wx.Frame.__init__(self, None, wx.ID_ANY, title, pos, size)         self.panel_one = PanelOne(self)         self.boxsizer = wx.BoxSizer(wx.VERTICAL)         self.boxsizer.Add(self.panel_one, 1, wx.EXPAND)         self.SetSizer(self.boxsizer)         self.boxsizer.Fit(self)         self.boxsizer.Layout()  app = MyApp(False) app.MainLoop()  

This code does what it is meant to do nicely. However, it hangs quite often and then updates the values after a while. Is there any way I can optimize it further?

Search display template for content search web part for task aggregation

In a site collection, I have about 4 task list setup each on separate subsites. So on the root level, I am using a content search web part and through query, I am showing tasks from all of these 4 task lists to show aggregated tasks in the web part. Here is the query i am using: path:”https://.sharepoint.com/sites/” ContentTypeId:0x0108* -RefinableString01:Completed

RefineableString01 is a mapped managed property and its helping me showing non- completed (task status other than completed)tasks. Now the challenge I have is to show this web part as close as possible to an actual task list view which has Task name, due date, status, description as task headers/columns in CSWP and I believe it requires setting up a custom display template which I have not worked on at all.

Can someone help me setting up tabular view of tasks aggregation using custom template. FYI, I have already setup managed properties (mapping respective crawled properties to respective managed property called Refineablstring etc) for description, task status and due date.

Additionally, I would also like to show custom choice column called Investor (site column) in the CSWP along with other basic columns, I am waiting for it to get crawled, once crawled, I will setup a managed property for the same.

Can someone please help me with the cswp display template that I can use, thanks in advance.

Magento2: how to display 4 digit prices and tier prices in the admin > catalog?

How to modify Magento 2 in order to be able to show 4 digit prices and tier prices in the admin catalog? I can save 4 digit prices and they go in the database, even when I load a product edit form in the admin I can see a JSON on the source of the page which contains my 4 digit prices, but in the form itself the prices are all rounded to 2 digits. How can I get the form to show my 4 digit prices without rounding them down to 2 digits?