in my view controller.m i have a string like this   NSString *valueToSave = @"someValue";   and would like to safe the text with NSUserDefauls in Appdelegate.m   [[NSUserDefaults standardUserDefaults]  setObject:valueToSave forKey:@"preferenceName"];   how can i use the NSString in the other file?  This doesn't work:  #import "viewcontroller.m";
I'm developing a  application, and I'm using constant NSStrings as ways to store key names for my preferences.  I understand this is a good idea because it allows easy changing of keys if necessary. Plus, it's the whole 'separate your data from your logic' notion.     Anyway, is there a good way to make these constants defined once for the whole application?     I'm sure that there's an easy and intelligent way, but right now my classes just redefine the ones they use.
Why is my starting gravity low? In the fall of 2011 I made the leap from extract/partial kits to all-grain kits. I'm enjoying AG, but my SG is continuously below the expected. I have brewed 5 AG kits and 4 have had a low SG.   My assumption is my sugar extraction during mashing (or sparging) isn't optimal. I heat my mash water to 165 and mash the grains for 60 minutes. Mashing levels out at 152. For Lautering I heat the water to 175-180. After I drain the initial mash I add the lautering water and let that soak for 10 minutes. the temperature levels out around 170-172. Then I drain into the kettle and being the boil.  I aim for a gentle boil just enough to break the surface tension. I boil for 60 minutes, chill, rack, take a reading and pitch yeast.  Here are some of the numbers  type            expected     actual  kit st paul porter  1.052        1.039   http://www.northernbrewer.com/shop/st-paul-porter-all-grain-kit.html belgium strong  1.067        1.055   http://www.midwestsupplies.com/superior-strong-ale-all-grain-kit.html troegs hop back 1.063        1.049   http://www.byo.com/stories/recipeindex/article/recipes/90-american-amber-a-pale-ale/2196-troeegs-hopback-amber-ale-clone   The fuorth was the Phat Tyre kit from Northern Brewer. Can't remember the SG though. It was low. They taste great, but the numbers weren't "right". What can I adjust so the numbers are more inline with the recipe?   Update Thank you for all the feedback. There are a number of factors for me to review and adjust. Given my current setup I will follow @mdma advice and recirculate the wort once and extend lautering to 30 minutes.  It will be a week or two before I can attempt this, so it will be awhile before I report back again.  Update #2 I now have some awesome local contacts who are helping me out with technique and trouble shooting. Another (major) issue I could be experiencing is draining the wort way too fast. According to my friend. The drain should be low and slow after cycling a gallon or 2 of wort. sparging should take ~2 hours. for each gallon drained plato/brix should drop 3 points and go no lower than 3-5 points at the end.  the second recommendation is to heat up 3-5 gallons of water to 180 and poor it in prior to/while sparging.  my first attempt using this technique proved successful with the gravity being a lot closer to the anticipated OG. I had some temp issues with the batch, but I was so focused on sparging that I ignored the temp. My guess is I would have been right on if my temp didn't fall so low.  Update #3 I had the chance to brew with my mentor this weekend and he pointed out 2 glaring problems with my mashing technique.   Starting mash temp is too low. I was heating my water to 10-12 degrees above target temp. He recommends 17 degrees. between grain absorption &amp; the tun itself most of the heat dissipates within the first few minutes. This does go against what I originally said. That I was hitting my temp marks. Looking back I was hasty with my readings. I should not dump my sparge water (or lauter?) into the tun while draining the wort. The idea is to compact the liquid into the bottom of the tun thus compacting the sugars. I am stirring up the mash when I dump all sparge water in. We kept our sparge water 1-2 inches above the grain bed and our final results we excellent.   A 3rd recommendation he made was to lower the pH of the water. tap water is ~7 and the ideal mash pH is 5.2. He added a solvent, which I cannot remember the name of, which did this for us. I'll be picking up some of that this weekend.  Thanks to all who helped me out with this problem. I have a Toshiba z830 with ubuntu 12.04. I could use without problems the DSL connection (I have no router, only a modem) at home until a couple of days ago:   It stopped to work when while connected with the DSL connection via CiscoVPN (to my workplace), I had to leave the laptop unattended for a while and I guess the laptop tried to go to suspend. When I came back there were many messages on a black screen (sorry, I cannot attach an image because of my low reputation) and the laptop was not responding. I had to reset the it.   After rebooting it, the internet connection didn't work as did before (no browsing, no ssh, no skype, etc) although it says it is connected. I only can browse, etc when I connect to CiscoVPN to the same place where I was connected when it crashed.  When I am physically where I connected via VPN (at work) I can use the wireless, which I am not able to use now anymore since the incident described above.  Some additional information:  martillu@ubuntu:~$ cat /etc/resolv.conf   domain km.icrr.u-tokyo.ac.jp   nameserver 10.240.12.134   nameserver 10.240.12.135    martillu@ubuntu:~$ route -n   Kernel IP routing table   Destination Gateway Genmask Flags Metric Ref Use Iface   0.0.0.0 61.127.116.199 0.0.0.0 UG 0 0 0 ppp0   61.127.116.199 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0   169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 ppp0    martillu@ubuntu:~$ ifconfig   eth0 Link encap:Ethernet HWaddr e8:e0:b7:2f:bc:5a   inet6 addr: fe80::eae0:b7ff:fe2f:bc5a/64 Scope:Link   UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1   RX packets:17620 errors:0 dropped:1 overruns:0 frame:0   TX packets:13168 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:1000   RX bytes:19452232 (19.4 MB) TX bytes:2568218 (2.5 MB)   Interrupt:20 Memory:c0700000-c0720000    lo Link encap:Local Loopback   inet addr:127.0.0.1 Mask:255.0.0.0   inet6 addr: ::1/128 Scope:Host   UP LOOPBACK RUNNING MTU:16436 Metric:1   RX packets:134 errors:0 dropped:0 overruns:0 frame:0   TX packets:134 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:0   RX bytes:36316 (36.3 KB) TX bytes:36316 (36.3 KB)    ppp0 Link encapoint-to-Point Protocol   inet addr:219.167.252.226 P-t-P:61.127.116.199 Mask:255.255.255.255   UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1454 Metric:1   RX packets:17608 errors:0 dropped:0 overruns:0 frame:0   TX packets:13129 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:3   RX bytes:18993590 (18.9 MB) TX bytes:2221195 (2.2 MB)    wlan0 Link encap:Ethernet HWaddr 9c:b7:0d:d9:21:f3   UP BROADCAST MULTICAST MTU:1500 Metric:1   RX packets:0 errors:0 dropped:0 overruns:0 frame:0   TX packets:0 errors:0 dropped:0 overruns:0 carrier:0   collisions:0 txqueuelen:1000   RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)    I think that: domain km.icrr.u-tokyo.ac.jp in the resolv.conf may be suspicious, since if I am not connected via CiscoVPN I do not know why it should appear "km.icrr.u-tokyo.ac.jp" (this is where I connect via VPN). So I just got this Nikon D3100 Camera.  And I am trying to take a picture using autofocus with the kit lens(18-55mm).    The system is in Auto mode, AF-A, single frame and the lens A-M switch is on "A",  VR is "ON".  When I press shutter half way down, focus confirmation light in lower left corner of viewfinder neither lit nor blinks(hear clicking). When I press the shutter all the way down, the shutter seems locked (hear clicking, but shutter not released).    The manual says the shutter will lock itself if it can't get focus. But the place is well lit and have distinct color and I can easily focus using my old Canon.    The camera works fine in manual focusing, but I can't get it to take picture under auto-focusing.  I wonder is there something wrong with the setting that I don't know or is that I got a lemon?  Thanks What is behind the definitions of work and energy? Will spoiled food always make you sick? Does encrypting my home folder make my computer more secure? Do I have to enter my password more if my home folder is encrypted? What else should I know about encrypting my home folder? I have been taught to use the if I had form in conditional clauses referring to the past:     If the president had asked me, I would have told him the same thing.   As far as I can tell though, the would have construct is sometimes used in conditional clauses as well, so it wouldn't be incorrect to say:     If the president would have asked me, I would have told him the same thing.   What is the difference between the two and the proper use of the latter? Convergence in measure and almost everywhere In a finite measure space, let $\{f_{n}\}$ be a sequence of measurable functions. Show that $f_{n}  \rightarrow f$ in measure if and only if every subsequence $\{f_{n_{k}}\}$ contains a subsequence $\{f_{n_{k_{j}}}\}$, that converges almost everywhere to f.   I can prove from converge in measure to converge almost everywhere, but I don't know how to write it down for the other direction. What should be in the sources.list for Kali Rolling Linux? This is exact content from my sources.list:  #  # deb cdrom:[Debian GNU/Linux 2016.1 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160830-11:29]/ kali-rolling contrib main non-free #deb cdrom:[Debian GNU/Linux 2016.1 _Kali-rolling_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160830-11:29]/ kali-rolling contrib main non-free   I couldn't install the Synaptic package manager and was told to modify sources.list.  I googled a lot and added some repos into it and ran update and upgrade command only to see Kali crash... I had to recover it.  Please mention the exact content that should be there to ensure that Kali Linux works. How can I view the camera through an object as a material in Cycles? Largest Mass Diffraction How to properly scale image in uv editor Hello to anyone who come here and help out or read. I have an issue with the uv editor, I have been trying to make an proper eye. The issue is that I can't figure out how to scale this correctly.    Is there anything I can do to make the eye colors or texture? I've created a Lightning component to view key details for the Account and Contact lookups from a Case, like so:    The problem is, I have been unable to get field content to render when  using the &lt;force:inputField/&gt; or &lt;force:outputField/&gt; components when I place them inside the markup to style them as cards. I've used &lt;ui:outputText/&gt; as a workaround, but that means I don't get any of the built-in behaviors I would get with the &lt;force:*Field/&gt; components -- like Lightning styling, which means I have to manually do it using SLDS.  This displays the contact name as expected:  &lt;aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="LightningCaseTestController"&gt;   &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}" /&gt;   &lt;aura:attribute name="recordId" type="Id" /&gt;   &lt;aura:attribute name="contact" type="Contact" default="{sobjectType: 'Contact'}"/&gt;    &lt;force:outputField value="{!v.contact.Name}"/&gt;   &lt;force:inputField value="{!v.contact.Name}"/&gt;  &lt;/aura:component&gt;   This does not:  &lt;aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="LightningCaseTestController"&gt;   &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}" /&gt;   &lt;aura:attribute name="recordId" type="Id" /&gt;   &lt;aura:attribute name="contact" type="Contact" default="{sobjectType: 'Contact'}"/&gt;    &lt;article&gt;     &lt;force:outputField value="{!v.contact.Name}"/&gt;     &lt;force:inputField value="{!v.contact.Name}"/&gt;   &lt;/article&gt;  &lt;/aura:component&gt;   Basically, it appears that as soon as any markup is placed around the &lt;force:*Field/&gt; tags -- even just a &lt;div&gt; -- they no longer render. Examples in Trailhead and other places all seem to use &lt;ui:outputText/&gt; or &lt;ui:input*/&gt;.  This seems like a lot of extra manual work. Am I missing something?  Update: it only fails when the component is included in a Lightning page -- such as the record detail page -- from Lightning App Builder. If I add it to a simple Lightning app, it works:  &lt;aura:application &gt;     &lt;c:LightningCaseTest recordId="SOMECASEID" /&gt; &lt;/aura:application&gt;   So it appears to be a bug? On the grade of an ideal I need to prove the following statment (actually a special case of it).     Let $R$ be a Noetherian ring, $M$ a finite $R$-module and $I$ an ideal of $R$. Then   $\operatorname{grade}(I,M)\geq 2$ if and only if the homomorphism $M\rightarrow$Hom$_R(I,M)$ given by $m\mapsto(i\mapsto im)$ is an isomorphism.   This is Exercise 1.2.24 in Bruns and Herzog, Cohen-Macaulay Rings. Embed vimeo video into the body field If a Matrix Has Only Zero as an Eigen-Value Then It Is Nilpotent Prove that a matrix with only zero eigenvalues must be nilpotent.   How will I be able to prove this? Expected value of the number of flips until the first head Suppose we flip a coin until we see a head. What is the expected value of the number of flips we will take?  I am pretty new to expected value, so I tried to evaluate it by multiplying the probability of each scenario with the number of flips it took to get there (like taking the arithmetic mean). This didn't work though, because of the infinite possibilities. I'm really confused, and if someone were to provide an answer, I would really appreciate it if they could go into detail. cin and getline skipping input Do muggleborns get their letter on their 11th birthday or the summer before they start Hogwarts? A lot of the fanfiction seems to like to give Hermione her letter in September to coincide with her birthday. That just doesn't seem very logical for the Statute of Secrecy, as you then have 10 out of every 12 10-year-old wizards and witches knowing about magic while finishing the school year (assuming even distribution of birthdays).   It seems to me that this is just asking at least one of them to brag about knowing magic and spill the secret.   Also this would mean that the poor kid born on 30 of August would only have 2 days to adjust to being magical before being shepherded off to a boarding school in the middle of nowhere.  From another point of view, getting such news on your birthday can screw up a lot of celebration plans.  Also, from rereading the memory from Dumbledore where he introduced magic to Tom, there is no mention of snow or even closeness to his birthday from the caretaker.  I believe this view came from the fact that Harry got his letter on his birthday but that piece of fanon seems to forget that letters were being sent up to at least a week or 2 beforehand (leading to the Dursleys hiding on a rock in the sea in the first place). Append to the end of a file in C