how to upload a file to attachment in salesforce using lightning?

This is the helper class in lightning:({ MAX_FILE_SIZE: 750 000, save: function(component) { var fileInput = component.find("file").getElement(); var file = fileInput.files[0]; var fr = new FileReader(); -- --some logic-- --})From component I am calling this save method but I am getting this error:Something has gone wrong. Action failed: c$fileUpload$controller$save [TypeError: Cannot read property '0' of undefined]Failing descriptor: {c$fileUpload$controller$save}.Please try again.Please help me....Read more

lightning - <ui:inputText> keyup returns incorrect value (one less)

I am using in one of the lightning components and I am using it to filter a table. But when I'm trying to get its value in JS controller with the keyup function, it's giving one less value than actual.This question has been already asked for HTML here , But for HTML, we have a solution that we can use onkeyup instead of keyup. But in salesforce lightning, we don't have any onkeyup function for ui:inputText Source , So how to solve this issue?I have already tried keypress, keyup, keydown.All are giving one less value than actual oneComponent ...Read more

how to delete alarm in lightning (in js)

I am banging my head looking at the code for ... quite some time.I have a lightning event, created from ics (including an alarm).I want to delete the alarm after something has occurred. I found calItemBase has mAlarms. But how to delete a single alarm? (there should be only one). What is the proper value of mAlarms if there is no alarm?What to do with mAlarmLastAck and other properties?My workaround is to recreate from ical without the alarm, but then the user looses categories and other things he set for the event in the UI.Many thanks,Klaus...Read more

lightning ground rod

I have a quick question about lightning ground rods. We had a Kohler generator large enough to power most of the house installed for my 82 year old mother. The installer ran the line connecting it to the breaker box inches away from a grounding rod. My mother’s house had never been struck by lightning in the 40 years before but now it has been struck 4 times in 3 years. The generator was also struck these times. Could the line's proximity to the grounding rod be causing the damage after a strike?...Read more

Antenna to characterise lightning

what is the power spectrum and frequency spectrum of lightning. Can we calculate the Wattage in a lightning storm, can we draw useful power from it.I would like to build an antenna and receiver to monitor lightning and calculate distance of storm, general direction and determine the type of storm by something in the frequency spectrum if such a signature exists.Is there an area of research and literature for this?...Read more

Inbound video streaming over lightning port accessory

I am exploring the feasibility of building an accessory (through MFI) that will feed streaming video that will be rendered by an app resident on the host device.Looking at some similar products (for example EyeTV Mobile accessory by Elgato -- which is also MFI approved), I can see users reporting that the device does not work for iOS > 9. This is reportedly due to: "[...] latest iOS versions may deactivate Lightning devices depending on their use of electricity - this may affect the use of EyeTV Mobile despite its MFI certification"...which...Read more

lightning - Is it possible to use an 8 pin accessory on an iphone 4?

A relative just bought a biofeedback accessory for an iphone 5/6 and was wondering if they could use it on one of my old iphones. She'd rather use an iphone without any data on it so people could use it without supervision, but the most recent one I have is a 4 (maybe a 4s, not sure).I found this, but I'm worried it won't work. I know the best way is to just try it, and I probably will because it's cheap, but I'm interested in learning a bit about the differences between the two types of cables. Would a device built for the iphone 5/6 use a sli...Read more

Why does lightning strike from the ground-up?

The enlightening image below is of a lightning strike slowed down at 10,000 frames per second. It can be seen that the most intense flash produced from the lightening occurs in the direction from the ground up. Why does this final "ground-up" strike occur and why is it so much brighter and faster than the initial part of strike heading towards the ground?...Read more

Lightning Cable in Washing Machine

I accidentally put a USB to Lightning cable in the washer and dryer. The cable is mostly ok, but the plastic at the lightning end got a little warped. Am I risking anything by trying to connect a device with it? I'm reluctant to damage an iPhone, but at the same time, those cables aren't cheap....Read more

Lightning protection for TV Antenna

I live in an area with frequent lightning strikes. Occasionally people get killed due to those - specially when strikes enter house through TV antenna cables. My house is quite tall and seems to be the tallest building in this area. I have one lightning protector installed already. I wish to install some TV and satellite antennas on the roof of the house but very worried about possibility of lightning strikes entering the house through these cables. I am currently thinking about passing each cable through a two pole isolator switch which would ...Read more

Voltage, inductance & lightning in a length of wire

I initially got the idea after watching the famous Mike Holt video on grounding.https://www.youtube.com/watch?time_continue=138&v=mpgAVE4UwFwMike warns that longer wires to ground rods can attract more energy. So I thought he meant the lightning voltage can increase after passing through the wire (it doesn't as one of the Answers has detailed at length).I have many surge protection devices which protect many circuits so I wanted to know the mechanisms of it. And I tried to review the physics below:Given the inductance for a given length of ...Read more

wirebonding - Lightning protection system

When I have a lightning protection system installed on a building roof top , what is the best way to bond the electrical equipment on the roof? Is it ok to directly bond it to the down counductor of the LPS? or different measures should be taken? Lets say I have multiple air-condition units on the roof, how can I safely bond them to the lightning protection system. With bonding here I mean bonding the metalic body of the units.Lets say if I bond the body directly to the down conductor, in case of a lightning strike will current pass through the...Read more

How does a neutral wire add any protection from near-by lightning strike

As an amateur radio operator for 60 years now I have been aware that a major worry vis-a-vis lightning is not so much the very rare "direct hit" that blows up the house, but the far more common "near miss" in which a very large electromagnetic pulse will spread at the speed of light whenever lightning strikes nearby. I have been taught that this pulse (EMP) will induce a substantial voltage on antenna structures but also on power lines coming into the house. In this context, how does having the neutral wire (grounded at the home's AC service p...Read more