How to access files (.pdf) from a share on an windows-server from internet

Question: I have a "special question".
We have a public web-portal (accessible public over the internet).
The data (including images) are stored on an (internal) (MS)SQL-Server and the queried from the portal. The portal is running on an IIS (Visual Webgui -> AJAX).
In addition, a user of the webportal also can upload .pdf's with detail-descriptions.
These .pdf's are stored on a FileShare of the (internal) SQL-Server
On the portal, the .pdf's are loaded (streamed) directly from the FileShare on the SQL-Server (via File-Access).
We now create app's (Xamarin.Forms) to access the data over a (JSON) webservice.
=> This works nice (including load and show the images).
I now want, to enable the app also to load and show the .pfd's on the touch-devices.
As I don't want add this stuff to the webservice, search a way, to accces the .pdf's via uri from the apps.
So the problem is, that in don't know, how to make the share on the (internal) SQL-Server accessible in an easy (and secure) way from the internet.
Target (my cool Idea;-):
I have an url from the webporta, that is alleady accessible over the firewall - E.G. www.xx.ch
=> Now I search a "magic" way to enable the webserver to access the fileshare (internally) and add the "url" to the fileshare to the "space" of the webserver.
E.G. add url "documents" to the space of the webserver and the call uri:
"http://www.xx.ch/documents/xxx.pdf" from the app.
Does someone know hat to do that (or something similar:-)?
Thanks a lot for any feedback.
Fredy
e
Answer: I (proudly) have found the solution myself.
As I have opened the question - I also have to describe the solution...
In short:
- Add a Virtual Directory on IIS:
  - In IIS select sites - site of the portal
  - right click mouse - add virtual directory
    - named DatenAblage
    - pointing to the UNC-Path on the Fileserver
- click the new Virtual Directory ("DatenAblage")
- doubleclick on Icon "Authentification" (in the middle pane)
- Select "Anonymous Authentification" (have to be Enabled) and click "Edit" under "Actions" (on the right side)
Important (I have tried hours, before I have findout that):
- Set Anonymous user identity to "Application pool identity
That's it (was it in my case).
I first have done this on Intranetserver (very easy, if the trick Set Anonymous" (see above) is known.
Then, I have done the same steps on Internetserver (in DMZ).
After that, I am able to load a .pdf via http://www.sitename.ch/DatenAblage/xx.pdf (if it exists;-) from public internet.
Notes:
In my case, the firewall was already configured for running the public portal.
Public IP -> FW -> DMZ-IP Web-Server -> Internal IP
DMZ-IP Web-Server -> Internal IP SQL- and Fileserver (with the Share to "DatenAblage").
Hope this helps someone (as I was helped in the past in this - b.t.w. very useful portal)
Greetings from Switzerland


How to sort my dictionary using this condition

Question: How to sort my dictionary using this condition in python.
I have a Nested Dictionary which is describe below.
my_dict={
         "Moli": {"Price": 226, "Quantity": 300, "PreOrder": "Yes", "PostOrder": "No", "Dif": 36},
         "Anna": {"Price": 530, "Quantity": 154, "PreOrder": "No", "PostOrder": "Yes", "Dif": 26},
         "Bob": {"Price": 250, "Quantity": 100, "PreOrder": "No", "PostOrder": "No", "Dif": 46},
         "Annie": {"Price": 656, "Quantity": 96, "PreOrder": "Yes", "PostOrder": "No", "Dif": 55},
         "Calley": {"Price": 546, "Quantity": 76, "PreOrder": "No", "PostOrder": "Yes", "Dif": 35}
        }

I want to apply a condition on this nested dictionary. The condition is_

Sort the items where ("PreOrder"== "Yes" or "PostOrder"== "Yes") and show those item in descending order using "Quantity" value

Something like this.
my_dict2 = {("PreOrder"== "Yes" or "PostOrder"== "Yes") i[0]: i[1] for i in sorted(my_dict.items(), key=lambda x: x[1]["Quantity"], reverse=True)}

I know it's a wrong code.
expected output_
my_dict2={
         "Moli": {"Price": 226, "Quantity": 300, "PreOrder": "Yes", "PostOrder": "No", "Dif": 36},
         "Anna": {"Price": 530, "Quantity": 154, "PreOrder": "No", "PostOrder": "Yes", "Dif": 26},
         "Annie": {"Price": 656, "Quantity": 96, "PreOrder": "Yes", "PostOrder": "No", "Dif": 55},
         "Calley": {"Price": 546, "Quantity": 76, "PreOrder": "No", "PostOrder": "Yes", "Dif": 35}
         }

I would be very grateful if you could help me
Comment: that first condition is for filtering, not sorting. Do you only want the items with `"PreOrder"== "Yes" or "PostOrder"== "Yes"`?
Comment: Why is the key `Bob` missing from your expected output?
Comment: Because Bob's ("PreOrder"== "Yes" or "PostOrder"== "Yes") this condition is false. "PreOrder": "No", "PostOrder": "No"
Comment: and yes first check the condition then sorting in descending order using "Quantity" value
Comment: Can I write the code like this filtered = {i[0]: i[1] for i in sorted(my_dict.items(), key=lambda x: x[1]["Quantity"], reverse=True) if i[1]["True" not in my_dict[(list(my_dict.keys())[0])].values()]}
Answer: This involves multiple steps as you describe. First, we need a dict with only the items that we want. This filters the dict.
filtered = {k: v for k, v in my_dict.items() if v['PreOrder'] == 'Yes' or v['PostOrder'] == 'Yes'}

Then you want to show the items in order. This implies a list, not a dictionary. So we'll make one with tuples from the original dict.
items = [(k, v) for k, v in filtered.items()]

Finally, we need to sort the items. As you've written already, sort accepts any arbitrary sorting method, so we can pass in a lambda function for that.
ordered = sorted(items, key=lambda i: i[1]['Quantity'], reversed=True)

In general, it is very helpful to think about your problems in minimal steps.
Comment: you can do `sorted(filtered.items(), key=lambda i: i[1]['Quantity'])` btw
Comment: @Chase Good point! I would emphasize the need to understand the meaning of every step, but once you are comfortable, these kinds of shortcuts can be made.
Comment: Also, since, if i'm correct, version 3.6, dicts are sorted, so ending up with a dict instead of list is possible.
Comment: But sir I getting output like this_
Comment: @go2nirvana True, but I'm personally still uncomfortable with assuming it, because the data structure isn't built for that. For example when switching to other languages it would be easier to make the transition with the same concepts, not relying on an ordered dict.
Comment: my_dict2={
         "Moli": {"Price": 226, "Quantity": 300, "PreOrder": "Yes", "PostOrder": "No", "Dif": 36},
         "Anna": {"Price": 530, "Quantity": 154, "PreOrder": "No", "PostOrder": "Yes", "Dif": 26},
         "Annie": {"Price": 656, "Quantity": 96, "PreOrder": "Yes", "PostOrder": "No", "Dif": 55},
         "Calley": {"Price": 546, "Quantity": 76, "PreOrder": "No", "PostOrder": "Yes", "Dif": 35}
         }
Comment: Can I write the code like this filtered = {i[0]: i[1] for i in sorted(my_dict.items(), key=lambda x: x[1]["Quantity"], reverse=True) if i[1]["True" not in my_dict[(list(my_dict.keys())[0])].values()]}
Comment: @ammely Do you mean the reverse? My bad, I'll include it in the answer. With regards your other question, I don't really know what you mean. It could be better to ask another question for that. Also, tip: backticks for formatting `code`.
Answer: You can also do this using pandas library:
This saves a lot of lines of code and also reduces a lot of complexity.
Install pandas:
pip install pandas
Then, create a dataframe from my_dict:
In [229]: import pandas as pd

In [230]: df = pd.DataFrame(my_dict)

In [235]: df1 = df.T

In [244]: my_dict2 = df1[df1.PreOrder.eq('Yes') | df1.PostOrder.eq('Yes')].sort_values(by='Quantity', ascending=False).T.to_dict()

In [245]: my_dict2
Out[245]:
{'Moli': {'Price': 226,
  'Quantity': 300,
  'PreOrder': 'Yes',
  'PostOrder': 'No',
  'Dif': 36},
 'Anna': {'Price': 530,
  'Quantity': 154,
  'PreOrder': 'No',
  'PostOrder': 'Yes',
  'Dif': 26},
 'Annie': {'Price': 656,
  'Quantity': 96,
  'PreOrder': 'Yes',
  'PostOrder': 'No',
  'Dif': 55},
 'Calley': {'Price': 546,
  'Quantity': 76,
  'PreOrder': 'No',
  'PostOrder': 'Yes',
  'Dif': 35}}

Comment: @ammely Please check my answer as well.


How do I add collision to an imported gltf object

Question: I am new to three.js. How would I add collision to an object/mesh that was created and imported from Blender (gltf)? For example, let's say I imported a building and I want to walk around that building (ramps, stairs, and all) How would I go about doing that? because currently, my player passes through the imported gltf object
I started playing around with adding collision to objects imported from Blender, but it doesn't seem to work… my player can still go through the mesh. I added collision to my player, and I know it works because I tested the player collision on the native boxes (with useBox) not imported from Blender.
Answer: There are perhaps a half dozen physics engines for JavaScript today, including libraries like Rapier.js, Ammo.js, Havok, Cannon.js, and Oimo.js. Each has its own methods to set up "collision bodies", which may or may not be the same as the geometries you display on screen. It's common to create simplified geometries for this purpose, perhaps in a separate glTF file.
Another approach would be navmesh-based pathfinding, see three-pathfinding or yuka.js for this approach.
Finally, a simple data structure like an octree or BVH can be used instead of a full physics engine or navmesh. The three.js examples include a good demo and source code taking this approach:
three.js examples / games fps


How would I install shutoff valve for fridge water line on current setup

Question: I had a new fridge installed and the plastic water tubing from the sink cold water connection was leaking behind the fridge when they installed it. I am going to replace the plastic tubing and wanted to install a shutoff valve so I would be able to turn off the water to the fridge without having to turn off everything else. The current shut off valve is connected to the tubing I will be removing and I am not a big fan of these types of valves. What is the correct type to use?
Thanks
Answer: I would get a valve with 2 outlets, or a dual outlet any plumbing supply or big box stores will have them, this reduces the chance of leaks compared to t's. On a single port valve approx 16$ for a quality brass valve dual 3/8" ports.
Comment: do both of the valves have their own shutoff?
Comment: No they both use the same valve I usually have a shutoff in the wall at the fridge water outlet box (required code for my area) so another shutoff at the source is silly to me
Comment: well i wont have a shutoff in the wall behind the fridge. I am looking for a valve that can have two separate shut offs so I don't think your solutions will work.
Comment: That's how every house I have built and or remodeled worked not having a shutoff at the fridge is a code violation here you might want to check on that.
Comment: Do they make a valve that has 2 separate shut offs? I will not be installing one behind the fridge.
Answer: There are numerous ways that you could tee off of the tubing coming out of the wall using fittings, to then attach two separate stop valves.
OR you could splurge and get a double-valve unit:
Comment: i like that way that one looks. Not sure what size connections i need though. can you tell from the photo?
Comment: Yes, the one depicted will fit your specific scenario. 1/2" nominal compression inlet (for 5/8" O.D. copper pipe) x 3/8" compression outlet (for sink faucet) x 1/4" compression outlet (for refrigerator). This is what your photo *appears* to depict, please confirm prior to buying though...


Inspecting nil value returned by NSClassFromString

Question: We can create a class by using NSClassFromString:
Class class = NSClassFromString(@"someClass");
id object = [[class alloc] init];
[object test];

It's no problem here.
NSClassFromString would return nil if a class given by the string does not exist.
Fair enough and calling [object test];, when object is nil (because class is nil) would not cause any problem.
As an experiment, I changed @"someClass" to something else that does not exist.
By logging the value of class (when NSClassFromString returns nil) it shows 0x0.
And subsequently I tried to replace as a test:
id object = [[class alloc] init];
with the following one by one:
id object = [[Nil alloc] init];

id object = [[nil alloc] init];

id object = [[NSNull alloc] init];

Only id object = [[NSNull alloc] init]; does not cause any compile error but will cause a crash when it reaches to this line:
[object test];

So my question is, why can't I replace class with either nil or Nil, but when NSClassFromString returns nil and assign it to Class class and calling this [[class alloc] init]; would work? class is also nil here.
Adding error message for cases when id object = [[Nil alloc] init]; or id object = [[nil alloc] init]; is applied.

Bad receiver type of 'void *'.
Comment: What? NSNull is a class, and its singleton is not nil.  And what does it have to do with your question?
Comment: @nevanking: `nil` is a valid receiver for a message.
Comment: Also not part of your question but worth noting that using NSNull and then trying to call that `test` method causes a crash because `NSNull` is an actual object type (derived from `NSObject`) and that is an unrecognized selector for that object.
Comment: i will suggest to check this [reference link](http://nshipster.com/nil/)
Comment: You can send a message to a pointer to nil (`id thing = nil; thing = [[thing alloc] init];`) which will return nil, but not to nil itself. In the same way, you can't message an `int`: `int i = 3; [[i alloc] init];`
Comment: @pawan Thanks for link; I read that long time ago. I know the difference.
Comment: @nevanking Thanks for response. Can you elaborate a bit on _"which will return nil, but not to nil itself."_?
Comment: @Unheilig I'm not great at this, so take what I say with a grain of salt, but I was saying that there's a difference between nil and a pointer to nil. Something like `id obj = nil` is making a pointer to nil, which can be messaged. In Objective-C, the receiver of a message is always a pointer (pointer to an `NSString`, pointer to a `UIView` etc). So presumably the compiler is telling you that nil is an invalid receiver for a message.
Comment: @Unheilig: Are you positive this results in a compiler error? I tested it (with this code: https://gist.github.com/mdippery/9792183) and it compiled fine (albeit with a warning), and ran fine, too.
Comment: @mipadi Thanks for the follow-up and the gist; yes, what I got is exactly the same (i.e. `id myObject = [[nil alloc] init];`) and the error that prevents compilation is `Bad receiver type of 'void *'` as mentioned.
Answer: nil is of type void*, not id.  You cannot send messages to a void*.
NULL, Nil, and nil are type void* so that may be assigned to anything.  If nil was type id then you couldn't do this:
char* foo = nil;

which is not a useful limitation.
If you really want to send a message to nil you need to cast it to the correct type:
[(id)nil description];

Comment: @Unheilig: The compiler should just generate warnings for `[nil alloc] init]`, not errors, and the compiled project will run, but `[nil alloc] init]` returns a `nil` object. The runtime doesn't "wrap" nil in a struct or anything else -- the Objective-C runtime just has special handling for sending messages to `nil`.
Comment: @Unheilig It has nothing to do with the runtime.  The compiler stops you from sending a message to void* in the same way it stops you from assigning an int to a char*.  It's simple static type checking.  At runtime, on the other hand, a zero is zero and sending a message to zero is OK.
Comment: `nil` and `(id)0` and `(NSInteger)0` all have the same representation at runtime (a pointer-sized zero). You could use any of the three as the receiver of a message with identical results, if the compiler's type checker didn't stop you first.
Comment: nil is (id)0  means literal null value for Objective-C objects. and NULL  is (void *)0 literal null value for C pointers
Comment: Thanks for response. So, can we safely say (quoting from mircotherion's answer below) that we the runtime sees `nil` it would wrap a `struct` for us, but when I manually make it `nil` then it is not OK? Other words, I would like to understand why when I do `[[nil alloc] init];` is not OK, but when `NSClassFromString` returns a `nil` value to `class`, calling `[[class alloc] init];` is OK. But if I could confirm that the runtime does in fact wrap a `struct` around `nil` to make it `id` and that's why it works, I'd settle my curiosity with that.
Comment: @mipadi Thanks. It is an error that prevents compilation.
Comment: @pawan `nil` is `void*` in Obj-C, and `nullptr_t` in Obj-C++. You cannot send messages to either of those types, and the compiler will generate an error.
Comment: @Darren Nice analysis. "static type checking" at compile-time is understandable to me. But how and what makes it possible that  "a zero is zero and sending a zero a message" at runtime is OK, would you happen to know the subtleties? Other words, what does it do to make it possible at runtime under the hood?
Comment: @GregParker I am about to get the "aha" moment, but - so that means that if there were a compiler flag that I could use to bypass the compiler error and run it with `[[nil alloc] init];`, it would work  (given what you have said)? It doesn't now, because the error prevents compilation (stops me) in the first place?
Comment: @Unheilig Yes, that's correct.  When you use a typecast like `[(id)nil foo];` you override the compiler's default type checking and force it to compile.
Comment: @Darren `void *` in C is useful because it allows us to typecast a pointer to any type (hope my reasoning is not wrong, if so, correct me). Based on your example, can we safely say that we could as well do for ex: `(NSString *) nil = @"karma chameleon";`? I am asking because it seems like my question somehow skim through the subject as to why Obj-C being so dynamic. Given what @GregParker mentions above, it seems that during runtime `nil` is of the representations he mentioned, but during compile-time not so. The intricacies regarding to this between compile and runtime fascinates me. Thanks.
Comment: I faced the same problem but in Swift, and my app crash in this line:
 let customBlurClass: AnyObject.Type = NSClassFromString("_UICustomBlurEffect")!
my full used code is:
let customBlurClass: AnyObject.Type = NSClassFromString("_UICustomBlurEffect")!
        let customBlurObject: NSObject.Type = customBlurClass as! NSObject.Type
        self.blurEffect = customBlurObject.init() as! UIBlurEffect
        self.blurEffect.setValue(1.0, forKeyPath: "scale")
        self.blurEffect.setValue(radius, forKeyPath: "blurRadius")
        super.init(effect: radius == 0 ? nil : self.blurEffect)
Comment: any hepl please in Swfit
Answer: The Objective C runtime can handle the runtime situation of sending a message to nil, but if you already know at compile time that the target is nil, nothing good can possibly come out of it, so the compiler is doing you a favor by flagging a construct that is known not to accomplish anything.
Edit: @Darren is right, nil is a void *, not an id, so this fails for type checking reasons. Something like [[(id)nil alloc] init] does in fact compile. I still think a compiler should flag sending messages to known nils, but as a matter of fact, it doesn't.


How can I unlock the Club LOL?

Question: Sharing my town with younger sibling. We have all shops but no Club LOL. I never saw Dr. Shrunk after the T&T upgrade (we now have the TIY upgrade).
If he did visit and we missed him, will we get another chance for Club LOL? Also no animal neighbor approached me to suggest public works projects only the ones that were available at the beginning of game.
Answer: If you missed Dr. Shrunk after you upgraded to T&T the project will show up in the Public Works.
Source
Answer: If you did miss Dr. Shrunk, don't worry! It will show up a a public works project.

How can I unlock the Club LOL?


Python jsonschema not Raising an Exception

Question: I am attempting to validate a JSON schema like this:
try:
    print('instance {}'.format(json))
    print('schema {}'.format(schema))

    val = validate(instance=json, schema=schema)
    print('validation {}'.format(val))

except (ValidationError, Exception) as error:
    raise InvalidSchemaJSON from error

Where the JSON is:
{
    "t": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9",
    "p": "password"
}

And it needs to be validated against:
{
    'type': 'object',
    'properties': {
        't': {'type': 'string'},
        'p': {'type': 'string'},
    },
    'required': ['t', 'p']
}

I've tried modifying the schema in order to purposely set off an exception to:
{
    'type': 'object',
    'properties': {
        't1': {'type': 'string'},
        'p1': {'type': 'string'},
    },
    'required': ['t', 'p']
}

And no exception was raised.
What am I doing wrong here?
Comment: As this was down to a typo, I've suggested this be closed, as per closure guidelines.
Answer: In your modified schema you still have required keys as 'required': ['t', 'p']
It should be 'required': ['t1', 'p1']


How can I diagnose the cause of my washing machine shocking me?

Question: Australian 240v power supply.
Worked fine without incident for 5 years. One day I plugged washing machine into a plug adapter with no ground connection between the washing machine plug and the power outlet. (so it just has live and neutral connections). I received what felt like a 100 to 240v shock from the metal drum of the washing machine.
Putting my proximity voltage detector within 40cm of the unit resulted in it beeping (it usually needs to be within 1cm to detect anything.)
My question is: does this mean that the washing machine drum was always energized, and the only thing saving me from being shocked was that the ground wire was safely attracting the current away from me when I touched the machine?
Does this mean that the only possibility is that somewhere inside the machine a live wire is touching the metal exterior of the machine? or could it be another possibility?
My multimeter results:
From ground on plug to washing machine drum is infinite to 120,000 ohms resistance (changes when drum rotates). To other parts of the metal chassis it shows 83 ohms resistance. These parts still cause the proximity detector to light up.
The live, neutral on plug to drum and chassis show infinite resistance.
The live, neutral and ground prongs on the plug all show infinite resistance to each other.
My voltage testing screwdriver lights up when touched to the drum, chassis and internal ground wiring.
All other readings are infinite/blank, including voltage and current readings from drum and chassis while they are energized.
I don't understand how I can get shocks from the drum and chassis and they can set my proximity voltage alarm off, but no readings come through the multimeter. Is it because I can only rest the probes on the metal drum and the resistance is too high in my multimeter and the current is happier to flow through the chassis?
Note: the machine does not have to be turned on for the proximity meter to detect voltage in the drum.
Thanks
Comment: You can have induced electricity, this will transmit voltage but a (DC) multimeter will show infinite resistance. Note: I am not saying this is happening to you.
Comment: Could this happen with the way the washing machine motor works? I am interested in this theory because touching the chassis on the outside does not result in a shock, only the steel drum inside.
Comment: The ground pin to chassis should show nearly zero ohms (or infinite ohms but nothing in between), the 83 ohms suggests that it's not really bonded to the chassis. If you were in the USA, I'd suggest that it's using [split-phase](http://diy.stackexchange.com/a/33603/12620) 240VAC power and was using the ground connection as the 'neutral' to get 120VAC. However, I believe in Australia  240VAC is your 'base' powerline voltage, so split-phase 120VAC doesn't exist. Did the washer work normally aside from the (potentially dangerous) shock?
Comment: Yes, you are correct about Australian power. I tested it again on various spots and it varied from 4omhs to infinite.
Yes, it worked normally whilst being plugged into a grounded plug, without shocking and whilst being plugged into an ungrounded plug, with shocking.
Comment: The washing machine drum is likely coated with something, screwing with your measurements.  If you probe between two separate spots on the drum what resistance(s) do you get?  If its not near 0, your measurements arent working properly.  It may be insulated well enough to stop the tiny voltage from an ohm meter from being detected, but not stop 240V.
Comment: possible duplicate of [Plug-In Power Monitor causing washing machine drum to become electrified?](http://diy.stackexchange.com/questions/38085/plug-in-power-monitor-causing-washing-machine-drum-to-become-electrified)
Comment: Also, instead of opening 2 new questions it would probably be better to update your question from a year ago that has more information: http://diy.stackexchange.com/questions/38085/plug-in-power-monitor-causing-washing-machine-drum-to-become-electrified
Answer:
Putting  my proximity voltage detector within 40cm of the unit resulted in it  beeping (it usually needs to be within 1cm to detect anything.)

This usually means hot/neutral is reversed. There might be nothing wrong with the washer. Call an electrician first. And ground that outlet! Your machine's electronics will thank you.
(FWIW I use a non-contact voltage detector daily for diagnosing home appliances.)
Comment: Is it common for Neutral to be bonded to the chassis in Australia? If not, then I don't see how a swapped hot/neutral can cause this problem.


Best in position for Blitzball

Question: I have been playing Blitzball a lot and find it highly addictive...like others seem to also...and noticed that some people are more suited for specific positions compared to others. Obviously based upon stats. This got me thinking about who has the highest overall stats for specific positions in this game. Can anyone tell me who is best for defense, offense, and goalie based upon the specific stats and abilities that would be good for each? Obviously END and SHT for Offense, ATK and BLK for Defense, and CAT for Goalie (also specific abilities for each). If possible can you provide a location where I might find these people also? Thanks in advance!
Comment: Thanks for the info anyway! Maybe I should have kept Keepa then....oh well he's with the Ronso team in my game now. Yeah I realize the ability difference also, was hoping people answering would too like you did :p I guess I should include it
Comment: Actually, my earlier comment was incorrect.  I have since looked it up, and Keepa has (strangely) the highest `SHT` stat at max level, not `CAT`!
Comment: Actually now that you mention that I remember a friend back in the day showing me his team and Keepa was playing out on forward......yup its a fantasy alright where goalies play forward
Answer: Best stats (ignoring abilities):
SHT @ 99 : Keepa (Aurochs)
PA @ 99 : Vuroja (Kilika Beasts), Linna (Free Player)
SP @ 99 : Brother (Free Player), Nedus (Free Player)
AT @ 73 : Ropp (Free Player)
CAT @ 67 : Nimrook (Al Bhed)
BL @ 82 : Nav (Guado)
EN @ 88 : Basik (Ronso) not certain this is highest
HP @ 9999 : Many characters!
Tidus' Stats aren't incredible but his Jecht Shots can make up for them (and the fact that you can't get rid of him and that he is free...)
Compiled from: http://www.gamefaqs.com/ps2/197344-final-fantasy-x/faqs/19103
Comment: The intended `GK` has the best `SHT`? That's mental
Comment: Did you find this somewhere?
Comment: Ah, yes, taken from this source that I should have cited: http://www.gamefaqs.com/ps2/197344-final-fantasy-x/faqs/19103
Comment: There ya go :p lol

Best in position for Blitzball


How can I wire an HD antenna into my attic?

Question: I have a 2 year old house 2 floors and then an attic that you have to use a pulldown to get into.  The house has an ethernet cable (90% sure it is an ethernet cable) that is in the attic, I have a HD antenna that I want to hookup in the attic, that comes with a 100 foot cable, so I am pretty sure it will reach there.  On the 1st floor I have a relatively cheap media cabinet where all the ethernet/cable cables originate from.  How can I pipe the tv antenna cable up into the attic?
Comment: When you say "*cord*", do you mean "*power cord*" or "*data cable*"?
Answer: There's no substitute for it:  You're going to have to fish that wire.  A couple observations:
1.  If you were the "cable guy" you'd probably take the easy way out:  Drill from the living room through an exterior wall, then go up the outside of that wall.  Pretty cheesy, but common enough that people pretty much accept it without much question.  I'd recommend against it, since you don't need any extra penetrations of your exterior walls, but it is commonly done.
2.  The right way is to fish it up an interior wall or chase:  You could cut into a wall, fish the wire, then repair the drywall.  Or you could run it up a corner and make a mini chase by covering the wire with some kind of molding.  Or you could run it in a surface mount wiring tray. I've even seen some people get pretty creative with removing door molding and running wires in the space between the jamb and the framing, then drilling up through the header to get through the ceiling.  But I wouldn't recommend it, because you'll more than likely weaken the header when you drill it.  What this all adds up to is, unless you're feeling pretty ambitious, you may want to call in a pro.
Edit after all this typing:  There are TV Tuner-over-ethernet products out there.  Perhaps you put the antenna in the attic, put the TV Tuner sending unit up there, and put the TV-Tuner receiving unit in your media cabinet.  Whereby you can ignore my entire first paragraph.  :-)


Does Thunderbird Ubuntu One contacts sync work in 11.10?

Question: I have just installed Ubuntu 11.10 and am trying to get my contacts in Thunderbird to sync to Ubuntu One.
I thought it would just be a case of saving them in the Ubuntu One address book, which I have done, but these contacts do not appear in the Ubuntu One web portal.  Neither do the contacts that I already have existing in Ubuntu One (from an old experiment with Evolution) get pulled down to the address book.
The Ubuntu One console shows that Contacts sync is enabled and I can't find anywhere else that I might be able to configure anything to do with this.  Everything else in Ubuntu One seems to be working fine with this machine.
Can anyone confirm if this actually works and if so, how to go about setting it up
Comment: Contact Sync with Ubuntu One doesn't work for me either. Although I have checked "Enable Contacts Sync" in the Ubuntu One Control Panel...
Answer: From the Service Status page at one.ubuntu.com:

2011-11-02 Syncing of contacts is not working for some users due to server issues. On 2011-10-10 we released an update to all clients to help ease the load on the server and improve reliability of syncing. We're now working on finishing up adding additional server hardware.

As such, it is not working personally for me at the time of this writing. However, the way one would set up the contact sync is through the Ubuntu One control panel interface:
Comment: Yes, I'm assuming that is why it is not working for me but as I only tried to use it since they had server problems I guess I won't know until they sort it.  Did it work for you before the server issue ?  Also, it looks like this has been down for nearly a month - are outages of this length usual for Ubuntu One?
Comment: @JonReeves This last worked for me with Evolution during 11.04, I think. I'm hoping that as time goes on we won't be having anymore outages lasting this long...they had a similar problem for Firefox bookmark sync not working right and they eventually discontinued it.
Answer: What I've done is that I've disabled and then reenabled the Contacts Sync on Ubuntu One Control panel and restarted Thunderbird and all the contacts were then there.
Comment: Excellent!  Now it works!  I'm sure I tried this before and it made no difference - the Ubuntu One status was updated yesterday to say that they are still adding more servers to cope with load so maybe that is what has fixed it.
Comment: Nod: it wasn't working for me back in October '11. I figured it was hopeless and then one day ... poof. There it was.
Answer:
Open Ubuntu One.
Create/login with your Launchpad ID.
Click on Services.
Make sure Enable contact sync is marked.

There, you are done.
Comment: Already checked that.  Can you confirm that this is working for you?  I've just noticed the Ubuntu One service status says that there are some performance issues with contacts sync at the moment so that may be why I'm having problems


Reasons for preferring listening to "up to date" podcast episodes

Question: Not sure this makes a good post for this site, but I am looking for use cases which would make the podcasting model still viable in nowadays times in view of the following considerations. I wanted to know, from a usability perspective, what would make a user want to stay up to date and always listen to the latest podcast episode, as opposed to any episode. I ask because I am used to YouTube videos, address usually, i just click on any video I am interested in, and don't care about what date it was published. So, my question is, what makes podcasters care about the episode date? I mean, the only scenario I can think of is if it was about news or politics, in which case users may almost never want to download or stream and listen to old stuff.
Anyone have any other use case ideas?
Thanks.
Answer: Depends on the podcast and why a user listens.
I listen to several podcasts and there's 2 reasons why I want to stay up to date on a few of them (not all)

Storyline. Just like a TV show, some podcasts tell a story in progress. Eg I listen to the Lost Decade Games podcast all about an indie game developer's "as it happens" process of making games
Great Content / Personalities. I listen to the StackExchange podcast... every episode since the first one back when it was the Jeff/Joel StackOverflow podcast.

There are others I listen to, but without commitment to listen to every one.
For me, when I discovered the game dev podcast and realized I liked it, I went back 100+ episodes and started listening from the beginning.
Comment: The StackExchange podcast can be found using this RSS feed: http://blog.stackoverflow.com/feed/podcast/ but every podcast is different, to get better promotion many podcasters will submit their feeds to iTunes/Google Play so they can easily be found in default apps on iOS and Android.
Comment: Hi. Thank you for your reply.I've searched from the "Pocket Casts" podcast app, but all I was able to find was the "Skeptics SE Podcast", I couldn't find other SE our a generic SE Podcast. Would you be able to tell me how choke I couldn't find them?
Comment: How do podcast clients (dispatchers) search for podcasts? Is there one our mute central servers somewhere that can be queried for a list of podcast streams? How does the technology work?
Comment: So podcasters update their podcast to the server of every podcatcher out there to gain recognition? Seems strange that there would not be a central server.
Comment: What format is the URL you gave me for the podcast? Are there different formats for the files in podcast URLs, and what are these? Finally, could do I just paste the URL into my podcast client to use it. Can you please post a screenshot? When I open the intent the podcast client I have installed does not show up add a receiver on my Android device. Thanks.


After a minute running, dryer trips main breaker outside the house, but no internal breakers

Question: I recently solved (sort of?) an issue regarding my washer & dryer not getting power.  I consider that issue solved, but now I have a new one, possibly what caused the problem before.  Now that I have power to my washer & dryer, I did a small test load.  Washer did fine, but the dryer tripped the main breaker outside (100A), but none inside.  This didn't even happen when I started the dryer, but after 1-3 minutes (closer to 1 I think) it would trip.  I have tested that 4 times now and when I have the dryer off, nothing trips - but a couple minutes after starting the dryer, the whole house goes down.
The breaker panel shows no tripped breakers (all firmly on the ON side - I have turned them all off/on just in case as well).  The inside main breaker is fine too.  The outside breaker however is clearly tripped.  I clear it and turn it back on and everything is fine.  Both inside and outside are 100A.  Dryer is a 2-pole 30A breaker, which I just replaced today after noticing this new problem.
Previous post I had on my initial issue is here.  There are lots of pictures of my breaker and some other backstory on this problem.
Edit: Damn.  The outside breaker just tripped with the dryer breaker off.
Things I have on/plugged in/on: TV, router/modem, swamp cooler, fridge, water cooler/purifier, water heater, a few lights and a few things plugged in (biggest is my laptop here).
It is in the upper 90s here... could that be affecting something?
7:10pm (15 mins ago) happened again.  Did some deduction... When it tripped then, W&D breakers were off.  I left everything on the inside on and went to try and reset the outside, but it didn't reset.  Went back inside and picked the breakers with only numeric labels (1,2,3,4) and turned those off, and then the outside breaker would finally reset.  So by my logic, its one of these four.  Next time I'm going to turn these off one at a time when trying to reset the breaker, hopefully that will narrow it down more.
Comment: I would be replacing that outside breaker. It seems to be the common problem in all your scenarios. Breakers are not meant to be tripped a whole bunch. So perhaps the main breaker is not working properly, and now it's tripping more and more and more weakening it.
Comment: Can you tell me how many amps all the things plugged in/turned on/running when the breaker trips use?
Comment: That's a tough one, unfortunately I don't think I can right now but what I can say is there is nothing new that we have had plugged in recently.  We have been in this house for 6 months.  We actually had to replace the outside breaker before we moved in (freezing cold at night, needed the water heater and furnace going so pipes wouldnt burst), so that one is at least a pretty new breaker.
Comment: So I thought I had it nailed as circuit 4, so I only left the fridge on (besides that there was a toaster, microwave and water cooler on the circuit).  It tripped again, but turning off circuit 4 didn't let the thing reset... so I tried circuit 2 instead and it let it reset.  So now I think its circuit 2, but the trouble is I can't actually find something that is on circuit 2!  I think it *might* be the water heater but I can't find the plug to it, and by its nature its hard to tell if its actually off.  I'm leaving it off until I see that I need it for something.
Answer: The problem with mine was that the dryer started causing an existing loose wiring connection to spark and overheat at the panel, were it screws into the dryer breaker. The problem wasn't with the dryer or the breaker per se, but the dryer is electric so it drew so much current that it revealed the loose connection and exacerbated it, by the extreme heat and resulting oxidation of the copper. I think the heat may have been what tripped the breaker, because my Fluke tool only saw a max current draw of about 20-21A from the dryer. Find a safe way to check the main breaker's wiring connections and look for evidence of sparks and heat. Might be able to have a professional cut back the wire to a fresh spot and redo the connection, but after that kind of damage, it would make sense to spend another 10-20 dollars on a new breaker. That is, assuming my problem applies to the reader.
Answer: It seems to me, after reading all the stuff in your first question and on here that the problem is inside your cloths dryer. There is a good chance that some part of the heater coil is becoming shorted out and causing huge amounts of current to flow when the coil becomes hot.
The probable reason that it is the main breaker that trips is due to that breaker being the most sensitive to the sudden current surge short that occurs in the dryer. It may be an indication that that main breaker needs replacement but before even going down that road it is time to unplug the dryer and do a through investigation of its innards, particularly its heater unit and the wiring thereof.
Comment: Thank you - I took a look into it yesterday and at the time, it looked fine (of course, that may be different now).  However, the plot has thickened... About 10 minutes ago the breaker outside tripped, when the dryer circuit was off so of course, no dryer running.
Comment: Wow it is starting to sound like a staple or nail shorting things out. It may be time for a pro because if it is a short in the wiring that is a fire hazard the more trips the worse the problem gets until the problem circuit / wires burn apart (not good).
Comment: I have similar issues, but my main breaker tripped sporadically: some times it tripped while sometimes it isn't. Any ideas?
Answer: Sounds like it's tripping out on total load of the house, not specifically from the dryer. The fact that the problem started after replacing the dryer is coincidental. The dryer contributed to the problem, but really it is the total of current demand that is the problem. Since you only have 100 amp service, you are probably in need of a serious upgrade to 150 amp service.  The reason it's the outside breaker is that no two breakers trip at exactly the same point. In your case the outside breaker is tripping a little ahead of the inside breaker. High ambient temp outside also contributes to the outside breaker going first since the problem started in July with temps in the upper 90's.  I bet when the temps are cooler- into Sept. as I right this reply, that the problem goes away. That doesn't mean the issue is solved. You are probably running close to 100 amp total load at least some of the time.
Forget trying to find the culprit inside your house panel. You need a service upgrade to 150 amps. Hope this helps.


Ext JS 6.2.0 Classic - iconCls not works on Chrome

Question: Despite the same configuration works as expected on Firefox, the icon is not displayed on Chrome.
Here is my actioncolumn configuration:
xtype       : 'actioncolumn',
width       : 95,
align       : 'center',
sortable    : false,
menuDisabled: true,
items       : [{
    iconCls : 'icon-delete',
    tooltip : 'Delete',
    handler: function(grid, rowIndex, colIndex, node, e, record, rowNode) {
        // delete action
    }
}]

Here is the .css rules for the actioncolumn and the related iconCls:
.x-action-col-icon {
    color: #919191;
    font-size: 18px;
    height: 18px;
    width: 18px;
    cursor: pointer;
    vertical-align: middle;
    display: inline-block;
    line-height: 1;
}

.icon-delete:before {
    font: 18px/1 FontAwesome;
    color: #dd6550;
    content: "\f056";
}

The screenshot for Chrome:

And for Firefox:
Comment: Can you put your efforts [here](https://fiddle.sencha.com/#view/editor) ?so I can try to resolved issue.
Answer: Please check this fiddle, I have checked it and found working fine in both Chrome and Firefox browser.
Note: As of now I have included font-awesome and css (provided by you) in index.html
Screenshots attached:


Share information when Bigquery data is up-to-date with users

Question: I'm looking for the best place to store information when data from Bigquery table is ready for export and table is up-to-date - ready for user's queries. This information should be accesible for business users and external applications (checking will be performed e.g. every 5 minutes).
I'm going to use Cloud Composer as data workflow orchestration service but Composer metadata in Cloud SQL is accesible only for user who created Composer instance.
What are best practices to share such a data with users?
Answer: This is more like a functional requirement. Si why not at the end of each integration you add a new record in a data store.  Then make that data accessible by business users. Or you can use a store like Cloud Firestore, and when you add or modify a record you can trigger a Cloud Function that can send an email.


How to convert tuple to int?

Question: This is the code I am trying to run :
line = "123456789"
p = 2
print line[p,p+2]

And I get the error - TypeError: string indices must be integers, not tuple. How can I use line[ , ] with variables. Any help is appreciated.
Comment: You probably meant `line[p:p+2]`.
Answer: You want to use colons for slicing.
line = "123456789"
p = 2
print line[p:p+2]

That works fine.
Output:
34

Answer: line = "123456789"
p = 2
print line[p,p+2] # this is incorrect slice notation

the correct form is:
print line[p:p+2] # with a colon

look here for info on strings and string slicing

How to convert tuple to int?


Plumber drilled through exterior 2x4s - that's bad, right?

Question: I'm doing a bathroom remodel and adding a utility sink for my wife's art studio on the floor above. When we talked over the plan, I decided to go with the 2" drain they said I should use, but I had wanted to send it through an interior wall. However, they talked me into the exterior wall and said they would connect to the tub drain right where it came down. I even installed a ledger ahead of time and we talked about drilling through it for the drain.
Somewhere along the line though, the plumber changed his mind and went through 2 structural 2x4s. I was shocked when I saw it. There's less than an inch of wood on either side of the hole.
What should I do? Doesn't this weaken the wall? It even blocks me from installing the other ledger I'd planned and one of the joists it goes between has a huge gouge out of it I'd planned to deal with.
Here are some pictures:

I thought I would add an earlier picture of the joist I was going to shore up. It's a little hard to see due to the shadow, but there's a horizontal chunk of wood that is missing just above the sister. My plan, before the pipe was unexpectedly routed there, was to add a ledger on either side. That joist was notched way too wide before I bought the house. Now with the pipe in the way, I'm not sure how to address this.
More pics - Adding a few more pieces for better visualization of the off-center stud hole:

Update: I just spoke with the building guy at the township construction and code enforcement office. He pointed out that given the shape of my roof, it is a loadbearing wall. I forget the name of the roof type, but it's essentially almost like a pyramid (with a wide peak). I thought this was a significant detail I should add.
Comment: The minor annoyance is that he wasn't drilling guide holes before screwing through my shims I used to level the floor, but that's not a big deal. My main concern is structural integrity. How much of a concern is that?  I mean, a hole through 2 exterior 2x4s that leaves less than an inch of wood on either side seems pretty alarming to me. When I was learning about doing this DIY, my understanding was to not do this because they're structural.
Comment: Have him take it out, do it right, then sister the two studs. It's only permissible to compromise the structural integrity like that if no alternative route is an option.
Comment: @Kris I was debating whether to demand that or the stud shoe when the plumber boss comes. I was thinking though that if the shoe solution addresses the structural integrity issue, then they wouldn't have to redo all the work on the floor above (and I wouldn't be left with an empty hole in the baseboard up there.
Comment: @isherwood - well, it says to double (I.e. sister) the studs and add stud shoes. That would mean that the pipe would have to be removed, a new sister installed, drilled through, and then the pipe replaced. If they have to remove the pipe to do that, I would rather they just reroute it directly up on the right side then still go through two studs. I feel like there's a case for that that I can make with the plumber.
Comment: @isherwood - Respectfully, there are significant differences between this question and the proposed duplicate. Those were notches. These are off-center holes. That question was about an old install. This one is in the middle of a current job with the option to reroute. There are also issues with the pipe being above the joist/floor level with metal resting on the pipe. Undoubtedly, the current answers are similar, but the circumstances are not precisely the same. I think closing this question hampers me from finding an optimal solution.
Comment: Fair enough. I'll vote to reopen. However, there are several other similar discussions on the site that cover this topic fairly thoroughly.
Answer: Since your house is the vintage it is
Old houses, like yours, that predate modern lumber dimensioning often can't use stud shoes, as you discovered.  Since you're in that boat, you can try nailing a 8-10" piece of 2x blocking that's been notched to go around the pipe to the studs in question (this was what was done to reinforce the studs that were notched for the kitchen sink drainline in the 1950s ranch I live in).
For folks with modern studs...
This sort of problem is precisely why stud shoes are a thing.  These are sheet-metal pieces that fit over the pipe-in-stud-hole and are nailed or screwed into the stud to reinforce the weak spot the hole created.  I'd use Simpson HSS2-SDS1.5s (shown below) for this job; they're a bit trickier to install as you have to bend part of them around behind the pipe, but they're capable of transmitting both tension and compression around the hole, something regular stud shoes aren't rated for.  (They also come with all the screws you need to install them.)

P.S. If the shoe doesn't quite fit because the hole's too far forward, you should be able to use a shim between the front of the stud and the front of the shoe.  The results won't be great, but they'll be better than what you have...
Comment: Seems like the sort of thing the plumber should _come back and install as part of making the job correct_.  Anyone know if that's the case?
Comment: @hepcat72 If you look up the product pdf for the Simpson Strong-Tie stud shoes, the flange (part that appears to be in the way of installing over pipe) actually can be bent down 90 degrees to get it past the pipe, then you bend it back up.
Comment: @davidbak -- yeah, the plumber probably should have installed them to begin with...*sigh*
Comment: @JimStewart -- they are larger than what's normally allowed, but the OP described the pipe as 2" PVC, which is the largest pipe (OD = 2.375") that the Simpson shoes accept
Comment: Are plumbers qualified to install stud shoes? I always heard that when the plumbers and HVAC techs cut framing they shouldn't it's the framers who have to restore the framing to acceptable structural integrity.
Comment: Looks like they'd have the remove the pipe to install this, is that right?
Comment: A possible problem is that the hole is off center so the stud shoe *might* not be able to fit tight to the face of the stud without contacting the pipe.
Comment: What about the ledger I had planned to install? We're getting a cast iron claw foot tub and I'd planned to reinforce the floor there where the foot would go (and where the joist to the right had a big chunk of wood that came off. Plus, the metal piece they installed over that spot rests on the pipe right around where the foot will go.
Comment: It looks to me that this studshoe can be installed after the pipe is in place by bending out "wings". But if this studshoe is installed before the holes are bored, then it only permits a hole of a certain size to be bored, and directs the location. It looks like these holes are larger than normally allowed and maybe larger than this studshoe will accept.
Comment: @JimStewart Yes, I thought of that and am concerned. Also, these are studs from 1920, so I'm also concerned that the dimensions may be off for the shoe. The plumber boss is coming sometime this week to discuss the problem and do the drawings for the permit/inspection.
Comment: @ThreePhaseEel - Could you add to your answer to address the possibility that the shoe may not fit given the hole is off-center? Do you think in that case that the hole should be widened, the shoe somehow adjusted, or if it doesn't fit, should the pipe be rerouted and the studs sistered? What do you think?
Comment: @hepcat72 -- is the hole closer to the front edge or the back edge of the stud?
Comment: Front, unfortunately. You can tell from the fourth picture in the question. I'm concerned that the shoe will protrude away from the face of the stud and I wouldn't know how to deal with that.
Comment: I just added 5 more photos for better hole placement assessment at the bottom.
Comment: So when I took that next batch of pictures that I added, I noted how much bigger the hole is then the pipe. I just had the thought that maybe the pipe could be moved to be in a better position to fit the shoe, however I know what they will say if I suggest that. They will say that the pitch of the pipe would not be to code. He said that several times with the placement of other pipes, so I know he was trying to get the angles right so that it would pass inspection.
Comment: A stud shoe isn't going to fit those studs without some chiseling. I really don't think it's necessary anyway.
Comment: @ThreePhaseEel Well, the stud shoes arrived and I just held them up to the stud. They won't fit. My studs are 2&1/8" thick and these shoes only accommodate 1&1/2" studs. :(
Answer: There's really nothing to worry about here.

Yeah, the holes should've really been centered. A stud with even 3/4" of wood on each side retains much of its original stiffness, and the strength lost for just two studs is not significant. A stud with what's effectively a large notch loses a lot of stiffness. However, it's not a concern for just two studs in a wall system like this.

You don't need to repair this with hardware. There's a huge amount of strength in that wall system. Solid wood sheathing spans all those studs and ties them together. Nothing is going to fall apart. It's been done just like this for a century.
Comment: Answers like the popular one here get a lot of votes from laypeople who think that's a brilliant answer because it's simple and has a picture. Those votes are mostly based on emotion. Take them for what they're worth.
Comment: I just added another picture to the bottom of my question. It shows that there is essentially no wood to one side of the pipe. So it's not 3/4 of an inch. It's more like an eighth or less. Does that change your answer?
Comment: Also, from a contractual standpoint, if the plumber changes the design that I approved, they should review changes with me before implementing them. I am essentially the builder responsible for making a call on something like this. Had I been consulted, I would definitely have opted for an alternate solution that did not go through the studs. The reasoning for making the drain connection 2 joists over is likely a valid one, however in that case I would have suggested bringing the pipe down in that section between those two joists instead of cutting through the studs.
Comment: Not really. It's two studs (one, if you just consider the off-center one).


Divinity Original Sin Enhanced Edition PC: 'Enable Controller' Grayed out

Question: So I recently bought DOSEE on the PC.
In the options (Options - Game) the 'Enable Controller' is grayed out, despite having connected my PS4 to the computer via USB.
I've read to enable it before launching the game, which I have, but the option is still grayed out.
Anyone know a fix? Or suggesting anything? I know that the controller doesn't need an emulator because PS4 controllers are supported.
Comment: Have you connected the *Playstation* to your computer or the *Controller* to your computer? If the former, probably nothing will happen- the two computers won't know how to communicate sensibly over that protocol; if it's the latter I don't have an actual answer.
Answer: You can use the PS4controller through DS4windows. Just run the program first then open the game.
Comment: This does not answer the question. Obviously, the OP has tried to "just run the program" with his or her PS4 controller. This answer is not helpful because of this fact.
Comment: @AssafiCohen-Arazi The question doesn't mention anything about DS4windows,
Comment: @AssafiCohen-Arazi you literally say in your first comment that "this does not answer the question". Which is the same as saying it's not an answer to the question. Wipqozn is pointing out that it is an answer, giving the OP the option to use this particular program to accomplish what they want to do.
Comment: @Wipqozn The question isn't tagged with DS4, you can't just assume that they are using this. And even if they are, the answer is still not helpful because it provides no screenshots, no additional info, no source, no reference to personal experience, etc.
Comment: @AssafiCohen-Arazi They're not just assuming they're using it. It's assuming they're not, and suggesting they're do. I agree the answer isn't that helpful, but your comment is inaccurate, and this does qualify as an answer, just poorly.
Comment: @Wipqozn I never said it was not an answer. I've always mentioned the answer "is not helpful".
Comment: @Ash Alright, I see what you mean. I'll detract that part of my statement, but I stand by my opinion that the answer isn't helpful.


Critical points and strict local minimum on a differentiable function

Question: I reformulated the question and reposted it.
Let $f: (a, b) \to \Bbb R$ be a differentiable function such that for some $c\in (a, b)$, $f(c)$ is a strict local minimum, i.e., exists $\varepsilon>0$ such that $f(c)<f(x)$ for all $x\in (c-\varepsilon,c+\varepsilon)$. Suppose also that there is a point $d \in (a, b)$ such that $f(d) \le f(c)$. Show that there is at least one critical point between $c$ and $d$.
It's like adjustmente for the theorem of the intermediate value, for derivatives.
Since $f$ is differenciable, it is continuous.
Is there a contradiction in to say that $f(c)$ is a strict local minimum, i.e., exists $ε>0$ such that $f(c)<f(x)$ for all $x∈(c−ε,c+ε)$, on the way that $f(d) ≤ f(c)$?
How the mean value theorem could help here?
Answer: Assume WLOG that $d>c+\epsilon.$ Since $f$ is continuous and $f(d)\le f(c)$ there exists $x_0\in (c,d]$ such that $f(c)=f(x_0).$ (See $\bullet$.) Now, it follows from Rolle's theorem that there exists $x_1\in (c,x_0)$ such that $f'(x_1)=0.$

Consider $f:[c+\epsilon,d]\to \mathbb{R}.$ If $f(d)=f(c)$ we are done. So, assume $f(d)<f(c).$ That is, we have $f(d)<f(c)<f(c+\epsilon).$ It follows from the Intermediate value theorem (see https://en.wikipedia.org/wiki/Intermediate_value_theorem) the existence of $x_0$ such that $f(c)=f(x_0).$


how to do a button who open a popup

Question: i know that is a "newbie" question but i m totaly new in web dev and i have project in react js.
I try to do a button who open a mini window.

  const redirecttest = () =>{
    <Popout url='popout.html' title='Window title' onClosing={this.popupClosed}>

test

    </Popout>
  }
  console.log(mail);
  return (

        <button type='button' onClick={()=>{redirecttest()}}>Create an area</button>

i tried that but my web navigator doesnt like it and say this:
TypeError: undefined has no properties

  66 | const redirecttest = () =>{
> 67 |   <Popout url='popout.html' title='Window title' onClosing={this.popupClosed}>
     | ^  68 |
  69 |   </Popout>
  70 | }

can someone help me please :)

Answer: You would need to create a state for the popup visibility, and an event to set between 'open' or 'close', something like:
const [isOpen, setOpen] = useState(false);

function handleVisibility() {
  setOpen(prev => !prev);
}

return (

    <button type='button' onClick={handleVisibility}>Create an area</button>
    {isOpen &&
      <Popout url='popout.html' title='Window title'>

test

      </Popout>
    }

)

Answer: try this.. Take note that what you put inside the curly brackets{} tells react to evaluate it as a javascript expression. If you want to return a JSX, you use parenthesis ().
const redirecttest = () =>(
      <Popout url='popout.html' title='Window title' onClosing={this.popupClosed}>

      </Popout >
 );

side note: parenthesis is optional. You only need to wrap your JSX return with parentheses if it's multi-line
return
one line
;
return (

multi-line

Yes it is/h1>
);

how to do a button who open a popup


How to get around strategic eager loading in Datamapper?

Question: I'm processing a ton of book records (12.5 million) with Ruby and Datamapper. On rare occasion I need to grab associated identifiers for a particular book record, but Datamapper is creating a select statement grabbing all the associated identifiers for all the book records. The query take more than 2 minutes.
http://datamapper.org/why.html
The help document says this is "Strategic Eager Loading" and...
"The idea is that you aren't going to load a set of objects and use only an association in just one of them. This should hold up pretty well against a 99% rule.
When you don't want it to work like this, just load the item you want in it's own set. So DataMapper thinks ahead. We like to call it "performant by default". This feature single-handedly wipes out the "N+1 Query Problem"."
However, how do you load an item in it's own set? I can't seem to find a way to specify that I really only want to query the identifiers for one of the book records.
Comment: Okay, I think I've figured out the problem and a workaround. In order for associations for record to be selected without selecting all associations, you have to originally select the record with Record.get(). I was selecting the record with Record.first(). Though the results are the same, Datamapper subsequent association queries are different. Datamapper will grab all assocations when you use Record.first and Record.last as if you used Record.all.
Comment: My workaround is to query twice. First I use record = Record.first(). Then I grab the record again using record = Record.get(). That solves the issue.
Answer: If you are experiencing this issue, it might be because you are using Model.first() rather than Model.get(). See my comments under the question too.
As of DM 1.1.0...
Example using Model.first:
<code># this will create a select statement for one book record
book = Books.first(:author => 'Jane Austen')

# this will create select statement for all isbns associated with all books
# if there are a lot of books and identifiers, it will take forever
book.isbns.each do |isbn|
  # however, as expected it only iterates through related isbns
  puts isbn
end
</code>
This is the same behavior as using Book.all, and then selecting the associations on one
Example using Model.get:
<code># this will create a select statement for one book record
book = Books.get(2345)

# this will create select statement for book with a primary key of 2345
book.isbns.each do |isbn|
  puts isbn
end
</code>


Let $\mu,\nu$ be two finite positive measures. Show that, there is a set $E$ such that $\mu_E\ll\nu_E$ and $\mu_{E^c}\perp\nu_{E^c}$

Question:
Let $\mu,\nu$ be two finite positive measures on $(X,\mathfrak{M})$. For $E\in\mathfrak{M}$, we define $\mu_E(A):=\mu(A\cap E)$ and similarly $\nu_E$. Show that, there is $E\in\mathfrak{M}$ such that $\mu_E\ll\nu_E$ and $\mu_{X\setminus E}\perp\nu_{X\setminus E}$

We define the signed measure $\lambda=\mu-\nu$. By John Hahn Decompostition, $\lambda=\lambda^+-\lambda^-$ and there are $E,F\in\mathfrak{M}$ which are disjoint, $E\cup F=X$ such that $\lambda^+=\lambda_E$ and $\lambda^-=\lambda_F$.
So, $\lambda^+=\mu_E-\nu_E$ and $\lambda^-=\mu_F-\nu_F$. We have $\lambda^+\perp\lambda^-\implies \mu_E-\nu_E\perp \mu_F-\nu_F\implies \mu_E\perp\nu_F$ and $\mu_F\perp\nu_E$. But this is obvious, because $\lambda_E$ and $\nu_F$ are concentrated on $E$ and $F$ respectively and they are disjoint. I have to find $E$ such that $\mu_E\perp\nu_E$.
And I am not having any way out for the absolute continuity case? Can anyone help me to solve the problem?
Thanks for your help in advance.
Comment: If $\mu = \nu$, then, $\mu|_{E} = \nu|_{E}$ and $\mu|_{E^c} = \nu|_{E^c}$ for every $E$. So it may be better to assume that $\mu \ne \nu$.
Comment: If $\mu=\nu$, we can take $E=X$.
Answer: Hint: Let $\lambda =\mu +\nu$. Be Radon Nikodym Theorem we can  write $\mu(A)=\int_A f d\lambda$ and $\nu(A)=\int_A g d\lambda$. Let $E=\{x: f(x)g(x)>0\}=\{x: f(x)>0\}\cap \{x: g(x)>0\}$ and $F=\{x: f(x)g(x)=0\}$. It is fairly easy to see that this meets the requirements.


Sort a map by value in javascript and keep one field index to top

Question: May be this is a very simple question on this forum but I couldn't find the answer being novice to javascript.
I have this following code in javascript -
Let map = new Map<String,String>
map.set('0', select)
map.set('1', "foo");
map.set('2', "bar");
map.set('3', "baz");

I want to sort this map based on value. But index 0 should be on top and others should be sorted. So the final output should be printed as below -
[{'0':'Select'},{'2':'bar'}, {'3':'baz'}, {'1': 'foo'}];

Could you please help me on this?
Comment: Applying the accepted answer to your question's code: `map = new Map([...map].sort(([k1, v1], [k2, v2]) => v1.localeCompare(v2)));`
Comment: You could sort the keys and access them in order (i.e. `Object.keys(obj).sort()`)
Answer: You could get the Map#entries of the map and sort the array.
To move a certain value to top (or keep this value at top), you need a return value for Array#sort which reflects the wanted order. In this case a is taken fom the conditions and if falsy, like zero, the second part after the logical OR || is taken.

let map = new Map();

map.set('0', "Select");
map.set('1', "foo");
map.set('2', "bar");
map.set('3', "baz");

result = Array.from(map).sort(([, a], [, b]) =>
    (b === 'Select') - (a === 'Select') || a.localeCompare(b)
);

console.log(result);
Comment: you could cast the values to number: `Number(b === 'Select') - Number(a === 'Select')`
Comment: Thanks Nina .. I have accepted this answer. I have an entry in map as below -
map.set('0',"Select")
Is it possible to sort other entries and keep the select on top ?
Comment: you need a check for the top value and take the delta of the check. please see edit.
Comment: I am getting below error on (b === 'Select') - (a === 'Select')
The left hand side of an arithmetic operation must be type 'any', 'number','bigint' or enum type
Comment: Thank you so much :) Wish I could vote you more


Layout of multi-purpose status update box

Question: I'm building a status update box similar to the one found on Facebook and Google+. Mine will allow for multiple types of posts such as status updates, code snippets, images, projects and applications.  I'm just looking for suggestions on the layout.  I do like the Google+ layout with grey icons at the bottom right representing the different types of posts, but I'm not sure how clear it would be what you can post.  My options are a bit unique.  Facebook labels their choices, but I feel they have more of an outdated look with small colored icons.  So I'm looking for a combination of the two where I can use icons, but somehow make it obvious what can be posted.  I'd also like to possibly incorporate the arrow keys on the keyboard to choose what you're posting.
This is what I have so far and I really don't like how it looks.
Comment: Have you come up with any ideas so far yourself? If so then can you post an image or mockup for us to make suggestions against.
Comment: Added screenshot.
Comment: I would definitely keep the text labels.  Icons alone cannot accurately depict the concepts you described: Status, code, images, projects, apps.
Comment: Thank you Jung. Now I just need to figure out how to make it look better.
Answer:
How about a colour coded difference. Klicking in one would give the input field another colour. Or hovering over "image" would give an example text that appears in the input box and dissapears when you are "mouse out"
Comment: Yes, icons would look nicer but keep the labels. Even if they are small.
Comment: I like your idea of the placement. I'd like to use greyscale icons with labels that appear upon hover.
Comment: Maybe I can overlay the labels over the icons, possibly the bottom right.  I found a very nice set in which I can create 32x32 icons.
Answer: I feel using the image icons make for a nice visual and minimalist look. Out of curiosity, people do tend to hover over to see if there's any tooltip to explain the required functionality.
You could also have a little icon on the corner which can "Toggle" the labels with the images to allow users to hide/show the labels if required.
This way you can use both the ideas and allow visitors a little personalization in addition to using well perceived conventions as little icons that they are already familiar with.
Comment: I'm not sure exactly what you mean.  Can you create a mockup?  Balsamiq Mockups is nice.
Answer: If you're feeling ambitious (assuming this isn't something you've already got on the roadmap) you could have your update box auto-recognize the type of content being posted, and highlight the corresponding icon:

download bmml source – Wireframes created with Balsamiq Mockups
Comment: Interesting idea, but each type of post has a unique form with particular elements.


Space between block color glitch

Question: Why am I getting those weird glitches and how can I stop it? I've never had them before 1.5.
Answer: From the 1.5.1 patch release notes:

Notable: White stitching between blocks should be less frequent

So presumably, the answer is to wait a few days for that to be released (or snag the prerelease, up now, if you feel brave)

Space between block color glitch


Iphone Developer Program

Question: Is there a restriction or limit for the number of installed/distributed iPhone applications with the Standard Program? (Individual and/or Company)
Answer: the basic $99 developer program allows for 100 ad hoc ( non app store ) deployments. the $299 program is for internal ad hoc applications for companys with 500 or more employees, all this is easily available on the developer.apple.com website.
Answer: no there is no restriction if they are deployed through the appstore, distribution for an internal app using ad-hoc distribution is valid for up to 100 devices
Comment: If they're not (Ad Hoc/In-house distribution), there's still no limit.
Comment: Where did you get 50 devices from? It's 100, not 50.
Comment: Found it in another stackoverflow post, I'll change it :)
Answer: To be pedantic, there's no limit to the number of APPLICATIONS you can distribute, only the number of DEVICES that you may distribute to. As mentioned, you can distribute to 100 different DEVICES using the regular Developer license, but each device can have unlimited applications deployed to it.
Also, the 100 Device limit is reset each year.

Iphone Developer Program


What is the solution to the first Reachwater Rock puzzle

Question: What is the solution to the first Reachwater Rock puzzle, I've got the claw (hard to miss) but can't find any hints as to what the solution might be.

 Its for the quest to reforge Gauldur's amulet in the questline Forbidden Legend.

Update:
I've bruteforced the solution, see my answer, if someone can point out the hints I've missed I'll accept their answer, otherwise I'll accept my own in a few days.
Comment: I must have encountered a glitch, because I followed the quest so far, got the claws, put in the right combo and turned the claw, and the door wont open! SO frustrated!
Answer: You can find the solution on the back of the claw: open your inventory, inspect it, and rotate it around. As you noted, the solution is:

Outer: Bear
Middle: Whale
Inner: Snake

There are a few puzzles that consist of looking at the quest item at different angles: Bethesda seems to have been very proud of this feature, and these quests appear to just be a means to highlight it.
Answer: If some are looking here for the 2nd one, it's (I used bruteforce):

Eagle
Eagle
Dragon

This is actually the Ivory Dragon Claw for the second door. If you look at the claw in your inventory, you will see the combination on the underside of the claw itself.
Answer: Aha, I still haven't found any hints, but I've brute forced my way through.
It is (top to bottom) Bear, Whale, Snake.
Comment: yea, did the same this with this one, nothing on all the walls seem to hit to the answer (must have missed it).
Comment: Probably, if someone points out the hints I'll accept their answer, editing the question to reflect that.


Why is the counter output always x?

Question: I am having problem with this counter. The output is all xxxxxxxx. I know I should set the initial value of count and overflow to 0, but it gives an error that way.
module counter (in, start, count, clk, overflow);
input [3:0] in;
input clk;
input start;
output reg [7:0] count;
output reg overflow;
//reg count;
//count =0;
//overflow=0;
always @ (posedge clk)
  begin
    if (start) begin
      count <= 8'b0;
      overflow <= 1'b0;
    end

    else if (in == 4'b0101) begin
      count <= count+1;
    end
    if (count == 4'b1111) begin
      overflow <=1'b1;
    end
  end
endmodule

This is the testbench:
module tb();
  reg [3:0] in;
  reg clk,start;
  wire [7:0] count;
  reg overflow = 1'b0;

  initial begin

    $display ("time\t clk start in count overflow");
    $monitor ("%g\t %b %b %b %b", $time, clk, start, in, count, overflow);

    clk=0;
    in=0;
    start=0;
   // overflow=0;
   // count=0;

    #5 in=4'd1;
    #5 in=4'd5;
    #5 in=4'd4;
    #5 in=5'd5;
    #5 in=4'd1;
    #5 in=4'd5;
    #5 in=4'd4;
    #5 in=5'd5;
    #5 in=4'd1;
    #5 in=4'd5;
    #5 in=4'd4;
    #5 in=5'd5;
    #5 in=4'd1;
    #5 in=4'd5;
    #5 in=4'd4;
    #5 in=5'd5;
    #50 $finish;
  end

    always #5 clk=~clk;

  counter u0(.*);
endmodule

Comment: Count will remain at X until `start` goes to 1. What error are you getting?
Comment: Yes you have not reset the counter through start signal
Answer: There are two issues that need to be fixed.
1) Coincidently in=5 is set only during the neg edge of clock. This is because clk cycle is #10 and the tb code changes "in" value every #5 .As the counter checks the value of in at posedge it misses the in = 5.
The in time period needs to #10 or the TB can wait for a posedge of clk before setting signal "in".
2) the start needs to be set for the counter to reset , else the value of count = x (unknown) and count+1 => x+1 which equals x. Hence the counter will not increment and continue to remain x throughout.
Updated tb is below .
module tb();

  reg [3:0] in;
  reg clk,start;
  wire [7:0] count;
  reg overflow = 1'b0;

  initial begin

    $display ("time\t clk start in count overflow");
    $monitor ("%g\t %b %b %b %b", $time, clk, start, in, count, overflow);

    clk=0;
    in=0;
    start=0;
   // overflow=0;
   // count=0;

    #10 start = 1'b1; // reset counter
    #10 start = 1'b0;
    #10 in=4'd1;
    #10 in=4'd5;
    #10 in=4'd4;
    #10 in=5'd5;
    #10 in=4'd1;
    #10 in=4'd5;
    #10 in=4'd4;
    #10 in=5'd5;
    #10 in=4'd1;
    #10 in=4'd5;
    #10 in=4'd4;
    #10 in=5'd5;
    #10 in=4'd1;
    #10 in=4'd5;
    #10 in=4'd4;
    #10 in=5'd5;
    #50 $finish;

  end

    always #5 clk=~clk;

  counter u0(.*);

initial  // Dump waveform for debug
$dumpvars;

endmodule

You can dump waveform using $dumpvars command to debug.
Alternative code ( using posedge event to drive data in test bench )
// Code your testbench here
// or browse Examples
module tb();

  reg [3:0] in;
  reg clk,start;
  wire [7:0] count;
  reg overflow = 1'b0;

  initial begin

    $display ("time\t clk start in count overflow");
    $monitor ("%g\t %b %b %b %b", $time, clk, start, in, count, overflow);

    clk=0;
    in=0;
    start=0;
   // overflow=0;
   // count=0;

    @(posedge clk )   start = 1'b1;// reset counter
    @(posedge clk )   start = 1'b0;
    @(posedge clk )   in=4'd1;
    @(posedge clk )   in=4'd5;
    @(posedge clk )   in=4'd4;
    @(posedge clk )   in=5'd5;
    @(posedge clk )   in=4'd1;
    @(posedge clk )   in=4'd5;
    @(posedge clk )   in=4'd4;
    @(posedge clk )   in=5'd5;
    @(posedge clk )   in=4'd1;
    @(posedge clk )   in=4'd5;
    @(posedge clk )   in=4'd4;
    @(posedge clk )   in=5'd5;
    @(posedge clk )   in=4'd1;
    @(posedge clk )   in=4'd5;
    @(posedge clk )   in=4'd4;
    @(posedge clk )   in=5'd5;
    #50 $finish;

  end

    always #5 clk=~clk;

  counter u0(.*);

initial
$dumpvars;

endmodule

Why is the counter output always x?


Why is smoke entering my home through the fireplace?

Question: I recently moved to a new home with a wood burning fireplace.  I've never owned one of these before and I want to become familiar with it.
With a fire extinguisher and a pot of water ready, I placed some kindling and a dry log (that came with the house) in the fireplace, along with some clippings from a shrub and some clippings from a paper shredder.  Then, I lit the fire and closed the door.
Within a few minutes, a cloud of noxious smoke wafted into the room.  Not knowing what could be wrong, I drowned the fire.  After this, I stepped outside and observed that there was a little bit of smoke rising from the chimney.
As someone who has never owned a fireplace before, what do I need to know to operate my fireplace safely and avoid smoke coming in my home?
Comment: Also - try hearth.com
Answer: Damper closed - most likely.
Chimney blocked - while "damper closed" is a self-correctable version of this, if the fireplace has not been inspected there may be anything from bird nests to parts of a chimney in serious disrepair blocking the flue.
SO - before you become a statistic (of the chimney fire sort) call a chimney sweep and have the flue inspected to be sure it is in safe condition to use, and find out where the damper control is (often a lever or chain hanging down in the top of the fireplace.)
Another possible problem, particularly common if the fireplace & chimney is on the outside wall of the house, would be an excessively cold flue - sometimes curable by putting newspaper up into the throat of the fireplace and lighting it (before lighting the fire), to get air moving the right direction (up and out.)
Comment: Damper closed - and I didn't even know the thing existed before you told me about it.  I opened it up and tho I couldn't see the sky directly, I could see light shining in.
Answer: Chimneys have a damper, which is a flap meant to be closed when the chimney is not in use.  Look up from the inside of the hearth and you'll likely see a handle or chain.  Generally you cannot see the sky, even with the damper open.
If the house is new to you, but not new, have the chimney inspected, and the nice person who does the work will give you tips on fire starting.  Shrub clippings are likely too fresh to burn without excessive smoke.  My parents liked to start a bit of newspaper up the chimney to get the draft going, but that's purely a refinement of the technique.
When done, close the damper to prevent loss of conditioned air.
Answer: "Flue Blockage" is the generic answer, ranging from the sliding damper being closed to some kind of physical blockage. A fire doesn't need to be totally blocked for there to be smoke come back into the room. It is a simple case of pressure - if there's less pressure in the room than in a slightly-blocked flue you will still get smoke blow back into the room.
Two common cases not mentioned by Ecnerwal are

Depending on the type of your fireplace, many have a metal plate in the top of the fireplace which can be removed. This makes the hot air rise in a flattened "S" shape across the top of the fire, before it goes up the flue. If this plate has been dislodged or put back at an angle, it can impede the flow of air.
Your flue may be blocked with soot - loose, fluffy, sticky material from partly-burned material. This is often cleaned by professionals. I have cleaned it using a long stiff wire, the high-tensile steel wire used in farm fences. With a section about 1.5 times the height of the flue (yes, I'm talking many meters) I fed it into the flue and swirled it around in a spiral motion as I went. This approach requires being able to clearly access the bottom of the flue, which means removing a heavy plate such as described in point 1.

Cleaning soot from your flue may need to be an annual event - it depends hugely on what you burn and particularly how "green" the wood is - wood for burning should generally be seasoned by being stored for at least a year, for sap to evaporate.
Answer: I have a modern home that is sealed against draughts. If I light my wood burner and all the windows are closed, as the fire burns it reduces the pressure in the room. This causes the smoke to start coming back down the chimney and into the room.
So a suggestion would be to ensure you have a window open before you light the fire.
Comment: @Ecnerwal I like to poke fun at the Queen's English, from time to time. Sealing your home against checkers is a ridiculous endeavour. Those pesky bastards always find a way in.
Comment: [Draughts](http://en.wikipedia.org/wiki/Draughts)?
Comment: draught

noun
noun: draught; plural noun: draughts; noun: draft; plural noun: drafts
1.
a current of cool air in a room or other confined space.
"heavy curtains at the windows cut out draughts"
synonyms: current of air, rush of air, breath, whiff, waft, wind, breeze, gust, puff, blast, gale;
Comment: If you're not used to "separated by a common language" you haven't been paying attention, @Tester101 - British and American "English" have many little differences - gray and grey, color and colour, draft and draught, queue and line, grounded and earthed, a national dedication to terrible beer, common availability of good beer...


Javascript to Clojurescript interop with react-spring

Question: I am trying to implement react-spring (https://www.react-spring.io/docs/hooks/basics) into my Clojurescript proct and I am struggling to translate this to clojurescript
import {useSpring, animated} from 'react-spring'
function App() {
  const props = useSpring({opacity: 1,
                           from: {opacity: 0}})
  return <animated.div style={props}>I will fade in</animated.div>
}

So far this is what I have done:
I have required the following:
(:require
[useSpring]
[animated])

and in a let block I have something like so:
(defn example-app []
   (let [props (useSpring (->js {:opacity 1
                                 :from  {opacity: 0}}))]
    (def props props)
    [:animated.div {:style props} "I will fade in"]
))

The variable props returns this :
#js{:opacity #object[AnimatedValue [object Object]]}

Than this is how I render the animated object
(react-dom/render
(hx/f [example-app])
(goog.dom/getElement "example-app"))

This is the error that I get
#object[Error Invariant Violation: Objects are not valid as a React child (found: object with keys {ns, name, fqn, _hash, cljs$lang$protocol_mask$partition0$, cljs$lang$protocol_mask$partition1$}). If you meant to render a collection of children, use an array instead.
in core$example_app]

What am I doing wrong?  What am I missing?
Comment: whats the React error?
Comment: I have edited the question and added the error. Thanks
Comment: See this answer for a similar example of another React library consumed from a ClojureScript project: https://stackoverflow.com/a/58871983/483566
Comment: @DenisFuenzalida see above what I have also tried. I do not use reagent
Answer: I did manage to get a basic example to work, hopefully it will help you get started:

I cloned my example repo: https://github.com/dfuenzalida/cljs-react-intl/ (I created this for a test on react-intl, will work for you too)
From the checked out repo, I installed react-spring with yarn install react-spring
I edited the file shadow-cljs.edn to add the dependency on lilactown/hx:

{:source-paths ["src"]
 :dependencies [[lilactown/hx "0.5.3"]]
 :dev-http {8080 "target/"}
 :builds {:app {:output-dir "target/"
                :asset-path "."
                :target :browser
                :modules {:main {:init-fn app.main/main!}}
                :devtools {:after-load app.main/reload!}}}}

I replaced the contents of src/app/main.cljs with the react-spring example, adapted a bit:
(ns app.main
  (:require [hx.react :as hx :refer [defnc]]
            ["react-dom" :as react-dom]
            ["react-spring" :as spring]))

(defnc AppComponent [{:keys [title]}]
  (let [props (spring/useSpring (clj->js {:opacity 1 :from {:opacity 0}}))]
    [:<>
     [spring/animated.div {:style props} title]]))

;; App initialization

(defn mount-root []
  (react-dom/render
   (hx/f [AppComponent {:title "I will fade in"}])
   (js/document.getElementById "app")))

(defn main! []
  (mount-root)
  (println "[core]: loading"))

(defn reload! []
  (mount-root)
  (println "[core] reloaded"))

Finally, ran yarn install to download any missing deps and then yarn run html and yarn shadow-cljs watch app to start the compiler in watch mode. The console will show something like:
$ yarn shadow-cljs watch app
yarn run v1.17.3
$ /tmp/cljs-react-intl/node_modules/.bin/shadow-cljs watch app
shadow-cljs - config: /tmp/cljs-react-intl/shadow-cljs.edn  cli version: 2.8.74  node: v10.16.0
shadow-cljs - updating dependencies
...
shadow-cljs - dependencies updated
shadow-cljs - HTTP server available at http://localhost:8080
shadow-cljs - server version: 2.8.74 running at http://localhost:9630
shadow-cljs - nREPL server started on port 43685
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (156 files, 11 compiled, 0 warnings, 9.21s)

Once you load your app at http://localhost:8080, you should see something like:

The animation actually works, but I couldn't figure how to make the other examples to work (eg. the scroll example or the counter).
I hope this helps!
Comment: Ahh I see react fragments
Comment: What does is this `:<>`?


Equal division of rectangles to make total?

Question: I want to specify a number and have that number halve itself equally so that the bottom of my canvas fills with rectangles.  For instance, if I specified the number 4, the bottom of my canvas would have 4 rectangles, each rectangle smaller than the last, until the bottom half of the canvas was filled.  The total size of the rectangles would be approximate to half the size of my canvas.
 _______________
|               |
|               |
|               |
|               |
|_______________| <- middle = 240
|________d______|
|________c______|
|________b______|
|        a      |
|               |
 ---------------

Where a, b, c, and d, represet sections each rectangle.  A would be the largest rectangle, B would be around half the size of A, and C would be around half the size of B, so that the entirety fills up half of my canvas, etc.
What formula could I use to achieve this?
I'm developing an application and would obviously do each calculation inside of a loop, hence, I would only need to know how to calculate each individual rectangle while plugging in the iteration of my loop. e.g.
totalRects = 4;
middle = 240;
for(int i = 0; i<totalRects; i++)
{
   // Calculate size of rectangle of current iteration and draw.
}

Update  Using the formula provided in the answer below, the total sum of the pieces don't add up to the mid point:

The black line represents the midpoint of 240.
Answer: For $n$ rectangles, if you measure in terms of the length of the first rectangle, you have a total length of $$1+\frac{1}{2}+\frac{1}{4}+\ldots +\frac{1}{2^{n-1}}=\sum_{1=0}^{n-1}2^{-i}=2-2^{1-n}$$  So divide the total length by $2-2^{1-n}$ and that is the size of the first rectangle.  This is an application of a geometric series
Comment: @George Ross meant to type $2-2^{1-n}$.
Comment: Thanks for the quick response. I've tried your application above as, `size = 240 / (2 - Math.Pow(2, 4 - 1))` Where my my center and *n* is the number of rectangles I want to produce. I'm getting `-40`. What am I doing wrong?
Comment: @DavidMitra:  yes.   Fixed
Comment: @RossMillikan I updated my problem with your formula, and the division of the rectangles exceeds that of the midpoint.
Comment: @George:  I don't understand what you mean by midpoint.  If you want $4$ rectangles to fit in 240 pixels, the formula says they add to $1\frac{7}{8}$. Multiplying $240 \cdot \frac{8}{15}=128$ so the rectangles would be $128, 64, 32, 16$ which add to $240$.  I think you have an off-by-one error, as I got 265 as well using $1\frac34$
Answer: Let $a$ denote the area of the first and largest rectangle.
Assuming we want to draw $n>0$ rectangles, We can say that the total area of the page $T$ is:
$T= a +  (\frac{1}{2}) a +(\frac{1}{4}) a +...+ (\frac{1}{2})^{n-1} a$
$T=a(2-2^{1-n})$
$a=\frac{T}{2-2^{1-n}}$
Accordingly, the area of the (k-th) rectangle can be found using the value of $a$ above and this formula:
$a_k =\frac{a}{2^{k-1}} $


The 20-GB Storage with music, does it have to be used for music?

Question: The 20-GB Storage with music, does it have to be used for music? Or can I use it for documents / whatever I want
Title prtty much says it all, just a question befor i decided if i wana take up on the offer :P
Comment: Judging from the page on the official Ubuntu about the Ubuntu One, I think its streaming music from the cloud + 20GB storage space, rather than just 20GB storage space (the offer to the right) on that page.
Answer: You may use that storage for anything you want to; it is not limited to just music. You can store purchased music from the Ubuntu One music store, your own music, photos, documents, whatever you want. :)


1/4 copper to 1/2 PEX to 1/4 copper?

Question: I have an old home that has a 1/4 copper line running from a copper valve tee in the basement, directly up through the floor boards, into the fridge.
I'm trying to add an ice maker valve box behind my fridge (to stop constant leaks when the fridge is moved).  The valve box I got accepts 1/2 PEX into it, and has a 1/4 compression fitting.
Can I use some sharkbite fittings to go from a stub of the existing 1/4 copper line, into 1/2 PEX, up to the valve box, then back to 1/4 copper/braided to connect the fridge?  Will I have enough pressure?
I'd definitely prefer not to mess with the good job someone did on the copper valve tee.
Thanks!
Comment: It isn't clear why presence of a valve would stop leaks -- it's hard to decide whether an answer should address how to incorporate the valve you picked, or whether it would be better to address the unasked question "the existing piping arrangement leaks when the fridge is moved; how could I fix that?"
Comment: At a minimum, a picture of the parts in question would help people understand what's going on.
Answer: Since a fridge doesn't draw much water,  feel free to use whatever PEX to pipe adapters you can find, attached to appropriate pipe-size adapters to get to the size copper you need. It doesn't have to be elegant, it just needs to be water-tight and fit in the available space.

1/4 copper to 1/2 PEX to 1/4 copper?


Nginx location regex for css and js

Question: As my configuration, I'd like to serve css and js in location /luz_online_web, only access to /luz_online_web/*.css or .js is proxy_pass to http://22.214.171.124:8085/luz_online_web/.
server {
    server_name ~(?<name>[^.]+)\.dev\.abc\.io$;
    location  / {
      proxy_pass http://220.127.116.11:8085/luz_online_web/$name$request_uri;
      include /etc/nginx/klara-reverse.conf;

    }
    location ~* ^/luz_online_web/(.+\.(css|js))$ {
        rewrite ^/luz_online_web/(.*)$ /luz_online_web/$1 break;
        proxy_pass http://220.127.116.11:8085;
    }
}

But css and js file still not be loaded when I access to website.
CSS, JS file located in /luz_online_web directory while other files(HTML,PNG..) stored in /luz_online_web/name directory. If I remove filter and set location /luz_online_web/, they could be loaded, the path of js file such as
/luz_online_web/javax.faces.resource/jsf.js;jsessionid=SnhEULxbunZ9F6OEGRtJrMmy

Any idea?
Comment: so what is the difference between normal HTML files and CSS/JS files? seems both get from proxy. Can you elaborate?
Comment: @JonnieJS: normal html files could be load from luz_online_web/$name while css/js need to be load from luz_online_web folder.
Comment: and it is the **same** directory. please try to explain me where exactly every resource is located.
Please make edits for your question and try to add as many details as possible. Thanks.
Comment: @JonnieJS: it not the same. CSS, JS file located in /luz_online_web directory while other files(HTML,PNG..) stored in /luz_online_web/name directory. I just updated my question.
Comment: Can you please provide one example to css file path, and one example to png file path? it seems to me it is the same.
Answer: My issue is solved, I remove $ at the end of regex location, due to .css and .js in between of URL instead of the end.
location ~* ^/luz_online_web/(.+\.(css|js)) {
    rewrite ^/luz_online_web/(.*) /luz_online_web/$1 break;
    proxy_pass http://22.214.171.124:8085;
}

Nginx location regex for css and js


How to show collection image data without url image from database in stimul Report

Question: i use stimulsoft report for report collection image data from database, I use variable to pass parameter list collection to my report but it not working!!
my code shown below :
var imgConverter = new ImageConvert();
        var report = new StiReport();
        var t = new DataTable();

        t.Columns.Add("Img");

        foreach (DataGridViewRow dgv in dataGridViewX3.Rows)
        {
            t.Rows.Add(

               imgConverter.ByteArrayToImage((byte[])dgv.Cells["BarcodeImg"].Value)
            );
        }

        report.Load("BarcodeReport.mrt");
        report.RegData("DSBarcode", t);
        report.Compile();
        report.Show();

Answer: I think your problem will be solved with this example
DataSet ds = new DataSet();  System.Drawing.Image img =
System.Drawing.Image.FromFile(Server.MapPath("") +
"//image//titleLogo.jpg");
        byte[] bytes = (byte[])(new ImageConverter()).ConvertTo(img, typeof(byte[]));

dtTicket = new DataTable();  dtTicket.Clear();
dtTicket.Columns.Add("imgLogo", typeof(byte[]));

Row = dtTicket.NewRow();  Row["imgLogo"] = bytes;
dtTicket.Rows.Add(Row);  ds.Tables.Add(dtTicket);

Comment: Hello and welcome to SO! Please read the [tour](https://stackoverflow.com/tour), and [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer)
Answer: var imgConverter = new ImageConvert();
        var report = new StiReport();
        var t = new DataTable();
        //you should be define type of object in overload DataTable Column
        t.Columns.Add("img", typeof(Image));

        foreach (DataGridViewRow dgv in dataGridViewX3.Rows)
        {
            t.Rows.Add(

               imgConverter.ByteArrayToImage((byte[])dgv.Cells["BarcodeImg"].Value)
            );
        }

        report.Load("BarcodeReport.mrt");
        report.RegData("DSBarcode", t);
        report.Compile();
        report.Show();


msiexec run from innosetup displays help dialog

Question: I've got the following code as part of my setup script:
[Files]
Source: "{#SetupDir}\IronPython-2.7.3.msi"; DestDir: "{app}\Resources"; Components: Centipede; Check: IronPythonNotInstalled

[Run]
Filename: "msiexec.exe"; Parameters: "/I ""{app}\Resources\IronPython-2.7.3.msi"" /qb"; WorkingDir: "{app}\Resources"; Flags: shellexec; StatusMsg: "Installing IronPython"; Components: Centipede; Check: IronPythonNotInstalled

But every time I run the installer, I'm getting the help dialog, as when you run msiexec without any parameters.  It's probably just a silly mistake, but I can't see what it is.
The file is getting copied correctly, and the msi is valid (running it from the command line works fine).
Answer: The issue here is slightly more complex than I thought: the setup I was running was an old copy of the code.
Due to my environment, I was compiling the installer, pushing it to a (local) web server, then downloading on the test machine, and then running it.
I tried replacing msiexec with a "dump args" tool, and noticed that it still called msiexec.
Testing checksums confirmed it: I was just repeatedly downloading the same version.
The solution here, is to prevent caching of the downloaded installer.


CSS :not selector

Question: I am trying to use the CSS3 :not selector. Basically, I have a table that when you hover a row, the background color changes:
.table-hover tbody tr:hover > td, .table-hover tbody tr:hover > th {
    background-color: #272727;
}

On one of the
's I apply a latest-review class to the row. When I hover over thelatest-review row, the background color still changes because of the above CSS. I'd like it not to change colors. I've tried this and failed:
.table-hover tbody tr:hover > td:not(.latest-review), .table-hover tbody tr:hover > th:not(.latest-review) {
    background-color: #272727;
}

I am not really sure what else to try at this point. I am using Chrome currently and I am not worried about the :not selector not being supported in older browsers.
Comment: Why don't you try inverting the logic - apply a class .not-latest-review to everything which will allow the highlight, then remove that class when you don't want the highlight.
Answer: Well, you write that .latest-review is applied to
, but your code snippet uses  and . Either way, it's easier imho to simply add a simpler second rule after your hover rule (and not use :not):
.table-hover tr:hover {
    background-color: #272727;
}

.table-hover .latest-review {
    background-color: %original_color%
}

Comment: I prefer this over using `:not()` since it works in all browsers.
Comment: I would have done it this way. The thing is I am using Twitter Bootstrap as my base CSS. Sort of the first project I've used it on and I've found it difficult to override certain things unless named exactly how bootstrap labels them. I removed the bootstrap version of table hover and I am using this method instead, thanks
Comment: @Ronnie: You can always override a CSS declaration by being more specific. This means that you could simply write `.table-hover tbody tr.latest-review:hover > td, .table-hover tbody tr.lateste-review:hover > th` to ensure it gets overriden. I'd do that instead of altering the defaults.
Answer: The first CSS rule overrides the second. Either remove the first one or reset the color:
.table-hover tbody tr:hover > td.latest-review, .table-hover tbody tr:hover > th.latest-review {
    background-color: default-color;
}

CSS :not selector