Class TFSession
Drives the execution of a graph
Inherited Members
Namespace: TensorFlow
Assembly: TensorFlowSharp.dll
Syntax
public class TFSession : TensorFlow.TFDisposableThreadSafe
Remarks
This creates a new context to execute a TFGraph. You can use the constructor to create an empty session, or you can load an existing model using the FromSavedModel(TFSessionOptions, TFBuffer, String, String[], TFGraph, TFBuffer, TFStatus) static method in this class.
To execute operations with the graph, call the GetRunner() method which returns an object that you can use to build the operation by providing the inputs, requesting the operations that you want to execute and the desired outputs.
The GetRunner() method is a high-level helper function that wraps a call to the Run(TFOutput[], TFTensor[], TFOutput[], TFOperation[], TFBuffer, TFBuffer, TFStatus) method which just takes too many parameters that must be kept in sync.
Constructors
TFSession(TFStatus)
Creates a new execution session with an empty graph
Declaration
public TFSession (TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Remarks
The created graph can be retrieved using the Graph property on the session.
TFSession(TFGraph, TFStatus)
Creates a new execution session associated with the specified session graph.
Declaration
public TFSession (TensorFlow.TFGraph graph, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFGraph | graph | The Graph to which this session is associated. |
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
TFSession(TFGraph, TFSessionOptions, TFStatus)
Creates a new execution session associated with the specified session graph with some configuration options.
Declaration
public TFSession (TensorFlow.TFGraph graph, TensorFlow.TFSessionOptions sessionOptions, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFGraph | graph | The Graph to which this session is associated. |
| TFSessionOptions | sessionOptions | Session options. |
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Properties
Graph
Gets the graph associated with this TensorFlow session.
Declaration
public TensorFlow.TFGraph Graph { get; }
Property Value
| Type | Description |
|---|---|
| TFGraph | The graph. |
Methods
CloseSession(TFStatus)
Closes the session. Contacts any other processes associated with the session, if applicable.
Declaration
public void CloseSession (TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Remarks
Can not be called after calling DeleteSession.
DeleteSession(TFStatus)
Deletes the session.
Declaration
public void DeleteSession (TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFStatus | status | Status. |
FromSavedModel(TFSessionOptions, TFBuffer, String, String[], TFGraph, TFBuffer, TFStatus)
Creates a session and graph from a model stored in the SavedModel file format.
Declaration
public TensorFlow.TFSession FromSavedModel (TensorFlow.TFSessionOptions sessionOptions, TensorFlow.TFBuffer runOptions, string exportDir, string[] tags, TensorFlow.TFGraph graph, TensorFlow.TFBuffer metaGraphDef, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFSessionOptions | sessionOptions | Session options to use for the new session. |
| TFBuffer | runOptions | Options to use to initialize the state (can be null). |
| System.String | exportDir | must be set to the path of the exported SavedModel. |
| System.String[] | tags | must include the set of tags used to identify one MetaGraphDef in the SavedModel. |
| TFGraph | graph | This must be a newly created graph. |
| TFBuffer | metaGraphDef | On success, this will be populated on return with the contents of the MetaGraphDef (can be null). |
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Returns
| Type | Description |
|---|---|
| TFSession | On success, this populates the provided |
Remarks
This function creates a new session using the specified sessionOptions
and then initializes
the state (restoring tensors and other assets) using runOptions
.
This function loads the data that was saved using the SavedModel file format, as described here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/saved_model/README.md
GetRunner()
Gets a new runner, this provides a simpler API to prepare the inputs to run on a session
Declaration
public TensorFlow.TFSession.Runner GetRunner ();
Returns
| Type | Description |
|---|---|
The runner. |
Remarks
The runner has a simple API that allows developers to call the AddTarget, AddInput, AddOutput and Fetch to construct the parameters that will be passed to the TFSession.Run method.
The Run method will return an array of TFTensor values, one for each invocation to the Fetch method.
ListDevices(TFStatus)
Lists available devices in this session.
Declaration
public System.Collections.Generic.IEnumerable<TensorFlow.DeviceAttributes> ListDevices (TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<DeviceAttributes> | To be added. |
PartialRun(TFSession+PartialRunToken, TFOutput[], TFTensor[], TFOutput[], TFOperation[], TFStatus)
Declaration
public TensorFlow.TFTensor[] PartialRun (TensorFlow.TFSession.PartialRunToken token, TensorFlow.TFOutput[] inputs, TensorFlow.TFTensor[] inputValues, TensorFlow.TFOutput[] outputs, TensorFlow.TFOperation[] targetOpers, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| token | To be added. |
|
| TFOutput[] | inputs | To be added. |
| TFTensor[] | inputValues | To be added. |
| TFOutput[] | outputs | To be added. |
| TFOperation[] | targetOpers | To be added. |
| TFStatus | status | To be added. |
Returns
| Type | Description |
|---|---|
| TFTensor[] | To be added. |
PartialRunSetup(TFOutput[], TFOutput[], TFOperation[], TFStatus)
Prepares the session for a partial run.
Declaration
public TensorFlow.TFSession.PartialRunToken PartialRunSetup (TensorFlow.TFOutput[] inputs, TensorFlow.TFOutput[] outputs, TensorFlow.TFOperation[] targetOpers, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFOutput[] | inputs | Inputs. |
| TFOutput[] | outputs | Outputs. |
| TFOperation[] | targetOpers | Target operations to run. |
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Returns
| Type | Description |
|---|---|
A token that can be used to call PartialRun(TFSession+PartialRunToken, TFOutput[], TFTensor[], TFOutput[], TFOperation[], TFStatus) repeatedly. To complete your partial run, you should call Dispose on the resulting method. |
RestoreTensor(String, String, TFDataType)
Restores a tensor from a serialized tensorflor file.
Declaration
public TensorFlow.TFOutput RestoreTensor (string filename, string tensor, TensorFlow.TFDataType type);
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | File containing your saved tensors. |
| System.String | tensor | The name that was used to save the tensor. |
| TFDataType | type | The data type for the tensor. |
Returns
| Type | Description |
|---|---|
| TFOutput | The deserialized tensor from the file. |
Run(TFOutput[], TFTensor[], TFOutput[], TFOperation[], TFBuffer, TFBuffer, TFStatus)
Executes a pipeline given the specified inputs, inputValues, outputs, targetOpers, runMetadata and runOptions.
A simpler API is available by calling the GetRunner method which performs all the bookkeeping
necessary.
Declaration
public TensorFlow.TFTensor[] Run (TensorFlow.TFOutput[] inputs, TensorFlow.TFTensor[] inputValues, TensorFlow.TFOutput[] outputs, TensorFlow.TFOperation[] targetOpers = null, TensorFlow.TFBuffer runMetadata = null, TensorFlow.TFBuffer runOptions = null, TensorFlow.TFStatus status = null);
Parameters
| Type | Name | Description |
|---|---|---|
| TFOutput[] | inputs | Inputs nodes. |
| TFTensor[] | inputValues | Input values. |
| TFOutput[] | outputs | Output nodes. |
| TFOperation[] | targetOpers | Target operations to execute. |
| TFBuffer | runMetadata | Run metadata, a buffer containing the protocol buffer encoded value for https://github.com/tensorflow/tensorflow/blob/r1.9/tensorflow/core/protobuf/config.proto. |
| TFBuffer | runOptions | Run options, a buffer containing the protocol buffer encoded value for https://github.com/tensorflow/tensorflow/blob/r1.9/tensorflow/core/protobuf/config.proto. |
| TFStatus | status | Status buffer, if specified a status code will be left here, if not specified, a TFException exception is raised if there is an error. |
Returns
| Type | Description |
|---|---|
| TFTensor[] | An array of tensors fetched from the requested outputs. |
SaveTensors(String, ValueTuple<String,TFOutput>[])
Saves the tensors in the session to a file.
Declaration
public TensorFlow.TFTensor[] SaveTensors (string filename, ValueTuple<string,TensorFlow.TFOutput>[] tensors);
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | File to store the tensors in (for example: tensors.tsf). |
| System.ValueTuple<System.String,TFOutput>[] | tensors | An array of tuples that include the name you want to give the tensor on output, and the tensor you want to save. |
Returns
| Type | Description |
|---|---|
| TFTensor[] | The tensors. |
Remarks
Tensors saved with this method can be loaded by calling RestoreTensor.
using (var session = new TFSession ()) {
var a = session.Graph.Const(30, "a");
var b = session.Graph.Const(12, "b");
var multiplyResults = session.GetRunner().Run(session.Graph.Add(a, b));
var multiplyResultValue = multiplyResults.GetValue();
Console.WriteLine("a*b={0}", multiplyResultValue);
session.SaveTensors($"saved.tsf", ("a", a), ("b", b));
}


Home
Style guide
Sample login page
Font weight tester
Parallax scrolling example
You know the drill.
Email
Password
I forgot my password


AORUS TRX40 Master Gaming Motherboard Preview
by Peter DonnellThe new AMD Threadripper CPUs are here at last, or at least, they’re released. We don’t actually have one of the new CPUs in the office just yet. However, we do have two amazing new motherboards from AORUS. First up, it’s the AORUS TRX40 Master, which is designed for the enthusiast PC user, which explains why it comes absolutely packed with amazing features. While they say “gaming motherboard” I honestly think that’s just a moniker given to many things these days because it has RGB. However, with Threadripper proving a big hit with content creators for YouTube and Twitch, and other similar platforms, perhaps Gigabyte AORUS is a better judge of the market than I am.
AORUS TRX40 Master
This motherboard is packing some pretty impressive hardware, and so it should, given that the MASTER board is often one of the flagship releases from AORUS on any chipset, such as the Z390 MASTER we reviewed a while back. The new Threadripper CPUs are absolute beasts, so it’s no surprise the power delivery hardware has been given a big upgrade. The TRX40 MASTER features a direct power design with 16 phases delivering up to 70A each! That’s a lot of power, even for a Threadripper, so maxing out the CPU and overclocking shouldn’t be an issue. Plus, with a Fins Array cooler design, keeping that power hardware running at its best should be a breeze.
Features
- Direct 16+3 Phase Power Design for 3rd Gen AMD Ryzen™ Threadripper™ Processors
- Fins-Array, NanoCarbon, 8mm Heatpipe, Metal Cover, 5cm Chipset Fan
- Full PCIe Gen4 Design
- AQUANTIA 5GbE LAN + Intel GbE LAN
- 4 x PCIe 4.0 Slots
- 3 x PCIe Gen 4 M.2
- Quad-Channel DDR4
- WIFI 6 (802.11ax)
- Q-FLASH PLUS
AORUS MASTER
Without a doubt, this is a fantastic looking motherboard. I mean, it’s obviously a Threadripper motherboard with that enormous CPU socket in the middle. However, it’s still quite clearly a MASTER series motherboard, following the same design philosophy and colour schemes we’ve come to expect from AORUS. What’s really cool, literally, is the massive “Fins Array” VRM cooling that runs nearly the full length of the top of the board, with an 8mm heat pipe joining additional cooling on the left side. That heat pipe runs all the way down the back of the motherboard and joins the rear backplate too.
Got DIMMs?
Memory is not exactly left short either, with eight DIMMs lots supporting quad-channel DDR4. All of the slots are fully armoured too, helping prevent motherboard flex issues, while also improving the built quality and aesthetics overall. TRX40 can support up to 1TB of memory in total, albeit I dread to think what that would cost.
Gen 4.0!
The big hitter for AMD right now is that their latest chipsets and CPUs offer up PCI Gen 4.0. While that may not have a huge benefit for gamers right now, I bet it will in the near future. Plus, there are three M.2 mounts in here, where you can easily use the latest NVMe Gen 4 drivers for up to 5000 MBs read/write. Their built-in M.2 heatsinks not only keep your drives cool, but should also protect them too. All of the full-size PCI slots are armoured too, which is great given how heavy modern GPUs. However, just like everything else on this motherboard, I also think they look cool tool.
Active Cooling
Much like the X570 chipset, the TRX40 does use an active cooling fan. It’s barely noticeable though, and they’ve done a nice job hiding it under that shroud without compromising on the overall airflow of the chipset.
Solid Pin!
I first saw this on their stunning AORUS XTREME Z390 motherboard, but it seems Solid Pin has returned! It’s a reinforced direct connection for the 24-pin power cable. Plus, the 90-degree rotation should make for shorter cable runs. You’ll notice the dual 8-pin connectors in the top right are pretty well armoured too.
All the SATA connections are rotated too, which is good because routing eight SATA cables could quickly get messy if they weren’t!
More Connections
The bottom edge of the motherboard is packed with connections too. There’s a load of fan connectors dotted all over the MASTER, which is superb for those who want to keep control over their cooling setup.
Saber HiFi
It’s hard to find a motherboard with lousy audio these days. The MASTER is certainly in the upper tier though, with the ALC4050H + ESS 9218 powering the front ports, and the ALC4050H and ALC1220-VB powering the rear ports. That all comes backed up with WIMA capacitors too.
RGB
There are a few RGB treats tucked into this board too. However, we’ll be more than happy to show all of that off one we have the CPUs in the office. I do love that big rear I/O cover though, with a bit of brushed aluminium on top giving it a nice premium look and feel.
Backplate
The backplate is stunning, honestly, you’re rarely going to see it. However, as good as it looks, it’s a practical addition that strengthens the motherboard quite a lot. Plus, due to the way it’s mounted and the heatpipes on the motherboard, it’ll provide plenty of cooling to the PCB and other hardware too.
Rear I/O
The rear I/O shield is pre-installed, so no chance of you forgetting to install it. You’ll find 2 x USB 3.0, 5 x USB 3.2 and 1 x USB Type-C here too, so connectivity is clearly not in short supply. You get two LAN options too, with 5 GbE and 1 GbE which is perfect for connection directly to your router, plus a DAS or internal network. If that’s not enough, flagship 802.11ax WiFi will deliver the best wireless speeds currently available.
Tell me More!
We would love to, but we’re still waiting on the CPUs to arrive. That being said, we’ll have full performance figures, pretty RGB stuff, time-lapse builds and who knows what else in the coming days and weeks. Stay tuned for more!


{{ (user$ | async)?.firstName }} {{ (user$ | async)?.lastName }}
{{ (user$ | async)?.email }}
Last logged in: Today at 2:18pm
Profile
Profile
PRO
Personal Info
Update Image
User Name
First Name
Last Name
Contact Info
Email
Phone number
Building Name
Street
City
State
Pin


Nigel Dempster's panel show appearances
Nigel Dempster (born 1941-11-01[ref]) has appeared in 24 episodes between 1977-1984. Nigel Dempster on Wikipedia.
- 1984-12-01 / The News Quiz
- 1983-05-14 / The News Quiz
- 1982-11-20 / The News Quiz
- 1982-10-02 / The News Quiz
- 1982-01-09 / The News Quiz
- 1981-12-12 / The News Quiz
- 1981-10-26 / The News Quiz
- 1981-07-26 / Call My Bluff
- 1981-07-17 / Call My Bluff
- 1980-08-23 / The News Quiz
- 1980-06-07 / The News Quiz
- 1980-03-01 / The News Quiz
- 1980-01-12 / The News Quiz
- 1979-10-13 / The News Quiz
- 1979-09-01 / The News Quiz
- 1979-03-31 / The News Quiz
- 1978-09-16 / The News Quiz
- 1978-08-19 / The News Quiz
- 1978-07-29 / The News Quiz
- 1978-05-27 / The News Quiz
- 1978-04-12 / Call My Bluff
- 1978-04-05 / Call My Bluff
- 1977-10-18 / The News Quiz
- 1977-09-20 / The News Quiz


This is APN configuration profile generator on Web
View the Project on GitHub WataruSuzuki/APN Profile Generator
This projects grown your & my web site, APN Profile Generator.
Go to siteThis site can create APN configuration profile for iOS devices.
Sometimes, Apple hide APN setting from iOS devices.
Why? In my opinion, Apple preferential treatment relationship to Major Mobile Operators, not Users!
Almost cases, iPhone & iPad is so smart. Like case of choose major mobile operator, users have no problems.
Case of choose minor mobile operator(like MVNO), users have to set APN manually, because Apple don't show APN setting for us.
So, I'll release this site.
Or if you want to use this on App, Speciality is here!
Only me!! yet.. In 2016, Wataru Suzuki (@watarusuzuki) founded GitHub.
Always welcome to your join!
Having question? Or request new feature? Please join to slack team.


Priestess Pupina:
I understand.
I do not question your decision, but I must tell you that with that attitude, even if you meet Preacher Sla, he will not converse with you.
If you change your mind, please let me know...


Blogging
Ever since I started spending a lot of time with Ruby on Rails, people always tell me that I must create and record the learning experience in my own blog. This post is about a few blogging service and solution I used or tried to use, and my thoughts on them.
tumblr
I first registered for tumblr back in my grad school days, I put the project but it turns out that it is very difficult to post code snippets on tumblr, plus tumblr is not a platform that is intended for engineers and programmers.
Logdown
I did some research and came across logdown, which is a nice blogging service built specifically for programmers, and its backend markdown editor makes blogging with code snippets a snap. I recorded most of my Tealeaf learning experience in Logdown, but the more blog I wrote the more I realized that Logdown has a lot of shortcomings, such as there is no way to include images and graphs in a blog post, because it is reserved as a premium feature in Logdown. So I that is when I decided to seek other blogging platform to replace Logdown.
Github Pages
Then by some luck I found Github page, which is a way for github users to build blogs and official web pages of Github projects with Jekyll, then simply host them on Github! Although I know nothing about Jekyll, but like Kennedy said: “We choose to go to the moon in this decade and do the other things not because it was easy, but because it was hard!”. As an engineer, I should seek and embrace the unknown and push myself to grow. So I followed the official guide on github:
And it took me around half an hour to build and host my blog on github, easy as pie!


Start Bootstrap
About
Contact
Animals
Portfolio
1 Column Portfolio
2 Column Portfolio
3 Column Portfolio
4 Column Portfolio
Single Portfolio Item
Blog
Blog Home 1
Blog Home 2
Blog Post
Other Pages
Full Width Page
Sidebar Page
FAQ
Pricing Table
See Life
Seahorses
Grab your snorkels and join us as we get up close to these colourful critters…
Fast jellyfish facts
Family
: Syngnathidae
Genus
: Hippocampus
Classification
: Fish
Lifespan (in wild)
: Three years
Weight
: Up to 200g
Body size
: 2cm to 35cm
Top speed
: 150cm/h
Diet
: Carnivore
Habitat
: Oceans
Range
:


I encourage you to retry programming assignments. It can take a few tries to master some of the concepts in this course and
practicing in code is the best way to get there.
You cannot, however, retake tests or quizzes.
The best way by far to learn this material is by actually coding. Whenever you are given a new
concept you should try it out in code, even if there's no assignment for it.
Writing many small programs, experimenting, and researching on the Internet are the best ways to
master programming. Contact me if you're looking for ideas about practice programs.
There is no final exam but there is a final project. You can find it in the Application and Review unit.


This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.
A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing.
This sounded nonsense to Alice, so she said nothing, but set off at once toward the Red Queen. To her surprise, she lost sight of her in a moment, and found herself walking.
For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!
Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.


{% extends "layout.html" %} {% block jumbotron %}
Cheat sheet of Python. Some concepts of generator for a Python programmer need to know.
>>> def prime(n): ... p = 2 ... while n > 0: ... for _ in range(2,p): ... if p % _ == 0: ... break ... else: ... yield p ... n-=1 ... p+=1 ... >>> p = prime(3) >>> next(p) 2 >>> next(p) 3 >>> >>> next(p) 5 >>> next(p) Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration >>> for _ in prime(5): ... print(_, end=" ") ... 2 3 5 7 11 >>>
>>> class count(object): ... def __init__(self,n): ... self._n = n ... def __iter__(self): ... n = self._n ... while n>0: ... yield n ... n-=1 ... def __reversed__(self): ... n = 0 ... while n<self._n: ... yield n ... n+=1 ... >>> for _ in count(5): ... print(_, end=" ") ... 5 4 3 2 1 >>> >>> for _ in reversed(count(5)): ... print(_, end=" ") ... 0 1 2 3 4 >>>
>>> def spam(): ... msg = yield ... print("Message:",msg) ... >>> try: ... g = spam() ... # start generator ... next(g) ... # send message to generator ... g.send("Hello World!") ... except StopIteration: ... pass ... Message: Hello World!
# delegating list >>> def chain(a,b): ... yield from a ... yield from b ... >>> a = [1,2,3] >>> b = [4,5,6] >>> for _ in chain(a,b): ... print(_, end=" ") ... 1 2 3 4 5 6 >>> # delegating dict >>> a = {'k1':1,'k2':2} >>> b = {'k3':3,'k4':4} >>> for _key in chain(a,b): ... print(_key, end=" ") ... k2 k1 k3 k4 >>>
>>> def fib(n): ... if n<=2: ... return 1 ... return fib(n-1)+fib(n-2) ... >>> def g_fib(n): ... for _ in range(1,n+1): ... yield fib(_) ... >>> from collections import deque >>> t = [g_fib(3),g_fib(5)] >>> q = deque() >>> q.extend(t) >>> def run(): ... while q: ... try: ... t = q.popleft() ... print(next(t)) ... q.append(t) ... except StopIteration: ... print("Task done") ... >>> run() 1 1 1 1 2 2 Task done 3 5 Task done
# skill: using task and wait queue from collections import deque from select import select import socket tasks = deque() w_read = {} w_send = {} def run(): while any([tasks,w_read,w_send]): while not tasks: # polling tasks can_r,can_s,_ = select( w_read,w_send,[]) for _r in can_r: tasks.append(w_read.pop(_r)) for _w in can_s: tasks.append(w_send.pop(_w)) try: task = tasks.popleft() why,what = next(task) if why == 'recv': w_read[what] = task elif why == 'send': w_send[what] = task else: raise RuntimeError except StopIteration: pass def server(): host = ('localhost',5566) sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR,1) sock.bind(host) sock.listen(5) while True: # tell scheduler want block yield 'recv', sock conn,addr = sock.accept() tasks.append(client_handler(conn)) def client_handler(conn): while True: # tell scheduler want block yield 'recv', conn msg = conn.recv(1024) if not msg: break # tell scheduler want block yield 'send', conn conn.send(msg) conn.close() tasks.append(server()) run()
# this method will cause blocking hunger from collections import deque from select import select import socket tasks = deque() w_read = {} w_send = {} def run(): while any([tasks,w_read,w_send]): while not tasks: # polling tasks can_r,can_s,_ = select( w_read,w_send,[]) for _r in can_r: tasks.append(w_read.pop(_r)) for _w in can_s: tasks.append(w_send.pop(_w)) try: task = tasks.popleft() why,what = next(task) if why == 'recv': w_read[what] = task elif why == 'send': w_send[what] = task elif why == 'continue': print what tasks.append(task) else: raise RuntimeError except StopIteration: pass def fib(n): if n<=2: return 1 return fib(n-1)+fib(n-2) def g_fib(n): for _ in range(1,n+1): yield 'continue', fib(_) tasks.append(g_fib(15)) def server(): host = ('localhost',5566) sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR,1) sock.bind(host) sock.listen(5) while True: yield 'recv', sock conn,addr = sock.accept() tasks.append(client_handler(conn)) def client_handler(conn): while True: yield 'recv', conn msg = conn.recv(1024) if not msg: break yield 'send', conn conn.send(msg) conn.close() tasks.append(server()) run()
>>> import contextlib >>> @contextlib.contextmanager ... def mylist(): ... try: ... l = [1,2,3,4,5] ... yield l ... finally: ... print("exit scope") ... >>> with mylist() as l: ... print(l) ... [1, 2, 3, 4, 5] exit scope
# ref: PyCon 2014 - David Beazley # define a context manager class class GeneratorCM(object): def __init__(self,gen): self._gen = gen def __enter__(self): return next(self._gen) def __exit__(self, *exc_info): try: if exc_info[0] is None: next(self._gen) else: self._gen.throw(*exc_info) raise RuntimeError except StopIteration: return True except: raise # define a decorator def contextmanager(func): def run(*a, **k): return GeneratorCM(func(*a, **k)) return run # example of context manager @contextmanager def mylist(): try: l=[1,2,3,4,5] yield l finally: print "exit scope" with mylist() as l: print l # bash> python example.py # [1, 2, 3, 4, 5] # exit scope
# future - a result will compute later # using Python 3.2 or later >>> import concurrent.futures as cf >>> pool = cf.ThreadPoolExecutor(3) >>> import time >>> def do_func(x,y): ... time.sleep(10) ... return x + y ... >>> pool.submit(do_func,2,3) <Future at 0x10bffd4e0 state=running> >>> _.result() 5 # error handling on callback function >>> def callback_handler(fut): ... try: ... result = fut.result() ... print("Got:",result) ... except TypeError: ... print("Got TypeError") ... >>> pool.submit(do_func,2,"Hello") <Future at 0x10c2800b8 state=pending> >>> _.add_done_callback(callback_handler) Got TypeError
# as above example, rename func below >>> import concurrent.futures as cf >>> import time >>> def enter(x,y): ... time.sleep(10) ... return x + y ... >>> def exit(fut): ... try: ... res = fut.result() ... print("Got:",res) ... except: ... raise ... # This is almost a context manager form # Rewrite: # wrapping generator with "Task" class Task(object): def __init__(self,gen): self._gen = gen def step(self, val=None): # Purpose: run the next yield try: fut = self._gen.send(val) fut.add_done_callback(self._wkup) except StopIteration: pass def _wkup(self, fut): # Purpose: handling result res = fut.result() # "send result" to generator self.step(res) # Demo how to use "Task" import concurrent.futures as cf import time pool = cf.ThreadPoolExecutor(3) def f(x,y): time.sleep(10) return x + y def do_func(x,y): result = yield pool.submit(f,x,y) print("Got:",result) g = do_func(2,3) t = Task(g) t.step() # bash> python example.py # Got: 5
# ex.py # wrapping generator with "Task" class Task(object): def __init__(self,gen): self._gen = gen def step(self, val=None): # Purpose: run the next yield try: fut = self._gen.send(val) fut.add_done_callback(self._wakeup) except StopIteration: pass def _wakeup(self, fut): # Purpose: handling result res = fut.result() self.step(res) # Demo how to use "Task" import concurrent.futures as cf import time pool = cf.ThreadPoolExecutor(8) def func(x,y): return x + y def do_func(x,y): res = yield pool.submit(func,x,y) print("Got:", res) # brute-force solution def after_bf(delay,gen): yield pool.submit(time.sleep, delay) result = None try: while True: fut = gen.send(result) result = yield fut except StopIteration: pass # elegant solution def after_e(delay,gen): # do some task like init yield pool.submit(time.sleep, delay) # do exactly task after some task yield from gen # bash> python3 >>> from ex import Task >>> from ex import do_func >>> from ex import after_bf >>> from ex import after_e >>> Task(after_bf(5,do_func(2,3))).step() >>> Got: 5 >>> Task(after_e(5,do_func(2,3))).step() >>> Got: 5


, your love for the great outdoors is clear, just about as clear as the windows on your campervan rental. So pack your Kelty and hop on board because you're going to New Zealand! ...now all you have to do is pick an island.
, you like adventure and excitement, but your main priority when it comes to your next vacation is rest and relaxation. Put on some flip flops, grab the suntan lotion, and pour another Mai Tai, because you are going to Hawaii!
, you've probably eaten a cricket once or twice, and you're really into petting tigers... That's why this vacation is perfect for you and your new and improved travel blog. Make sure you bring a power plug adaptor, you're going to want to Instagram this. #Thailand.
, get back to work.


However, HTML is a broad language and there is a lot to memorize. That’s why the following cheat sheet has been provided, providing easy reference to the most common and useful HTML codes.
1 Work on evolutions of this specification proceeds at http://www.w3.org/TR/html/. The HTML5 Recommendation represents a milestone in the development of HTML but far from being the end of the road and improvements are already well under way.
2The HTML5 specification has added a number of useful features in new APIs that you may not have delved into yet, likely because of the lack of browser support.
3HTML5 has none of the presentational attributes that were in HTML4 as their functions are better handled by CSS. Some attributes from HTML4 are no longer allowed in HTML5 at all and they have been removed completely.
4In 1980, physicist Tim Berners-Lee, then a contractor at CERN, proposed and prototyped ENQUIRE, a system for CERN researchers to use and share documents. In 1989, Berners-Lee wrote a memo proposing an Internet-based hypertext system.[3] Berners-Lee specified HTML and wrote the browser and server software in late 1990.


| Home | Trees | Indices | Help |
|---|
|
|
| Instance Methods | |||
| new empty list |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
| Properties | |
|
Inherited from |
| Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
hash(x)
|
reverse *IN PLACE*
|
x+y
|
str(x)
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Mar 12 12:56:39 2013 | http://epydoc.sourceforge.net |


Omics Pipe Tutorial – Adding a New Module (Tool)¶
Users can easily create new analysis modules for use within omics_pipe. The user has two options for creating new analysis modules: - Adding analysis modules directly within the omics_pipe/scripts installation directory - Creating a new working directory where all analysis modules scripts are located (this can be changed in the parameters file by changing the WORKING_DIR parameter to the desired location). If you want to use option 2, in order to use pre-installed analysis modules, for the time being you must copy these analysis modules to your new working directory. If you choose option 1, you can simply add additional analysis modules and they will be accessible along with the pre-installed analysis modules.
To create a new analysis module, you need to perform four steps: 1. Create a Bash script with the command to be sent to the cluster 2. Create a Python module that calls the Bash script 3. Add your module to your custom pipeline 4. Add new module parameters to parameters file
The section below details each of these steps.
1. Create a Bash script¶
The first step in creating your custom module is to create the Bash script with the command you would like to run. If you are unsure how to write a Bash script, you can look at the examples in omics_pipe/scripts or work through this tutorial (http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html). In many cases, this will be a simple script with a one line command to call the analysis program. You should name your script something that will be easily identifiable and it should have the suffix .sh (e.g. analysis_script.sh). At the beginning of your analysis script, you should put the following lines:
#!/bin/bash
set -x
#Source modules for current shell
source $MODULESHOME/init/bash
#Make output directory if it doesn't exist
mkdir -p ${variable} #RESULTS_DIR
#Move tmp dir to scratch
export TMPDIR=${variable} #TEMP_DIR
#Load specified software version
module load fastqc/${variable} #VERSION
The ${variable} will be changed to ${number} (e.g. $1) based on the location of the variable in the input script (more on this below). These settings are assuming you are working on a cluster with a modular structure. If not, “module load” may not be appropriate to load the software, so please ask your system administrator to provide assistance with this if your cluster has a different system. After you specify the software and other configuration variables, you can write the commands for the software you would like to use. When you are finished with the commands, exit the script with ‘exit 0.’ An example script for running the software program FASTQC is below.
#Runs fastqc with $1=SAMPLE, $2=RAW_DATA_DIR, $3=QC_PATH
fastqc -o $3 $2/$1.fastq
exit 0
Substitute all variables that you would like to change from the parameter file with a variable notation, in the form of $1, $2, $3, etc for the first, second, third, etc input parameter that will be passed to the script. Once you have appropriately parameterized the script, save the script either in your working directory (along will all the other scripts you will need, possibly copied from omics_pipe/scripts) or in the omics_pipe/scripts directory.
2. Create a Python module¶
Now that you have created your custom script, you can create the Python module that will handle that script and schedule a job on the compute cluster using DRMAA (https://code.google.com/p/drmaa-python/wiki/Tutorial). You should name the Python module the same name as your custom analysis module, but with the extension .py. In this example, your Python module would be named analysis_script.py and the function within it would also be called analysis_script. Save your custom Python module within the same directory as your custom pipeline script. At the top of your Python module, cut and copy the text below.
#!/usr/bin/env python
import drmaa
from omics_pipe.parameters.default_parameters import default_parameters
from omics_pipe.utils import *
p = Bunch(default_parameters)
You will then write a simple Python function that take the form of the function below. You can directly cut and copy
this function and then change the necessary names/parameters to fit your custom analysis. ::
def fastqc(sample, fastqc_flag):
'''QC check of raw .fastq files using FASTQC
input: .fastq file
output: folder and zipped folder containing html, txt and image files
citation: Babraham Bioinformatics
link: http://www.bioinformatics.babraham.ac.uk/projects/fastqc/
parameters from parameters file: RAW_DATA_DIR,QC_PATH, FASTQC_VERSION'''
spawn_job(jobname = 'fastqc', SAMPLE = sample, LOG_PATH = p.LOG_PATH, RESULTS_EMAIL = p.RESULTS_EMAIL, walltime = "12:00:00", queue = p.QUEUE, nodes = 1, ppn = 8, memory = "16gb", script = "/fastqc_drmaa.sh", args_list = [sample, p.RAW_DATA_DIR,p.QC_PATH, p.FASTQC_VERSION])
job_status(jobname = 'fastqc', resultspath = p.QC_PATH, SAMPLE = sample, outputfilename = sample + "_fastq/" + "fastqc_data.txt", FLAG_PATH = p.FLAG_PATH)
return
Name your function the same as the names of both the Bash and Python scripts you just created for consistency. In our example, the first line would look like: “def analysis_script(sample, analysis_script_flag):”. As you can see, I changed the name of the function as well as the name of the flag input file. The document string should be change to describe what your analysis module does, what type of input file it takes, a citation and link to the tool that you are calling, as well as the parameters that are needed in the parameters file that will be passed to the Bash script that you created. After you are done documenting your function, you will change a few items within the spawn_job and job_status functions that are called from the omics_pipe.utils module. In the spawn_job function, you should change the job name to match the name of your function, you can customize the resources your job will request from the compute cluster, you will need to change the name of the script to match that of the Bash script that you just created, and then you will change the parameters listed in the variable “args_list.” The variable “sample” is lower case because it is passed to this function from omics_pipe, but input parameters coming from the parameters file must be prefixed with “p.” List the parameters that you need to feed into your custom analysis script in the order that you numbered them in the Bash script. In the example above, $1 corresponds to ‘sample’ $2 corresponds to p.RAW_DATA_DIR, etc. Once you have the spawn_job function updated, you will update the job_status function with the job name, results path and a name of an output file that will be produced from your Bash script. This can be any file that is created. This function will check that this file exists in the specified results directory, check that its size is greater than zero, and then it will create a flag file if it exists.
3. Add custom Python module to your custom pipeline¶
In order to use your custom analysis module, you will need to create a custom pipeline with your custom analysis module included as a step in the pipeline. For a tutorial on how to create a custom pipeline, see Section “Creating a Custom Pipeline Script.” Once you have a custom pipeline script, please make sure your custom analysis module and custom pipeline script are in the same directory.
4. Add new parameters to parameters file¶
Add the parameters necessary for your custom analysis module to run into the parameters file. Simply add the parameters to your parameters script, save it, and then run your custom pipeline.
5. Create Custom Module Directory¶
In order for Omics Pipe to find your custom modules and scripts, create a local directory and put your new scripts, module files and custom pipeline within this folder. In your parameter file, specify this directory as the WORKING_DIR: parameter. In your custom pipeline script, you can import custom modules at the beginning of the script that are within the same folder as the custom pipeline. For Omics Pipe modules, import those modules as they appear in the Omics Pipe pipeline scripts.
6. Run your pipeline¶
Run your custom modules/pipeline as you would from the command line for running a custom pipeline.


---
layout: post
title: '#DBHangOps 11/28/12'
categories:
- computing
- database
- linux
- mysql
tags:
- '#DBHangOps'
- cacti
- database
- data_corruption
- ganglia
- monitoring
- mysql
- mysql_planet
- nagios
- opentsdb
- query_killing
status: publish
type: post
published: true
meta:
_edit_last: '1'
_wp_old_slug: dbhangops
---
Now that the thanksgiving holiday is over, it seems like the perfect time to have another #DBHangOps. If you're interested, check this twitter search or check back on my blog here for a link to the google hangout.
Items currently on our agenda for today:
* Data corruption!
* Monitoring -- what do you monitor, why, etc.
* Query killing -- do you kill queries in production regularly, or in emergencies?
* Fun or useful configurations
Looking forward to chatting about MySQL stuff today!
Fun time hitting these topics this week. Check out the recording:


About me
The world is changed. I feel it in the water. I feel it in the earth. I smell it in the air. Much that once was is lost, for none now live who remember it. It began with the forging of the Great Rings. Three were given to the Elves; immortal, wisest and fairest of all beings. Seven to the Dwarf Lords, great miners and craftsmen of the mountain halls. And nine, nine rings were gifted to the race of Men, who, above all else, desire power. For within these rings was bound the strength and will to govern each race. But they were all of them deceived, for another ring was made. In the land of Mordor, in the fires of Mount Doom, the Dark Lord Sauron forged, in secret, a master ring to control all others. And into this ring he poured his cruelty, his malice and his will to dominate all life. One ring to rule them all...


PyCon ES 2022
After having my talk (in English) accepted, I was told that PyCon Spain will be in Spanish… I start learning the language a few months back and see if I can survive… and I did!!!
Day 0 - Arrival
Just before flying to Granada for the conference, I was on a Camino and was just passed the border and spent the night in a small village called Oía. So I already have an understanding that I cannot expect everyone to speak English. I am in the mood of trying to speak Spanish at any chance, and it was fun.
Disfruto churros aquí @PyConES pic.twitter.com/ahLFgcyJV1
— Cheuk Ting Ho at #PyConES (@cheukting_ho) September 30, 2022
I met up with a few people including the organiser of the conference. We had tapas and I was mind blown by the amount of food that we were given.
Y ustedes ¿cómo llevan la @PyConES? #PyConES22 nos vemos mañana! pic.twitter.com/wjYKRA5piu
— 「Cristián」 (@cmaureir) September 29, 2022
Day 1 - Workshops
The first day of the conference is workshop day and for people to pick up the badges. The sponsors already have the tables ready. I mainly spend time staying in the “hall track”. I tried to speak with some people. Some of them are happy to speak English with me but what I love the most is trying to speak to people who do not speak English and I have to try my Spanish hard.
After picking up my badge, I spend some time working and finished working on my talk.
@PyConES comienza ahora! pic.twitter.com/S6nzG6ovbX
— Cheuk Ting Ho at #PyConES (@cheukting_ho) September 30, 2022
We also have the dinner for the minorities (PyLadies plus other communities that support minorities in the Python community). I would say the vibe is super nice, I got a chance to talk to different people (in English and Spanish). People asked about my work and I can tell them about Anaconda and PyScirpt.
The dinner starts and ends quite late (especially for me who is from the part of the world where we have dinner around 6 pm), by the time I get to bed it’s already passed 1 am.
Day 2 - Conference
Despite the lack of sleep, I arrived at the conference on time for the opening and the keynote.
After a brief coffee break, I have giving my talk. The audiences are very interested in the topic and maybe we will see PyCon ES having sprints in the future.
Muy 🔝 las primeras charlas del día en esta nuestra #PyConES22.
— PyCon España (@PyConES) October 1, 2022
Un saludo a las personas que están de chair de sesión y que van a tirar tizas ante cualquier “más que una pregunta tengo un comentario”. pic.twitter.com/qpjOiNiQ3u
Then I went to a very interesting talk. From the technical point of view, it is about using MicroPython to control a mortar to vibrate. I would say the open-mind-ness and diversity of PyCon ES is one of the best in all the PyCon that I have ever been to.
quizás la charla más esperada @PyConES https://t.co/FPlnk5cht3 pic.twitter.com/ahRNoRhe0x
— Cheuk Ting Ho at #PyConES (@cheukting_ho) October 1, 2022
After lunch, there is entertainment - a band is doing 90s anime and movie covers (I was told the performers are scholars in the university)
Sailor moon!!!!! @PyConES pic.twitter.com/N46LpPpPF9
— Cheuk Ting Ho at #PyConES (@cheukting_ho) October 1, 2022
Then, I took a break from the conference and then prepare my first ever lightning talk in Spanish… I would say it is my light talk of the year.
@cheukting_ho learnt Spanish to ask for submissions in Spanish for the @PyjamasConf so please apply now!!!! pic.twitter.com/5bG5t225cA
— PyCon España (@PyConES) October 1, 2022
After the conference, I attended the speaker and organiser dinner in a fancy dinner reception. I feel my artier for tech conferences are totally under-dress on that occasion. But the food is good and now everyone is so keen to teach me Spanish and that makes me very happy.
Foto grupal de la organización de la #PyConES22 de anoche. Qué decir más que está siendo una experiencia maravillosa y que, en palabras de @fergunet, “esto no se acaba hasta que brindemos todes y digamos JUMANJI!!!”. pic.twitter.com/ZLPFs3wAQ3
— PyCon España (@PyConES) October 2, 2022
Day 3 - Conference
The last day of the conference is always challenging after all the socials every night. But I keep my discipline and be at the conference for the keynote in the morning. After that, I retrieved into the quiet room to do some organising work.
Then I went to a few talks after lunch, I try my very best to understand them and depending on the slides I can understand 10-30% of them even though it is in Spanish.
Una charla sobre Python y @SnowflakeDB en @PyConES pic.twitter.com/tW41tzhwXP
— Cheuk Ting Ho at #PyConES (@cheukting_ho) October 2, 2022
So, it comes to the end. People starts leaving after the closing and after some emotional goodbyes, they all went home. (There was a small drama for people taking the train to Madrid but I a not affected as I am flying)
Cierre de la @PyConES Mucho gracias 😊 pic.twitter.com/FZoRotOoE2
— Cheuk Ting Ho at #PyConES (@cheukting_ho) October 2, 2022
Conclusions
I am impressed by the conference and so far there is a huge Spanish-speaking community (they sold out 800 tickets, and it is only in Spain) that I have not been in touch with much yet. They are also contributors and active users in Python (there’s a translation project for translating the official Python documentation to Spanish) and I wish I can discover and learn more about this part of the Python community.
I am glad that I started learning Spanish and they welcome me who still cannot speak their language good enough to have a conversation. I will keep learning and hopefully, I will go to another Spanish-speaking conference (maybe in Latin America) one day.


ANDRE A film review by Steve Rhodes Copyright 1995 Steve Rhodes
RATING (0 TO ****): **
ANDRE is a kid's show based on a true story. It is set in late 50s/early 60s in a remote fishing village in Maine. The Dad (Keith Carradine) makes his living as an admitted inept harbor master. He is more interested in animals than doing the labors of a harbor master.
The show gets its only interest from a seal (the famous Andre) that the family adopts as a pup to nurse it back to health when he loses his Mom to a fishing net. The only reason that Andre became famous is that he in turn adopted the family and would not leave. His fame went so far as to include an appearance on, what else, the Ed Sullivan Show.
The acting is all straight forward as is the script (by Dana Baratta based on the book "A Seal Called Andre" by Lew Dietz and Harry Goodridge) and the directing (George Miller). This is your traditional, lets play it conservative and do nothing that could upset or offend anyone sort of show for little tykes. The movie takes no chances. Other than the obligatory, lets make them think someone is going to die scenes, it is a sugary sweet show. I found it frequently boring, but never offensive.
On a more positive note, the narration by Annette O'Toole is lovely - very melodic. Then again, O'Toole is such a beautiful actress, I really missed seeing her in the flesh.
For it being a true story, for the wonderful seal (he IS really cute), and for the absolutely wonderful ending scene (I came close to crying in a show that almost put me to sleep), I rate ANDRE **. I give it a mild thumbs down, and recommend it only to people under 13. My 5-year-old boy liked ANDRE, and he gives it a thumbs up, I should point out. The movie runs 1:35. The MPAA rates it PG for reasons that totally escape me. THE LION KING was more PG than this show which is clearly a G.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEWED WRITTEN ON: September 11, 1994
Opinions expressed are mine and not meant to reflect my employer's.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


D·Bug is a young and multidisciplinary company specialized in thinking and developing innovative software solutions.
Rigorous and high-quality software, according to the client requirements
Committed with deadlines
Good communication with a friendly environment
"Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program or a piece of electronic hardware, thus making it behave as expected."
D·Bug has similar goals as this process. We aspire to be recognized in the field of software development, creating great solutions for great clients.


'Idol Room' & 'My Little Television V2' to put a hold on IZ*ONE's guest appearance broadcasts
by beansssOn November 7, JTBC's 'Idol Room' and MBC's 'My Little Television V2' responded to girl group IZ*ONE's upcoming guest appearance broadcasts. The girl group has already completed filming for both 'Idol Room' and 'My Little Television V2', with both broadcasts originally expected to air some time around their comeback.
However, JTBC reps told media outlets on this day, "It's true that IZ*ONE have already completed filming for 'Idol Room'; however, the broadcast date is unconfirmed. We plan to come to a decision after monitoring the investigation results."
Likewise, MBC representatives stated, "We are internally discussing the matter of IZ*ONE's filmed content on 'My Little Television V2'."
Earlier on this day, IZ*ONE cancelled their upcoming comeback showcase, originally scheduled for November 11, after it was revealed that Ahn Joon Young PD admitted to rigging viewers' votes during 'Produce 48' as well as 'Produce X 101'.


Beam Laser Cutter
Simulation
Tutorial
New Design
Projects
Hans' Projects
Photo Frame
Puzzle
Coaster
Don't forget mommy's birthday!
Back
back
Skip
Review


|
| template<typename AD_SCALAR , typename SCALAR = double> |
| static std::string | generateJacobianSource (CppAD::ADFun< AD_SCALAR > &f, SparsityPattern &pattern, const size_t jacDim, size_t &maxTempVarCount, bool useReverse=false, bool ignoreZero=true, std::string jacName="jac", std::string inputName="x_in", std::string tempName="v_", std::string scalarName="double") |
| | generate source code for Jacobian More...
|
| |
| template<typename AD_SCALAR > |
| static std::string | generateForwardZeroSource (CppAD::ADFun< AD_SCALAR > &f, size_t &maxTempVarCount, bool ignoreZero=true, std::string jacName="forwardZero", std::string inputName="x_in", std::string tempName="v_") |
| | Generates code for the "zero order" derivative. More...
|
| |
| template<typename AD_SCALAR > |
| static std::string | generateHessianSource (CppAD::ADFun< AD_SCALAR > &f, SparsityPattern &pattern, const size_t hesDim, size_t &maxTempVarCount, bool ignoreZero=true, std::string jacName="hes", std::string inputName="x_in", std::string tempName="v_") |
| | generate source code for Hessian More...
|
| |
| static void | replaceAll (std::string &text, const std::string &placeholder, const std::string replaceWith) |
| | replaces all occurrences of a (sub-)string in a string with a replacement string More...
|
| |
| static void | replaceOnce (std::string &text, const std::string &placeholder, const std::string replaceWith) |
| | replaces the first occurrence of a (sub-)string in a string with a replacement string More...
|
| |
| static void | writeFile (const std::string &outputFile, const std::string &content) |
| | write a string to file More...
|
| |
| static std::string | parseFile (const std::string &filename) |
| | read the contents of a file to string More...
|
| |
| template<typename SC = double> |
| static std::shared_ptr< CppAD::cg::DynamicLib< SC > > | loadDynamicLibCppad (const std::string &libName) |
| | load a previously generated dynamic library by name More...
|
| |
Utility class for Auto-Diff code generation.
template<typename AD_SCALAR , typename SCALAR = double>
| static std::string ct::core::internal::CGHelpers::generateJacobianSource |
( |
CppAD::ADFun< AD_SCALAR > & |
f, |
|
|
SparsityPattern & |
pattern, |
|
|
const size_t |
jacDim, |
|
|
size_t & |
maxTempVarCount, |
|
|
bool |
useReverse = false , |
|
|
bool |
ignoreZero = true , |
|
|
std::string |
jacName = "jac" , |
|
|
std::string |
inputName = "x_in" , |
|
|
std::string |
tempName = "v_" , |
|
|
std::string |
scalarName = "double" |
|
) |
| |
|
inlinestatic |
generate source code for Jacobian
This method generates C source code for a Jacobian generated by Auto Differentiation.
It generates C source code but does not write it to file. A sparsity pattern can be provided to only get certain elements of the Jacobian. Zero entries in the Jacobian are automatically detected and do not need to be defined sparse. Optionally, a flag can be set to explicitely ignore the zero entries of the Jacobian. If so, it is assumed that all entries of the Jacobian are set to zero outside of the generated code.
- Parameters
-
| f | Auto-Diff function |
| x_dim | input dimension of independent (input) variable |
| jac | returns the resulting Jacobian |
| pattern | sparsity pattern defining which entries of the Jacobian to generate |
| maxTempVarCount | number of temporary variables in the resulting source code |
| useReverse | if true, Auto-Diff reverse mode will be used |
| ignoreZero | if true, the source code will not set zero entries in the Jacobian |
| jacName | name of the Jacobian variable in the source code |
| inputName | name of the independent (input) variable of the Jacobian |
| tempName | name of temporary variables (i.e. an array / vector) |
- Returns
- generated C source code
- Template Parameters
-
| AD_SCALAR | Auto-Diff scalar type which is either a normal AD type or a codegen type |
| SCALAR | underlying primitive type |
References ct::core::internal::SparsityPattern::col(), i, n, ct::core::internal::SparsityPattern::row(), ct::core::internal::SparsityPattern::sparsity(), and ct::core::internal::SparsityPattern::workJacobian().
Referenced by ct::core::DerivativesCppadCG< IN_DIM, OUT_DIM >::generateJacobianSource().
template<typename AD_SCALAR >
| static std::string ct::core::internal::CGHelpers::generateForwardZeroSource |
( |
CppAD::ADFun< AD_SCALAR > & |
f, |
|
|
size_t & |
maxTempVarCount, |
|
|
bool |
ignoreZero = true , |
|
|
std::string |
jacName = "forwardZero" , |
|
|
std::string |
inputName = "x_in" , |
|
|
std::string |
tempName = "v_" |
|
) |
| |
|
inlinestatic |
Generates code for the "zero order" derivative.
This method generates C code for the "zero order" derivative, i.e. the original function/model itself. While this seems unusual at first, Auto-Diff can optimize regular function calls and generate more efficient code. The resulting code should have comparable numerical accuracy as the original model.
- Parameters
-
| f | The function to generate source code for |
| x_dim | input dimension of independent (input) variable |
| jac | zero-order Jacobian |
| maxTempVarCount | number of temporary variables in the resulting source code |
| ignoreZero | if true, the source code will not set zero entries in the Jacobian |
| jacName | name of the Jacobian variable in the source code |
| inputName | name of the independent (input) variable of the Jacobian |
| tempName | name of temporary variables (i.e. an array / vector) |
- Returns
- Template Parameters
-
| AD_SCALAR | Auto-Diff scalar type which is either a normal AD type or a codegen type |
References i, and n.
Referenced by ct::core::DerivativesCppadCG< IN_DIM, OUT_DIM >::generateForwardZeroSource().
template<typename AD_SCALAR >
| static std::string ct::core::internal::CGHelpers::generateHessianSource |
( |
CppAD::ADFun< AD_SCALAR > & |
f, |
|
|
SparsityPattern & |
pattern, |
|
|
const size_t |
hesDim, |
|
|
size_t & |
maxTempVarCount, |
|
|
bool |
ignoreZero = true , |
|
|
std::string |
jacName = "hes" , |
|
|
std::string |
inputName = "x_in" , |
|
|
std::string |
tempName = "v_" |
|
) |
| |
|
inlinestatic |
generate source code for Hessian
This method generates C source code for a Hessian generated by Auto Differentiation.
It generates C source code but does not write it to file. A sparsity pattern can be provided to only get certain elements of the Hessian. Zero entries in the Hessian are automatically detected and do not need to be defined sparse. Optionally, a flag can be set to explicitely ignore the zero entries of the Hessian. If so, it is assumed that all entries of the Hessian are set to zero outside of the generated code.
- Parameters
-
| f | Auto-Diff function |
| pattern | sparsity pattern defining which entries of the Hessian to generate |
| hesDim | the dimension of the Hessian to generate |
| maxTempVarCount | number of temporary variables in the resulting source code |
| useReverse | if true, Auto-Diff reverse mode will be used |
| ignoreZero | if true, the source code will not set zero entries in the Hessian |
| jacName | name of the Hessian variable in the source code |
| inputName | name of the independent (input) variable of the Hessian |
| tempName | name of temporary variables (i.e. an array / vector) |
- Returns
- generated C source code
- Template Parameters
-
| AD_SCALAR | Auto-Diff scalar type which is either a normal AD type or a codegen type |
References ct::core::internal::SparsityPattern::col(), i, n, ct::core::internal::SparsityPattern::row(), ct::core::internal::SparsityPattern::sparsity(), and ct::core::internal::SparsityPattern::workHessian().
Referenced by ct::core::DerivativesCppadCG< IN_DIM, OUT_DIM >::generateHessianSource().


Random Website goes here. Header
Links will go here. Navbar
Some stuff. Section content
Other stuff.
Another section of content, like the last