I am only starting to learn coding. I need to be able to use my custom controller I created for use in a visualforce page in production. I can't get past code coverage failure when I try to deploy from sandbox. I tried all the existing test classes available in production, because I don't know how to create a test class. Below is the code for my controller, please check if there's something wrong with it: public class MyController {  public ApexPages.StandardController sc;  public MyController(ApexPages.StandardController sc) {     this.sc = sc; }  public void quicksave() {     AVTRRT__Job_Applicant__c j = (AVTRRT__Job_Applicant__c) sc.getRecord();     update j.AVTRRT__Contact_Candidate__r; } }
I would like to know the best way to write test methods for controller extension classes that are used by Visualforce.  What is the minimum set code that I need to cover the basic operation of the controller without taking into account any custom functionality that I might add.  Here is my example class with the test method ready to be completed.  public with sharing class myExtension{      private final Account acct;      public myExtension(ApexPages.StandardController stdController){         this.acct = (Account)stdController.getRecord();     }      public static testMethod void testmyExtension(){      } }
revoking apex managed sharing permission I'm using apex managed sharing to grant permissions very similar to how it is done in this example trigger:   However, I also need the ability to revoke or delete this access and having it revert to private. The reason for this is my understanding is that there are only two access options for managed sharing access 'read' or 'edit' with no 3rd option of 'none' or 'private'.  Reference:   I've tried adding the shares to a list and deleting the list and I'm getting the error: DELETE_FAILED, cannot delete owner or rule share rows,   I also noticed there is a field on the share object 'isDeleted' this field however is not writable.  Does anyone have experience revoking or deleting these permissions once they've been created?  Thanks! I’m studying a PhD in Theoretical Physics (quantum field theory, to be specific), but I would like to learn more about black holes (and related areas. Does anyone have any suggestions for textbooks/available notes on these subjects for people without much background in them? Obviously I’m very comfortable with mathematics and physics in general so I’m not looking for “pop science” material. There are a lot of poorly drawn schematics here. A few times people have actually asked for critiques of their schematics. This question is intended as a single repository on schematic drawing rules and guidelines can point people to. The question is  What are the rules and guidelines for drawing good schematics?     Note: This is about schematics themselves, not about the circuits they represent. Freestyle with multiple objects I have several objects that intersect each other:   I would like to draw lines on the silhouette and key details with Freestyle, however Blender does detect intersections between objects and gives a very strange result:   What I'm trying to make is something like this:   Note: This is just an example, what I'm trying to do has about 10 highly detailed objects which intersect each other, so manually combining them is not possible.  Is it possible to make Freestyle detect edges at face intersections? If not, is there a simple way of combining the objects to create a single object with the outer faces of all the objects? How do I get a thread ID from an arbitrary pthread_t? I have a pthread_t, and I'd like to change its CPU affinity. The problem is that I'm using glibc 2.3.2, which doesn't have . That's OK, though, because pthread_setaffinity_np() is itself a wrapper of , which can be called by passing a thread ID instead of a process ID to set the affinity for an arbitrary thread.  BUT ... The thread id that sched_setaffinity can work with is an OS thread id, the kind that you can get from the  system call. This is different from the opaque type pthread_t, and gettid() will only return the thread-id of the current thread. I need to be able to set the CPU affinity of an arbitrary thread.  Unfortunately, I can't access the pthread's private parts, which would let me steal the thread id by casting a pthread_t to a struct pthread *. All the better, I guess, since relying on private implementations is asking for even more trouble.  I've also been reading up on the  function, however this returns a "unique integral identifier" -- which I don't believe is in any way shape or form equivalent to an OS thread id.  Hence, the question: How can I get a thread ID from an arbitrary pthread_t? How to restore a system after accidentally removing all kernels? I already know how to do it on Mac OS X (plenty of instructions online).  But is it possible to do it on Ubuntu? If yes, how? today I installed Ubuntu 64-bit on a netbook. When the netbook boots this, error report appeared. I think there is a problem with the partitions.  Gave up waiting for root device. Common problems:   — Boot args (cat /proc/cmdline)     — Check rootdelay= (did the system wait long enough?)     — Check root= (did the system wait for the right device?)   — Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!   BusyBox v.1.21.1 (Ubuntu 1:1.21.1-1ubuntu1) built-in shell (ash)    Enter 'help' for list of built-in commands.    (initramfs)   Output of lsblk as requested:  $ lsblk NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 232.9G  0 disk  ├─sda1   8:1    0   231G  0 part  ├─sda2   8:2    0     1K  0 part  └─sda5   8:5    0     2G  0 part [SWAP] sr0     11:0    1   1.2G  0 rom  /cdrom loop0    7:0    0   1.1G  1 loop /rofs Calculate sum of series $\sum \frac{n^2}{n!}$ I have to calculate sum of series $\sum \frac{n^2}{n!}$. I know that $\sum \frac{1}{n!}=e$ but I dont know how can I use that fact here.. do not optimize/remove html I would like to have a page with some html content in it that CK Editor does not seem to support, in particular: I want to have a little &lt;form tag with a couple of &lt;input fields. I can enter it in Switch to plain text editor mode and save from there and it will keep the elements but when I want to edit the page, it'll go back to the Switch to rich text editor and remove my &lt;form html items. How can i set CD Editor to not remove any html it may not be able to render?  Thank you! Let $f : \mathbb{R}^n → \mathbb{R}_∞$ be a function and let $C ⊂ dom f$ be a convex set.  $$**Part I**$$ Prove that $f$ is a convex function if and only if $f$ is convex over every line $L_{v,x_0}$ where $L_{v,x_0} := \{x_0 + tv : t \in \mathbb{R}\}$.  i.e. f is convex iff when restricted to any line, it be convex on that certain line.  So essentially to handle this proof I need to show that convexity for $f$ holds when its convex over any arbitrary line, and on the converse it does not hold when $f$ is not convex over that arbitrary line. If $f$ is convex then,  $$\forall x,y \in C, a \in [0,1]$$ it holds that $$f(ax+(1-a)y) \leq af(x) + (1-a)f(y) \space \space\space\space\space\space\space\space\space\space\space\space (1)$$  EDIT: $$**Part II**$$  Let $f : \mathbb{R}^n \to \mathbb{R}_∞$ be a function.   I want to prove that $f$ is convex over the line $L_{v,x_0}$ iff $\psi : \mathbb{R} \to \mathbb{R}_∞$  $\psi(t) := f (x_0 + tv)$, is convex over $I (x_0, v )$.  where $L_{v,x_0}:= \{x_0 + tv : t ∈ \mathbb{R}\}$, and $I(x_0,v):=\{t \in \mathbb{R} : x_0 + tv \in C\}$  Any help is very much appreciated Is it possible to make abstract classes in Python? Why does a passport have a place of birth field on it? Almost all passports I have seen have a place of birth field on them. For instance, on the US Passport,    Is there a specific reason to this? How can I add the Memtest86+ options back to the Grub menu? In languages like Java and C#, strings are immutable and it can be computationally expensive to build a string one character at a time.  In said languages, there are library classes to reduce this cost such as C# System.Text.StringBuilder and Java java.lang.StringBuilder.  Does php (4 or 5; I'm interested in both) share this limitation?  If so, are there similar solutions to the problem available? Allowing FTP access to a local user without allowing SSH/command line access For example, you're doing a research for a car to purchase. You get a list of cars with engine number, city where a car was assembled, and a color. What's missing is make, model and price. Can I install any iOS version I wish by picking and choosing which firmware to restore? I'm trying to downgrade my iPhone from the current iOS to an older one, as per .  But every time I try, I always receive this error:     The iPhone could not be restored. This device isn't eligible for the requested build.     I have tried many times with and without DFU mode. Any ideas regarding this? Looking at the following dataset:   Date        Visits   Carts      carts       Orders                       Created   converted    Created 2011-11-11    12277     161        9          36   2011-11-12    11871     93         5          19     2011-11-13    13072     107        8          8      2011-11-14    13594     112        4          34     2011-11-15    12741     129        8          43     2011-11-16    15491     261        16         57  2011-11-17    13418     186        17         42       I've been asked to plot this on a graph, using the Date has the X-Axis and the rest of the data on the Y-Axis. The problem is that the scale of the data is dramatically different. where Visits are in the thousands and Orders Created are in the low tens, the data doesn't plot well on a graph.     I was wondering what a statistician would do in this scenario, I could divide the the Visits by a 1000 and then put in the description (Visits (K)), but then I start to have the same problem with Carts Created, as they are in the hundreds and everything else is in the low tens.  What kind of thing is done in this scenario? How can I listen to communication between a process and a serial port? On a Gentoo Linux machine, a process is communicating with another computer via serial port (/dev/ttyS1). I want to listen to this communication (i.e. what is being sent/received by the process) without further interfering.   How can I achieve this with just basic Linux tools? I even can change the serial port the process is communicating with, so maybe I can 'shortcut' two devices (/dev/ttyS1 and /dev/xxx) listen to all communication, when all output to /dev/ttyS1 is forwarded to /dev/xxx and vice versa. But how do I do it? Something with socat?