Propane vs electric water heater energy cost

Question: My calculations tell me that propane water heater should be an economical alternative
to an electric water heater.
But, looking at Energuide labels of comparable water heater, I seem to be wrong.
Hypothesis :

The propane retail price per gallon is $2.60

https://www.eia.gov/dnav/pet/pet_pri_wfr_dcus_nus_w.htm

The electricy price is $0.16 per kw/h

https://www.eia.gov/electricity

Both are tankless water heater.

Thermal efficiency is 95% for electricity

Thermal efficiency is 90% for propane

Calculations

BTUs required to raise  50 gallons of water by 70 deg F
1 gallon of water = 8.33 pounds
To raise the temperature of 1 pound of water by 1 deg F = 1 BTU
To raise 50 gallons of water by 1 deg F = 50 * 8.33 = 416.5 BTU
To raise 50 gallons of water by 70 deg F = 416.5 * 70 = 29,155 BTU
29,155 BTUs per day

Propane gas consumption, per day (50 gal, 70 deg F raise)
1 gallon of propane = 91,000 BTU
91,000 BTU @ 90% thermal efficiency = 91,000 * 0.9 = 81,900 actual BTU per gallon
Daily BTUs to propane gallons = 29,155 BTUs per day / 81,900 BTU per gallon = 0.35 gallon
0.35 gallons per day

Electricity consumption, per day
1 kw/h = 3412 BTUs @ 95% thermal efficiency = 3241 actual BTUs per kw/h
Daily BTUs per day in KW = 29,155 BTU / 3241 btu per kw/h @ 95% = 8.99 kw/h
8.99 kw/h per day

Daily Propane cost : 0.35 gallon @ $2.60 per gallon = $0.91
Electricity cost = 8,99 kw/h @ $0.16  = $1.43
It seems to me that propane is clear winner.
Let's change the hypothesis, and say I live in a area where propane is more expensive $3.30 per gallon), and electricity is cheap, ($0.11 kw/h)
Daily propane cost : 0.35 gallon @ $3.00 per gallon = $1.05
Daily electricity cost = 8,99 kw/h @ $0.11 = $0.99
This is an unlikely scenario, and propane is only 5% more expensive
How can energuide rate electricity cheaper than propane?
Comment: Thermal efficiency of electric is 100% by definition.  If it were only 95% then where does the 5% go? The unit would have to be glowing cherry red.
Comment: @Filip  A real gallon is 4.546L ~10lbs  You are using the smaller US gallon.

~
Comment: If the OP is actually trying to decide whether to install an electric or a propane tankless water heater, then he must consider the flow rate of water needed in this application. The power required to raise the temperature of a decent stream of water by 70 deg F is so large that it will draw 125 A at 240 V.  Hardly anyone has electric service that can devote  30 kW to heating water. Electric tankless water heaters are only for point of use, not central.
Comment: In affluent North America the minimum burner size for a whole house gas fired tankless water heater is 160 kBTU / h.  I think the conversion factor is 1 kBTU / h = 293 W (?? someone please check this). Only gas fired burners can supply the heating rate for whole house tankless water heating in the colder areas of North America. A storage tank must be used for whole house hot water supply using electrical power. If the OP is interested in efficiency he should get an electric heat pump water heater.
Comment: Are you sure that you want a tankless heater? You should be looking at heat pump water heaters, *including* the split-system units (Sanden/ECO2 and friends), if you want an efficient water heater
Comment: As with most things location, location, location.  Average is usually half of the lowest and highest and in most cases you are in the highest in your location.
Comment: Also, are you sure you are looking for propane and not natural gas? Your location says Montreal, and I've only known propane to be used far outside urban areas.
Comment: @UnhandledExcepSean   Thought OP was American when using the wrong weight for a gallon.  Not sure but I doubt my old neighbourhood in east end of Laval has natural gas.
Comment: Add the ROI to your calculation. Unless you have city propane line, you will need to invest into local gas tank.
Comment: @crip659 : the wrong weight for a gallon? AFAIK 1 gallon of water= 3.78 L = 3.78 kg = 8.33 lbs... what do you think the weight of 1 gallon is? please correct me.
Comment: @Filip surely the mass of a unit of water?
Answer: Government regulations are funny.
Because Energuide labels follow regulations written prior to February 24, 2022 when the Ukraine war blew up, weirdly re-shaping the energy market.  In particular, the government used a metric to determine the price of electricity and gas which is not the same metric you used.  You can't just "freestyle it" or you'll get different results.  Your next step is to look up the relevant regulations to see how the NRC requires the Energuide data be generated.
But markets are capricious.
The simple fact is that gas and electric prices are spot markets subject to dramatic change based on world events. EV adoption may drive up electric costs, or it may drive down electric costs due to V2G and home batteries removing the need for very costly peaking units. A whole town may be killed by a poison gas cloud in a Lac-Mégantic style catastrophe resulting in the banning of fracking and gas prices increase by 10x.
What we know for sure is that converting from propane to electricity is easy to do at scale, so electricity prices will always be moderated by the fact that it will always use the cheapest of many sources.
Also, with the uncertainties of wind, solar and EVs, the electric market is pushing pretty hard to move consumers to demand pricing.  As such, with an electric, you could find yourself paying the price de l'heure every time you open a tap.
Don't forget other costs and limitations.
Gas tankless are more expensive, but electric tankless requires a positively enormous electric service.  We regularly see tankless installations fail entirely (as in, the spouse is dissatisfied and forces it to be removed) because people under-size the heater for the flow, electric elements, because they're not willing to commit to the large electric service a tankless requires. Realistically to run a tankless you will need 400A class electric service.
Note also that propane has limits too, in northern climes.  It's stored in the tank as liquid, but must be boiled to vapor to be used. To evaporate, a pound of propane requires 180 BTU, which it takes from the liquid propane in the tank. That makes the liquid colder. As the liquid gets closer to its boiling point of -42°, its vapor pressure falls, as does its ability to flow.  In summer, the liquid quickly re-absorbs energy from the environment through the tank walls, but this slows down the colder it gets. This forms a limit to how much gas the propane tank can deliver. A tankless heater is VERY demanding - our simple unit delivers 200,000 BTU/hr -  so this could be an issue.
Comment: A **proper** propane tank install in cold areas is underground, where the temperature is nice and stable. Plenty of folks cheap out, of course, but a buried tank is not subject to freezing up.
Answer: TL;DR You're doing better than EnergyGuide
While you might think it is all BTUs (or all kWh, which is used in some places), but that is not what the EnergyGuide ratings are about. Actually, I think that is what they should be about - provide a number per unit of usage and let the user calculate the rest. For water heaters, that would be "gallons per day". For heating or cooling it would be "per degree day". But your typical consumer is presumed to not understand such lofty concepts, and instead things are based on "similar appliances". To some degree that makes sense. For example, the typical consumer will be shopping for a replacement similar item - another regular air conditioner + furnace (and not switch to a heat pump), another gas water heater (and not switch to electric), another electric dryer (and not switch to gas). Plus not dramatically change size/capacity. Not dramatically changing size/capacity usually makes sense for HVAC (unless you are building an addition to your house) but actually is quite common for water heaters (the water heater that works sufficiently for a couple may be way undersized for a family of 5).
The end result is that EnergyGuide labels are based on same type, similar size. I picked a couple of tankless water heaters available at Home Depot (I did that because I know Home Depot sells a decent variety and includes links to EnergyGuide labels). And it just so happens that with electric tankless hot water heaters, there is pretty much no difference between models. They are all 100% efficient! So a 2.5 GPM ECO 27 (27kW) and a 1.7 GPM ECO 18 (18kW) are the same - $288 for one, $289 for the other, based on comparisons with other 1.7 - 2.7 GPM electric tankless water heaters, $0.12/kWh, 2408 kWh per year. And on those two, the scale doesn't even show a range of $. On the other hand, the 0.7 GPM ECO 8 (8kW) is at the high end of the range, at $74! But that means nothing - the range is $72 - $74 (< 3% difference) and the cost is low compared to the larger models because for 0 - 1.7 GPM the usage is 615 kWh, just about 1/4 of the larger models, because it is calculated for heating ~ 1/4 as much water as the larger models.
Similar things happen with natural gas/propane. But since we never see "how many gallons, how much temperature rise", it is impossible to directly compare gas and electric from EnergyGuide ratings, only by doing the BTU calculations as you already did. I picked a natural gas heater rated at 3.7 GPM and it is lumped into a 2.8 - 4 GPM natural gas group with a total of $149 and a range from $130 to $151. The range is a bit larger than with electric because no gas appliances are 100% efficient, and the actual efficiency (90%, 95%, etc.) varies by make/model.
Back to the original question. I tried finding electric comparable to the sample gas. Not so easy. The EnergyGuide GPM ratings on electric tend to be way below the manufacturer's advertised GPM, presumably due to different measurements (temperature rise). And the large ones I checked (e.g., 36 kW - needs a lot of power) don't have EnergyGuide ratings, at least not in the Home Depot web site. I suspect (but have not researched this) that EnergyGuide ratings may max. out at a certain level deliberately on the basis that a certain size is not energy efficient simply based on the peak demand required. (Peak demand is a big issue in the electricity business.) On the gas side? Even harder to figure out. A $206/year "propane 2.6 GPM" group. A $237/year "natural gas 0.8 - 6.0". Plus those last two had nearly identical energy (182 Therms vs. 184 Therms) but different per-Therm costs.
It isn't this simple to calculate for HVAC, washing machines, refrigerators, etc. But for straight resistance heating (tankless electric, by its nature, can't make good use of heat pump technology) and straight combustion heating (propane or natural gas), figure out BTUs out (amount of water x temperature rise) and combustion efficiency (or 100% for electric) to get BTUs in, then calculate how much fuel or electricity and you have your cost.
And if it is all equal (or close), consider the critical issue of electric demand. Many commercial and industrial customers pay demand charges, most residential do not. But that could change.
Comment: I note that the GPM ratings of the electric TWHs are _much_ lower than those for the gas ones. Probably, as you mentioned, because heating that much water with electricity will produce local brownouts, so it's, erm... not recommended. ;)
Answer: Man, are you guys overthinking this or what?   it all depends upon whats more expensive, electric or nat gas or propane.  BUT and here is the big BUT if you have regular power outages there's no way you can power a electric, on-demand WH with a generator, whereas a gas fired on-demand WH  needs very little power, leaving other generator capacity for the rest of the house.      I've said this many times before but I think electric, ondemand WHs make no sense, we can hardly keep the lights on now and when more and more things go all electric it will get even harder.  IMHO just go with a tank type WH.
Comment: Agreed! The electric grid can't keep up with current demand, everybody wants more production, but NIMBY! Unfortunately, this is a comment, not an answer. ;)


nginx location proxy_pass of URL

Question: In my nginx configuration I want to proxy_pass the following URL
Origin URL:
http://188.8.131.52:8080/SOME-SERVICE/sub-path

Proxied Path:
http://22.214.171.124:1234/SOME-SERVICE/sub-path

The SOME-SERVICE value will have different values like:
http://18.104.22.168:8080/user-service/sub-path
http://188.8.131.52:8080/auth-service/sub-path

How should I write location path pattern to match the generic SOME-SERVICE value and proxy the URL with this value?
Thanks
Answer: Try this:
location /*-service/ { // your stuff goes here }

Or, if you have a list of service-names
location /(user|auth)-service/ { // your stuff goes here }

Comment: The **SOME-SERVICE** does not follow a specific naming pattern and I don't know the list of services in advance ...
Comment: Do you simply want to allow all requests to go through?

nginx location proxy_pass of URL


How to fix CORS error on localhost when connecting to a local Appwrite from a local React app?

Question: I'm using the web SDK for Appwrite in a React app:
const client = new Client()
    .setEndpoint(import.meta.env.URL)
    .setProject(import.meta.env.PROJECT_ID)

  const account = new Account(client);

  const promise = account.create(ID.unique(),
    "firstname.lastname@example.com",
    "somepassword");

  promise.then(
    function (response: any) {
      console.log(response);
    },
    function (error: any) {
      console.log(error);
    }
  );

In the Appwrite GUI I have configured a Web App platform with localhost domain.
My React app works on localhost.

The endpoint name and project name match data from Appwrite
dashboard.
App is started on http, the API is also set up on http.
I've indicated localhost as a place where the API calls will come
from
The app is under http://localhost:5173/ and API on
http://localhost:8455.

In the console I get an error:
POST http://localhost:8455/account net::ERR_FAILED 404 (Not Found)
Access to XMLHttpRequest at 'http://localhost:8455/account' from origin 'http://localhost:5173'
has been blocked by CORS policy:
No 'Access-Control-Allow-Origin' header is present on the requested resource.

How to fix that error?
Comment: Did you set backend CORS?
Comment: The port numbers have to match also, or else the server has to set CORS headers for the client host/port.
Answer: It doesn't look like the URL is correct. Ensure the endpoint includes the /v1 like http://localhost:8455/v1.
Answer: First of all you have to install the cors package in your backend folder as:
npm install cors

and then you have to set the variables as:
var cors = require('cors')
app.use(cors())

then you maynot face this problem. This may help you
Comment: He is talking about AppWrite. It'a serverless service.


How can I diagnose a water heater leaking through TP valve?

Question: My natural gas water heater leaks about 1/2 gallon of hot water through my TP valve every day. This started about a month ago. Last week I replaced the TP valve with one that had identical specs as the old one, and it still leaks. There is a thermal expansion tank installed just above the heater.
The replacement valve I installed is CashAcme 23577-0150. The valve indicates "500,000 BTU/hr (ASME) Max Heater Input" and the water heater plate indicates 750,000 BTU/hour so maybe I just need a higher-rated TP valve, but I want to make sure that I am understanding the ratings correctly before I try a valve that is rated differently than the one I took off originally. The new valve also says 105,000 BTU.
While I was replacing the TP valve and had the heater off and water disconnected, I tried to drain the heater using the drain valve at the bottom of the heater. I had a difficult time getting water to come out the drain. Perhaps the heater has accumulated some sediment and that is preventing the drain from working. The plate on the water heater indicates it is 18 years old. Perhaps this is reason enough to replace the heater.
I turned the water temperature down slightly and it didn't seem to make much difference. The temperature of the hot water at the faucet does feel less hot, but I didn't measure it with a thermometer. If I have installed the correct valve, my guess would be that the thermostat that controls the temperature may be faulty or not working properly. The unit has a "digital" style control with lights that indicate the desired temperature. Perhaps the problem is with the electronics or perhaps it may be with the temperature sensor/sending unit.
I am very confident in my ability to just replace the water heater, but obviously cost and time are a concern. How long should water heaters last? What steps can be taken to diagnose the issue? Are replacement parts typically easily available that would fix this problem? Should I just give up and replace the water heater at this point?
Answer: The most common reason for a T/P to operate is excess pressure, which can happen with an expansion tank if the expansion tank has gone bad (or if it's too small, but that is less common, especially for "used to work.") It can also be because you have a PRV (pressure reducing valve - regulator) that's not working or adjusted right and is allowing overall pressure to be too high.
A crude test of the tank is to see if water comes out the air valve on the expansion tank, which indicates a failed bladder. Slightly less crude test is to depressurize the water side of the system and see if there's air pressure in the tank bladder, as there should be.
A pressure gauge is required to diagnose an operating pressure relief properly. Preferably one with an indicator of maximum pressure reached since last reset, so you don't have to sit there and watch the thing, or have a camera do that for you (modern method.) With absolutely no effort at seeing if a better deal could be had I found one for under $12 (plus shipping, so...) on a very quick look.
An 18 year old water heater is old, to be sure, and you might want to replace it for that reason, but the age of the heater (and the crud on the bottom from not draining it regularly) almost surely is not why the T/P is operating, IMHO. If it's located where the inevitable leak indicating that the time has come won't be a big deal (I see a lack of drain pan, but it also looks like bare concrete) then I would not rush to replace it, but I might shop occasionally to have an idea of what you'd do when you found it leaking, without panic-buying something, at least.
Comment: Replace the sacrificial anode while you are at it.
Comment: Usually when you buy a water heater, the manufacturer will have a stated "guaranteed" service life  e.g. 10, 20, 25 years and will charge accordingly.  These are based on the thickness of the tank lining and the expected service wear.   I have been fortunate to exceed them by many years, but once past the stated time, anything can happen.  This number will not be on the spec label, but may be elsewhere on the jacket.
Comment: It's widely reported that the only actual difference is the amount of the price you pay that goes to the paying their insurance policy on the ones that don't make it that far and have to have warranty payouts.


connection_config deprecated warning with RSpec after migrating to Rails 6.1

Question: I upgraded an app to Rails 6.1.0 (from 220.127.116.11, by creating a new api-only app, adding RSpec, then copying needed files over manually).
I am seeing the following warning when I run RSpec:
DEPRECATION WARNING: connection_config is deprecated and will be removed from Rails 6.2 (Use
connection_db_config instead) (called from <top (required)> at
[...app/models/application_record.rb:1].

I did not change the ApplicationRecord class from the default:
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end

I only see this warning when I run RSpec. I have not seen it in the rails console or in the Rails server log.
Here is my config/database.yml:
default: &default
  adapter: postgresql
  encoding: unicode
  host: <%= ENV.fetch('DATABASE_HOST', 'localhost') %>
  username: <%= ENV.fetch('POSTGRES_USER', 'postgres') %>
  password: <%= ENV.fetch('POSTGRES_PASSWORD', '') %>
  database: <%= ENV.fetch('POSTGRES_DB', 'myapp_development') %>
  pool: 5
  timeout: 5000

development:
  <<: *default

test:
  <<: *default
database: myapp_test

production:
  <<: *default

Any suggestions on how to get rid of this?
Comment: I got same situation but warning path was pointing  to `devise_auth_token`. That gem is using deprecated `connection_config` instead of `connection_db_config`. When I replaced manually deprecated line in gem file - warning went away.

I searched in rspec for place where `connection_config` is used but I found nothing. Are you using any other gems ?
Comment: Thanks for the suggestion @jakubm. See my answer.
Comment: Yeah, I am also using `money-rails` but nothing was pointing to it.
Answer: After further debugging I was able to trace it to the money-rails gem.
https://github.com/RubyMoney/money-rails/issues/601
Comment: I was seeing this in both money-rails AND honeybadger (v4.5), upgrading both has fixed it.
Morale of the story is to have a look at your rspec logs, they should highlight which line/gem is causing the issues.
Thanks Mark!
Comment: adding `ActiveRecord.legacy_connection_handling = false` in `application.rb` removed the warning.
Answer: The root fix for me:
From
ActiveRecord::Base.connection_config.to_h.deep_dup
To
ActiveRecord::Base.connection_db_config.configuration_hash.deep_dup


Deus Ex Human Revolution - loading is not ending

Question: I am having a problem with Deus Ex: Human Revolution, I have been playing without any problems, but after a couple of weeks I began experiencing issues with the game getting stuck on loading screens.
After exiting or after dieing, the game is getting stuck on a loading screen. I am able to continue playing the game only after clicking 'Load Previous Auto-Save'.
I have checked on Google for other people experiencing this issue, but didn't find anything.
Answer: Is your pc set to run at full performance. Mine did the same until I increased its performance in the control panel. Unlike you, though, I could not load previous saves.
How long have you waited on the loading screen? My machine usually takes 7 minutes to load.
Comment: I didn't install Update for the game. After installing the update problem was disappeared.


What computer vision library should I use for 3D mapping?

Question: Numerous 3D mapping applications were researched and implemented in MAVs. I would like to know what library is used to be able to map an indoor environment in 3D? Is PCL enough?
Answer: One proposal would be to try out the kinfu_app of PCL.
See the documentation with explanation here


I'm Making Drop Down Menu, But It Shows Vertically Incorrectly

Question: I found a video that explains how to create drop down menu, as the headlines should appear horizontally and sublines should appear vertically, with me the head & sub lines shows vertically! I checked the code many times, but I can't find where is the problem in the code!
I'm beginner to HTML5 & CSS.

#headlist ul {
  margin: 0px;
  padding: 0px;
  list-style: none;
  font-family: Roboto Light;
}

#headlist ul li {
  float: left;
  width: 1225px;
  height: 70px;
  background-color: #303030;
  line-height: 70px;
  text-align: center;
  font-size: 30px;
  position: relative;
  bottom: 15px;
}

#headlist ul li a {
  text-decoration: none;
  color: white;
  display: block;
}

#headlist ul li a:hover {
  background-color: green;
}

#headlist ul li ul li {
  display: none;
}

#headlist ul li:hover ul li {
  display: block;

        About

Who We Are?

Key People

        Divisions

ExtenzaLife

Ludic Science

Fleming-Monroe

Massive Logistic

Massive Energetic

Teleportation Center

        Massive Dynamic Foundation

WELCOME TO

  M A S S I V E
D Y N A M I C

"What do we do? What don't we do!"

the project content I inspired it from Fringe series.
Comment: what exactly is your question? Sorry but I can't quite clearly understand...
Comment: I'm not clear on what you're expecting to happen. What's a headline in your code? Maybe About, Divisions, Massive Dynamic Foundation? And the "sublines" are the links in the unordered list within those list items? Note that the selector `#headlist ul` is going to apply to all `ul` elements that are descendants of `#headlst`, at *any* depth...
Answer: Several issues with the original code...
Whenever you have a nested ul li structure like this (very common for menus), you must make sure that the CSS is specific enough to target the top level (main menu) and the child menus (dropdowns) separately. Your CSS was unintentionally targeting both, example:
#headlist ul li

This selector is targeting ALL the li elements in your menu when I believe you only wanted to target the top level items. To fix you can use the immediate child selector ">" like this:
#headlist > ul > li

This is targeting only li elements that are immediately inside of ul elements that are immediately inside of the #headlist element (the top menu items only).
Once you are clearly targeting the top level menu items and the drop down items with different CSS, you can achieve the desired layout more easily. I removed the float and styled the top level menu items like this:
#headlist > ul {
  display: flex;
}
#headlist > ul > li {
  position: relative;
  flex: 1 0 auto;
}

The top level menu becomes a flexbox container allowing the contained li elements to flow in a horizontal row. The flex rule on the li items allows them to grow to fill the available space.
The only other main change is I am using absolute positioning on the dropdowns which requires position: relative on the top level lis.
Not perfect but I hope this will help you get going in the right direction.

#headlist ul {
  margin: 0px;
  padding: 0px;
  list-style: none;
  font-family: Roboto Light;
}

#headlist > ul {
  display: flex;
}
#headlist > ul > li {
  position: relative;
  flex: 1 0 auto;
}

#headlist ul li {
  height: 70px;
  background-color: #303030;
  line-height: 70px;
  text-align: center;
  font-size: 30px;
  position: relative;
  bottom: 15px;
}

#headlist ul li a {
  text-decoration: none;
  color: white;
  display: block;
}

#headlist ul li a:hover {
  background-color: green;
}

#headlist > ul > li ul {
  display: none;
  position: absolute;
  min-width: 250px;
  top: 100%;
  left: 0;
}

#headlist > ul > li:hover ul {
  display: block;
}

        About

Who We Are?

Key People

        Divisions

ExtenzaLife

Ludic Science

Fleming-Monroe

Massive Logistic

Massive Energetic

Teleportation Center

        Massive Dynamic Foundation

WELCOME TO

  M A S S I V E
D Y N A M I C

"What do we do? What don't we do!"


Replacing bathroom light fixture, no junction box

Question: First time homeowner and newbie DIY-er here.
I'm replacing the light fixture in our bathroom and there's no junction box behind the wall, but I think I'm seeing insulation in there too.
There's a stud directly to the left of the circular hole (where the previous fixture had two screws into the stud, and two screws into the drywall).
Do I need to put a junction box in there?  It seems unsafe not to.
Comment: More: https://diy.stackexchange.com/questions/154803/old-work-box-for-vanity-light The point is that you probably should retrofit a box, but it's not necessary in all cases.
Comment: Gotcha, thanks. I'll try to find a box that fits.
Comment: @isherwood I saw that post, it's similar, but I don't think it's completely applicable to mine. But maybe I'm too much of a beginner to know the difference.
Comment: The answers on that question don't mention it, but it is legal to use the fixture housing as a junction box if it's suitable. You'd need a strain relief device at the entry point. In many years as a home builder this was commonly done.
Comment: Here's another: https://diy.stackexchange.com/questions/141398/bathroom-light-fixture-with-no-stud-or-box
Comment: @isherwood that's sort of what I thought.  The new fixture I bought doesn't have a big enough housing for all the wires, I don't think, so I'll have to push back
Comment: If you don't end up finding a suitable box or bracing method most home supply stores would let you exchange for a light with a larger housing, although an offset mount can still be a challenge.
Answer: The big unknown is the state of the wiring behind the drywall. If it is in conduit (unlikely) then you are in better shape because you can run new wires if you need to. More likely is that this is a cable. If there is enough loose cable inside the wall that you can actually have cable (i.e., outer-sheath still attached) pull through the hole in the drywall, then you can either use a surface-mount box or use a fixture that has a box built into it - i.e., pull the cable all the way into the fixture.
However, if the cable (outer sheath) ends behind the drywall with no extra length available, then you have to cut into the wall and install a box. If the cable (outer sheath) ends too far behind the wall to get it into a box at this location then you have bigger problems.
Assuming the cable sheath ends within a few inches of the wall, you should be able to cut a hole to match a box and install a box. The left edge should be at the stud - mount the box to the stud. The cable will need to go into the box so that the outer sheath fits through a proper clamp. On plastic boxes these are usually part of the box. On metal boxes these are additional (they don't cost much, they just aren't included because a metal box used with conduit will not need them, plus sometimes you need more than one, depending on how you are using the box).
Comment: Very helpful, thank you!


Is it possible to set tbl-colwidth property in Quarto document for LaTeX output on per table basis?

Question: I am creating a Quarto document in R. The output is a LaTeX document (document class: scrbook). The problem I am facing is that I have some tables in the document, which has long content in the first column of the table. Because of that, the contents of the first and second columns overlap. This happens even when I keep the tbl-colwidth property to "auto".
To avoid this, I set tbl-colwidth:[20,80], which means first column would occupy 20% of the width of the page, and the 80% width would be occupied by the second column. But in this setting, there is a large gap between the two columns in most of the pages.
So, I want to know if it is possible to set the tbl-colwidth attribute on per table basis. For most of the tables, I would like to set the tbl-colwidth: auto. But only for the troublesome tables, I would like to change the tbl-colwidth manually to something like [30,70].
For example of such a table, look at this web page. On this page, there is a table under the title "Hypothesis". In this table's first column, one row has the value "enableExperimentalNewNoteButton", which is quite wide. For this kind of table, I would like to set tbl-colwidth:[30,70], or any other values needed. But for other tables, I would like to keep the tbl-colwidth: auto. Is this possible to do?
The YAML code for this document is as follows:
<code>---
title: "PDF Example"
subtitle: "Example of PDF Settings in Quarto"
author: Eva
date: today
date-format: DD/MM/YYYY
format:
  pdf:
    documentclass: scrbook
    tbl-colwidths: [20,80]
    df-print: paged
    keep-tex: true
execute:
  echo: false
  warning: false
  message: false
  error: false
editor: visual
---
</code>
Comment: Could you please provide a minimal working example?
Comment: Have you tried `tbl-colwidths` as chunk option for specific tables?
Comment: And please provide a complete example! Your given code has no tables to test on!
Comment: @shafee I never knew that it can be used as chunk option. I think it's only a global setting in YAML. Can it be done at chunk level using #| tbl-colwidth: [30,70]?
Comment: Well again, I am not sure unless you are providing me with enough code or you can test yourself!
Answer: It is possible to change tbl column width manually and have a global option as a default, e.g.
<code>---
title: "PDF Example"
format:
  pdf:
    documentclass: scrbook
    tbl-colwidths: [80,20]
---

| text  | number  |
|--------|--------|
| `r stringi::stri_rand_lipsum(1)`  | 555   |

: Global tbl colwidths

| text  | number  |
|--------|--------|
| `r stringi::stri_rand_lipsum(1)` | 666   |

: Manually changed {tbl-colwidths="[50,50]"}
</code>


mysql select distinct *

Question: I'd rather post an image here, but it says that I don't have enough reputation to do it.
I tried to find something similar to my question, but there are to much "distinct" and "group by" to find something useful... "distinct *" in search gives the same, as "distinct"..
Here is link to xlsx-file with table with source example data and table with desired result
Source example data - is a simplified result of some complex query.

The question is here:
I'd like to apply to this result of select some grouping, which gives query "select distinct * from table_below".
But, this variant is not very good for performance reason. My original non-simplified table has about 4000 rows, and 10 columns. So, "select distinct *" takes 20 sec to give needed result.
To be clear, I want to make grouping by 4-th column, but within every "column_id", as shown in xlsx attached file.
Thanks in advance
Comment: I would suggest that it is a good idea to include 4-5 rows of sample data in your question, instead of providing download links.
Comment: FYI: `SELECT DISTINCT *` generally does nothing different than `SELECT *` because you most likely have a primary key.
Comment: No, it has not one. You could see it, if you've opened attached file )

I added an index for first column, so performance is good now ( < 1 sec ). But I assume, there must be some more flexible or just other solutions? ...
Answer: It is better to write out the coloumn names. Could you try this?
<code>SELECT DISTINCT coming_id, spare_id ,spare_sum, product_id
FROM Table
Order by coming_id, spare_id, product_id
</code>

mysql select distinct *


Looping through a variable which contains []

Question: I am trying to create a PHP function that will echo info from a db. My col names look like banana[1], banana[2], apple[1], apple[2], apple[3], and so on.
The function will select the fruit
function fruits($fruit){

}

and then within that function I'll loop through the fruits.
How do I echo these?
echo $fruit[$i];

obviously doesn't work.
Pretty basic, but I can't figure out. Concatenation kills me.
function ponctuation($section,$sect){

switch($section){
    case 'apple':
        $i=1;
    break;
    case 'banana':
        $i=13;
    break;
}

global $mysql_tablename;
global $FName;
global $Lname;

if(isset($mysql_tablename)){
$result = mysql_query("SELECT * FROM $mysql_tablename WHERE FName='$FName' AND Lname='$Lname'");
    $row = mysql_fetch_array($result);

echo '<form method="post" action="ponctuation.php?'.${$section.$sect}.'_valider">';
echo '
';
$query = mysql_query("SELECT * FROM `ponct_enonces` WHERE `section`='$section' AND `sect`='$sect'");
while($row_q = mysql_fetch_assoc($query)) {
    if($row_q['enon']==0 && $row_q['senon']==0){
        echo '
'.$row_q['enonce'].'
';
    }
    if($row_q['enon']==1){
            echo '
'.$row_q['enonce'].'
';
            echo '<textarea rows="3" cols="100" name="'.$i.'" wrap="physical">' . $row[$section[$i]] . '</textarea>';
    }
    if($row_q['senon']==1){
            echo '
'.$row_q['enonce'].'
';
            echo '<textarea rows="3" cols="100" name="'.$i.'" wrap="physical">' . $row[$section]. '</textarea>';
    }
    $i++;
    }
echo '
';
echo '<input type="submit" name="submit" value="Valider"/>';
echo '</form>';
}

}
The code is a little ugly, and some vars have French names, other have English names.
Comment: What's wrong with `echo $fruit[$i]`?
Comment: Don't hav enough information to help you.  Maybe posting the code fragment where you say you're looping the fruits array may help.
Comment: Did you mean `$row['banana[1]']=blabla...`, `$row['banana[2]']=blabla..`? If so, just do `foreach($row as $fruit) echo $fruit;`
Answer: col names won't be expanded into PHP array structures for you, e.g.
SELECT fruit[1], fruit[2], ...., fruit[100]

will give you the equivalent of
$row = array(
   'fruit[1]' => someval,
   'fruit[2]' => someval,
   ...
);

if you want to iterate those, you'll have to get ugly:
$fruit = array();
for ($i = 0; $i <= 100; $i++) {
    $fruit[$i] = $row['fruit[' . $i . ']'];
}

which begs the question of... why? This is a horrible data structure to be using. Properly normalizing it into a 'fruit attributes' sub-table would save you this trouble, and also allow you to have n attributes, rather than the fixed 1..100 range or whatever it is you have.
Comment: So if I don't want to get ugly, how should I call my cols?
Comment: Do some [normalization](http://en.wikipedia.org/wiki/Database_normalization) on it
Comment: I'm sorry... normalization? Still pretty new to PHP.
Comment: Should I call them apple1, apple2 instead? That's what I first did, but then I was told to call them apple[1] and so on, that it would be easier to handle.
Comment: database concept. follow the link and do some reading. doesn't have anything to do with php, other than you're using php to talk to a database.
Comment: `apple[1]` would work in an html form with php, creating an array in $_POST or $_GET for you. but in a database, it's a whole different ball game.
Comment: I'll do the reading, thanks :)

What if I want to set apple[1] as the value of a form input?

echo '' . $row[$fruit[$i]] . '';

This is what I have so far, and it's not working. (I'm looping through $i.)
Answer: If you're attempting to loop over all the columns in a row, you can use fetch_array:
$result = $mysqli->query($query);
$row = $result->fetch_array();

// loop over columns
for ($i = 0, $count = count($row); $i < $count; $i++)
    echo $row[$i];

That way, you won't have to worry about the column names. I might be misunderstanding your question, though.
Comment: Why call `count()` for every iteration ?
Comment: @Zaffy - Well, to be fair, a row with five columns wouldn't be a huge performance hit (unless it's fetching many rows, that is). But you're right, I should (and did) optimize it.


case in oracle procedure

Question: Is the usage of CASE wrong in the code below?
I am getting an error:

"PLS-00103: Encountered the symbol ";" when expecting one of the
  following:
case The symbol "case" was substituted for ";" to continue. "

Code is :
create or replace PROCEDURE MIK_3PL_ITEM_ERRORS_PROC_1 IS
  i_error_code varchar2(5);
  i_desc       varchar2(200);
  CURSOR c_3pl_error IS
    SELECT mie.client_item_id, mie.message_id,
           mie.error_desc, mis.process_flag
      FROM mik_3pl_item_error_etl mie,
           dummy_staging mis
     WHERE mie.client_item_id = mis.client_item_id
       AND mie.message_id = mis.message_id;
BEGIN
  dbms_output.put_line ('hello');
  for i in c_3pl_error
  loop
    dbms_output.put_line ('in loop');
    DECLARE
      -- L_relations_exist VARCHAR2(1);
      L_error_message   VARCHAR2(255) := NULL;
      L_return          BOOLEAN       := FALSE;
    BEGIN
      select error_code
        into i_error_code
        from mik_3pl_error_desc
       where description = i.error_desc;
      -- dbms_output.put_line(i_error_code);
      CASE i_error_code
         WHEN  'E2'  THEN dbms_output.put_line ('in case');
      END;  -- end of CASE */
    END; /*End of begin */
  end loop;
END MIK_3PL_ITEM_ERRORS_PROC_1;

Comment: This question appears to be off-topic because it is about syntactic error.
Comment: You should end `case` statement with `end case;` not just `end;` alone.
Answer: It needs to be:
    ...
      CASE i_error_code
         WHEN  'E2'  THEN dbms_output.put_line ('in case');
      END CASE;  -- end of CASE */
    END;

It's trying to treat the END; as the end of the block - matching that END with the BEGIN - and it knows the case is still open.
The documentation for the CASE statement shows that. (Not to be confused with a CASE expression, which does just have END. Ahem. Thank you Nicholas!)
Comment: aah ! syntactic error indeed! my bad. Thanks Alex and Nicholas

case in oracle procedure


Ubuntu 14.04.1 hangs every minute

Question: Every minute I get a second or so of minor lag.  So far I know the following:

It happens every minute around :00 seconds
It only affects video, not audio
I get a spike of iowait and disk write every time it happens
Using iotop, the culprit appears to be nautilus
There are no jobs in /etc/cron.d/ set to go every minute
Nautilus does not have to have a window open for this to happen

I have a Dell Studio 1558 with an Intel i3 330M (Ironlake) and integrated Intel HD Graphics.  I'm using whatever driver is included in Ubuntu by default, specifically i915 according to lspci -k.
I am not absolutely certain that that problem is nautilus, but I don't know where to go from here.  Any answers or further debugging suggestions would be greatly appreciated.
P.S. Although my question seems to be a duplicate of this question, no answers were ever given in that thread, and the asker closed it because updating to 13.10 fixed the problem for him/her.
Comment: I think it is your graphic driver issue. Try to find some drivers for linux and let me know. What is your lappy by the way?
Comment: Thanks for the reply, I edited the original post with hardware information.  However, according to launchpad, the "xserver-xorg-video-intel" package hasn't been changed for Trusty since February, and I think that's the one that has my driver?
Answer: I have variety installed, which is a wallpaper switcher. One of the options in the preferences was to have a large digital clock in the lower right corner of the desktop. Disabling this feature fixed my problem.
The iowait I was getting every minute must have been variety opening the wallpaper file and writing the new clock to it. The reason iowait showed the culprit to be nautilus is because nautilus manages the desktop and wallpaper in Ubuntu.

Ubuntu 14.04.1 hangs every minute


Does the Sensor Tower sense cloaked units?

Question: If I see my opponent has a Sensor Tower up, is it still safe to attack with Dark Templar or cloaked Banshees?  Will he see them coming on the minimap?
What about burrowed Roaches?  Will the Sensor Tower still sense those even if it can't sense cloaked units?
I understand that the Sensor Tower is not a detector and will not give vision of the units.  I am inquiring as to whether it will alert the player to the PRESENCE of them, even if you still can't target them without an additional source of detection.
Answer: The radar ability of the sensor tower will not detect cloaked or burrowed units, regardless of whether they are within the fog of war.
Picture:
Editor View:
Comment: I thought they did, but that was a painful mistake...
Comment: Wow... then what is the point of sensor towers? They don't seem that useful to me.
Comment: They give you a heads up regarding air drops and army movements.
Answer: Sensor towers are not detectors so no they will not see them.  For the purposes of detection burrow is identical to cloak.
Comment: Not sure why this was downvoted, it is correct. [This page](http://starcraft.wikia.com/wiki/Sensor_tower/Development#cite_note-CydraSensor-6) quotes a Blizzard Battle.net thread: "Do cloaked and burrowed units appear as blips within the radar's range?" "No. Cloaked and burrowed units don't appear." It was a detector at various times during beta but the ability was removed.


Could not import Xamarin.ObjcBinding.CSharp.targets

Question: I have unistall and installed Xamarin Studio on same Mac computer (because a have some problem with mono). Now all work properly except a project that bind a ObjectC library (previously that works fine). That is the error:

MyBindingProject.csproj could not import "$(MSBuildExtensionsPath)\Xamarin\Xamarin.ObjcBinding.CSharp.targets"

There is no file Xamarin.ObjcBinding.CSharp.targets on that path. I have tried also to recreate a new iOS Binding Project but that doesn't solve it. How could i solve?

=== Xamarin Studio ===
Version 4.0.10 (build 5)
Runtime:  Mono 3.2.0 ((no/7c7fcc7)
=== Apple Developer Tools ===
Xcode 5.0.2 (3335.32) Build 5A3005
=== Xamarin.Mac ===
Xamarin.Mac: Not Installed
=== Xamarin.iOS ===
Version: 188.8.131.52 (Business Edition) Branch:  Build date: 2013-11-11
  16:04:00-0500
=== Xamarin.Android ===
Version: 4.8.0 (Business Edition)
=== Operating System ===
Mac OS X 10.8.5
Answer: I have reinstalled just Xamarin.iOS and problem it's solved
Answer: I had a half-baked copy paste install, and had this same error with Xamarin iOS 10.x (shortly to be replaced by Visual Studio for Mac). I went to the "Check for updates" and switched from the stable channel to Alpha to properly reload the Xamarin iOS.


Corroded wiring casing in basement - cause?

Question: I just had our annual furnace tune-up and the guy who performed the inspection gave us a B tag violation because the electrical supply wire to our gas furnace is corroded and copper wiring is exposed.  I am going to contact the company who installed it to look at fixing ASAP but the technician who found the issue said he has never seen it before and can't say what caused it.
The furnace is located in our basement near the foundation wall, and being an older house, there is some dampness/potential leaking happening (will have to wait for our first spring before we know the full extent) so my first guess would have been water damage, but could it have damaged the wiring this badly? And what is that white crusty stuff?
Furnace installed and all the electrical was redone in 2017 when previous owner flipped the house.
I am just wondering if anyone has seen something like this before and can confirm the cause, and if it's something I should be worried about reoccurring after the wire is replaced.
Comment: Do you have a water softener nearby?  If so, when you fill the salt tank you generate salt dust.  In a high-humidity environment like a basement near a foundation wall that is a surefire combo for corrosion.
Comment: I have seen BX and MC corroded that it is so localized I would guess MC that a caustic like drain-0 or some other chemical was spilled on it. Usually when BX is in bad shape there is rust.
Comment: My guess would be extreme heat on the conduit and some moisture
Comment: Is that armor magnetic? (Try putting a fridge magnet to it)
Comment: "all the electrical was redone in 2017 when previous owner flipped the house" How do you know that for sure. That sounds like something a flipper says but doesn't typically do.
Comment: Was there _any_ inspection done on the house of the work that the flipper did, or was there a pre-sale inspection? This should have certainly been caught by either of those!
Comment: - I held up a fridge magnet to the metal casing on the wire in multiple spots and it doesn't seem to be magnetic
- Yes we do actually have a softener nearby. The wire runs all the way from the electrical panel over to the furnace via the ceiling and no other spot has corrosion except right behind the furnace
- Yes we have two inspection reports, one from right after it was flipped and one from when we bought it this March. Neither mentions any issues with the furnace or electric
- I'm pretty sure the 2017 electrical claim is legit, as per the two inspections and the panel looks very new
Comment: Lots of great info to go on, thanks all!
Answer: 2017 - probably MC-Lite (aluminum armor) which you could verify by magnet, but the fact that the corrosion is primarily white leans heavily that way.
Given that much corrosion in 3 years, I'd suspect that it's getting something like acidic condensate from the furnace flue (or condensate drain) dripped or splashed on it, or there's water softener salt/brine getting onto it.
A third possibility would be if there was any concrete work associated with the "flipping" and concrete/cement got onto the cable and was not removed - concrete and aluminum are highly incompatible.
Aside from correcting whatever is contaminating the cable, or if you can't figure out what that is, this might be a place where liquidtight conduit and THWN would be a better bet than MC-Lite.


Water coming in BELOW sump pit inlet pipe! Is this normal?

Question: So, we live in a new house (moved in a year and a half ago as soon as the build was finished). We moved in during the dead of a Canadian winter. Even still, my sump pit would fill and pump put quite frequently. I knew the water table here was high, so not incredibly surprising. After about a month, we got a permit to route our sump to the sanitary floor drain which was great; didn't have to worry about recycling water and creating a "fountain" effect.
Fast forward a year and a half and here's the problem I'm facing. Although this past winter I noticed our pit didn't fill nearly as much (chalk it up to water table changing and grading around the house actually being completed?), it has started filling like crazy over the past few days (mid-April) as the weather has suddenly warmed and we're dealing with lots of snow melt. There's no water resting directly against the house, but our whole area has a lot of pooling water. There are even little sloughs created across the alley past our backyard. So I feel like it's inevitable that this rapid snow melt will affect the water table. Here's the problem though—as my pit is filling, the water is coming in EXCLUSIVELY through a tiny gap between the bottom of the ABS pipe and the hole cut in wall of the sump basin that receives the inlet pipe. So the pipe itself seems to suddenly not be bringing water in; rather, water is coming in through a relief point through a crack between the inlet pipe and the basin wall (as it is not sealed all too well at all.)
I've called around and a lot of people seem to think it's normal. They say that as the water underneath the slab gets higher/more saturated, the water is simply finding a relief point and is making its way through that crack. (Note that this isn't a permeable/perforated pit; a solid pit with only the inlet and discharge pipes coming in/out.)
This makes some sense to me. However, I'm thrown off by how it seems like NO water is coming in through the inlet pipe anymore. Could it possibly have come detached under our slab? Most people I talk to seem to think not—they say the inlet pipe will be solid ABS pipe all the way to the outside of our foundation wall, after which point it will T off to perforated drain tile.
Anyway, let me know if this seems normal! I'm stressing over wondering if something underneath our slab is broken/detached and wondering if that's why water is coming in through this crack instead of the pipe.
Thanks.
Comment: You don't want to seal a house's bottom too well.  If you do, you know what you'll have?  A boat.  Then it becomes a numbers game: the weight of your house versus the weight of the water that wants to level the water table *through* your basement.  We're dealing with fairly large numbers that are likely to break something.
Comment: @Harper Right, I realize that, and that's what I'm concerned about. That's why I'm curious about if I should be adding another relief hole in the sump basin itself. It seems like with the large amount of water that's obviously under my slab, there should be more than just this small crack to allow water into my pit. Let me know what you think.
Answer: Apart from routing a sump pump for water around a foundation to a sanitary drain (no storm sewers where you live?), this sounds normal.
Usually, the perforated piping is just a supplement to the classic French drain design using rocks. The pipe is to ensure there is always a path with low resistance when the water table gets high enough. Otherwise, some water should still find its way through the rocks/soil when the water table is above the sump pit basin and below the bottom of the pipe.
Comment: Thanks very much. Any thoughts, though, as to why the inlet pipe wouldn't be bringing in any water at all? To clarify, are you saying that the water table happens to be in a "sweet spot" where it's high enough to get to that relief point in the pit but not high enough to reach the drain tile? Again, just wondering why I haven't seen this at all in the past 1.5 years, and now it's been nothing but this for a week. Thanks.
Comment: @MikeM, yeah, that's exactly it.  We have the same situation at our house.  Water entering the perimeter drain enters higher up.  There is gravel under your basement floor that can hold a lot of water as the water table rises.  It has an easy path to drain into the sump pit, and that happens before the water table reaches the perimeter drain.
Comment: @MikeM Where was the dump outputting water before? It sounds like it was probably just dumping it somewhere above ground nearby outside your home which just re-saturates the ground near your foundation and causes the pump to keep pumping it away (essentially what I believe you meant by your fountain effect comment). You also changed the grading around your foundation. WIth these updates, a significant reduction in water around your foundation is highly possible if the root cause was not an overall high water table.
Comment: It only discharged water around the house for the first week—when it was dead of winter and -30 degrees Celsius (-22 F). It was creating a thick slab of ice, and so that's why the city told us to re-route to the floor drain once we explained the issue. But yes, the grading around the house changed, and after that's point I noticed it filling significantly less. Everything you're saying makes sense, so I really hope you're right. It is just somewhat shocking that I'm only now seeing water come through this crack rather than the pipe after 1.5 years—but snow melt just began, so maybe that's why.
Comment: I just would love to see at least some water come through the pipe so I can have confidence something didn't detach or otherwise fail. But maybe all this snow melt is causing the table to hit this "sweet spot" between the drain tile and the relief point in the pit—and that's all there is to it. I sure hope so.
Comment: @statueeuphemism Also, I'm wondering why there isn't a dedicated hole in the sump pit for receiving water that is coming up under the slab? If there is so much water under there that isn't making its way all the way up to the drain tile, ought I add some other kind of relief hole w/filter fabric?
Comment: @MikeM The reason is diminishing returns on what your foundation drain and sump pit is intended to do. You could make a hole to the center of the earth and pump out all the water you encounter along the way, but it won't do any more to protect your foundation and it will waste electricity pumping out more water from more consistently saturated levels of the water table.


Front entry door replacement -- Do I need to need to replace the frame? How to handle trim from previous storm door

Question: I had a full glass non-vented storm door over my existing entry door for several years. Due to the heat build up, the entry door starting warping and peeling. I found out that the manufacturer strongly recommends either a vented storm door or no storm door at all since a non-vented storm door can cause the warping/peeling I'm seeing.
In response, I removed the full glass storm door since it was old and of poor quality anyway. We've then decided that we just want to replace the front door. We're looking to replace the front door with one of the same size. We've already found a model that appears to be exactly the same size as what we have now.

Do I really need to replace the entire frame, or can I just replace the slab?
If it's better to replace the door and frame, how would I go about doing that given what I have available in the pictures below? I have trim on my entryway with holes from the storm door removal. I cannot tell if I should be removing that metal trim and replacing it completely, or if the new entry door I purchase will come with trim to replace what I have now.

I'm trying to avoid hiring a contractor to do this work, but I'm not sure how involved or complex the work will need to be. I want the final outcome to be neat and clean, but the existing trim is giving me pause.
Comment: Is the door itself actually warped? If not, it might be a lot easier and cheaper to simply sand and refinish the existing door.
Comment: nothing to do with heat, just a bad pant job, probably no primer used. redo
Comment: Changing a door in an existing jamb isn't rocket science, but it's not trivial either. If you take your time and have sharp tools, it can be done well. Regarding the very outside cladding, one usually changes that -- try to find a gutter fabricator that'll make the pieces for you.
Comment: Appears to be and the same size, are two different things.  The door fits/attaches to the door frame, so the exact same size door should fit.  Trim is usually just to make it look nice.
Comment: The middle piece that frames the glass is already warped, so sanding and refinishing alone won't be enough. We're committed to getting a new door as we're tired of the existing door anyway. Does one usually replace the outside white trim as part of a door installation? If not, how do you handle the existing trim that has holes in it? Do you just replace that "capping" separately?
Answer: If you intend to reuse the jamb, here are some key measurements to check:
Opening size - width, height, depth of the jamb (or make sure you get a door that is the same thickness)
Door hinge spacing and size - if you get a door slab that is already routered out for hinges.
Door handle bore size and spacing so the handle and deadbolt strike in the same places as the existing door.
Also check the style of weatherstripping on the existing door jamb. Some older doors have the overlapping metal channel weatherstripping which is going to be less common.
If you order from a millwork shop/door shop, they should be able to advise you on whether a particular door slab will work. If you order from a big box store, you will probably be on your own as far as making sure things fit properly.
Regarding the trim on the outside, if it is a metal trim of some kind, it's unlikely to come with a new door slab, and would have to be ordered separately.
If you buy a whole new prehung door you would have to replace or reuse the interior trim and any trim on the exterior. Finding a door slab that will fit the existing opening would be the cheapest and simplest option, but may limit your choices.
Answer: If you're asking this, you probably don't want to take on replacing the front door frame and all.  Here is a DIY step-by-step on Family Handyman.  Keep in mind that write-ups like this always make things look easier than they are.  If you're redoing the door frame, you have to redo interior and exterior trim and flash everything properly so there are no water leaks.  It's tricky and probably not the best introduction to door installation.  If you screw up, you might end up with a rotted sill.
Replacing the door in the existing frame is still finicky but much less risky: if you screw up, you can just put the old door back.  Here is This Old House on youTube where they replace the slab.  (Again, they always make it look easy.  This is to give you an idea of what steps are involved.  Take with a grain of salt and your mileage may vary.  As recently came up, This Old House does occasionally cheat a little...)  In a nutshell, your new door will almost certainly not fit the old frame and you'll have to cut the edges to make it fit.  You'll also have to cut out mortises for the hinges, bore holes for the locks, etc.  But again, you can split this over multiple days because if you're not finished, you just put the old door back on the hinges.
The holes on the trim where the storm door was installed can be filled with putty.  This is a hack, but I installed mirror film on the inside of mine to reduce heat and it does help.  You can have it professionally done if you don't want a hack-job like mine.
Comment: I found my other offensive This Old House video: https://www.youtube.com/watch?v=4DYzcyQaNuc.


Shapes on coordinated question GCSE

Question: I am struggling with this question where I don't know how to use the coordinate of A and B on the square to work out the coordinate of D.
I found that it could be (2, -1) because of where the x and y coordinates are but It was incorrect.
Question:

Thank You and help is appreciated
How would I work the coordinated out?
Comment: Use that AD and AB are perpendicular and side lengths of a square are equal
Comment: i still dont understand
Answer: Hint:
look at the figure

and note that the triangles $AEB$, $BFD$, $DGC$,$CHA$ are equal.
Comment: how could I use knowing that the triangles are equal to work out coordinate of D
Comment: Using the fact that for $AEB$ you know $AE$ and $EB$.
Comment: how would I work out what cm AE AND EB are the sides
Comment: im really confused
Comment: is there another method to work out D
Comment: @aspaering this is a simpler approach. Using different lengths of sides of triangle like EB, AH, try to conclude about coordinates. A is 1 units left of B so D is 1 units down of A. So y coordinate of D is 3-1=2. Similarly A is 4 units above B so D is 4 units left of A. X coordinate of D is -2.
Comment: Emilio there's a discrepancy in your image and op.
Comment: @King Tut: Yes sorry, I' changed $C$ and $D$ but  this  does not change the method.
Comment: Obviously. My up votes are recharged.
Answer: Your answer is:

D(x,y) : Tell me when you have got somewhere, and I will edit it in.

Step 1: Find how you get from A to B with a vector
Step 2: Rotate AB $90^\circ$ clockwise
Step 3: Put this vector on $A$ to find $D$
Comment: Is vector AB (2                                                                                3)
Comment: @AspaeringStar7 nope
Comment: um is the vector (2 -2 )
Comment: No,  I meant BA.
Comment: is vector (2 -4)
Comment: or i the vector ( -2 4 )
Comment: actually how do I find the vector of a line with two coordinates
Comment: Please don't spam me with answers. This is the comments section; if you really want help that you would like constant contact with you should look at forums instead.
Comment: ok i got the vector  (1 2) after doing step two how o I do step 3
Comment: Just realised something was wrong. I've corrected it now.
Comment: do I times vector by 90 to rotate vector
Comment: please can you put the step by step solutions as I am getting confused if you can
Comment: ok using a method that line AB is perpendicular to line DC so I times the coordinates of AB and DC by -1 so the new coordinates are (-2,-3) and (-4,1) there fore coordinates D are (-2,1). Is that a valid method?

Shapes on coordinated question GCSE


GPT4All (2.0.0) Unable to instantiate model: code=129, Model format not supported

Question: enter image description here
when i use gpt4all==0.2.3 got error below
(.venv) PS D:\Projects\owngpt> python gpt.py
load INSTRUCTOR_Transformer
max_seq_length  512
loading indexes
loading indexes
Traceback (most recent call last):
File "D:\Projects\owngpt\gpt.py", line 29, in
llm = GPT4All(
File "D:\Projects\owngpt.venv\lib\site-packages\langchain\load\serializable.py", line 97, in init
super().init(**kwargs)
File "D:\Projects\owngpt.venv\lib\site-packages\pydantic\v1\main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for GPT4All
root
GPT4All.init() got an unexpected keyword argument 'device' (type=type_error)
when i use gpt4all==2.0.0 got error below
(.venv) PS D:\Projects\owngpt> python gpt.py
load INSTRUCTOR_Transformer
max_seq_length  512
loading indexes
gguf_init_from_file: invalid magic number 67676a74
gguf_init_from_file: invalid magic number 67676a74
gguf_init_from_file: invalid magic number 67676a74
Traceback (most recent call last):
File "D:\Projects\owngpt\gpt.py", line 23, in
llm = GPT4All(
File "D:\Projects\owngpt.venv\lib\site-packages\langchain\load\serializable.py", line 97, in init
super().init(**kwargs)
File "D:\Projects\owngpt.venv\lib\site-packages\pydantic\v1\main.py", line 341, in init
raise validation_error
pydantic.v1.error_wrappers.ValidationError: 1 validation error for GPT4All
root
Unable to instantiate model: code=129, Model format not supported (no matching implementation found) (type=value_error)
Comment: Did it work with the GGUF model format for `gpt4all v2`? gpt4all.io provides this model: `nous-hermes-llama2-13b.Q4_0.gguf`.
Answer: There was a problem with the model format in your code. gpt4all wanted the GGUF model format.
Below is the fixed code.
Dependencies:
pip install langchain faiss-cpu InstructorEmbedding torch sentence_transformers gpt4all

Fixed code:
from langchain.document_loaders import WebBaseLoader
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.embeddings.huggingface import HuggingFaceInstructEmbeddings
from langchain.vectorstores import FAISS
from langchain.chains import RetrievalQA
from langchain.llms import GPT4All

from langchain.globals import set_debug

set_debug(True)

# documents = TextLoader("data/text.txt").load()
documents = WebBaseLoader("https://leetcode.com/problem-list/top-interview-questions").load()
text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=64)

texts = text_splitter.split_documents(documents)

instructor_embeddings = HuggingFaceInstructEmbeddings(
  model_name="hkunlp/instructor-large",
  model_kwargs={"device": "cpu"}
)

vectorstore = FAISS.from_documents(texts, instructor_embeddings)

question = "Difficulty Problem names"
retriever = vectorstore.as_retriever(search_kwargs={"k": 1})
docs = retriever.get_relevant_documents(question)

print("Loading indices")

llm = GPT4All(
    model="nous-hermes-llama2-13b.Q4_0.gguf",
    max_tokens=2048,
    allow_download=True,
    backend="gptj",
    verbose=True,
)

qa_chain = RetrievalQA.from_chain_type(
  llm, retriever=vectorstore.as_retriever()
)

qa_chain(question)

Output is incorrect unfortunately.
load INSTRUCTOR_Transformer
max_seq_length  512
Loading indices
{'query': 'Difficulty Problem names',
 'result': ' The difficulty of the problem is indicated by a number between 1 and 5, with 1 being the easiest and 5 being the hardest. The problem name corresponds to its LeetCode URL slug, which can be found in the link that appears when you click on the problem title. For example, if you click on "Pick One" from the list of problems above, it will take you to this page: https://leetcode.com/problems/pick-one/. The difficulty level for "Pick One" is 2, which means it\'s a medium problem.'}


Why do Pedestrian Traffic Signals only play the audible crossing notification for only a short duration and not for the entire duration of crossing?

Question: As per with the American Disability Act (ADA), audible pedestrian signals are supposed to be implemented in most traffic signal projects. These audible signals are designed to assist visually impaired individuals in crossing streets.
Though I can understand the use of these signals and how they help visually impaired people in knowing that its safe to cross,what I have never been able to figure out is why do the audible notifications (i.e the beeps or cuckoos) stop after a short while and do not last the entire duration for which an individual can cross the street ?
If I was blind and I used the audio notifications as a cue to start crossing,wont the stopping of these audio notifications (after a short duration of like 5 seconds when you can actually still cross the street for 20 more seconds) cause confusion about whether there is still some time left over to cross the street ?
I am assuming this is a design flaw because if the purpose of the audio cue was to only inform visually impaired users to start walking across,how will they know when time is running out or has run out and its dangerous to cross the street.
Comment: In Sweden this is not the case, maybe you should learn from us? :)
Comment: Maybe :),but at least in Seattle,all the traffic crossings I have come across have this issue
Comment: Seems obvious.  Blind people generally walk slower than sighted people, because they need to take much more care not to run into obstacles.  This scheme makes sure they don't step out when there's enough time for a sighted person to cross, but not enough time for a blind person to cross.
Answer: This question only has a localized relevance, since around the world different countries, and even states within those countries, can have different behaviour. Thus while Vitaly's answer is likely correct, then a large number of responses to this question will be That's not true where I am.
For example: (If Wikipedia is correct)

Audible signals, such as beeps, in order to help blind or
  partially-sighted pedestrians; or a short recorded message, as in
  Scotland, Hong Kong, Singapore and some parts of Canada (moderate to
  large urban centres), the United States, including Michigan,
  Massachusetts and Texas. In Japan, various electronic melodies are
  played, often of traditional melancholic folk songs such as "Tōryanse"
  or "Sakura". In Croatia and Sweden, beeps (or clicks) with long
  intervals in-between signifying "don't walk" mode and beeps with very
  short intervals signifying "walk" mode.

I think Croatia and Sweden have excellent ideas there and probably this is implemented elsewhere in the world too, maybe with slight variations from place to place - each country being at a slightly different stage or opinion of what's the best solution.
Perhaps the traditional songs might also be useful because you can tell how far through the song you are as you arrive, but it's a bit of a fluffy method with which to treat something serious like a pedestrian crossing...
In any case, the audible signal may not be the only method of determining state as in some areas, audible signals are switched off at night (or for some reason cannot be used in a given location) and in these cases tactile signals may be available - for example a small rotating cone on the underside of the button unit when the signal is at green to cross.
As a further indicator of the wide variation in implementation, a study into audible pedestrian signals in the US was made for the US Access Board (Bentzen & Tabor 1998 / Accessible Design for the Blind) and states:

The matrix entitled "Accessible Pedestrian Signals: Product Functional
  Characteristics" on page 33 [shown below] shows the functional characteristics of
  each product.  Manufacturer information is given on page 34.  All
  products produce a sound, vibration, or both, during the walk
  interval.  Beyond this, there is great variation in the functional
  characteristics of different products, with some providing information
  throughout the signal cycle.  A few devices have audio output that
  varies, by message or repeat frequency, as the pedestrian cycle
  changes from WALK to DON'T START to DON'T WALK
Comment: Great answer. In Australia there's also what they call a  ["vibrotactile" feedback section](http://www.apsguide.org/chapter10_australia.cfm) on crossing buttons which "pulses" and can be felt by the finger, enabling use by both blind and deaf people. Our crossings also "beep" (at different rates) while the crossing is red *and* when it turns green.
Comment: @KitGrose I  think Australia would be only place which will be able to pull off that "vibrotactile" feedback section with its warm weather :) ,cant imagine sticking my hand out in the snow or the rain for that here
Comment: There could be another reason: say you live or work near a traffic intersection; especially in cities, you might only be 5 - 10 meters away from the traffic light itself. If the audio alert is loud, then you're hearing a loud, annoying sound playing for 30 seconds or so, every few minutes, all day long.

I am assuming that a long sound is more annoying than a short one; I am guessing that a long sound is more likely to bypass the brain's filter and hit your conciousness, whereas an often heard short sound is easier for your brain to ignore.
Answer: The reason might be just what you said - that the signal is meant to let people know they should start walking. Suppose a signal lasted the entire duration of the green light. Then a blind pedestrian who has just arrived at a crossing, and hears the signal, has no way of knowing whether the signal is going to go on for some time, or whether it's going to stop in a few seconds so that he doesn't actually have enough time to cross. As opposed to the current situation, where he knows for sure that he's got some time left to cross safely.
BTW, here in Israel it does last for as long as you can cross.
Comment: Yes it would. Which still doesn't mean that that's not the reason behind it :). I don't think it's a design flaw, I'm pretty sure it's intentional, even if it's not the best solution.
Comment: That problem would be easily solved by varying the frequency of the bleeps. And if I am not mistaken, that is how it is done in the Netherlands: the speed of the bleeps increases as time runs out and/or the tone changes.
Answer: To answer the question:
Why do Pedestrian Traffic Signals only play the audible crossing notification for only a short duration and not for the entire duration of crossing?
I think the actual answer is 'Nobody has actually done any proper research on it' or at least if research has been done in one country, people in other countries haven't come across it or implemented it.
Presumably the 'safe to cross' indication cuts out early based on an assumption about how long it will take users to finish crossing the road, which could be mathematically modelled.

And as an aside: in the UK even the synchronisation of the signage for sighted people is often done wrong ( too long a delay between the traffic being stopped and the signage indicating that it is safe to cross - so pedestrians learn to just ignore the signage and cross anyway).
Answer: The audio crossing signals I remember hearing are clicks which last throughout the entire duration of the green light, however, they click faster to signal that time is running out.
This way the pedestrian knows when the light is green and if there is enough time to start crossing or not.
Of course, this varies according to location.


Grails GSP - Display different textfields dependant on locale

Question: I'm having an issue trying to display a different g:textfield dependant on the users locale using Grails 2.4.3.
I've found that to bypass an issue raised in Grails 2.4.3 I have to set the a variable on my gsp page:
<g:set var="lang" value="${session.'org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE'}" />

I can display ${lang} correctly and see the correct value on screen.
I have to display a different textfield dependant on the locale value so I assumed I could use the following but it doesn't work?
<g:if test="${lang.equals('de')}">
    German Textfield
</g:if>

I have tried the lang.equals and lang == de which I've shown here with each de and en
<g:elseif test="${lang == 'en'}">
    English Textfield
</g:elseif>

<g:else>
    no language support
</g:else>

Answer: Do it like this:
<g:if test="${lang == Locale.GERMAN}">
...

I would recommend you to get the current locale like this:
<%@ page import="org.springframework.web.servlet.support.RequestContextUtils" %>

<g:set var="lang" value="${RequestContextUtils.getLocale(request)}" />

Answer: Locale is not a language. It holds both country and language. Refer to specs.
<g:set var="locale" value="${RequestContextUtils.getLocale(request)}" />
<g:if test="${locale == Locale.GERMAN}">German Textfield</g:if>

Answer: <%@ page import="org.springframework.web.servlet.support.RequestContextUtils" %>
<g:set var="lang" value="${RequestContextUtils.getLocale(request)}" />
...

<g:if test="${lang.getLanguage() == 'ru'}">


OWL Carousel 2 - slide more than 1 item with dots

Question: I use OWL Carousel 2, I disable navigation and I want to use the Dots for navigation.
Right now I have 15 items and I have 15 dots too, is there any way to have for example 3 Dots and to slide 5 items when I press on first Dot? Like in this image:

Thank you in advance
Answer: try this code
Html:
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">
    <link rel="stylesheet" type="text/css" href="style.css">

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

css:
.item{
    border: 1px solid #000;
    background-color: red;
    text-align: center;
}

Comment: thank you very much is work like a charm, I really appreciate your help.


Will the story be drastically different depending on the house I choose in Hogwarts Legacy?

Question: I've chosen Gryffindor as my house and I'm enjoying the story so far, but how much different will the story be if I had chosen a different house such as Slytherin, Ravenclaw or Hufflepuff?
Are there even any differences? If yes, then what?
Answer: There are only a few differences in the game that come about as a result of selecting one house over another. The most obvious, yet least impactful on the story are as following:

The House Colors incorporated into some of your gear will reflect
your chosen house
Exclusive access to your Common Room location (and a Floo Flame fast travel point not accessible to other houses)
Extra socializing and introductions with other 5th year students in your house
Certain extra dialogue that may reference your house

The more impactful is the quest that leads up to meeting a certain individual part way through the storyline. Each house has a different quest that precedes the meeting with

 Richard Jackdaw

Gryffindor:

 Gryffindor students will embark on The Hunt for the Missing Pages, where you'll meet Nearly Headless Nick and join the Headless Hunt.

Ravenclaw:

 Ravenclaw students start the hunt for Ollivander's Heirloom, where you'll investigate The Owlery.

Slytherin:

 Slytherin students will become Scrope's Last Hope, which includes Following a series of map clues to meet Headmaster Black's House Elf and find a secret grotto.

Hufflepuff:

 Hufflepuff students seek out a Prisoner of Love, including a trip to the infamous Azkhaban Prison to solve a murdery mystery.

Besides that, there aren't really any differences to the storyline between each house.

IGN Wiki: House Differences
Comment: @ShaunRoselt aside from the one quest leading to the meeting of the individual i mentioned, all other quests should be the same no matter the house you pick.
Comment: So the main story line is exactly the same on all of the houses?


A conjecture about numbers of the form $10^{m}(2^{k}−1)+2^{k-1}−1$, where $m$ is the number of decimal digits of $ 2^{k-1}$.

Question: Question

Numbers $n$ of the form $10^{m}(2^{k}−1)+2^{k-1}−1$, where $m$ is the number of decimal digits of $ 2^{k-1}$. For example:

$k=1$ then $n=10$.
$k=2$ then $n=31$.
$k=3$ then  $n=73$.
$k=4$ then $n=157.$

Conjecture:
the number $(2^k-1)\cdot 10^m+2^{k-1}-1$ where $m$ is the number of decimal digits of $2^{k-1}$ is never prime when it is of the form $7s+6$, that is when it is congruent to $6$ $\pmod 7$. Examples: $n=1023511$ ($k=10$)$\equiv 6 \pmod 7$ and thus it is composite $(1023511=19\times103\times523)$, $n=20471023$ ($k=11$) $\equiv 6 \pmod 7$ and thus it is composite ($20471023=479\times42737)$. With PFGW we arrived to $k=565000$ and all the $n's$ congruent to $6 \pmod 7$ are composite. According to Giovanni Resta's calculations in a post which has been canceled, there should be no probable prime congruent to 6 $\pmod 7$ upto k=800.000. The residue $6$ $\pmod 7$ occurs when either $m=6t+3$ and $k=3l+1$ or $m=6t+4$ and $k=3l+2$ with $k$ and $l$ some non-negative integers, but amazingly when it occurs the number is not prime. Can you find a counter-example or give a proof for the conjecture? Here a link to other interesting questions: Is there a number of the form  $f(n)=7k+6=5p$ with prime  p? and Why do all residues occur in this similar sequence?
For primes of this form see:
The on-line Encyclopedia of integer sequences
The following vector contains all the exponents k<=366800 leading to a prime
$[2, 3, 4, 7, 8, 12, 19, 22, 36, 46, 51, 67, 79, 215, 359, 394, 451, 1323, 2131, 3336, 3371, 6231, 19179, 39699, 51456, 56238, 69660, 75894, 79798, 92020, 174968, 176006, 181015, 285019, 331259, 360787, 366770]$
Exponent $541456$ leads to another probable prime with residue 5 mod 7 and 325990 digits, but it need not be the next in increasing order.
Remark: we found five-in-a-row probable primes with res 5 mod 7. Probable primes with residue 5 are now twice frequent than expected.
Exponents of these primes seem to be NOT random at all. Another thing I noticed, i don't know if it has some importance: the exponents leading to a probable prime $215, 69660, 92020, 541456$ are multiples of $43$. I noticed that $\frac{215}{41}, \frac{69660}{41}, \frac{92020}{41}, \frac{541456}{41}$ all have a periodic decimal expansion equal to $\overline{24390}=29^3+1$. This is equivalent to say that when k is a multiple of 43 and the number $10^{m}(2^{k}−1)+2^{k-1}−1$ is prime, then k is of the form $41s+r$ where r is a number in the set (1,10,16,18,37). Is there some mathematical reason for that?
Comment: How can you give a bounty of $200$ when you only have $116$ reputation?
Comment: Please reduce your editing of this post. It is not necessary to keep the search limit quite up to date in the post. If you want to have the current search limit on the page, post a comment (and delete it when you post the next). Updating the post once or twice a week is plenty enough.
Comment: It's worth to mention that if $n = (2^k-1)\cdot 10^m + 2^{k-1}-1$, then $2n+1=(2\cdot 10^m + 1)(2^k - 1)$. In particular, $n$ can never be a [Sophie Germain prime](https://en.wikipedia.org/wiki/Sophie_Germain_prime).
Comment: https://github.com/gnufinder/special-prime/issues
Comment: https://mathoverflow.net/questions/294527/does-concatenating-mersenne-numbers-necessarily-lead-to-a-composite-number-in-th
Comment: The sum of the reciprocal of exponents converges? And at what value?
Comment: https://math.stackexchange.com/questions/2740494/can-concatenating-the-numbers-2n-and-2n1-lead-to-a-sophie-germain-prime-g
Comment: Passed k=360.000 no prime with res 6 mod 7 found
Comment: @Giovanni Resta Please, could you help us to find other primes of this type in the range k=[200.000...300.000]?
Comment: almost at 100 edits!
Comment: @qwr very helpfull comment!
Comment: @Peter on mersenne forum somebody pointed out to me that it is also surprising nine in a row primes 3 mod 7.
Comment: @EnzoCreti Considering that residue $0$ is impossible for ec-primes, the theoretical frequencies for residues $[1,2,3,4,5,6]$ are $[1/17,2/17,8/17,2/17,2/17,2/17]$ respective. Hence "nine 3's in a row" has probability about $1:884$ , whereas "five 9's" in a row has probability about $1:44371$, which is much less.
Comment: @EnzoCreti Is this true for all found ec-primes with residue $5$ mod $7$ ? If yes, this would be a nice additional conjecture.
Comment: Your new conjecture actually holds for the found primes. It might be possible to show the new conjecture, but I will have to work it out.
Comment: @Peter yes it was odd the last exponent.
Comment: Curiously the sum of the reciprocals of exponents is close to $\pi^2/6$
Comment: 1/2+1/3+1/4+...+1/285019 is less than $\pi^2/6$ by about 0.001
Comment: @peter told me about this and i found it very interesting. I made this tool: https://solutionsti360.ca/MATH/pfgw/stats.php, so anybody can help computing. Simply download and run to participate. Just refresh the page to update stats.
Comment: @François Huppé I cannot install the tool on my office computer because I am not the admnistrator of the computer.
Comment: is it windows 10 or xp ?
Comment: @ François Huppé Windows 10...the problem is that I am not the administrator of the computer and so I cannot install the tool
Comment: @ François Huppé The server doesn't detect unique clients therefore when you fire more than one it will process the same work in all instances, on the same machine.
 Also there is a lot of idle time between server connection, would be wise to download more than one task. So said somebody on Mersenne forum
Comment: Yes, i updated the linux version, now it gets multiple jobs from the server, and also you can start multiple instance
Comment: i'll try to get the win 10 version to work tonight...
Comment: @François Huppé did you pass 200k?
Comment: @DanaJ would you like to join in this project? solutionsti360.ca/MATH/pfgw/stats.php,
Comment: @Peter Great news!!! During these holidays two new ec-primes found: 360787 and 366770!!!
Comment: @EnzoCreti Wow! I will analyze and doublecheck them! I think you checked with base $3$ , right ?
Comment: @Peter yes base 3
Comment: @Peter I bet residue 3?
Comment: @Peter I added the values in Oeis
Comment: I wanted to enter the new ec-chatroom, but apparently, it does not exist anymore. The first number has $217\ 216$ digits and residue $2$ mod $7$
Comment: @Peter so two-in a row mod 7?
Comment: And the second number has $220\ 818$ digits and residue $5$ mod $7$.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/82290/discussion-between-enzo-creti-and-peter).
Comment: @Especially Lime Giovanni Resta found another probable prime with exponent 541456. It is curious that $541456=700^2+51456$ where 51456 is an exponent leading to an ec prime!
Comment: @Peter@Especially Lime the first four ec primes are emirps. $31, 73, 157, 12763$. Moreover (13+2)/3=5 a prime. (37+2)/3=13 a prime. (751+2)/3=251 a prime and (36721+2)/3=12241 also a prime!
Comment: @peter 5,13 and 12241 are also part of a twin-pair!
Comment: The first four primes of this form are emirps $31, 73, 157, 12763$. $31^2+73^2+157^2+12763^2+1=162925109$ is a prime. And $13^2+37^2+751^2+36721^2+1=1348997381$ is also a prime of the form $157*k+1$.
Comment: $162925109^2+1=2*13272295571330941$ an even semiprime. $1348997381^2+1=2*909896966972429581$ an even semi-prime.
Comment: $162925109$ and $1348997381$ are both congruent to $2333$ mod 24.
Comment: $31^2+13^2-1=1129$ is a prime. $157^2+751^2-1=588649$ is a prime. $12763^2+36721^2-1=1511326009$ is a prime. All these primes end with digit 9.
Answer: According to your list, a counter-example, if it exists, must have more than $60,000$ digits. So, a counterexample would be a quite gigantic prime.
Unfortunately, a proof of the conjecture will almost certainly be out of reach.
The search for a counter-example can be painful as well, it is well possible that the smallest is already too big for current algorithms for primality testing.
Comment: For $k=32$, we have the factorization $$131\cdot 4463\cdot 21601\cdot 44623 \cdot 76213$$ This is a counterexample with residue $6$
Comment: @Peter Every number is of the form $10^{m}(2^k-1)+2^{k-1}-1$, where $m$ is the number of decimal digits of $2^{k-1}$. As $\log_{2}10$ is irrational, the residues of $m$ and $k$ modulo 6, and hence the residues of $10^{m}$ and $2^{k-1}$ modulo 7, are independent. You can find out the distribution simply by tabulating the possible cases.
Comment: My observation just explains why different residues modulo 7 occur at different frequencies.
Comment: @EnzoCreti No, this is only known for arithmetic progressions of the form $an+b$ with coprime $a$ and $b$ (Dirichlet). The numbers here will behave like "random" numbers , hence we won't be able to rule out a large prime.
Comment: https://math.stackexchange.com/questions/2658464/is-frac-2716-915-680-41713-a-wagstaff-prime#comment5492093_2658464
Comment: @EnzoCreti Concerning the structure of the factors of those numbers, I search a prime factor of $f(530)$ and in a new project I search $f(n)$ of the form $7k+6$ such that $\frac{f(n)}{5}$ is prime which turns out to be tough as well.
Comment: @VishaalSelvaraj A nice observation, but I don't think that is considered to be of great importance. Otherwise we would already have found helpers. r.e.s was a helper, but quit at $10^5$, now we are only two despite of 1k+ views. And without some luck or more helpers, we won't be able to decide the conjecture.
Comment: You should at least present all primes upto $n=10^5$
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/74488/discussion-between-peter-and-enzo-creti).
Comment: @Peter today at 16.00
Comment: @Peter the sum of the reciprocals of the ec-primes is about $0.052408...$ Curiously $0.05240...$ is about equal to $\frac{360}{\sqrt{360*2^{17}}}$
Comment: @EnzoCreti How did you get this list ? It shows that a counterexample must have more than $60\ 000$ digits. I think that the numbers of this form (no matter of the congruences) can have least prime factor very high. The probability that the least prime factor is very high is much higher than one might expect. A large "random" number has no prime factor less than $10^{20}$ with probability about $1.2$%. I do not think there is a special reason. Moreover, my list of candidates has become obsolete.
Comment: @Taneli Huuskonen And can you extimate in what percentage residue 6 mod 7 should occur?
Comment: Yes. The residue 3 occurs 4/9 of the time; the residues 2, 4, 5, and 6 occur 1/9 of the time each; and the residues 0 and 1 occur 1/18 of the time each. The residue 6 occurs exactly when either $m=6n+3$ and $k=3l+1$, or $m=6n+4$ and $k=3l+2$, for some nonnegative integers $n$ and $l$.
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/72806/discussion-between-enzo-creti-and-taneli-huuskonen).
Comment: @EnzoCreti Not really realistic. Sometimes, we only have a very small prime factor and a prime cofactor and sometimes the smallest prime factor has more than $15$ digits. This does not indicate hidden factors. So, it seems to be a pure coincidence that $6$ does not appear early. If factordb would allow concatenating numbers, that would be fine! But it seems that factordb does not support this yet. I have passed $120\ 000$ now without success.
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/73002/discussion-between-enzo-creti-and-peter).
Comment: Primes are of limited importance. They are used for cryptography, but there are better methods and the safety of the RSA is debatable. Such primes as the one you search are purely for curiousity. Nevertheless, many such primes were calculated. It is a bit sad that this kind of primes is not considered to be interesting by most of the people here. Of course, special primes, as the Mersenne primes, are more important because they answer important mathematical questions.
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/73126/discussion-between-enzo-creti-and-peter).
Comment: @Peter Yes I have noticed.
Comment: For $k=586916$, we get a number of the form $7k+6$ divisible by $83339$
Comment: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/73471/discussion-between-enzo-creti-and-peter).
Comment: New project : https://math.stackexchange.com/questions/2666033/is-there-a-number-of-the-form-fn-7k6-5p-with-prime-p
Comment: @Peter ok I wait news from you.
Comment: @EnzoCreti To show that the smallest prime factor can be very large.
Comment: @Peter have you find a factor for f(530)?
Comment: @EnzoCreti No, seems that the smallest prime factor has more than $25$ , probably even more than $30$ digits. Of course, trial division does not work anymore to find such factors. The elliptic curve method is the key. With factordb , the concatenation for numbers works, if the numbers are concrete or depend linear on $n$ , for example $c(123,456)$ gives $123456$ and $c(n,n+2)$ correctly concatenates $n$ and $n+2$. Strangely, $c(M(n+1),M(n))$ does NOT cancatenate $2^{n+1}-1$ and $2^n-1$ correctly, otherwise this would be the perfect way to search further primes.
Comment: For clarification, $M(n)=2^n-1$ , the $n-th$ Mersenne number is a valid syntax in factordb. I also tried "c(2^(n+1)-1,2^n-1)" , but without success either.
Comment: https://math.stackexchange.com/questions/2668139/concatenation-with-factordb
Comment: My post have 870 views but only 13 votes...so I think that there is skepticism about that conjecture or nobody believes it has some importance...
Comment: @Peter between 10^5 and 2*10^5 there are about 2000 candidates (or even less)...if the probability of a random number to be prime is 1 out of 4200, perhaps it will be still difficult to find a prime?
Comment: @EnzoCreti The logarithm is roughly $n\cdot \ln(4)$ , hence the probability that a candidate is prime is about $1:\frac{e^{-\gamma}}{\ln(10^6)}\cdot \ln(4)\cdot n\approx 1:0.0563\cdot n$
Comment: A large number has no prime factor less than $x$ with probability about $\frac{e^{-\gamma}}{\ln(x)}$, if $x$ is large. The approximation is already good for $x=10^6$
Comment: Didn't continue, probably no factor below $10^{30}$
Comment: https://math.stackexchange.com/questions/2674050/why-do-all-residues-occur-in-this-similar-sequence
Comment: Most of the conjectures on primes hold good only in a certain interval.
Comment: I know that, I myself am astonished with Legendre's conjecture that there exists a prime between every square number and it is true and has been put in landau's problems.
Comment: @Peter Could we start towards k=300.000?
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/74066/discussion-between-enzo-creti-and-peter).
Comment: Enzo creti, your discovery is remarkable. I don't believe I am saying this, but I think you should patent your discoveries before uploading them.
Comment: I have asked my friends to siphon some computer power from cyber cafes to help you calculate.
Comment: If possible could you take me in your chat room?
Comment: @Peter this morning I arrived at 248.000, the search has slowed down. I was hoping that on Saturday morning we would have arrived at k=300.000 but now I think that this is not the case...
Comment: @Vishaal Selvaraj you told me about a library...you said that it is necessary high power of the computer. How much do you believe?
Comment: 1.8 GHz give or take, but 4 GB RAM IS recommended
Comment: Actually the library uses custom data types with user defined precision..
Comment: @EnzoCreti It is not a matter of space, it is a matter of computational power and of parallelization.
Comment: @Vishaal Selvaraj Ok thank you very much, I have half a mind to buy a new computer (mine at home is broken I'm using the computer office). So I could help also Peter...
Comment: @Peter f(n)/5 conjecture is another good question...
Comment: No , it is a matter of memory space too since, the data types are 100~200 bytes in size and running operations on them requires more ram.
Comment: @EnzoCreti I know no primes of the forms given in this question : https://math.stackexchange.com/questions/2374537/are-there-prime-numbers-cn-or-rcn?rq=1
Comment: @EnzoCreti Great!
Comment: @EnzoCreti You passed the $150k$-digit-mark. The largest known prime is only roughly $150$ times larger than the numbers you now verify.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/74236/discussion-between-enzo-creti-and-peter).
Comment: PARI/GP is slow with modulo-calculations involving very large numbers. With a better software we could sieve out more factors with pollard-rho, p-1-method, etc. So, perhaps you are looking for a powerful program that can do this. Or, alternatively, you are content with the fact that counterexamples will be very rare, but likely exist. What I finally can make : Estimate the number of primes in very large ranges based on the weak candidates (no prime factor less than $100$)
Comment: Surprisingly, the expected number of primes in the ranges  $[10^k,10^{k+1}]$ for $k=3,4,5,6$ is about $5.4$. Whether this pattern continues ?
Comment: In fact , the pattern should continue. Since $\ln(f(n))\approx \ln(4^n)$ for large $k$, the expected number of primes in the range $[10^k,10^{k+1}]$ is approximately $5$, if we only consider that $2$ and $3$ can never be a prime factor. The special structure of the numbers seems to  slightly increase this number to about $5.4$. So, we probably have infinite many counter-examples.
Comment: @EnzoCreti When do you have your internet at home ?
Answer: @peter told me about this and i found it very interesting.
I made this tool, so anybody can help computing. Simply download and run to participate. Just refresh the page to update stats. With 30-40 person, getting to $n=10^7$ should not be to long.
Comment: How many people participated already ?
Comment: @DanaJ have you a routine for Sage whcih allows to test this conjecture?