Comparison between Bootstrap and Material Design frameworks

Question: The Bootstrap/Foundation family of design frameworks has been the main driving force behind a lot of responsive front-end web development projects. The Google Materials Design concept has also been floating around for a while, and it seems that the Materials family of design frameworks (e.g. Materialize) is starting to emerge as a competitor/alternative.
Just wondering if any of the UX gurus out there has done some analysis behind both development frameworks and looked at the pros and cons of each framework. On the surface a lot of the differences appear to be in the visual styling of elements and the interaction of UI components, but underneath each family is a set of design philosophies that are important when it comes to adopting/extending the existing framework and customizing it for your own projects and applications.
I think the things that need to be addressed in the comparison would probably include:

Philosophy/Intent - since Materials Design appears to be device/platform/channel agnostic in theory, but not sure if this is also the case in practice. Bootstrap appears to be dedicated to mobile devices but is probably semi-agnostic.
Coverage - there are many questions asked about 'gaps' in Bootstrap, probably because of the lack of standardization of UI design patterns and the need for customized UI components. It seems like Materials design may potentially cover more use cases and scenarios.
Flexibility/Extensibility - both seem well designed and easily customizable (at least judging by the amount of code on CodePen for Bootstrap), which actually leads to the problem that Microsoft has faced with its definition of its Microsoft Fluent design concept.
Comment: Imho you can't compare them as they aren't the same. Material design is a design guideline for ui to standardise visual aspects and ux on android platform, Bootstrap is a development framework
Comment: While not a bad question in general, I'm voting to close as the pros and cons of any particular UI framework are mostly going to be heavily dependent on opinion and the context they need to be used in.
Comment: @Razor9012 Materialize is a design framework based on the Google Material Design concept, so you can compare it to Bootstrap. Bootstrap, however, does explain some of its design concepts as well.
Comment: There is confusion as to what you area asking. Are you asking about Google's Material Philosophy or are you asking about a specific framework based on that? If the former, that's really an apples vs. oranges question.
Comment: @DA01 I have asked for a comparison between the two family of frameworks based on some criteria rather than just whether people think it is good or bad. And the question is asking for a comparison between the two different type of frameworks so I don't think it is comparing apples and oranges.
Comment: @MichaelLai "Material Design" Isn't a framework. That's the confusion. Materialize *is* a framework. As for the criteria, the philosophy of a development framework is usually the same: make development faster with a set of standard code to build off of. Coverage is well documented on each of the framework sites. Flexibility and Extensibility is, alas, mostly subjective and heavily context centric.
Comment: FYI, there really isn't a 'family' of Bootstrap frameworks. Bootstrap is Bootstrap.
Answer: They are both UX frameworks, but are very differently opinionated

Material design is very opinionated about how UX elements behave and interact visually.  It starts with general principles around visual elements (physics, light, space, momentum) and expands on those principles to provide concrete examples and requirements for specific elements (buttons, cards, toasts, etc).

Material design is less opinionated about implementation:  the docs mention Polymer and Android development framework as possibilities for implementation, but there are other non-specified packages like Materialize which provide Material Design implementations for other platforms.

Bootstrap is opinionated about implementation.  Bootstrap provides a specific framework for constructing responsive UX using a set of HTML classes and pre-wired CSS styles and behaviors.  The bootstrap documents describe HTML elements and also default styles, but the core semantics of bootstrap are captured in CSS classes.

Bootstrap is less opinionated about visual presentation/style....indeed, it has been designed around CSS classes so that the visual presentation can be easily customized using stylesheets.
Comment: It may make sense to say 'material design' isn't opinionated about implementation, but any particular CSS framework based on it (ie, materialize) likely is.
Answer: I don't think Material is a framework, but I agree it depends on the definition of framework. If I use this:

In computer programming, a software framework is an abstraction in
  which software providing generic functionality can be selectively
  changed by additional user-written code, thus providing
  application-specific software. A software framework is a universal,
  reusable software environment that provides particular functionality
  as part of a larger software platform to facilitate development of
  software applications, products and solutions. Software frameworks may
  include support programs, compilers, code libraries, tool sets, and
  application programming interfaces (APIs) that bring together all the
  different components to enable development of a project or solution.
Frameworks contain key distinguishing features that separate them from
  normal libraries:

inversion of control: In a framework, unlike in libraries or normal user applications, the overall program's flow of control is not
  dictated by the caller, but by the framework.
default behavior: A framework has a default behavior. This default behavior must be some useful behavior and not a series of
  no-ops.
extensibility: A framework can be extended by the user usually by selective overriding or specialized by user code to provide specific
  functionality.
non-modifiable framework code: The framework code, in general, is not supposed to be modified, while accepting user-implemented
  extensions. In other words, users can extend the framework, but should
  not modify its code.

then Material is not a framework, but a guideline to build frameworks. For example, Materialize is a framework built on Material guidelines. Another example is what I build for my team: a very customized version of Bootstrap that uses Material (a re-work from http://fezvrasta.github.io/bootstrap-material-design/ which is a bit dirty and loads a lot of unnecessary things) and has an aditional bridge to Polymer. So in my case, the frameworks are Bootstrap and Polymer, while Material is the guideline I used to built it.
This being said, going to the OP's points:

Philosophy/Intent - since Materials Design appears to be device/platform/channel agnostic in theory, but not sure if this is also the case in practice. Bootstrap appears to be dedicated to mobile devices but is probably semi-agnostic.

I think it's EXACTLY the opposite: Material is agnostic until you use
  a framework. Also, build 10 sites with Material and everything will
  start to look the same. On the other side, Bootstrap has a "mobile
  first" philosophy, but is the most used framework for desktop
  nowadays

Coverage - there are many questions asked about 'gaps' in Bootstrap, probably because of the lack of standardization of UI design patterns and the need for customized UI components. It seems like Materials design may potentially cover more use cases and scenarios.

see my comment above. I think Bootstrap potentially covers ALL cases, not
  most, something Material fails to do

Flexibility/Extensibility - both seem well designed and easily customizable (at least judging by the amount of code on CodePen for Bootstrap), which actually leads to the problem that Microsoft has faced with its definition of its Microsoft Fluent design concept.

If I take the definition of frameworks I provided above, then yes, I
  totally agree

In the end, I think Bootstrap provides a framework to built code upon, and same happens with Polymer, while Material provides a set of UX and design guidelines that helps UXD maximize results, so I don't see then as opposite, but totally complementary (hence why I built what I built)
Comment: you edited the title, but when I answered the question it was about Material, and the body of the question still is. Also, the OP mentions Materialize between other frameworks, so by editing the title I feel like you're leaving out all other frameworks based on Material, like Lumx, Angular, Ionic, MUI, Leaf and many more
Comment: The question is a bit confusing, but the OP is talking specifically about the *materialize* framework. It's an actual framework based on Material Design.
Comment: valid point, though I'd say that would definitely make the question way to broad (I'd argue it's not a good question as it is right now as there is no real way to answer this sans context)
Comment: @Devin sorry, I did make a mistake with the question so I have updated it.
Comment: @DA01 sorry, but you can see the context from the description, even though I accidentally made a mistake with the question (which I have fixed).
Comment: @MichaelLai the context I'm referring to is the specific needs of the particular project.
Comment: @DA01 The context I am providing is the modern challenge of application/product/service design rather than the specific needs of a particular project otherwise I think the answer would be a little bit more straightforward (and therefore not as interesting to answer).
Comment: @MichaelLai well, that's the challenge, IMHO. There's no generic answer--at least not one that would really fit StackExchange.
Answer: Bootstrap is mainly a responsive grid system, with some default UI look and feel decisions made for you (that you can easily over-ride).
Materialize is mainly a set of UI elements and interactions (but also has a grid).
And then there's about 2,000 other UI CSS frameworks out there as well. Rarely do you use these frameworks out of the box, so what is 'best' in terms of UX is really subjective. Which framework to choose typically has more to do with your UI development process and team preferences.
Comment: I am not really asking which is better, but just what people think about the similarities and differences between the two frameworks based on how they go about providing a solution to the modern front end development challenge.
Comment: @MichaelLai which particular challenge? :)
Comment: Well, I assume that these frameworks exist for a particular reason, probably to try and help people interpret the Twitter and Google/Android look and feel (which Apple and Windows have really only provided guidelines), but more importantly help to standardize design pattern/components for front end development in an omni-channel, omni-device, 'modern', 'responsive', 'clean', 'sexy' brave new world of application/product/service design? :D
Comment: @MichaelLai Bootstrap exists specifically to make responsive web sites. Materialize appears to exist for those that want to mimic Google's material design. I'd say one is a responsive grid framework, the other is a fleshed out UI framework. Rarely would you use one or the other without understanding the needs of a particular project, though--specifically how much customization you need/want to do to the stock framework. Neither framework is really about Apple vs. Windows vs. Android, though.
Comment: And you'd likely consider a dozen more most of the time. So it's not a cut-and-dried, this vs. that, unfortunately.
Comment: Having worked with too many 'developer' driven projects, questions like this needs to be asked so that developers don't just say 'why not use Bootstrap because everyone does' because they approach development frameworks purely from the implementation point of view, and as you pointed out, they are both quite customizable.
Comment: @MichaelLai well, these *are* development frameworks. :) And they have a good point. Going with an off-the-shelf framework is sometimes a good idea. Gives you a head start on things. But, again, all depends on the proejct.


Can I override Standard Save Button (with a visualforce page) on Standard page of a Custom object?

Question: The requirement is to show some messages after Save. Messages would depend on the fields entered for custom object record. The best way which I figured would be to override the standard Save button on the custom object to a visualforce page which would display appropriate messages and then perform save.
Not sure how to do that. Please help.
Answer: Add a field, hidden, of course, that should be set when a message should be displayed. Then, add a hidden Visualforce page to the layout that should reset the flag and show a message when appropriate. The flag can be set from a trigger.
trigger X on Y (before insert, before update) {
    for(Y r: Trigger.new) {
        r.Flag__c = r.Field__c == 'Some Value';
    }
}

Page:
<apex:page standardcontroller="Y" extensions="yExt" action="{!resetFlag}">

</apex:page>

Extension:
public class yExt {
    ApexPages.StandardController c;
    public Boolean showMessage { get; set; }
    public yExt(ApexPages.StandardController ctrl) {
        c = ctrl;
        showMessage = ((Y)ctrl.getRecord()).Flag__c;
    }
    public void resetFlag() {
        ((Y)c.getRecord()).Flag__c = false;
        c.save();
    }
}

Drop this into a page layout with a zero-height frame (will make it effectively invisible), and you've got your message alert.
This is only a very basic framework; you might want to make some adjustments based on your exact requirements.
Answer: The save button in the standard layout cannot be override. But you can still built a VF page and place your own buttons. But as the above answer says its gonna take whole lot of coding.
All the best.
Answer: Sort of depends, your question is a little confusing.  On the Detail view page of the object is where you ultimately need to see the message, post-save correct?  Since that's the "view" page of the record, see if this will help.

I've done something like this in the past to show more of a "current state of the record" and if you want there to be colors you can use images/icons to make it stand out.  So it always shows, might be even better than showing something just after save.  Here's how: Create a Formula field to check your fields, and output some text/images or not.
Same idea as above, always showing for the detail/view page.  This time create an inline VF page and drop it on the layout.  Then you can show anything you want here. (http://blog.jeffdouglas.com/2009/05/08/inline-visualforce-pages-with-standard-page-layouts/)

If you are wanting to show "Field validation errors" upon "click" of the save button and give the user the ability to fix and re-save, then you need to create Validation Rules. https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_defining_field_validation_rules.htm
If the validation rules don't work, sometimes you need to reference other objects, then you need a before insert/update trigger.

If you literally want to display a message ONLY upon successful save, then you need to override the entire Edit page of the record.  Lot of work here, but that's how to do it.
Comment: The edit page wouldn't be appropriate for a successful-save message, exactly. That's more work than what's needed. But formulas are quite useful, and might do the trick.
Answer: You can't override the Save button unless you override the whole Edit layout, which is not a best practice and there is a lot of effort involved to re-build it. Also it's not scalable for new fields, related lists etc.
I would rather recommend writing a before insert/before update trigger on the Account object that will throw errors accordingly to the record or a particular field.
Comment: Actually, there's very little work to re-build it. I did so using the REST API (describe layout/record type), and about 100 lines of code. Non-trivial, yes, but not as hard as one might imagine. And, edit pages don't use related lists. OP wants an informational message, not an error.
Comment: True regarding the related list, my bad :). Although why would you re-build the layout when a simple trigger can do the job? At the end of the day it's the business/dev call which approach they take. I always tend to use the KISS method as much as I can
Comment: I wouldn't rewrite the layout for that purpose. We used this technique to add a real-time address validation popup. The layout was hard coded, so I made it dynamic. Regarding triggers, though, they can't show informational messages, only errors. So, triggers work in some cases, not all.
Comment: Totally agree. I would rebuild the layout for fancy validations and popus etc, though in this case he's after standard error messages (validation style), hence I think a trigger will work better in this scenario


SSRS regional format running inside Sharepoint

Question: We have SSRS running in integration mode inside of sharepoint.  When developing SSRS reports we are able to set the date and number formats to recognize regional settings and format appropriately.  But when the report is deployed to SSRS the regional formats all revert back to us.  Is there a way to have this display properly inside of Sharepoint?
Answer: We have written an external DLL that SSRS uses. We pass the value that we want converted (for example a date) and a Region Code/Culture setting. When we create the reports, all the reports have the region format as a parameter.
The reason for this is there is no way for SSRS to get the region from the client web browser, plus we wanted the users to be able to explicitly set what the region code they want for display.
Here is an article on using a custom assembly for SSRS.
Let me know if you want more background.


Who Owns an Idea on the Web?

Question: Let us say that person "A" mentioned an idea for a software project on the web (ie. in a forum). Person "B" sees this idea and implements it. Can person "A" claim ownership of the idea? Has person "B" done something illegal by implementing the idea that person "A" posted?
Comment: Some sites have their own agreements.
Comment: @Jeff what if there is no such agreement specified?
Answer: Nobody owns the idea.
Nobody can own an idea.  An idea is abstract and has practically no value on its own - it's the execution of that idea that is worth something.
Copyright refers to an actual creative work - i.e. the content or design.  Recreating a similar work is fair game, you just can't appropriate the original work as your own, or use it for your own material benefit without explicit permission from the copyright owner.
If ideas could be copyrighted then we'd only have one operating system, one web browser, one search engine, one blog engine.  That's not how copyright works.

Addendum: For people arriving at this question first time, the original question was tagged copyright and implied that there was actually a copyright issue.  I realize that patent law is more germane to software than copyright law, and Jerry's Answer is an excellent one for explaining the patent side (the short answer is that patent law doesn't apply either, unless "A" actually implements the idea and/or patents it and "B" uses the exact same implementation).
Please do keep in mind, however, that the question still says nothing about filing for a patent, and I think that the question should be taken at face value; i.e. in the absence of "A" having any implementation or registration at all, does "A" have rights to the work of "B"?  The answer is clearly no, and the copyright question is still worth answering because copyright is the only type of IP that exists implicitly.

IANAL, of course, and I disclaim any responsibility if you somehow manage to get yourself sued.
Comment: @jprete: As I pointed out in another reply, patents do not cover ideas, they cover inventions and processes. Two people can implement the same idea in different ways and both get patents without any dispute. Of course, patents are a different beast altogether; most patent disputes come up when somebody managed to patent something ridiculously generic, and that patent subsequently gets overturned in court if you have the money to fight it (unless you're Microsoft in the 21st century).
Comment: Patents *do* cover ideas, in exchange for publication of the idea, so copyright law is a bit of a non sequitur.
Comment: @jprete: I'm not sure how you can claim that copyright law is a "non sequitur" when the question is tagged `[copyright]` and the question itself specifically refers to an idea that hasn't been implemented yet (i.e. could not possibly have a patent).
Comment: Copyright is not a correct tag to stick on this question, though. Ideas certainly don't fall under copyright, but they can conceivably fall under patent protection, if they are the right kind of idea (as you pointed out, invention or process). So I finessed the point and assumed that the OP was thinking of the most appropriate form of protection for the idea.
Comment: @jprete: An invention or process is not an idea, it's an implementation.  I'd prefer not to drag this out into an epistemological discussion; suffice it to say that the OP probably would have mentioned if the idea was patented, and to assume otherwise is likely unwarranted.  I can't imagine that anybody is seriously wondering *"is it OK for me to copy a patented process?"* Patents are straightforward aside from the side issue of defining what makes a valid patent; it's copyright that many people don't quite seem to grok.
Comment: Patents are supposed to cover implementations, not ideas, but in practice software patents can cover ideas.  However, the idea wasn't patented, and if (IIRC) nobody files for a patent for a year after the blog post it's unpatentable in the USA.  Copyright has nothing whatsoever to do with ideas.
Comment: @David, the original question (pre-edit) was actually tagged `[copyright]`, and despite the truth of your last sentence, many people don't actually realize that copyright has nothing to do with ideas - this question was representative of that confusion. Yes, in practice, software patents and many other patents may be issued covering fairly generic ideas - that's why patent trolls exist - but negligence at the patent office doesn't change the letter of the law, and very often those patents don't actually hold up in court (the trolls count on the inventors not having the resources to fight it).
Comment: +1. Thanks for clarifying your answer to include the patent/copyright distinction.
Answer: First, this varies by country. There is a degree of commonality between countries, but the details definitely vary.
@Aaronaught is correct, however, that you can't patent an idea -- patent law (at least in most countries) is clear on the fact that a patent must cover something tangible, not just an idea.
The US follows a "first to invent" system, so if both people filed for patents on the invention, the first one to invent it would be given priority. "Invent" doesn't necessarily mean "think of the idea" though - in fact, reduction to practice (i.e., implementing the idea) is usually the point at which something is considered "invented". A sufficiently detailed written description can qualify though, so if a question like that above came to court, it would probably go to the jury to decide whether the written description in question was sufficiently detailed to qualify as "inventing" or not. That would probably come down to a question of who much was left for somebody to figure out -- specifically, whether a "person of ordinary skill in the art" ("POSITA") would be able to follow the directions and produce a working result, or whether they'd need to complete the invention on their own -- i.e., the description left enough gaps that the POSITA wouldn't be able to implement it.
I should add that the courts tend to set the bar for a "POSITA" pretty low -- it's pretty well known that a lot of the most brilliant inventions seem pretty obvious after the fact. To compensate for that, they tend to treat a POSITA as somebody who does little more than follow directions. The definition of a POSITA is also used to decide whether something is "obvious" and in their ruling on KSR v. Teleflex, the US Supreme Court overruled a lower court decision on what would be obvious to a POSITA, loosening the definition a bit by adding an "obvious to try" criterion (i.e., they gave a POSITA credit for a little more intelligence and common sense, so you have to work a little harder to show that something you've tried to patent isn't obvious).
Most other countries follow a "first to file" system -- whoever files for the patent first is given priority. This eliminates most of the questions above (though there's still a similar question of whether something is obvious or not; though the law is similar in many places (e.g., in most EU countries) it tends to be interpreted more strictly in many, so what would qualify as sufficiently non-obvious to qualify for a patent in the US often won't in many other countries.
As usual: IANAL, and this post should not be construed as legal advice.
Reference: for those in the US, the real reference is US code, Title 35. §102 is probably the most relevant to this question. The link above to the KSR v. Teleflex decision is also highly relevant on the question of obviousness, and probably gives at least some indication of the kind of description that would be needed to qualify as invention.
Comment: Great explanation of the patent side of the equation. I'd add (obvious as it may sound) that the "first to invent" doctrine requires one to have positive proof of that fact; in the absence of clear evidence I believe the law basically reverts to "first to file".
Answer: Whoever implements it first gets to say every one else is a liar. People may spout a million ideas every day, but it does not matter: the fact you have implemented an idea means you have taken ownership of the idea.
It's safe to say this is a gray area where such activities can be contested as mere inspiration rather than the actual idea.
Comment: @jprete: They can't file for a patent on an idea, period.  Patents can only be inventions or processes.
Comment: @jprete: Doubtful, otherwise we'd all be paying licensing fees for the CRUD design.  The "idea" must be detailed enough not only to implement but to qualify as novel. Someone might even manage to *get* a patent for a 5-line description of a web site, but normally those patents don't hold up in a dispute.
Comment: @Aaronaught: True enough, but an idea that's detailed enough to implement is likely to be a software process.
Comment: @jprete have you ever looked at copyright,IPR,patent dispute cases?. Also No one can really prove who came up with the idea first. Even if it is made public. you believe posting on the forums is making public? what about older posts on same or different forums or sites.
Comment: I've deleted my earlier comment on this post as inaccurate.
Answer: I am not a lawyer, but I don't think that A can do anything. If you publish an idea on a public forum, and somebody uses it, and you haven't filed for a patent on the idea, then you don't have any protection. You have to file for patent protection in order to get any protection, and this is why you often see "Patent Pending" marked on products (since the patent has been applied for but not yet approved).
EDIT: As Aaronaught points out, even for patents the scope of legal ideas is limited to "inventions or processes". If the idea is an invention or process, then A could conceivably patent it after making the post and then sue B for damages. I'm not in a position to elaborate on the conditions and work required to do this, however.
Aside from patents, there are copyrights, trademarks, and trade secrets, none of which apply in this case.
Answer: To my understanding, there is no way to own an idea, and once you have it, you need to decide where you'll share it. My suggestion is that you can do some research about your idea, but never let the whole picture to be seen.
So, basically the problem is that you cannot claim your ownership of the idea, unless you prove it, (like it happened with the Winklevoss brothers with Zuckerberg, not saying that I agree with any of them, but they managed to get a legal dispute over an idea with the propper documents and layers).
I recall reading at some place of the Getting Real book that you may have an idea, but it has no actual owner until you  implement it.
Comment: Didn't they claimed they had a verbal contract with Zuckerberg to build their site? It's not like he over-heard their idea at some bar or saw it posted somewhere.

Who Owns an Idea on the Web?


Question about wide swinging punches

Question: In various (usually Kung Fu) movies & clips on YouTube, you see lots of wide swinging punches to the head.  It seems to me that it could theoretically work, but that if you're a little bit off or if the guy moves his head in a little, you'd connect with the heel of your palm, your clenched thumb, and the second-from-the-fingertips sections of your fingers.  So, are wide swinging punches at all advisable in real life?
Comment: Look up rabbit punch. It's illegal in boxing, but it's pretty effective if you can connect with it.
Answer: The wide swinging punches you see can be used, but there's usually some bits of context that is usually erased when you see them in movies or demonstration sets.
First, some of these movements were originally designed for weapons, not empty hands.  China has a long history of weapons being banned, or of people just being too poor to afford enough weapons for everyone - but they still practiced the moves.  Whether that concept was lost during the transmission for some schools, or whether they show it empty hands in public while practicing the real usage in private, depends on the particular school/lineage.
Second, when they are designed for empty hand attacks, the wide swings are not your entry attacks - they telegraph too much.  They're designed as followups after you've engaged in some way (got them with a jab, grabbed their guard, got them off balance...)
Third, a lot of the wide-swinging punch movements, the contact point is either the nice, thick bone protuberances at the wrist, or the forearm proper.  Not only does this give you a broader contact point, it also transitions into grappling, locks, or take downs quite well.  (Also, some of the swinging "punches" are actually takedowns, again, either hidden deliberately or lost through mistransmission.)
For both demonstrations and movies, wide swinging movements look great, which is why they show up a lot, even though combatively, they may be used very differently or not as much.
Comment: Makes sense, thanks.  I'd been wondering if the wrist-bone wouldn't be a lot less prone to injury than any kind of wide fist or ridge-hand strike.
Comment: You're usually hitting with either the end of the ulna (https://en.wikipedia.org/wiki/Ulna) or radius (https://en.wikipedia.org/wiki/Radius_%28bone%29), both of which are much bigger bones than the carpal/metacarpals, and the force doesn't have to travel through any immediate joints.  The reason you see a lot of empty hand styles spend a lot of time knuckle toughening is actually to build the carpal/metacarpal bones...but bone remodeling takes years.
Answer: They could work. Lots of styles of Kung Fu use circular motions in their movements. Kenpo also uses some circular motions. They work depending on the situation and a true master of their art will be able to show how. I personally don't believe they are ideal for self defense in today's world, but when you talk about the movies the goal is to make it look nice and flashy with flow to it. Straight punching can be quite boring for a movie.
Answer: I think it is a matter of timing as always. Nevertheless Furi Tsuki (also called Furi Ush) is one of my favorite Karate techniques, as it has shown a high rate of effectiveness for me so far, and it is a very dangerous punch when correctly connected (which means you must use it with control, or not use it at all).
In Goju-Ryu Karate style at least, this technique is composed of a swinging block with one arm, while swinging the other fist down from the back, and it hits the head temple with the two main knuckles with the fist turned on it side, powered by the whole torso, both arms and shoulders, and the hip.
Answer: First, I would say that it is important, when watching a form or even partner work between two people, to be careful identifying an intended throw. It's sometimes hard even watching sparring, if a wide swinging arm was meant as a block, a strike or a missed grab or throw.
Second, I would say that many blocks in several styles are thrown as strikes with the theory (right or wrong) that any movement should try to be both. A block should culminate in a grab/off-balancing, a strike should quickly flow into a grab, throw or off-balancing. This concept often causes some "hook" punches to look a little wild when they really shouldn't be. A little sloppy.
Thirdly, A few punches I've been taught (with varying degrees of practicality) are the "hammer fist" thrown in a wide horizontal arc across the centerline, often thrown wide to clear a guard. Also, the reverse "Oh Uch" punch which goes wide and ends towards the centerline, often used with short weapons but seen open-handed as well.
Lastly, Much of what we see in performed styles are, frankly, stylized to look impressive to spectators. Arcs and circles are made very wide to represent idealized "circles" which are prized in the art or to represent an idealized posture in Eastern spiritual contexts.
~Jared

Question about wide swinging punches


Separating power from data micro USB to HDMI

Question: I have a camera which both draws power and sends its data through a battery pack to a custom monitor. The monitor also draws power as well as receives the camera data through the battery pack. (Both the camera and the monitor connect to the Battery pack with Micro USB) I intended to use a monitor which uses its own power supply so I used a Micro USB to HDMI converter meant for phones(MHL). However it didn't work, the adapter smelled burnt and the HDMI port on the monitor no longer worked however the HDMI cable itself still works. I figured it must be because the battery pack outputs both the camera data as well as power, the power must have burnt out everything. Is it possible to separate the power output from the data output and to convert it from Micro USB to HDMI without burning out the ports?
Additionally I opened the monitor that came with the battery and camera and the Micro USB Wire connected to a circuit board with a smaller red, black, and green wire. The battery pack consists of two 18650 rechargeable batteries(3.7 Volts, 2500mah).
Answer: The AMT630A chip inside the monitor is a chip for receiving analog composite video and conveting it to digital to drive the TFT panel.
There is no digital video that is compatible with MHL or HDMI.
You can of course make a cable that only provides the analog composite for connecting it to an older TV directly or using a converter box to make it HDMI.
So the manufacturer simply used a standard connector for non-standard purposes, and thus using existing cables it is possible to damage equipment - therefore standard connectors should never be used for non-standard purposes. The HDMI input of the monitor is now damaged.
Modifying and using equipment for purposes they are not meant for needs awful lot of research whether it can be modified or used for other purposes to prevent damage.


Cannot access folder on Raspberry Pi

Question: I'm trying to open a PHP file on my Raspberry Pi running Raspbian. But it won't let me move the file from its current location to the 'www' folder I keep getting an error message saying 'Access Denied', I've looked online and it seems that I need to login with the credentials 'pi' and 'raspberry' however I never logged in before, I was always automatically logged in when I turned the Pi on. Is there any way to get over this issue? I'm sure it's simple but I'm not used to Raspberry Pi's so it's difficult
Answer: You are logged in automatically as the Pi user with the default password. The reaason you can't copy a file to the /var/www/ directory is because you do not own the folder. To get around this do the following from a termianl window:
switch to the directory where the file you want to move is located (assuming the file is in your home directory):
cd

then move the file with the following command (substituing the file name you want to move):
sudo mv name_of_file_to_move /var/www/

If you want to copy the file instead of moving it use this command instead of the previous one:
sudo cp name_of_file_to_copy /var/www/

When asked for a password use raspberry (assuming you have not changed the password).
you can check the file has been moved to the new location with the following command:
ls -la /var/www/

Answer: You could use this command in the terminal  to make your user the owner: 'chown user /path/to/your/directory' make sure only folder for now not the file for the file use 'chown user /path/to/your//folders/file/you/need/access/'
above just replace the 'user' with your account thats not the root account the one that you are signed into for file browsing!

and replace the '/path/to/your/directory'  and '/path/to/your//folders/file/you/need/access/' to your exact file path
Also you can use a /* to gain access to all files and supfoldors in a directory
Answer: Use sudo raspi-config to run the initial config again and setup a new root user so you can use it to have the priviliges you need.
Reference
Comment: This is not required. His Pi is setup to autologin as the Pi user. The issue is that the Pi user does not own the www directory, and as a result he needs to use sudo to move the file.

Cannot access folder on Raspberry Pi


Switching propane bbq to natural gas

Question: I have a small propane bbq. My last home had a propane tank for home use (mainly fireplace), so I had a line installed from the home tank to my deck so I could utilize the unlimited propane supply. I remember having to change out a valve in the bbq, and I believe also use a different hose. I now live in a house with natural gas with a line to the deck. My question is will I need to make further changes to the bbq for this to work? My sense is that, even though it was a "home supply" of propane, it's still not the same as a home supply of natural gas but I've tried pretty extensive googling and all I can find is in relation to switching a small propane tank bbq to gas ... I can find nothing about the difference between home propane tank hook-up and natural gas.
Comment: Does this answer your question? [problems hooking up propane tank to grill](https://diy.stackexchange.com/questions/166045/problems-hooking-up-propane-tank-to-grill)
Comment: I am not sure this is the only thing, so I am leaving it as a comment. The orifices that shoot the gas out into the tubes will need to be changed. These orifices' regulate how much gas gets burned. The pressure of LP gas needs to regulated down a LOT. Natural gas, when piped in will already be at a low pressure, but still may not be suited for a BBQ
Answer: Just like with kitchen cookers (ovens, hobs, grills), which have a different set of jets for lpg or natural gas, using inappropriate jets won't work properly. Obviously your bbq is jetted for lpg, and works well on that. However, since most gas bbqs are designed for lpg, you probably won't find jets for natural gas that will fit your bbq.
Also, the regulator will possibly be producing a pressure that won't do the job. Best to question the manufacturers/retailers of your bbq - you may be lucky, but somehow, it's doubtful. Bbqs are usually designed to be portable/moveable, and being fixed to a gasline from a house isn't envisaged.
Comment: You can definitely buy a BBQ/Grill that's fixed in position and runs off a natural gas line. But you can't just take a BBQ that runs off LPG and expect it to work with natural gas. You may or may not be able to buy a conversion kit (you can get such for ovens), but most likely you should buy a new BBQ.
Answer: Regardless of what you used to have you need to do the following:

Check the gas pressure at the outdoor line using a manometer; hopefully it's 6-7 inches W.C. (water column)
Take apart your burner/igniter system and look at the orifices; they should have an imprinted stamp which says something like .95, .99, 1.02, 1.05, or whatever. This is the size of the orifice in millimeters.
Convert that millimeter to decimal inches and check out this PDF file
You will likely end up in the 10-15k BTU range per orifice
You need to replace that orifice with a different one of appropriate size for your gas pressure which achieves the same BTUs +/- 10%

If you have machinist drill bits then you could in theory drill the orifices larger.
A .99 orifice is about .039 inches so 10.5k btu in propane. For 7 inches W.C. you would need .055 inches (1.397 mm)
Make sure to obey the precise sizes or else you could end up with a grill that catches fire quickly when on high.
Answer: I recommend buying a grill specifically engineered to be safe with natural gas.
Weber does not provide conversion kits.  See https://www.weber.com/US/en/blog/burning-questions/can-i-convert-my-gas-grill/weber-29870.html
Make sure you have a shut off valve on your natural gas pipe.  Best of luck.

Switching propane bbq to natural gas


Gaussian RBF vs. Gaussian kernel

Question: What is the difference between doing linear regression with a Gaussian Radial Basis Function (RBF) and doing linear regression with a Gaussian kernel?
Comment: Yes that's exatcty what I meant. Duly noted for future reference.
Comment: Welcome to the site, @user35965. Please spell out your acronyms. By "RBF", do you mean *radial basis function*?
Answer: The only real difference is in the regularisation that is applied.  A regularised RBF network typically uses a penalty based on the squared norm of the weights.  For the kernel version, the penalty is typically on the squared norm of the weights of the linear model implicitly constructed in the feature space induced by the kernel.  The key practical difference this makes is that the penalty for the RBF network depends on the centers of the RBF network (and hence on the sample of data used) whereas for the RBF kernel, the induced feature space is the same regardless of the sample of data, so the penalty is a penalty on the function of the model, rather than on its parameterisation.
In other words, for both models we have
$f(\vec{x}') = \sum_{i=1}^\ell \alpha_i \mathcal{K}(\vec{x}_i, \vec{x}')$
For the RBF network approach, the training criterion is
$L = \sum_{i=1}^\ell (y_i - f(\vec{x}_i))^2 + \lambda \|\alpha\|^2$
For the RBF kernel method, we have that $\mathcal{K}(\vec{x},\vec{x}') = \phi(\vec{x})\cdot\phi(\vec{x}')$, and $\vec{w} = \sum_{i=1}^\ell \alpha_i\phi(\vec{x}_i)$.  This means that a squared norm penalty on the weights of the model in the induced feature space, $\vec{w}$ can be written in terms of the dual parameters, $\vec{\alpha}$ as
$\|\vec{w}\|^2 = \vec{\alpha}^T\matrix{K}\vec{\alpha},$
where $\matrix{K}$ is the matix of pair-wise evaluations of the kernel for all training patterns. The training criterion is then
$L = \sum_{i=1}^\ell (y_i - f(\vec{x}_i))^2 + \lambda \vec{\alpha}^T\matrix{K}\vec{\alpha}$.
The only difference between the two models is the $\matrix{K}$ in the regularisation term.
The key theoretical advantage of the kernel approach is that it allows you to interpret a non-linear model as a linear model following a fixed non-linear transformation that doesn't depend on the sample of data.  Thus any statistical learning theory that exists for linear models automatically transfers to the non-linear version.  However, this all breaks down as soon as you try and tune the kernel parameters, at which point we are back to pretty much the same point theoretically speaking as we were with RBF (and MLP) neural networks.  So the theoretical advantage is perhaps not as great as we would like.
Is it likely to make any real difference in terms of performance?  Probably not much.  The "no free lunch" theorems suggest that there is no a-priori superiority of any algorithm over all others, and the difference in the regularisation is fairly subtle, so if in doubt try both and choose the best according to e.g. cross-validation.
Comment: @CagdasOzgenc Yes, for the RBF the regulariser is $\|\vec{\alpha}\|^2 = \vec{\alpha}^T\matrix{I}\vec{\alpha}$ rather than the $ \vec{\alpha}^T\matrix{K}\vec{\alpha}$ for the kernel machine.  They would become more similar as the width of the basis function approaches zero as $K$ would approach $I$.   I think this is essentially because $K$ is accounting for the correlation between basis functions.
Comment: @CagdasOzgenc The way I look at it is that the $K$ in the regulariser weights the penalisation differently for each basis vector, and the penalty depends on the selection of the other basis vectors.  This weight depends on their correlations, so if you pick a different sample, the weights change to compensate.  The other way to look at it is that the model is defined in a feature space determined by $\phi(x)$, which doesn't depend on the choice of basis vectors (providing they span the space containing the data).
Comment: @CagdasOzgenc Sure we can transform the space of the basis functions by an eigen-decomposition of $K$ and regain a $\|\vec{\alpha}'\|^2$ style regulariser (indeed that is a useful trick in optimising the regularisation parameter - https://doi.org/10.1016/j.neunet.2007.05.005).  However that transformation eliminates the dependency of the original choice of basis function. For the two things to be equal would require $\vec{\alpha}^T\matrix{K}\vec{\alpha} = \mu\vec{\alpha}^T\matrix{I}\vec{\alpha}$, which is not generally true (especially not for the RBF kernel).
Comment: @CagdasOzgenc no problem, most of the standard texts explain it through eigenfunctions of the kernel function, which makes my brain hurt as well! ;o)

Gaussian RBF vs. Gaussian kernel


Do sunflower seedlings need support to grow upright?

Question: I've planted some sunflower seeds a couple of months ago and now they're growing successfully but they're somewhat slanted currently rather than growing vertically. Do I need to place some sticks/cable-ties to keep them upright or will they self-align eventually?
Answer: They will probably self align with maybe a crook in the lower stem; give them as much overhead light as possible. This answer is based on experience with a flat of mine which currently looks like this:

The story here is that I sowed a flat of 50 sunflower seeds and foolishly put it out where chipmunks could get at it; I wanted to give it as much light as possible. The seeds had already started to germinate but the chipmunk mowed through the flat anyway pulling out all the not yet germinated seed and chewing off the growing tips of many of those already up out of the soil.
On the left (far) side are a few of the original seedlings that by chance survived and on the right are some later seeds re-sown in empty cells and given more light and protection. In the last weeks the really tall ones have been flopped over several times in gusty winds and dark skies.
As you can see even the seeds given plenty of light stretch upwards quite dramatically from the soil and of those that suffered the attack many are almost vertical again; there are a few with a bend which probably will not go away but we shall see.


Can someone with low master's grades be accepted to a scholarship for phd program?

Question: I have a bachelor's degree in mathematics with grade 15.5/20 and M1+M2 degrees together 12.2/20. (French system university) (M2 degree in differential geometry and geometric control). I want to apply to a phd program abroad and so I need a scholarship to finance my living expenses , my question is : Is it possible to get accepted to a scholarship with my mentioned master's grades ?
Comment: I think you should read why the similar https://academia.stackexchange.com/q/145233/19627 was closed, and start reading https://academia.stackexchange.com/a/38238/19627.
Answer: There are two issues: getting admitted and getting funding. The first is easier than the second.
There are a lot of variables here, not just your grades. The world is a big place and you don't indicate where you want to apply. Standards vary for both admissions and funding.
You first need to find a place where an application won't be immediately rejected. You then need to convince someone, or perhaps a committee, that you are a good candidate for success.
The rest of this is probably only valid in US, but, if you can get admitted here, then you can probably get funded as a TA, as most doctoral students are. And letters of recommendation are very important and can negate the issues of a low GPA, provided you can show you are sufficiently knowledgeable in the important subjects.
The competition is very stiff, of course, so your application has to stand out in some areas if it lacks in others.
But the only way to know is to make some applications and see what feedback you get. Depending on all of the factors considered you may have a chance. Don't make assumptions and don't necessarily believe everything you are told by people who aren't making the decisions.

For advice on how doctoral admissions works in various places around the world see: How does the admissions process work for Ph.D. programs in Country X?


What is the benefit of the specification approach in JavaEE?

Question: What is the benefit of having multiple implementations just for doing one thing? Are there any other languages that use this concept?
Answer: It's the same idea as with the difference between interfaces and classes (abstract classes included). Why don't you write everything with classes?
Because once you write the code, that code is fixed and only does what it was written to do. One thing and one thing only. What if I need another implementation that does something slightly different? Or faster? Or by consuming less memory or resources? How do I replace the code if everything is tied to only one implementation? You can't.
Now extend that idea a bit and you get the answer to your question. Take for example, the JVM. The spec sais how it should behave, but there are tons of  implementations. The JVM that runs on your PC isn't the same that runs on your mobile phone. Someone else decided to write a JVM optimized for their platform. They can do that because of the "specification approach" as you call it. How about if I'm a manufacturer of smart refrigerators and want to use Java as a language because I can find more developers than, say, C++? Am I going to install the Oracle JVM on the thing?
Another example. Do you use Tomcat? What if GlassFish was your only option?
And the same goes for XML parsing, messaging, servlets, web services, or whatever. You get a reference implementation which you can use, or you can write another one optimized for your specific situation if the reference implementation doesn't quite float your boat.
And yes, a lot of other languages do it the same, for similar purposes. You have multiple implementations that do the same, but in very different ways, and for different reasons or needs.


Why the toolbar button icon is grey at runtime?

Question: I"m setting the icon of a toolbar button (using Infragistics component library for the toolbar), The problem is that on design time the icon is showing normally. But at runtime the icon become greyed, though the drawing of the icon is still apparent, but its colors are all lost and the shape of the icon image is grey. So i'm wondering if it's colour related bug, or I need to tweek something in VS, or it is a bug in the library i'm using i.e. Infragistics.
So anyone faced that problem before and fixed it?
Answer: I am now aware of this Infragistics, but check if the icon has some property like Enabled os isEnable
Answer: For the classis toolbar appareance, is the "RenderMode" responsable fo the toolbar "look" - it can be system, professional, etc.


What to do with comments, when a chat room is no longer available?

Question: Recently, community touched an yet unsolved question: Salt analysis using spectroscopy.
I wanted to go ahead and clean up the mess in the comments as I hoped it would contain some more information about the original intend of the OP. (I also suspected, that the answer was hidden somewhere there.)
However, the link at the end leading to the chat is a dead end. What happened here? And how to deal with that? All the previous comments are somehow not really leading to anything.
Answer: Rooms that don't contain enough content are deleted automatically after a while:

Rooms will exist indefinitely, so long as there is at least one person actively talking in the room. A room is considered worth retaining if it has more than 15 messages by at least 2 users.

This specific room only contains 8 chat messages from those two users, which is why it was deleted after it became inactive. This is intentional behaviour, though the interaction with the "move comments to chat" feature is a bit unfortunate here.
I can undelete this specific room, but maybe there should also be changes to the deletion policy for these rooms. Having the links break is problematic.
Comment: Thanks for the information, I thought I read something about that a while ago, but was unsure. I can completely understand the intent behind the whole deleting. I am not too sure if it is worth salvaging the room, since not a lot of people will read through it anyway. The question itself is not that brilliant and might not attract a lot of views anyway.


What is the difference between a Thread and a Handler

Question: I'm trying to find out the difference between a thread and a handler. Does creating a new handler create a new thread?. When a new handler is run using post(), is it creating a new thread? Please explain
Answer: Threads are generic processing tasks that can do most things, but one thing they cannot do is update the UI.
Handlers on the other hand are bound to threads that allow you to communicate with the UI thread (update the UI).
So for example show a toast or a update a progress bar via a message (Runnable) posted to a  handler but you can't if you start this runnable as a thread.
With handler you can also have things like MessageQueuing, scheduling and repeating.
I am yet to encounter a situation where I needed a thread in android.
I mostly use a combination of AsyncTasks and Handlers.
Handlers for the aforementioned tasks.
AsyncTasks for download/ data fetching and polling etc.
You can read the developer article here "Painless Threading"  for more threading in android.
Correction:
Each Handler instance is associated with a single thread and that thread's message queue. They are not threads in their own behalf. as described here.
Answer: A thread defines a process running. Like you have a main (UI thread) in android. and all other threads run in background.(in parallel).
Handler is completely different, it is like initiating the task defined in a handler..
To clear out your confusion, and perform threading in android you must read :
http://android-developers.blogspot.com/2009/05/painless-threading.html
and i would suggest AsyncTask instead of using Thread in all cases.
Answer: Why we use handlers with thread :
When we install an application in android then it create a thread  for that application called MAIN UI Thread, All activities run inside that thread , By the android single thread model rule we can not access UI elements (bitmap , textview etc..) directly for another thread defined inside that activity.
So if want to access Main UI Thread elements by another thread then we will use  handlers.


How to define consult faces generically for minibuffer highlighting that fits with your selected theme?

Question: Background
I'm experimenting with different themes to see which one I prefer. I'm giving a theme time to soak, so to speak, by using it for a few weeks. At the moment I'm trying the paganini theme.
Consult results issue to solve:
1. Improved line highlighting
As can be seen in the attached image, highlighting works for some consult results. In the image you can see *Colors* currently highlighted in the minibuffer in an orange color whereas the alternative buffers are in white.
In the editor itself you can see line 56 with a faint background color also to indicate the current line the cursor is on.
What property should be set to do the same whilst cycling through results in the minibuffer with the up/down arrows or C-p and C-n?
2. File results highlighting confused with list color
If instead of switching to an active buffer I C-n (or down-arrow) to a historically visited file like ~/Code/ldeck/zio/zio-hello/build.sbt I see no highlighting at all for those results. i.e., all results under --- File --- do not change color nor change background color to indicate the current selection.
It turns out that defface consult-file inherits by default from font-lock-function-name-face. The defface consult-file has the description: "Face used to highlight files in `consult-buffer'."
But it appears in this case that that setting is being used for listed files, not highlighted files.
So I can (set-face-attribute 'consult-file nil :inherit nil) to fix that for the moment and then those historical files highlight in the same way that the open buffers do.
If I, however, I customise the color of consult-file to use any foreground color, no highlighting appears at all when up/downing through possible results.
Is there another property I'm missing that would allow this to be customised but also honour highlighting?
How would I define a background color to highlight the minibuffer line currently selected?
Comment: Could you try and customize `vertico-current` also?
Comment: Thanks for the hint @SwarnenduBiswas. Do you have any particular lisp in mind?
Answer: One way to do this is to set the highlight background face so that while iterating through the results, the current item is background highlighted.
That way, whatever the foreground color happens to be, the current item is distinguished from the others via its highlighted background.
For example, taking the pictured "5/197  Switch to:" color as roughly #3498db, and using a color picker to darken it (experimenting along the way by executing the below set-face-attribute command) you can arrive at something that fits the theme and then plug it into your emacs config.
...
(global-hl-line-mode 1)
(set-face-attribute 'highlight nil :background "#294F6E")


Learning to Rank with Unlabelled Dataset

Question: I have folder of about 60k PDF documents that I would like to learn to rank based on queries to surface the most relevant results. The goal is to surface and rank relevant documents, very much like a search engine. I understand that Learning to Rank is a supervised algorithm that requires features generated based on query-document pairs. However, the problem is that none of them are labelled. How many queries should I have to even begin training the model?
Answer: There are different ways to look at this:

You can apply a totally unsupervised method, like computing a TDIDF vector for the query and then ranking according to its similarity (e.g. cosine) against every document. This requires no training at all, but you can't even evaluate the method.
You can use an already implemented system like ElasticSearch.
You can train a supervised ranking model with any number of samples, but obviously it's going to work much better with a large number. The first difficulty is to generate a sample of queries which is as representative as possible. The second difficulty is to find a way to select the top document(s) for every query: if done manually, the annotator needs to read 60k documents (ouch!). I'm not even going to talk about taking into account the subjectivity and potential ambiguity of a query.
You could try to do some form of semi-supervised learning or active learning. You could progressively refine the model by using user feedback for instance, if this works for your use case.


Does a VPN make 3g/4g/cellular connections more secure?

Question: I have been reading the FAQs at witopia.net, publicvpn.com, and other VPN providers, and I see why their services might be valuable when I use my computer or smartphone at a WiFi hotspot.  But what about when I use my smartphone with AT&T's 3g cellular data?  Will a VPN make my data more secure, or does 3g already include comparable encryption?
Answer: 3G does include encryption, however, it has been broken and cannot be assumed to be secure.
If you are handling sensitive data on any wireless link, you should always encrypt. For many jobs the HTTPS encryption available in web browsers is sufficient. So if you wanted to read your personal emails via a web browser, that is all you need. Similarly, if using a mobile email client, ensuring that POP3S or IMAPS is enabled is sufficient.
If, on the other hand you need to log in to an enterprise system containing customer or payments data, you really should be using a VPN so that the end-to-end conversation is encrypted.
Comment: While I agree with most of the contents of this answer, I think that if you *own* or *trust* the (wireless) connection then VPN connection won't help much (e.g., no advantage to use VPN while on your home WiFi)
Comment: You certainly have a point. It would be fairly extreme to run a VPN on your home network unless you really wanted to to be highly secured.
Answer: At the end of the day, even if 3G and 4G are totally secure, you have the internet at the other end of it, which is definitely not secure. So yes, VPN will make your cellular connections more secure.
Then again, a VPN just gets you securely onto a remote network. From there, if you browse the internet, then again, it's just going back out over the internet. But if your aim is to more securely get to a remote network, then yes, VPN is the way to go.
The other thing VPNs can provide in some cases is anonymity (assuming you don't then go and do something personally identifiable like log into your facebook account or MSN or whatever via the link!), and in this case, VPNs definitely improve on the situation vs vanilla 3G/4G cellular internet. But don't confuse anonymity with security :)
Comment: A VPN does **not** give you any anonymity. Possibly quite the opposite since the VPN system itself will almost certainly be logging your use. There is, however, a *class* of VPN that *is* designed to given better anonymity, largely linked to the TOR system. As you point out, the purpose of a VPN is to get a secure *local* network connection from a remote location.
Comment: Sorry, I should have been clearer about VPN anonymity: a VPN on its own doesn't guarantee anonymity; however, if you choose your provider correctly and are careful how you use it, it can provide some level of anonymity. TOR can provide full anonymity, however it can also get you into a lot of trouble, especially if you make yourself an edge router. It's also quite slow and not suitable for bandwidth intensive purposes, so it has its own set of problems.


Find never-called functions

Question: I'm doing some refactoring in a project using Qt with Visual Studio 2008, and I'd like to know if there's a simple way to find the functions and methods that are never called?
Answer: You can try a static code analysis tool, like http://en.wikipedia.org/wiki/Cppcheck
Comment: Does Cppcheck have this feature? I can't find it.
Answer: A -Wall in your compilation options should do it. (Or -Wunused-function). Check the compilator options in VS.
Answer: I've always preferred "grep", but that may be a bit "old-school".
Visual Studio will build a call-graph for you that is helpful but not 100% reliable.
Another alternative is comment out the function and see if the project will still link.
Comment: That's OK to check only one function, not all of them.
Answer: Is there a chance to build this Qt Project using gcc? If so, you could use gcov. It tells you all methods which were called during execution. Then you could use ctags to create a list of all methods available. From these two sets  you could find those, not being called.
Of cause the application should run long enough under gcov for delivering more or less complete list of used functions.
(I guess there is an easier way using linker or a compiler switch. :-))

Find never-called functions


Sticking to high voltage DC Current

Question: I heard that if you come into contact with a high voltage DC current, you will 'stick' to it until it is switched off. Why is this and how high does the voltage have to be for someone to 'stick' to it?
Comment: Welcome to EE.SE. Sometimes there is a knee-jerk reaction that jerks your hand away. I have seen the 'freeze' effect when someone grabbed 2 phase bars with 600 VAC between them. He could not let go but someone close by hit the main disconnect switch and saved his life, though the palms of both hands were burnt real bad. If there is enough power you may 'stick' whether it is AC or DC.
Comment: @Sparky256 I thought it was just DC, but what makes this happen? I still don't understand why is it not possible to let go? P.S. What are phase bars?
Comment: Please read answer below.
Answer: The 'phase' bars refer to an industrial 3 phase surge suppressor that was under final electrical test with 600 VAC between each phase. The phases were connected to banks of MOV modules using copper bus bars.
"Sticking" refers to a current so strong your muscles can no longer function. Your brain is overwhelmed by pain. This can be fatal if the power is not cut off within seconds. This can be AC or DC current, but common in most every case is that a person "grabbed" a live circuit instead of just accidental contact that made the hand jerk away.
DC current tends to hurt more with brief contact as it slams the muscles hard in one direction. I touched a 800 VDC supply once and it went between my index finger and my thumb. My left arm was useless for about an hour.
When I was 15 years old I hit the power transformer output connections to an old color TV (it was all tubes back then), about 600 VAC center tapped. It hit my left wrist and burned 2 small holes like a snake bite. I could not use my arm for hours.
A quick summary would be that:

You touch or are struck by massive power such as lightning of a lightning simulator. You may survive, but will have scars for life. Touching a huge capacitor bank (fully charged) means losing a finger at least.
You touch typical 'hot' wires under 1,000 volts AC or DC, and it really hurts but part of the pain is your hand jerking away so fast you may hyperextend muscles. DC tends to hurt much more as it slams muscles in one direction.
Same as line 2 but you grab the hot wires or exposed circuits. Now your hands can no longer jerk away and you are stuck until you die or someone is there to cut the power.
Just for giggles, in the USA UL considers 48 VDC or 36 VAC to be the maximum safe exposed voltage that you can touch and get just a mild 'tickle'. But each time you double that voltage 4 times as much power is put through your body. This is where \$I^2R\$ becomes such a nasty equation.

Sticking to high voltage DC Current


What proves that sections 9(1) and 9(2) of Consumer Protection Act, 2002 impose strict liability on sellers?

Question: On its blog, on December 11 2018, Gluckstein Lawyers allegated that

In Ontario, there are two main pieces of legislation: the Sale of Goods Act (the "SGA") and the Consumer Protection Act (the "CPA"). The SGA deals with buyers and sellers; a purchase is required. The CPA has broader language; it deals with consumers and suppliers. The language of the CPA suggests that consumer contracts for the sale of goods and/or services, and bare licenses may all be covered by this legislation. These Acts have many similarities, one of which being the consumer's reliance on the supplier. The supplier is perceived to have greater knowledge and skill regarding the subject matter.  The SGA and CPA are mechanisms which keep suppliers accountable for their products and services. Actions commenced under these Acts have strict liability, meaning that should an action arise, the Defendant may be found liable regardless of fault. [emphasis mine] An example of this can be found in the recent case of Singh v. Shoppers Home Health Care [et. al. 2018 ONSC 5879].

But the CPA never writes out "strict liability"! CPA writes out "Absolute liability" merely once, under s. 104.0.1 (5) that has not been proclaimed by the Lieutenant Governor, and is not in force. That s. 104.0.1 legislates strict liability for "PART X.1 ADMINISTRATIVE PENALTIES", but does NOT spell out absolute liability for the whole CPA.
I know that "Absolute Liability can simply be said as Strict Liability minus exceptions."
Premise that opposing party, or the judge, rebuffs a blog as authority. Then how can a Self-Represented Litigant prove CPA sections 9(1) and (2)'s impositions of strict liability on sellers?

Quality of services

9 (1) The supplier is deemed to warrant that the services supplied under a consumer agreement are of a reasonably acceptable quality.  2002, c. 30, Sched. A, s. 9 (1).
Quality of goods
(2) The implied conditions and warranties applying to the sale of goods by virtue of the Sale of Goods Act are deemed to apply with necessary modifications to goods that are leased or traded or otherwise supplied under a consumer agreement.  2002, c. 30, Sched. A, s. 9 (2).
Answer: The absence of any reference to intent
An offence that does not require the prosecution to prove intent on the part of the perpetrator is the definition of a strict liability offence. Since the offences in the Act spell out what must be proved and intent or it's synonyms (knowingly, wilfully etc.) isn't mentioned, they are strict liability offences.
Comment: Please see my edited question. This answer does not appear to answer for sections 9(1) and 9(2).


How do I keep a zombie from despawning, since nametags apparently aren't working for me?

Question: I'm making an adventure map in Minecraft, and I want to keep zombies from despawning. I've already tried nametags, and they still despawn.
Comment: Is there anything else you have tried before?  Along with that, what version of Minecraft are you running?
Comment: I'm running Minecraft 1.8 Forge
Comment: Did you make sure they cannot move? They could walk around and kill themselves.
Comment: They've been trapped, so there's no way they could die.
Comment: What do you mean "despawn"? If they get killed, it could possibly because they burned in the sun. You can give it headgear (pumpkin, helmet) or create a ceiling to cover the sun.
Answer: If, for whatever reason, nametags don't keep a Zombie from naturally despawning, you can use some NBT magic to do the trick. Each and every Living Entity (aka Mob) has the NBT tag PersistenceRequired of the type boolean. This tag does exactly what you want to achieve.
The MinecraftWiki states the following:

PersistenceRequired: 1 or 0 (true/false) - true if the mob must not despawn naturally.

Source:  https://minecraft.wiki/w/Chunk_format
Applying that tag to a Zombie can be done in two ways:
1. Summon a new Zombie
/summon Zombie ~ ~ ~ {PersistenceRequired:true}
Of course, you can edit the co-ordinates to whatever fits your needs. The tildes (~) are relative co-ordinates, thus representing the position of the executing player or command block.
2. Edit the entity data of an existing Zombie
/entitydata @e[type=Zombie,r=3,c=1] {PersistenceRequired:true}
For this command to work, the Zombie must be within three blocks in a spherical radius of who- or whatever executes the command (r=3). Of course, you can easily edit that parameter. This command also selects only the nearest Zombie to you or the respective command block (c=1). You can omit the count (c) parameter if you want to do this for every Zombie within the given radius.


Is there a difference between walk-in and drop-in?

Question: Can I refer to a drop-in advice center as a walk-in advice center? I mean is there any practical difference between these two adjectives?
Comment: Such terms are part of the adopted commercial lingo of a country and may vary from place to place.  I am not certain what an "advice center" is exactly since we don't have them here in the US, at least not under that name. Is it a fortune teller?  a medical clinic?  a psychological counseling clinic? a place to take small appliances for repair? Maybe you could tell us what you believe the term to mean, and where you've encountered one.
Comment: @Tᴚoɯɐuo There are these places where you could seek free advice on different things such as housing, financial problems or, most commonly, family issues. I saw it on an English sign outside the facility. I checked it and I noticed such a thing exists at least in the UK. I was already familiar with walk-in like a walk-in spa; then it came to me how different it could be with drop-in while in use.
Comment: In the US, *walk-in* refers to a customer who goes to a business without an appointment. I haven't heard of *drop-in* used this way.
Comment: It doesn't have any practical bearing on these places, but to drop in on someone and to walk in on someone have very different meanings.
Answer: From what I have searched for the places people may visit casually for advice or assistance, both drop-in and walk-in are used, the former being used much frequently.
Interestingly, but British spelling--centre--multiplies the search results greatly, and  I can't help wondering why. Anyway, both seem to mean pretty much the same thing.


What is the difference between a Display Manager and Desktop Environment?

Question: I know that a Window Manager just manages windows, and can basically be used with any DE. My question is what is the difference between a display manager and a desktop environment? I ask this because I run i3-gaps on Arch Linux, and I want to be able to have multiple display managers/window managers/desktop environments, just so things aren't boring.
Comment: The display manager typically is a GUI login manager.  The desktop environment is a GUI environment for working on the computer after you're logged in.
Answer: According to Wikipedia, a Display Manager (such as KDM) is a graphical login utility, from which you can choose a user to log in as and a desktop environment (and/or window manager) to run.
A Desktop Environment is a collection of software to implement the "desktop" GUI paradigm, with things like icons, a graphical file browser, a clock, a notification area, wallpaper, settings management tool, and so on. They often provide support for inter-process activities such as cut/copy/paste and drag-and-drop. Some DEs aim to provide an extensive suite of software that all works together, including things like a web browser, email client, chat client, text editor, archive manager, office document suite, and so on.
In theory, all three of DM, WM, and DE are independent. In practice, there's usually, at a minimum, better integration if you use ones that are developed together (you can run KDE apps on GNOME, but since KDE uses QT and GNOME uses GTK, they won't have the same look-and-feel and GNOME tools that edit the way apps look in GTK may have no affect for QT apps).
Comment: Cool, I figured that out earlier, I left the post up in case anyone else was wondering :)
Another quick question, when I go to a virtual console, I can't switch back to my DE. I am running LightDM and the DE i use the most is Cinnamon, but with the w command, it says my cinnamon session is at :0 -_-
Comment: Cool; I learned something looking up the answer myself. Would be good to mark the question as answered, so anybody else searching for this info can see it has an answer. As for virtual consoles and window managers, I've had no problem switching off of the X11 console and then back to it. Have you simply tried *all* of them, until one drops you into a GUI instead of a command line? Which one its on seems to very.
Comment: CBHacking Yes, I have. It' so weird it's like it's not in a real session, under TTY it says :0 when I do the W command.


Execute Package Task by Package Name for Sql Server Stored Packages

Question: I've seen where people execute different packages by name on the file system by changing the file system connection information via a variable.  I need to execute different packages on Sql Server.  Has anyone seen a way to do this?
Answer: I ended up adding the packages to sql agent and then executing the bia msdb.dbo.sp_start_job [agent job name]


I can't find my funds on my bitcoin wallet

Question: I can't find my funds on my blockchain wallet after saving for over 1 years. My blockchain account show (00) total when i have saved 3 BTC what should i do ? please help
Answer:
what should i do

It depends whether you have a Blockchain.com account or a Blockchain.com wallet.
If you have a Blockchain.com account, contact Blockchain.com support.
If you have a Blockchain.com wallet, check the transaction history and find the Bitcoin addresses which held your money. You can then check those addresses in several different  blockchain explorers to see if money has been removed from those addresses. If not you may be able to regain control by  re-creating your wallet from your recovery phrase or wallet backups.


In JOSM, adjusting one line to follow another

Question: I would like to adjust a rudimentary drawn area (neighborhood) so that it uses the same nodes as the nearby streets. Doing it by hand seems very combersome - I use "a" or a nearby plus symbol to create a new node on the way, then I select it, and shift+select nearby street node, and hit "m" (merge).  How do I select "bad" line, and make it auto-join all the nearby nodes along the way, possibly with clicks or a keystroke.  I know about "follow", but that only works for a new drawing.
Answer: JOSM has a follow mode. Draw your way by using two consecutive nodes of an existing way, then just repeatedly press f to follow this way.
However most OSM editors are against joining highways with areas. Therefore I suggest to draw the neighborhood area completely separate instead of re-using nodes from the street.
Comment: thx, but what about **existing** ways - if I have two ways right next to each other (two neighborhoods next to each with a mutual border), I would like to reuse that way segment, instead of having two separate sets of nodes. Is there a way to select one way and interactively glue it with another?
Comment: My personal workflow is to split one of the areas at the shared border, delete this way and re-draw it along the existing way of the other border using follow mode. JOSM has various advanced tools in various addons, maybe there is an alternative approach.
Answer: Contourmerge plugin.
Beware is it very powerful.
Comment: Welcome to GIS SE! Please, can you provide more information about it? Links could become invalid, so any additional explanation would be welcomed.
Comment: Welcome to GIS SE! As a new user please take the [tour] to learn about our focused Q&A format.  Please don't just offer a link to a potential solution - instead **[edit]** your answer to give some detail on how to use it, and how it answers the question.  Link only answers without additional information may be deleted.


Spring behaviour under high atmospheric pressure

Question: We have a spring inside a chamber. We compress the spring and then let it decompress freely. Will its decompression (its speed and displacement) be the same if the air pressure of the chamber is $1\;\mathrm{atm}$ or $3000\;\mathrm{atm}$? If not, how will it be affected?
Comment: What do you reckon?
Comment: I reckon it WILL be affected. It will depend on the thickness of the spring, the more thickness, the more drag will be. And in extreme pressure, this drag is substantial.
Comment: Won't be affected.
Answer: In 3000atm it's speed of decompression will be slower because it is facing greater air density and the expanding spring has to move it. There will also be less "resonance" as the denser air damps the spring movement.
Answer: Damping
The density of atmospheric air is approximately 1.225 kg/m$^3$. At 3000 atm, the density would be 3675 kg/m$^3$ compared to the density of water of 1000 kg/m$^3$.  I don't know the viscosity of high density air, but as @DirkBruere answered, it could be a significant factor in the damping of the spring decompression.
The relative difference in decompression speed would depend on the spring stiffness.  For example the motion of a slinky would be affected in a major way, but the motion of a car suspension spring might be similar in either environment.
Stiffness Change
Another factor to consider is the deformation of the spring due to the high pressures at its surface.  3000 atm is approximately 44,000 psi.  That is likely enough to deform the steel cross section, making a difference in the spring stiffness.
Comment: I don't think the air density is correctly calculated for 3000 atm. That is high above the critical pressure of air (38 atm) where the ideal gas formula is no longer valid.
Comment: how many kilograms per square centimeter is 3000 atm?
Comment: @ergon:  Pressure is force/area.  You are asking for mass/area, which doesn't make sense.  If it helps, 1 atm is 101,325 Pascals.


Ruby on Rails - Storing application configuration

Question: I have a relatively simple Rails app and I would like to store various configuration settings that administrator users can change whilst the application is running, for example, allowing comments on posts or changing the display format of the date.
I know I can store constants etc in the environment.rb file, however these appear to be loaded only when the server is restarted.
Is there an alternative place I can define this information or would it be better to keep it in the database?
Any advice appreciated.
Thanks.
Answer: You could use the rails-settings-cached gem which is a fork of the rails-settings gem (linked by Yi-Ru Lin in another answer).
Once setup, you'll be able to do things such as:
Setting.foo = 123
Setting.foo # returns 123

You can also manage settings on models, ex:
user.settings.color = :red
user.settings.color # returns :red

Answer: You can use database. Create a separate table "settings" that stores key/value parameters you need. The downside of this solution is a performance hit (querying DB every time you need a setting). To fix this issue you could you read/write through cache like "cache_money" or create your own by using "Rails.cache"
Comment: Just posted an answer with approach that keeps settings in the database, updates them as needed, and does not suffer performance issues without resorting to caching DB stuff.
Answer: Try looking at it might be what you need.
http://github.com/ledermann/rails-settings
Comment: The squeegy repo is 4 years out of date and impossible to use with modern rails.  The ledermann gem requires you tie to another active record object (makes it impossible to use for global app settings.)  If you want global app settings, https://github.com/huacnlee/rails-settings-cached is the best
Answer: The best way is to use a database table. Each row should contain a keyword and a value. Simples.
Comment: OK, but how would you manage the different data types?
For example, some settings will be boolean, others strings, others integers etc
Comment: Can you not just use one row and add each setting as a column? Retrieving a setting would then be as simple as SELECT enable_setting FROM server_settings LIMIT 1;
Answer: I have used app_config gem for a while myself, but it fails with rails 2.3.9 (and probably also with rails 3.x), so I found this blog that mentions rails-settings and configuration, rails-settings stores values in DB, but configuration have namespaces built-in. I haven't tried them, but I think I will switch to rails-settings.
I notice now that the branch of rails-settings that Yi-Ru Lin mentions seems to be more featureful than the other rails-settings
Jarl
Answer: For rails 4, if you are using postgresql, you can use HStore, which is just like a serializable attribute, but you do SQL queries with it.
For rails 3, you can use activerecord-postgres-hstore gem.
Answer: I tried https://github.com/huacnlee/rails-settings-cached, but it does not work as described. Obviously the author forgot to mention some additional tune-ups in the gem usage description. I failed to write a controller for settings manipulation.
Instead I succeeded to utilize https://github.com/paulca/configurable_engine - despite some minor problems, this gem is by far more reasonable than rails-settings-cached.
The configurable_engine gem has a drawback: it has the hard-coded routes which are obscure and non-convenient. The gem's author promised to correct it, but said that he currently didn't have time for it.
So this problem was easily arranged by simply creating my own routes. Here is my code (added to make this gem really work):
routes.rb
 namespace :admin do
   resources :configurables, only: [:index, :show, :edit, :update, :destroy]
 end

admin/configurables_controller.rb
class Admin::ConfigurablesController < Admin::ApplicationController
      # include the engine controller actions
  include ConfigurableEngine::ConfigurablesController

  before_action :set_configurable, only: [:show, :edit, :update, :destroy]

  def index

    @configurables = (Configurable.all.size > 0 ? Configurable.all : []) +
    (Configurable.defaults.keys - Configurable.all.collect { |c| c.name })

  end

  def show
  end

  def edit
    new = params[:new]
  end

  def new

    respond_to do |format|

      name = params[:name]

        if name

            @configurable = Configurable.create!(name: name, value: nil)

            if @configurable
            format.html { redirect_to edit_admin_configurable_path(@configurable, new: true), notice: 'The setting was successfully created.' }
        else
            format.html { redirect_to admin_configurables_url, notice: 'Failed to create the setting.' }
        end
        else
            format.html { redirect_to admin_configurables_url, notice: 'The name of the new setting was not specified.' }
        end

    end

  end

  def update
    respond_to do |format|
      if @configurable.update(configurable_params)
        format.html { redirect_to [:admin, @configurable], notice: 'The setting was successfully updated.' }
        format.json { render :show, status: :ok, location: @configurable }
      else
        format.html { render :edit }
        format.json { render json: @configurable.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    @configurable.destroy
    respond_to do |format|
      format.html { redirect_to admin_configurables_url, notice: 'The setting was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_configurable
      @configurable = Configurable.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def configurable_params
      params.require(:configurable).permit(:name, :value)
    end

end

index.html.erb

Settings

      Name

    <% @configurables.each do |configurable| %>

        <% if configurable.try(:name) %>
          <%= Configurable.defaults[configurable.name][:name]%>

          <%= link_to 'Show', [:admin, configurable] %>
          <%= link_to 'Edit', edit_admin_configurable_path(configurable) %>
          <%= link_to 'Destroy', [:admin, configurable], method: :delete, data: { confirm: 'Are you sure?' } %>
        <% else %>
          <%= Configurable.defaults[configurable][:name] %>
          <%= link_to 'Create', new_admin_configurable_path(name: configurable) %>

        <% end %>

    <% end %>

edit.html.erb

Editing <%= @new ? "new " : "" %>setting

<%= render 'form', configurable: @configurable %>

<%= link_to 'Show', [:admin, @configurable] %> |
<%= link_to 'Back', admin_configurables_path %>

show.html.erb

  Name:
  <%= Configurable.defaults[@configurable.name][:name] %>

  Value:
  <%= @configurable.value %>

<%= link_to 'Edit', edit_admin_configurable_path(@configurable) %> |
<%= link_to 'Back', admin_configurables_path %>

_form.html.erb
<%= form_for([:admin, configurable]) do |f| %>

    <%= f.label "Name" %>
    <%= Configurable.defaults[@configurable.name][:name] %>

    <%= f.label "Value" %>
    <%= f.text_area :value %>

    <%= f.submit "Submit" %>

<% end %>

Due to the hard-coded routes my controller is not completely REST-compliant, but it is pretty close to. My new action actually creates a (database-stored) setting (only to override its yml-file value).
So this code added to the gem description code lets you practically utilize the run-time-changeable RoR settings.
The gem requires you to set some default values in an yml file in advance, which you may override later at the run-time. But you can't create a new setting at run-time (not-yml-file-existent) - only modify an existent (in yml file) one - which is quite logical.
Or you may restore (at the run-time) the default value of any setting (by deleting its database-stored overriden value).
This code was checked to work with Rails 5.


Unable to run truffle console

Question: When I'm running the truffle compile cmd getting the prompt "Everything is upto date." ABIS folder is created but the corresponding file related to contacts are not there. Basically, the folder is empty. Ganache is running, settings are correct. Please see the attached screenshot for more info. But when I run truffle console it says "unbale to connect to the server." Anyone has any idea what's happening. I'm running windows.
truffke_config.js
<code> networks: {
development: {
  host: "127.0.0.1",     // Localhost (default: none)
  port: 7545,            // Standard Ethereum port (default: none)
  network_id: "*",       // Any network (default: none)
 },
</code>
Answer: I solved this issue by installing ganache-CLI via WSL. Able to interact with the local blockchain now.

Unable to run truffle console


How to change android account of a phone

Question: I want to use different Google Account for my Android phone (Huawei Mate8). When I did Factory Reset, Android did not allow me to use another account, it says (Please sign in using the owner's account of this phone). In this case, I cannot sell the phone since the new owner will not be able to add its account. How do I eliminate this issue?
Answer: Go to settings and then accounts choose add account and then add the other e mail id that you want to, after that go to Google under accounts where both your accounts will be displayed, there delete the previous one and it'll be gone
Comment: Thank you very much. As I said in the question, I did Factory reset. Also I cannot login the owner's Google account, *I made a huge mistake by using 2-step verification via Google Auth App that I installed before resetting* :(, is there an alternative way instead of that?
Comment: Trying skipping sign in if it is possible assuming its possible since new phones allow that and then try, [ https://support.google.com/android-one/answer/6088915?hl=en-GB accord ding to this thread https://productforums.google.com/forum/m/#!topic/gmail/KyLff1ZQ4-M many have the same problem but only that worked. So try full deletion as mentioned in the former link


How to retrieve all post titles of a specific post type?

Question: I would like to use the titles within a select element in a form I am echoing to the client side. What would be the best way to do this?
Comment: The question is not very clear. Are you trying to return all post titles for all posts under specific post type? Is that right?
Comment: Sorry! Yes exactly, I have made a custom post type, created a few posts of this type, and I want to echo a form with a select element which allows a user to select one of the titles (They represent projects) to donate to.
Answer: You could - and in my mind, should - use API functions to get the data.
// query for your post type
$post_type_query  = new WP_Query(
    array (
        'post_type'      => 'your-post-type',
        'posts_per_page' => -1
    )
);
// we need the array of posts
$posts_array      = $post_type_query->posts;
// create a list with needed information
// the key equals the ID, the value is the post_title
$post_title_array = wp_list_pluck( $posts_array, 'post_title', 'ID' );

Comment: +1 for `wp_list_pluck()`. I always forget about that one...
Comment: Beware this will easily overload sites with lots of posts. Running WP_Query with `'posts_per_page' => -1` without sufficiently restrictive filters is an easy way to crash a site or run out of server resources.
Comment: +1 for introducing me to the pluck! How had I not seen this before??
Comment: +1 for the one-liner.... One-liners always rock!
Comment: You're not wrong @sbnc.eu but the question was how to get all the titles.
Comment: Right, and what I am saying that this method is only viable for small sites. If there are lots of posts a custom query is a must. Performance and memory footprint difference can be to large to ignore.
Comment: @sbnc.eu Thank you – feel free to post a solution for it.
Answer: Query all post titles of a specific post type
// Function that returns post titles from specific post type as form select element
// returns null if found no results.

function output_projects_list() {
    global $wpdb;

    $custom_post_type = 'page'; // define your custom post type slug here

    // A sql query to return all post titles
    $results = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = %s and post_status = 'publish'", $custom_post_type ), ARRAY_A );

    // Return null if we found no results
    if ( ! $results )
        return;

    // HTML for our select printing post titles as loop
    $output = '<select name="project" id="project">';

    foreach( $results as $index => $post ) {
        $output .= '<option value="' . $post['ID'] . '">' . $post['post_title'] . '</option>';
    }

    $output .= '</select>'; // end of select element

    // get the html
    return $output;
}

// Then in your project just call the function
// Where you want the select form to appear
echo output_projects_list();

Comment: This is an overly complex function for something that can easily be done using the API that WordPress provides in the WP_Query class. The answer provided by @ialocin is far better. You shouldnt need $wpdb for this.
Comment: @Brian What is `far better` about the other answer? This is technically faster as you are grabbing only the data that you need from mysql. The other answer (easier answer) grabs all the data into memory then modifies it afterwards in PHP. Thats more work for PHP. Both are acceptable but each have their strengths. If you know mysql then this isn't overly complex at all. Its pretty simple.
Comment: Yes and what is the point of the comment? :)
Comment: I agree with @JoeMoe1984, This function isn't as simple as the other answer... BUT it is MUCH more efficient from a memory perspective. SQL is a FAR better place (than wp_list_pluck(...)) to reduce/extract the valuable information from. Yes, it is slightly more complex, but your system will thank you for that...
Answer: For an hierarchical post type, we have the built-in:
wp_dropdown_pages(
    [
        'post_type' => 'page',
        'echo'      => 1,
        'name'      => 'wpse_titles',
        'id'        => 'wpse-titles'
    ]
);

that will generate a select element with post titles and the post ID as the option value.
Example:
<select name='wpse_titles' id='wpse-titles'>
    <option class="level-0" value="1">AAA</option>
    <option class="level-0" value="2">BBB</option>
    <option class="level-1" value="3">   CCC</option>
</select>

It's not clear from the documentation for wp_dropdown_pages(), but it's a wrapper for get_pages() and also support it's input arguments.
Answer: The way I have always done things like this is using get_posts and foreach like something below:
// Create our arguments for getting our post
$args = [
  'post_type'=>'custom-slug'
];

// we get an array of posts objects
$posts = get_posts($args);

// start our string
$str = '<select>';
// then we create an option for each post
foreach($posts as $key=>$post){
  $str .= '<option>'.$post->post_title.'</option>';
}
$str .= '</select>';
echo $str;

Comment: This is working well, thank you. I am attempting to add 'selected' to the option currently saved, I've tried a lot of different bits of code and finally have come to this, which is allowing me to update the option but the 'selected' isn't being added to the correct one. Any pointers on what I'm doing wrong?

`       $str .= ''. $post->post_title .'';`

Many thanks for any suggestions

p.s. Sorry I don't seem to be adding code correctly, tried backticks