Do any languages other than Haskell implement strings as linked lists of characters?

Question: Haskell's String type is an alias for [Char] (i.e. a linked list of Chars). Does any other language use an implementation of strings like this?
Comment: Did you know that Haskell also has a [`Text`](https://hackage.haskell.org/package/text-22.214.171.124/docs/Data-Text.html) type which is a conventional way of implementing strings - i.e. just like java.lang.String?
Comment: As a side note, Scala lets you implicitly treat a string as a list of chars, even though the underlying representation is a regular java string.
Comment: Haskell was designed as a replacement for a language called Miranda. Pretty-much any dubious design decision in Haskell (including Strings-as-linked-lists) can be traced back to being the way it was done in Miranda...
Answer: Yes. Erlang does the same, as well as quite a few other functional programming languages.
Using strings as a list of chars makes them very easy to pattern match and reason about. However, their performance is relatively bad:

accessing the nth character in a string takes walking through all n-1 items before it. This is thus linear in time.
appending strings is slow for the same reason (you need to loop through all characters of the first string)
in a linked list, you need to store both a character and a pointer to the next character. This takes a lot more memory (for each character, you need both the character itself plus a pointer to the next memory location, which on most systems actually takes more space than the character itself).

Also, Unicode, where one grapheme might consist of multiple characters, has made them even less practical, as this makes the pattern matching on characters very awkward again.
Often, these languages also have other ways to deal with strings that are faster, but harder  to manipulate. For instance, Haskell has the Text type, and Erlang has Binaries that can be treated as strings.
Comment: "twice as much memory" is rather optimistic. For the common case of ASCII characters (which would take 1 byte as part of a UTF-8 string) you'd need 8+1 bytes for a node on a 64 bit system. And that isn't even taking allocator overhead or alignment, so a node will likely end up with 16 bytes of memory. For Japanese text where each character takes 3 bytes of UTF-8 the difference is still a factor of 5 for long strings.
Comment: "accessing the nth character in a string takes walking through all n-1 items before it. This is thus linear in time. " -- this is also true of strings stored as an array of UTF8 bytes or UTF16 words, as these are variable length encodings so you need to interpret all other bytes/words until you get to the one that starts the character you're looking for.  This hasn't stopped this representation being the most common.
Comment: @CodesInChaos You are very right. I have changed the faulty 'rougly twice as much memory' part to a slightly more general statement. Jules: This is indeed true. Of course, *replacing* part of a string is another case where linked lists have a problem over arrays (assuming that the new string does not result in new memory needing to be allocated for the array, which would complicate it somewhat), because if I replace something in a linked list, I need to replace everything in front of it as well, as the pointers no longer work.
Comment: Re, "the common case of ASCII characters", Slowly, but surely, it's becoming less common.  Won't be long I expect before we start seeing programming languages (or programming language variants) with non-ASCII keywords.
Answer: The "abc" syntax in Prolog is usually a shorthand notation for a list of character codes, i.e. [97,98,99], which is also the case in Erlang. See this question for details. When a Prolog implementation supports a custom string type (e.g. ECLiPSe/SWI/YAP), there are predicates to convert from and to lists of character codes.
Comment: Think the OP was more interested in "complex" string types, i.e. a minimal string is always a series or list of character codes. But while I don't know Haskell (just some basics), this sounds like `String` would store more metadata per node/character, i.e. the linked list connection to the next node.


Cantilever cable adjustment device

Question: I'm about to build up a frame (Motobecane Fantom CX) with cantilevers and drop bars. I plan to use my old Campy 9-speed levers. Obviously, those levers don't have any way of adjusting the cable length - so I'll have to add some way to adjust it. I know I can buy a front cable hanger with an adjusting barrel, so that takes care of the front. It's the rear that I can't figure out: this frame already has a cable stop for the rear brake, so I don't think I even have the option of installing one of those adjustable hangers on the seat bolt. I think what I need is some sort of adjusting barrel that can fit into the existing cable stop - does such a thing exist? If not, how can I make one?
Comment: I wonder if it's worth editing the subject to be a little more specific. "Cantilever brake adjusters for use with drop bars?" or something would make the question/answers easier to find.
Comment: @moz - OK, done.
Answer: You can get in-line cable housing adjusters.
A pair is listed on http://www.sheldonbrown.com/harris/cable-hardware-brake.html, part CAH32. I think those are made by jagwire, and they should be available at virtually any bike shop.
edit: those inline adjusters are for derailleur cables only. Use this http://harriscyclery.net/product/qbp-mickey-cable-barrel-adjuster-1061.htm for brake cables. It goes in the cable stop. Being a QBP product, you should also be able to obtain those at virtually any local bike shop.
Answer: Try haunting established bike shops for their "old parts" boxes... Most have 'em....
I'm sure I have seen the sort of device you would need; essentially an adjusting barrel with a knurled ring around the outside that would allow the threaded portion to just slide into the frame boss.
If not the dedicated part, perhaps you could incorporate the adjuster mechanism for a rear DR?  They would be about the right size.
Good luck with the cantis, I know some folks still like 'em, but I was glad to wave by-by.  The pads did last a long time....
Comment: Well, I wanted a frame for road riding that would allow me to run fatter tires. And I wanted to keep my old wheels and brake levers, so cantis were the only choice.
Comment: This is the correct answer and the part is correct for the era. The barrel adjuster from old 'Weinmann' style sidepulls can be used too.
Answer: I put  Surly Cable Hangers on all my bikes with canti brakes. They have an adjustable barrel to alter the cable tension before the straddle cable hanger.

Cantilever cable adjustment device


What's going to happen to my delisted ADR shares?

Question: As the title says, my ADR is delisting.  It's going OTC.  In such a situation would my shares, which I have with my bank's discount brokerage, normally automatically convert to the OTC shares and remain in my account?  Is it possible my bank (USAA, if it matters) will not be able to handle OTC shares for whatever reason, and force me to sell?
Answer: Most discount brokers handle OTC stocks transparently, so it shouldn't matter.
Note, however, that there's a difference between "OTC" and "Grey market". The difference between the OTC market and the NYSE or NASDAQ is just the listing requirements of the major exchanges and the degree of SEC regulation. The OTC markets still have market-makers who provide liquidity. That is not the case for "Grey market". You need to check whether "delisting", in the case of your stock, just means moving to OTC (in which case, nothing to worry about) or means going to grey market.
Comment: See also https://www.investopedia.com/articles/fundamental-analysis/08/pink-sheets-ottcb.asp


R Package for Ordinal Data Modeling with Random Effects, but with Relaxation of Proportional Odds Assumption

Question: Seeking an R package capable of modeling ordinal data including random effects (like clmm) while relaxing the proportional odds assumption. Although clmm handles random effects, it does not allow relaxation of the proportional odds assumption. Any recommendations for alternative packages would be greatly appreciated.
Answer: Random effects work better with Bayesian models.  The rmsb package uses Stan to fit PO models with or without random effects (single level) with non-proportional odds for a subset of the variables (partial proportional odds model, Peterson & Harrell 1990). It also fits a constrained partial proportional odds model (Peterson & Harrell 1990).  An extensive vignette is at https://hbiostat.org/
Note that in some situations relaxing the PO assumption makes things worse.  See this.  For other resources see this.


Shadow copy in mvc core

Question: In Asp.Net Shadow copying enables assemblies that are used in an application domain to be updated without unloading the application domain.
Since Mvc Core not support AppDomain and can not load duplicate different version of assembly.
I'm looking for a way to update the assemblies at runtime without unload or stop site.
My goal is to update the site with a new version if available on remote server.
Answer: You can find a workaround here: The site DLL seems to be intermittently locked when publishing. The trick consists of creating a subdirectory (eg. /PREVIOUS), move the 'old' files in that directory, change the web.config to point to the exe in that directory, publish the new site and change the web.config again. Of course, this should be scripted... If you have set 'Remove additional files at destination' you cannot work with a subdirectory, but you can put that directory elsewhere of course (as long as IIS has access to it).
Comment: It's more than that though. You also need to redirect the wwwroot and also the content root from within your project, in order to fully support on the fly updating. Othewrise your site, during the copying process, will be in a state were the old assemblies work with new content (js scripts, assets etc) before web.config is changed to point back to the original location
Answer: I too would like this. The current best workaround I'm aware of - when you want to overwrite assemblies that are in use, place a file in the folder called:

app_offline.htm

...this will temporarily take the site offline allowing you to overwrite the files. Remove or rename the file when you're done.
If you script this it would have minimal impact.
Answer: I have found the solution, which solves for me the problem of build errors in VS2017 due to locking of assemblies by dotnet.exe process, spawned by IIS Express. I've just added pre-build script to ASP.NET Core Web Application, touching applicationhost.config file, located in hidden .vs directory, which is used by IIS Express as config file. It looks in .csproj file like this:
  <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
    <Exec Command="IF EXIST "$(SolutionDir)\.vs\config\applicationhost.config" (pushd $(SolutionDir)\.vs\config\ & copy /b applicationhost.config +,, & popd)" />
  </Target>

Once file is touched by the script, IIS express terminates the dotnet.exe process, allowing build to proceed successfully. The new dotnet.exe process is spawned on the next request to web application.
UPDATE
For VS 2019 location of applicationhost.config file was changed so pre-build script event in .csproj file should look slightly different:
  <Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="$(Configuration) == 'Debug'">
    <Exec Command="IF EXIST "$(SolutionDir)\.vs\<SolutionName>\config\applicationhost.config" (pushd "$(SolutionDir).vs\<SolutionName>\config\" & copy /b applicationhost.config +,, & popd)" />
  </Target>

where <SolutionName> is solution file name without extension .sln.
It is also required to remove the attribute hostingModel="InProcess" from the IIS Express configuration file $(SolutionDir)\.vs\<SolutionName>\config\applicationhost.config, which is automatically generated by VS on starting web application under IIS Express.
Comment: That's not actually a solution. How could you do that in production environment with normal IIS?
Comment: I agree that this is not universal solution. It is intended primarily for development purposes and for me it still works fine (with minor changes for VS2019).

Shadow copy in mvc core


How to link Facebook to Iphone App using Xcode

Question: I'm using version Xcode 4.3 .  At this stage I have a very basic App, so I have no conflicting features of elements.
I was wondering does anyone know how to link facebook to the Iphone App using Xcode.  I want a simply Login Feature through the use of facebook.  But have been unsuccessful in finding updated tutorials and becoming increasingly annoyed at broken links.
Any information would be greatly appreciated.
Answer: Why not take a look at Facebook's documentation as a starting point?
https://developers.facebook.com/docs/mobile/ios/build/


Is file a basic form of database?

Question: I'm having an interesting conversation with my friend who's a developer. I'm a database admin. I say file is a basic form of database. I believe whatever that stores data can be called a database. He says only engine like sql server is a database. I think he's confused between a database and database management system? Please share your thoughts. Am I right or wrong ? Btw he agrees an excel is a database since it has rows and columns. I say a simple word document is also a simple form of database without coming into the argument of whether it's efficient or what are it's capabilities!
Answer: According to Garcia-Molina (this is from memory) a database is any permanent store of data where the data is retrievable.
This, to my mind, makes a notepad file a "database". The whole issue here is context and semantics!
A database can mean pretty much whatever the person who uses the word says!
To give you another example, I used to work for an airline. The word "flight" meant 3 different things depending on whether you were talking to engineers, flight crew or sales people.

1) to an engineer, a "flight" meant an aircraft taking off and landing (one "leg")
2) to flight crew, a "flight" meant out from base and back to base (two "legs" - aka a "return")
3) to sales, a "flight" meant a season (high/low) of "flights" over a six month period - obviously many "legs" (also known as a "rotation").

Database terminology is fraught with the same issues:

Does a database have to be relational? Clearly not, although some purists might argue otherwise.
Does it have SQL or not? Does that make it a  database? Clearly there were databases prior to SQL and many current databases don't support it!
If you store a list of phone numbers in a notepad file on Google drive, is that a database? Clearly by some criteria it is - it's searchable, the data is retrievable and permanent!

My answer to your question is to be clear in your definitions before you start a detailled technical conversation - as an IT person in the airline who dealt with engineers, flight crew and sales, I always  had to stop and ask them what they meant by "flight" and then gently nudge them towards the terms "leg", "return" or "rotation".
Do the same in your conversations about databases and you'll not go wrong - "Are we talking about SQL Server or MongoDB?" &c.

Is file a basic form of database?


How to change the page title of product list pages

Question: I have a list of titles I want to overwrite the default page title on multiple product list pages with (title tag in the html head). But not on the product view page, only on the 'product list' page.
I tried creating a new custom attribute 'productlist_pagetitle' which would contain the new title. In template/page/html/head.phtml I would then use the title taken from the attribute to write it to the title tag.
However I am confused about a few things.

as far as I understand I can use the attribute as a meta field, but it is attached to a product. is there a way to link the attribute to 'product list' pages?
where / how can I actually enter my data (the new titles)?
how I can access the value of the attribute?

Sorry, I'm new to Magento and their EAV model. Any help would be greatly appreciated!
Comment: by product list you meant category pages?
Answer: why not to set category page title on category edit page:


Voltage drop in a forward biased diode

Question: I'm trying to understand why is there a voltage drop when a diode is in a forward bias. From what I understood the PN-junction creates a potential barrier of about 0.7 V for silicon. Now looking at the circuit below, if we choose to integrate in the path of conventional current, it would seem that the electric field of the PN-junction would increase the voltage because of ΔV = -∫E.ds. But that would result in a voltage rise, not a voltage drop. So is there a field created by charge accumulating at the surface of the diode? And if so why would this electric field be bigger than the electric field of the junction in such a way that it would create a voltage drop of approximately 0.7 V. Is it because of the internal resistance of the diode?
Answer: If we measure the voltage between the terminals of a diode in an open circuit, the outcome is zero. The E-field of the junction in only internal.
When a forward voltage is applied, but there is also a big resistance in series in the circuit, there is a tension between the ends of the diode but below 0.7V. Even below the threshold a small current flows.
When we decrease the resistance in series, the current increases, and the voltage in the diode also increases. When the threshold is reached, it stays there for further increase of current.
The model of ohmic resistance for diodes is misleading because, as can be seen from the example above, their behaviour is highly non-linear.
What happens is that the junction is a potential barrier, that once overcome, allows current as a conductor, but different from a conductor, requiring a voltage to keep passing the barrier.

Voltage drop in a forward biased diode


mono balanced to stereo minijack lead

Question: i was making a lead to attach a balanced shotgun mike to a
Panasonic NV-GS230 DV camera, minijack stereo mike input.
 This is now interesting because i made the lead,
 Ring to negative polarity for balanced mono
 Tip to positive polarity for balanced mono
 Sleeve ground.
 it worked Really very well, but i suspect one of the stereo tracks
  on my DV tape is out of phase?
  what do you guys reckon?
Comment: What makes you think it's out of phase?
Answer: If the input is expecting a stereo signal & you're instead sending it both sides of a balanced output, then yes, you will be 180° out of phase, as that's the whole idea of the balanced signal - each pole is out of phase with the other.
When the signal arrives at the other end, one pole is inverted & the two signals them summed - this makes any noise picked up on the way out of phase & therefore cancels itself out.
You actually need to unbalance the signal yourself, then send the same signal to both sides of the stereo input.
Send the cold pin [usually pin 3] and the shield [pin 1] to the sleeve, then the hot pin [pin 2] to the ring. Bridge the ring to the tip [connect the 2 together in other words]
You really don't want long cables if you're doing this, as they are liable to interference.
This is the best pic I could find of how to do it, courtesy of Photobucket

mono balanced to stereo minijack lead


Does Ubuntu touch has MP3/MP4 playback support by default?

Question: I believe these are essential for apps like Youtube, but the codecs are closed source. How does Ubuntu touch resolves this issue? Does it use VLC as the backend?
Answer: The Mp3/Mp4 support is third party used.  Unless you install them, no media player put in by default runs them.
There are different repositories that do supply them. This one I use is Fluendo mp3 decoder GStreamer 0.10 plugin.
Comment: It sounds like desktop. Are you sure the situation is the same with Mobile?
Comment: @Naveen Ubuntu no matter the flavor still do not have certain libs installed to boot.  You stated that mobile does not have these codecs, which supports every desktop version I have played with.  If this plug-in is, in fact, wrong for you, then a simple look around in the software center should procure some results.
Comment: Ubuntu touch is a different beast, through. You sure you can install the GStreamer plugins in Ubuntu Touch? BTW, GStreamer 0.10 is obsolete, in newer versions of Ubuntu it won't be appearing.
Answer: Much of what Canonical did when building Ubuntu Touch was about enabling OEMs to use their existing android drivers with UT. OEMs are reluctant to release sources for their devices' drivers. Not only that, there are many hardware manufacturers which have different policies so it is hard to get something more than a binary blob. Essentially, there is an interfacing layer called libhybris which talks to a part of Android's multimedia stack called AndroidMedia. Then there is a gst-hybris GStreamer plugin. GStreamer is used as a backend for Qt's multimedia stack. In the end, you have your hardware acceleration if your chip supports and OpenMAX (omx) APIs are implemented.
Take a look at the page 20 in the "Ubuntu touch internals" and at Android's multimedia stack:
http://elinux.org/images/c/cf/Ubuntu_Touch_Internals_1.pdf#20
https://source.android.com/devices/media.html
Answer: I recommend installing the Fluendo codec. An easy way to install this codec and a few others is to install the ubuntu-restricted-extras package. First, make sure you have the Universe repositories enabled. Then you will need to open a terminal. How to do this varies by GNU/Linux distro and desktop, but you can figure it out. Then, type sudo apt-get install ubuntu-restricted-extras in it. Press Enter. This will install some useful codecs, some fonts made by Microsoft, but no programs, except for Adobe Flash Player. You may need to restart your system afterwards. However there is no prompt or warning of any kind to restart your system, I recommend doing so anyway. The reason doing all of this is necessary is because Canonical Ltd. (the makers of Ubuntu) could not include the proprietary codecs in Ubuntu because they were not free. However, installing this package takes care of it and installs the codecs, Adobe Flash Player, and Microsoft TrueType Fonts anyway.


When should I use user_load($user->uid)

Question: when do we need to load user using  user_load($user->uid) after global $user. Why do we need to load a user because we can access user data after declaring it global. I am adding a commerce customer to his billing and shipping profiles, should I use user_load?
Answer: The global $user object is just the bare data received from the users table for the associated user. It doesn't have any field, or other module-added data, attached to it by default.
For example, if you have a field attached to your user accounts called 'field_nickname', and you want to inspect the value of that field for the current user in code, you would need to call user_load() for the data to be available.
// Might work, but it's not guaranteed - depends on the modules
// you have installed and what's happened in the page build so far
$account = $GLOBALS['user'];
if ($items = field_get_items('user', $account, 'field_nickname')) {
  // ...
}

// Will always work.
$account = user_load($GLOBALS['user']->uid);
if ($items = field_get_items('user', $account, 'field_nickname')) {
  // ...
}

There are situations when other modules will load the field and other module data onto the global $user object, so depending on what modules you have installed you call to user_load() might not strictly be necessary.
However, it's good practice to make sure you load the object yourself; if another module has already run it for the current user then that data is statically cached, so you don't get a performance hit.
Answer: You don't need to do user_load() on global $user.
global $user is already a loaded user (the current user).
use user_load() when you want to load users other than the current user. for example, if you have a uid for the author of a node or comment, or a uid from a commerce order, then you use user_load() to load the user object.
Unless (as Clive mentioned), you need to access fields attached to the user, in which case you should load it.
Also, if you want profile2 fields you will need to do
$profile = profile2_load_by_user($user, 'PROFILE_NAME');

Comment: That's not strictly true...field data isn't available by default on the global `$user` object for example - it needs to go through `user_load()` (which in turn invokes `field_attach_load()`) for that to happen
Comment: True, I was also going to mention things like profile2, and the fact that if you want profile2 fields they have to be separately loaded.

When should I use user_load($user->uid)


Is the opposite of 上床 下床 or 起床?

Question: I have always learnt that 'to get out of bed' is 起床, but a book of mine says that two elderly people 从来不下床. Is there a difference between the two or is it just a dialect thing?
Also, if you can say 下床, can you say 我上床 to mean 'I am going to bed'?
Comment: see dictionaries, e.g.bkrs:下床:下床离开床铺。#15634
如:「医生吩咐她必须卧床静养,不宜随便下床。」
get out of bed get up (from bed)同义: 起床, 起身, 起来, 起五更,他好多了,能下床了。(he already is much better and can get out of bed)  cf.下车/飞机,下楼梯,
Answer: Alright, to me, 起床 means the end of sleep and getting up. 下床 means the opposite of being on the bed, as in your example, two elderly people 从来不下床 may mean that they have health problems so they have to be lying on the bed, but they may not be asleep when they are on the bed.
上床 can be used to refer to the action of going to bed, like 我一般晚上 11 点钟上床。(I usually go to bed at 11 pm.) Also 上床 is the common saying of having sex.
Comment: @Blaszard Yes you can say 醒来 but 醒来 emphasizes the state transition from being asleep to being awake. Instead if you say 起床 people would think that you are already out of bed.
Comment: It is correct, 起床 mean 'wake up and get out of bed' 下床 only mean 'get out of bed' The opposite of 起床 is 就寑 (get on the bed to sleep)
Comment: I agree. 起床 means get up. It might not suggest that the person got off or out of the bed and he might still be sitting on the bed awake.
Comment: Isn't 醒来 also used?
Answer: 上床 generally means that you have moved to bed, but not necessarily to sleep. You can read books and other activities in bed. For example: 我上床去睡觉。
下床 is you leave the bed, first, there is a temporary departure and will come back within a short time; second, the location of the move, for example, you just read in bed, and now get out of bed to the sofa to read a book. For example: 我下床穿衣服。
And 起床 often is used to represent a series of actions that awaken from sleep. The coherent behavior of sleeping from bed, sleeping and opening your eyes, sitting up, getting out of bed, and washing yourselves can all be called up. For example: 我起床去工作了。

Is the opposite of 上床 下床 or 起床?


Noise problem from neighbour

Question: I have just moved into a house with an open area in the back that is glassed in.  Something that they call a Queensland room in Australia.  A patio that has glass walls and windows.  My neighbour loves his music.  How can I reduce the noise coming from his place through glass.  Is there something that can be stuck on the glass that is see through that stops the noise from coming into our space.  I don't want to antagonise him because he sounds like he is having a great time and is a nice neighbour otherwise.
Comment: Hello, and welcome to Stack Exchange. Blocking noise is difficult; as @RedGrittyBrick says, double-glazing is a good but expensive solution, but just making sure there aren't any air gaps in the glass wall may help and be a lot cheaper.
Answer: The best solution, though perhaps not always the most practical, is to upgrade single glazing to double-glazing or upgrade double-glazing to triple-glazing.
A compromise is "secondary double glazing" which is not as effective.
Answer: Unfortunately to block sound you really need thermal mass and/or disruption to the scatter/reflect the noise.  I do not believe their is any kind of film which does this.
Double/secondary glazing should make a difference, but is expensive.  Another thought might be to (a) plant some bushes/shrubs between you and the neighbour to help scatter the noise (b) putting in plush carpets and "rug type" wall hangings which will absorb rather then scatter the noise and (c) consider a white noise generator or your own music.  Our minds are a bit funny like that - they tune out rain and comparitively large regular sounds, yet you can hear a mouse running across your ceiling !   None of these are anything like a panacea though.

Noise problem from neighbour


What does wordpress search, search?

Question: I just realized in testing, it appears worpress search is not matching my search term "php" with any post's tagged with "php" or in a category of "php" unless php is in the title or body, is that all the search searches for?
Answer: yes, WordPress search only searches title or post content. There are a few plugins that extend search to taxonomies, Relevanssi is one.
EDIT - The query WordPress produces for default search:
<code>SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID
FROM wp_posts  WHERE 1=1
AND (((wp_posts.post_title LIKE '%test%')
OR (wp_posts.post_content LIKE '%test%')))
AND wp_posts.post_type IN ('post', 'page', 'attachment')
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_author = 1
AND wp_posts.post_status = 'private')
ORDER BY wp_posts.post_date DESC
LIMIT 0, 10
</code>
Comment: thanks, ill just have to remember to include the tags/category term somewhere in the content
Comment: I think what @Milo says is not correct.
Default search can search taxonomies and custom fields. Check this analysis here:
https://gist.github.com/2023628
Comment: @p.a. - you can obviously query taxonomies and custom fields but the actual query WordPress performs when you do a search does not include those things. see edit above for SQL WordPress produces when you perform a search.
Comment: @Milo I lost you; can Wordpress search for custom taxonomies and custom fields via Wp-Query or not? This is important for my dev plans. Thanks
Comment: @p.a. - you can't do a full pattern match search of everything simultaneously without directly modifying the query via filters like [`posts_join`](http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join) and [`posts_where`](http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where)

What does wordpress search, search?


Wrong sorting of elevation classes QGIS

Question: I'm a totally beginner with QGIS and maybe I have a very easy problem, but I can't help myself.
I got an elevation shapefile with classes of elevations like that: 1-100m, 101-200m, ...
When I try to classify this dates to display them with a continuous shift of colours, QGIS always sorts the classes like that: 1-100m, 1001-1101m, 101-200m, 1101-1200m, ...
So the colours of the elevation classes are mixed and don't display the continuous shift. Is there an easy way to sort the classes in the attribut table in the right way?
Thanks a lot!
Answer: The attribute table entries you quoted are strings. These can only be sorted alphabetically.
You have to create numerical values from them in a new column of type integer or real using the field calculator with something like
<code> left(  "elevation" , strpos(  "elevation" ,'-'))
</code>
Comment: Okay, sounds easy... But what du I have to do in the field calculator? Create a new column and then? How can I transform the large amount of dates to numerical entries? I never used it before... So many questions, I'm sorry...

Wrong sorting of elevation classes QGIS


UKUU new kernel error: you need to load the kernel first

Question: I installed new kernel with UKUU on my Ubuntu 18.10 (kernel 4.15 running). However when I boot the computer and use advance boot options in GRUB 2.2, it shows me the error saying:

error: you need to load the kernel first

Also in UKUU the default kernel installed with Ubuntu distribution is marked with Ubuntu logo, however the others including the one that I downloaded are marked with Linux penguin logo in the beginning of their name.

how can I load the kernel for the system?
How to make it as the default kernel to boot with?
Does having dual boot with windows have anything to do with it and making any problems or not?

Thank you so much.
Answer: I had this same problem. To fix it, I went into the UEFI and disabled Secure Boot. After saving the settings and rebooting I was able to use the new kernel.


How do I explain work experience in a different field on my SOP?

Question: I want to pursue a masters degree in Electrical Engineering. I have a bachelor's degree in Electrical and Electronics Engineering, but I have two years experience as a software engineer. I want to state the reason for shifting from EEE to software in my SOP, but the main reason was purely financial; to clear my loans that I took up for my undergrad. The software job paid me thrice the amount of the Electrical Jobs. How do I explain this on my SOP? Can I state any other reason that sounds better compared to financial motives?
Comment: Are you sure this is even such a big issue? Those fields are still very close actually. Most of the engineers I know work in slightly different fields than their University major (not even counting all those working in sales).
Comment: @user7019377 I am unsure if not stating the reason for a job in a different field could be a potential reason for rejection
Answer: There are many people who do exactly this - many have worked in a field that is almost completely unrelated to the subject(s) that they are researching.  There is a major opportunity to emphasise the demonstrable tranferable skills that you developed from your work that would benefit your research.
In your situation, as with many similar circumstances, specific examples of technical skills that you used and developed as working as a software engineer that would be relevant in your research in electrical engineering.


How do I get pictures entered into fields in contact records to be viewable in the contact record?

Question: And not just present as file names, or require that the file be opened to view the picture?
Answer: Welcome! That's a CiviCRM Core Contact Field -> so simply hit Edit on the Contact Record and look for the field: Browse/Upload Image
Comment: Sure. But after you save the field, all you can see is the file name.  I want to be able to see the picture when reviewing the contact record, not the file name. Am I doing something wrong?
Comment: Ah that may just Shoreditch extension for me then [we use that with most of our clients]  -> I'll add what I see


Can a PowerShell script inside a Zip file execute automatically upon unzipping?

Question: I have a zip file that has a Powershell script inside that I want to look at. Is it possible that the Powershell script could execute automatically just by unzipping the file? This is not something I want to happen. Thank you!
Comment: You could, if you're paranoid, unpack it on a platform that lacks powershell... Like a linux live media.
Answer: Generally speaking, the answer is no. There's a risk that a malicious archive will exploit a bug in your archive software to open a file, but if your software has such a bug then attempting to execute a script is actually relatively safe, as there's lots of ways to block that (you'd have fewer options it if just ran an executable or took over the archive utility directly).
With that said, if you're feeling paranoid, here's a few things you could do:

Set the execution policy in Powershell to "Restricted", which says "don't run scripts, period". It won't stop something like a CMD script invoking powershell with a malicious command, but it will stop an attempt to execute a .ps1 (or similar) file directly.
Rename the file, before unpacking, using a hex editor. File names in ZIP archives are stored in plain text, uncompressed, and if you simply change a non-NULL character (rather than adding or removing any) then it'll still be a valid file afterward. Changing the extension will prevent attempts to launch the file using ShellExecute or similar, although it could still be explicitly passed to Powershell... but if the attacker has the ability to launch arbitrary programs directly then the PS script isn't going to be anything except a payload, and probably a simple one. Hex editors are simple enough that it's extremely unlikely they'd have a vulnerability that could be triggered by reading any file, no matter how malicious.
Use a sandbox to unzip the file. For example, on Windows, there are multiple Zip unpacker apps in the Windows Store, most of which don't even have permissions to write to the file system without permission, much less launch a program. If one of them tries anyway, at worst you'll get a prompt asking you to confirm you want to open the file / launch the program.
Use a system that has no Powershell available. On a Mac or Linux box, this just requires never having installed it. On Windows, this requires moving/renaming/deleting the executable, removing its Execute permission, or using the OS' built-in app restriction policies to prevent it from running. Note that any of these actions require Admin privileges as Powershell is installed in the system directory, may cause the OS to malfunction in the long term (some Windows Updates require a working Powershell, for example) so you should undo it afterward, and that on anything except 32-bit x86 Windows there may be multiple versions of Powershell installed using different architectures (for example, on my x86-64 machine, there's one in "System32" (the 64-bit one) and one in "SysWOW64" (the 32-bit one, in the "Windows-on-Windows64" system directory).
Answer: Not under normal circumstances. I mean, if no malware is already running on your PC and you are using well known archiving apps (default windows zip, winzip, winrar, 7zip). But it is very easy to missclick and run it on your own ;)
Comment: I don't think "well known" has anything to do with it.  I think what you're really getting at is whether or not the zip application is *secure*.  If you use a zip application that happens to have a vulnerability, and the zip archive is a malicious one designed to take advantage of said vulnerability, then it doesn't matter if the zip library is "well known".
Comment: If anything a well known app might make this (admittedly unlikely) attack slightly more likely since hackers don't usually bother targeting rarely used apps... Note that I'm not suggesting that therefore you use the least used app available...
Comment: I agree, but as far a I know there is no known vulnerability you describe in recent versions of "most known" apps and it never happened to me something got executed automatically when I've used them (or I didn't notice? :))
Comment: Ups, actually, there is one https://threatpost.com/critical-winrar-flaw-found-actively-being-exploited/142204/
Comment: I agree - I think the risk here is **very** small, and I'm sure it has never happened to you or just about anyone here.  However, that wasn't my point.  My point is that just because something is "Well known" doesn't mean it is safe.  In fact, well known sometimes mean **less** safe, because it is more targeted.  As a result "well known" is simply a red herring that distracts from the underlying issue, and may give people "confidence" in the wrong thing.
Comment: In the end I think it does not matter if its well or less known. Definitely it depends where it is downloaded from. Vulnerability can be in both. In "less" known I think there is higher probability of vulnerabilities and backdoors and smaller chance for regular updates. And as you say, well known could be more focused by attackers, so even if there is less chance for vulnerability existence there is higher chance the vulnerability will be discovered.


How to make a marketplace multi languge support?

Question: How to make a marketplace with buyers and suppliers multilingual? Because if someone writes product details with their language then how can another user in another country see the text in their native language.
Comment: It's not clear for me whether you're asking for implementation or design advice.
Answer: This has been well implemented on a few sites by showing the original text, and the offering a button to translate the text with a well chosen icon (typically a globe).  Once translated, there should be a button to "untranslate" the text as well.  Here's an example of the buttons:

This usually is done using the Google Translate API, but I'm sure there are also other services for this.

Alternatively you can spend millions on having all the text professionally translated into all the languages that you support, but I'm going to guess that you have better things to do with the millions.  Rather use Google translate and donate the millions to Doctors Without Borders.
Comment: I guess google translator is not accurate and there should be a better way. For example if there is an ask a question messaging system as well then clicking translate eachtime is going to be very confusing for the user UX wise. If it was my site I would rather stick to English only and then just change the currency, Photos etc to reflect one specific country which users are visiting from.
Comment: @user45042 That doesn't answer the question as posed.  Besides there are many sites for which English is the minority of the revenue, and so if you were advising one of those sites, you would be giving narrow, and unhelpful advice.
Answer: A good example could be taken from Aliexpress.com, which sells and ships worldwide. They do use Google translator to translate the whole page.
I don't know any better solution to reach all languages.
Answer: If you support multiple currencies on your site, then use a drop down to enable shoppers to select the currency and/or the country. Ensure the option to choose the currency/country is highly prominent. If you can automatically detect the geographic location of the shopper, then set the default currency/country based on the location.
Since automatic country selection is not always accurate, you can also ask the users to choose the country when they first enter the site and allow them to change it any time.
If your store is localized in 2 or 3 languages, then list them using the language's own name itself across the website header so that the user can toggle between them.
If yours is a multilingual store, then use a drop down language selector that lists all the languages in alphabetical order.
Answer: There are translation tools (API's) that can be implemented in websites and applications,  but I recommend not to  rely too much on them.
You shouldn't translate the text automatically for users but leave it as an option. It's possible a non-English person can still read English, and the message is almost certainly better communicated in it's original form. Automatic translation tools like Google Translate are a disaster to UX. Text get translated into something that doesn't communicate the message anymore. They mess up grammar, mis-interpret the meaning of words or complete sentences. Leave it as an option to the user as a last resort.
Also Google Translate isn't the only translator to look into:
A comparison table on Wikipedia
You get better results when you let it translate by people. A way to do this is to reduce the amount of supported languages in a way it will still reach most of the users. For example English and Spanish are in the western world the most spoken languages and you can get the English text translated by a small team of Spanish students. This is just an example and there are other/better ways to reduce costs but for a marketplace with an unknown amount of data it will be an impossible job. Instead, stick with automation or no translation at all.


Remove First Name, Last Name and confirm password fields in account create page

Question: I searched a lot to remove required fields like first name, Last name and confirm passwordfields in account create page.
So far i renamed required value from 1 to 0 from the table eav_attribute
After this i hided first name, Last Name, Confirm Password from register.phtml
But still i'm getting
The first name cannot be empty, The Last name cannot be empty, etc,..
Did any one know how to do this ?
Please give me a idea to solve this..
Answer: You have to change two more files:
Change /js/prototype/validation.js and comment out the following lines:
['validate-cpassword', 'Please make sure your passwords match.', function(v) {
                var conf = $('confirmation') ? $('confirmation') : $$('.validate-cpassword')[0];
                var pass = false;
                if ($('password')) {
                    pass = $('password');
                }
                var passwordElements = $$('.validate-password');
                for (var i = 0; i < passwordElements.size(); i++) {
                    var passwordElement = passwordElements[i];
                    if (passwordElement.up('form').id == conf.up('form').id) {
                        pass = passwordElement;
                    }
                }
                if ($$('.validate-admin-password').size()) {
                    pass = $$('.validate-admin-password')[0];
                }
                return (pass.value == conf.value);
            }],

After that, you also have to change the Magento Customer Core model. There are two types of validation: through the front-end javascript and in the backend Customer model.
Rewrite the model with your own customer module. Then copy the validate() public function. And comment out the following lines:
$confirmation = $this->getConfirmation();
        if ($password != $confirmation) {
            $errors[] = Mage::helper('customer')->__('Please make sure your passwords match.');
        }


Upgrade from Android L to Android 5

Question: I rooted my nexus 5 and upgrade the developer images of Android L (build number LPV79) back in June or July. Now. I'm waiting for Android 5 OTA. Will I be getting it? How can I check when it will come? All my apps updated to Android 5 so they are not working and crushing because they are not compatible. And I'm not getting any support from Google / Android. Who can help me?
Answer: There is no OTA update from the developer preview to the official release. You have to download the release version and flash it using fastboot.
Answer: theres the official OTA updates knocking around online, but just 4.4 update to 5.0. you will need the stock "locked" bootloader with kitkat for it go ahead and you need to sideload it via adb. not sure if you can wipe the rom and install it fresh but there is the official full rom from the dev sites anyway. mine took an hour from start to finish from 4.4 offical to 5.0 OTA. all apps updated and works great. I never jumped onto the pre release as i wasn't desperate for it. I have no critical apps and all mine use current APIs anyway.
sorry if you already know this but im sure at some point this will help someone :)
OTA ROM nexus 5:
http://android.clients.google.com/packages/ota/google_hammerhead/c1a33561be84a8a6a7d5a4c8e3463c4db9352ce6.signed-hammerhead-LRX21O-from-KTU84P.c1a33561.zip
FULL ROM
https://developers.google.com/android/nexus/images

Upgrade from Android L to Android 5


Minimax and Bayes rule

Question: Could anyone provide some examples that a decision rule which is minimax but not Bayes, and a decision rule which is Bayes but not minimax? Thanks!
Comment: @Oxonon It doesn't matter whether this seems "odd," though, because the point is to understand the distinction between these approaches to making decisions and to appreciate the scope and limitations of theorems that indicate how to use Bayesian procedures to find minimax solutions.  Bayes procedures are a basic tool even in classical ("frequentist") statistical theory. There is no contradiction of assumptions involved.
Comment: @Oxonon Right.  This question is about decision rules, not interpretation or statistical practice.
Comment: The two are based on different assumptions. Defining a minimax rule for a Bayesian setting would be odd. Similarly, a Bayesian rule with standard minimax assumptions would not be based on the assumptions and thus a touch odd.
Comment: @whuber, Surely you either start with a hypothesis space and a statement to the effect of "the true parameter lies in this space" or you start with "My belief is that the true parameter has some given distribution". And from there you act optimally with respect to the given information. Stating that you can find the minimax solution by setting up and solving a different appropriate Bayes problem is still just a method of finding the minimax solution --- there is no natural Bayes solution for that problem. Thatt is to say, the solution is determined by the assumptions, not method.
Answer: In the event the decision problem "has a value", i.e., when minimax meets maximin,
$$\min_\delta\,\max_\theta\,\mathbb E_\theta[L(\theta,\delta(X)]=
\max_\pi\min_\delta\mathbb \int \mathbb E_\theta[L(\theta,\delta(X)] \pi(\text{d}\theta)$$
there exists a Bayes procedure or a limit of Bayes procedures that is minimax. (This is actually a constructive method for producing minimax estimators in difficult settings: seek a Bayesian estimator with minimax risk, as eg in 1981 Casella's and Strawderman's derivation of the [unique] minimax estimator of a bounded Normal mean.)  However, this intersection between both concepts does not mean they are confounded.
For examples of minimax procedures that are not Bayes or limits of Bayes procedures, a classical example is the class of James-Stein estimators: when estimating a Normal mean vector $\theta\in\mathbb R^p$ with $p\ge 3$ and a quadratic loss function$$L(\theta,\delta)=(\delta-\theta)^\text{T}A(\delta-\theta)$$with $A$ a $p\times p$ symmetric positive definite matrix, estimators of the form$$\delta\,: x \longmapsto \delta(x)=\left\{ 1 - {a}||x||^{-2}\right\}x$$are minimax if $0\le a\le \bar{a}(p,A)$ where the upper bound is a function of the dimension $p$ and of the matrix $A$. For instance, $\bar{a}(p,\mathbf I_p)=2(p-2)$.
Conversely, most Bayes procedures are not minimax. Indeed, any prior $\pi$ such that$$\min_\delta\,\max_\theta\,\mathbb E_\theta[L(\theta,\delta(X)]=
> \min_\delta\mathbb \int \mathbb E_\theta[L(\theta,\delta(X)] \pi(\text{d}\theta)$$will not produce a minimax Bayes procedure.
Here is an illustration from my book:

Consider a Bernoulli observation, $x\sim \mathcal B e(\theta)$  with
$\theta\in\{0.1,0.5\}$. Four nonrandomized \est s of $\theta$ are
available, \begin{eqnarray*} \delta_1(x) & = & 0.1,\qquad \qquad
  \delta_2(x) = 0.5, \\ \delta_3(x) & = & 0.1\, \mathbb I_{x = 0} +
  0.5\, \mathbb I_{x = 1}, \quad
     \delta_4(x)  = 0.5\, \mathbb I_{x = 0} + 0.1\, \mathbb I_{x = 1}. \end{eqnarray*} Assume that the penalty for a wrong answer is $2$ when
$\theta = 0.1$ and $1$ when $\theta = 0.5$. The risk vectors
$(R(0.1,\delta),R(0.5,\delta))$ of the four estimators are then,
respectively, $(0,1)$, $(2,0)$, $(0.2,0.5)$, and $(1.8,0.5)$. It is
straightforward to see that the risk vector of any randomized
estimator is a convex combination of these four vectors or,
equivalently, that the risk set, $\mathfrak R$, is the convex hull of
the above four vectors, as represented by the following Figure

In this case, the minimax estimator is obtained at the intersection of
the diagonal of $\mathbb R^2$ with the lower boundary of $\mathfrak
  R$. As shown by this Figure, this estimator $\delta^*$ is randomized
and takes the value $\delta_3(x)$ with probability $\alpha = 0.87$ and
$\delta_2(x)$ with probability $1-\alpha$. The weight $\alpha$ is
actually derived from the equation
$$0.2 \alpha + 2(1-\alpha)  =  0.5 \alpha. $$ This estimator $\delta^*$ is also a (randomized) Bayes estimator with respect to the prior
$$\pi(\theta)  =  0.22\, \mathbb I_{0.1}(\theta) + 0.78\, \mathbb
  I_{0.5} (\theta); $$ the prior probabilities $\pi_1 = 0.22$
corresponds to the slope between $(0.2,0.5)$ and $(2,0)$, i.e., $$
  {\pi_1\over 1-\pi_1}  =  {0.5 \over 2-0.2}. $$ Notice that every
randomized estimator that is a combination of $\delta_2$ and of
$\delta_3$ is a Bayes estimator for this distribution, but that
$\delta^*$ only is also a minimax estimator.

Minimax and Bayes rule


Releasing job in CUPS administration does not work

Question: In the CUPS administration interface on localhost:631 for a local USB printer, clicking on "Release job" button claims that the job is released, but when going back to the list of tasks, the job is still held. The status of the printer is "Idle, Accepting Jobs, Not Shared", nothing seems to be wrong, but I cannot print anything. I tried pausing-unpausing the printer, restarting CUPS, to no effect. What am I doing wrong.
Answer: OK, super embarrassing, but the printer's USB cable was unplugged, so of course it wasn't printing anything... (but no message on the CUPS admin interface made that clear). Plug the printer back in, and lo and behold, releasing jobs works again. :)


Why does indicated airspeed change with altitude?

Question: I know that if you fly at a low altitude and at a high altitude at the same TAS, your IAS will be lower at the high altitude than at the low altitude.   Why is this though?   Wouldn't the static vent account for the change in pressure?   I have heard it has to do with the change in density but why would this effect the system as it measures pressure not density?   Maybe because ram air pressure (measured by the pitot tube) is affected by density?
Answer: As you state, IAS is simply based upon the difference between total pressure and static pressure. For low subsonic conditions:
$$ p_t = p_s + p_q = p_s + \frac {1}{2} \cdot \rho \cdot V^2$$
$\rho$ is the air density, which is a function of air temperature: $\rho = \frac {p_s}{R \cdot T}$. For indicated airspeed, the density at sea level $\rho_{SL}$ at 15 degC is taken:
$$ V_i = \sqrt {\frac{2 \cdot (p_t - p_s)}{\rho_{SL}}}$$
However, the actual dynamic pressure measured by the pitot tube is caused by actual density.

When temperature decreases, density increases.
So at colder temperatures, some of the dynamic pressure is due to higher $\rho$
Therefore, the $V_{ind}$ bit decreases. The pitot only measures dynamic pressure and does not know what is due to temperature

Air is colder at higher altitude if we stay in the troposphere - climb to over 33,000 ft and the IAS does not change anymore.
Answer: The anemometer is not a true speed instrument, but returns the value of the dynamic pressure at the Pitot tube, that can be correlated with the airspeed only for a given density. Thus, at higher altitudes, (lower air density) airspeed has to be higher in order to generate the same dynamic pressure at the Pitot tube, and the opposite is true for lower altitudes (higher density) where airspeed has to be lower in order to generate the same dynamic pressure...
Answer: Your airspeed is measured as a difference in pressure between the pitot (ram air) and static ports. As you go up in altitude the amount of air entering the pitot tube decreases even though the true airspeed stays the same. This reduces the "pressure" seen by the airspeed indicator and therefore decreases the delta seen between the two ports, indicating a lower airspeed.
Comment: But wouldn't the static port also see less air and compensate for it?   Why does the pitot tube sense this but not the static port?
Comment: @Murey Tasroc   The values at both static and Pitot are both absolute pressures, the sum of static and dynamic pressures. At the static port, the dynamic pressure is zero, and the static pressure is the same as the static pressure at the Pitot. Hence, and as the anemometer gives you the difference in absolute pressures between the pitot and the static port, that difference amounts to the dynamic pressure only...
Comment: of course, they both sense less air. But the delta between them is also less. Hence a lower IAS will be indicated
Comment: True airspeed does not stay the same as altitude increases unless power is reduced in which case the airplane is flying at a higher angle of attack and a lower indicated airspeed.
Answer: This bothered me as well with most of the explanations I found online, until I remembered that the pitot tube measures dynamic PLUS static pressure.
This makes sense when you remember that the pitot tube is also open to the outside air pressure just like the static vent.
As such, at higher altitudes the static vent will receive less pressure due to the drop in static air pressure, but the pitot tube will receive even less for two reasons; the drop in both static and dynamic air pressure.
Hope that helps.
This youtube video helped me when trying to answer your question:
Answer: No math is needed to explain.
If you fly at 100 knots indicated and climb from 1,000ft to 5,000ft with the same power your indicated airspeed will remain about the same.
In order to fly at the same true airspeed, you'd have to reduce power. So true airspeed is only constant if you make changes to your flight configuration to make it constant- it's really not constant at all. Even if you stay at the same altitude, if the temp changes, it will change.


Several MikTeX's and WinEdt

Question: If I have several MikTeX's distributions on my Win 8, which one is chosen by WinEdt 9.0? See also my question here. There is stated that WinEdt chooses one automatically.
Comment: Did my answer help you? Can you explain how you did manage to install several versions of MiKTeX on your computer or is that only a missunderstanding from the answer you linked to in your question?
Answer: Do you really have several versions of MiKTeX on your computer? How did you?
I think there is a missunderstanding: You can only install one MiKTeX version on Windows, because the installer of MiKTeX uses always the same directory(s) depending on user or admin installation. It could be (I never tried it) to use the mobile version of MiKTeX contained on a usb stick resulting to be used with an different path E:\... instead the usual C:\.... But then be very careful, that the both versions are not mixed by using different pathes to both versions (for example which pathes are used in the editor you use (you have to use different one to use different pathes to reach the correct tex version) to create tex code, or is the standard path used leading to the installed version?).  At last it is not a very good idea. Better omit it.
With TeXLive it is possible to have several versions installed on one computer. To change the used version there has a path to be changed, which one I do not know, I'm only a MiKTeX user ...

Several MikTeX's and WinEdt


Let non-admin backend users change their own password

Question: I have a shop with multiple users, some of them with quite restricted rights (handling orders only).
I have however not found a solution to let them change their own password without involving an admin or giving them the rights to change all users in the shop.
Is there a way to achieve a way to let non-admin users set their own password (possibly also with password guidelines, but this is not necessary) without involving another party?
Answer: I'm reasonably sure that anybody with access to the backend can change their own password via System > My Account. There is a field for Current Admin Password which uses the word admin, but it just means the current logged in user. The user just needs the acl system/myaccount, which should only give them the ability to change their own information.
Comment: Oh okay, I always misinterpreted the wording and obviously so did all other users. Thanks for the headsup, this is the solution I was looking for.

Still, password guidelines would be a nice to have.


Want the list of languages supported by each font.Is there any open source font library or database listing them?

Question: I want the list of languages supported by each font.Is there any open source library or database listing them? Alternatively, Apple Font Book  list of languages supported by the font. How is it generated? I assume there is some internal database. Is there any way to extract it?
Answer: The Unicode Common Locale Data Rpository (CLDR) contains a fairly extensive compilation of "Examplars", which are the minimum support required for various languages. Although Font Book is not specifically listed as one of the applications, the CLDR index page does mention Apple as a company that uses it, and it's very likely that's what Font Book employs to determine language support.
Note though that in many cases, simply having the characters is not enough for full language/script support. For many writing systems, additional characters and font data (OpenType Layout data) are required.


A disagreement with coauthor/boss about funding

Question: Some time ago, I wrote a paper with a coathor, who is the head of the lab I am currently working at and, essentially, my boss. We sent the paper to one of the best journals in our field, got overall positive reviews, revised the paper, and recently the paper was accepted for publication.
My lab got a substantial funding this year and my coauthor wants to include the funding information into our paper. However, there is a complication. The acceptance date of the paper is earlier than the date when we recieved the funding. As a result, the paper will not be accepted by the funder (we asked the funder about that). My coauthor decided that we should do something to change the acceptance date. We asked the journal about it, and the journal replied that the acceptance date, basically, cannot be altered. The only way to alter the acceptance date is to withdraw the paper on the basis that we have found some crucial mistake in our findings, then resubmit a revised version of the paper and undergo a new round of peer-review, which, I am afraid, might take a long time (it usually takes at least a year for this journal to make a decision). My coauthor insists that we should try to do that and he even asked me to try to find some flaws in our paper or something that can be improved in such a way that the need for improvement can be justified.
Frankly, I feel dishonest, weird and even somewhat dirty for being involved in this situation. I want to publish the paper as it is, without including the new funding information and altering the acceptance date. Moreover, I find the whole matter unethical.
I told my coauthor about my concerns and my opinion that it is reasonable to not include the new funding source. But he wouldn't listen. What's worse, is that I am the corresponding author and I have to negotiate all the matters with the journal.
I'm not really asking for advice. I just want to know your opinion about the situation.
Edit-1: I should probably clarify that my coauthor did not ask the funder a direct question about the paper, and he wrote a rather clevel e-mail to the journal (which I sent under his supervision) asking whether it is possible to make some changes in the paper and whether it will affect the acceptance date.
Edit-2: I would like to thank everybody for the comments. Your feedback was very helpful to me. I managed to persuade my coauthor to change his mind and do the right thing.
Comment: By posting this question in your own name you are creating a possibility for people to find the identity of your unethical coauthor. I'm not saying that's necessarily either good or bad, but definitely something you should think about. You may want to change to an anonymous user handle to avoid such awkwardness (and potential accusations of slander and legal risk).
Comment: It's really dumb to pull an accepted paper from a good journal because you want to try to attach it to a different funding source. Bad stuff could happen to it. Its unethical to be that dumb IMO.
Comment: I think most people would agree that you are right: it would be a lie (and unethical) to pretend that the research described in the paper was done using the funding. If you are the corresponding author, what is it that prevents you from using a "VETO" to not include the funding information?
Comment: Not only does this sound unethical, it sounds like it could easily fit the legal definition of fraud, depending on the exact circumstances and exactly what you and your coauthor do or say. Stick to just being honest. Don't try to change the past.
Comment: I'm confused. Why does your co-author want to do this? It can't be to include this paper in a report to the funder as part of what was done with the funds, because *the funder already knows about this and won't accept the paper*. So what does your co-author hope to get out of this?
Comment: @benxyzzy - Harsh reality is that you will allow yourself to be guilty of fraud and misconduct if you were to proceed as suggested by the co-author. Although you would most likely not be prosecuted or charged, this would not change the fact that you are guilty. This is worth a fight with a senior. It is still your paper and not theirs.
Comment: You're communicating author, you've communicated to request the fraudulent timestamp, and they've said no. If your colleague wanted to be communicator, he (it's a he, right) should have said so. If one extra inherited publication makes the difference, your boss/coauthor is fully expecting to under-deliver for this funder! It's obviously normal to reap some pre-prepared papers into the beginning of funding, and miss some in-progress ones on the other end... Not like the funder is going to think "wow I pay you and a week later you publish in Nature thanks to me!"
Comment: I don't think Leon Shutikoff is the OP's real name.
Comment: @Louic I should think when junior authors fail to deploy their "VETO" against more senior coauthors it is absolutely obvious why. There is the principle and then there is the harsh reality here
Comment: Louic, thank you for the comment. I probably will use my "VETO". I wrote this post simply because the whole matter makes me feel uneasy. I live in a country where my current situation is not that unsual.
Comment: The paper is accepted. Presumably, you can just let it go and it will get published.
Comment: Will the funder accept papers after the funding has been all used? It would make sense, and it would leave time for another good paper, in N years.
Comment: @Louic what you are really demanding of course is that the junior place themselves in career jeopardy for your principles. The harsh reality is that superiors leaning on their juniors to behave unethically is common; furthermore the consequences of refusal are fast and material. Nobody wins any prizes for honesty in academia
Answer: In case the ethics argument fails, here is another argument against pulling the paper.  If you withdraw the paper for any reason, you run the risk that the resubmitted paper will be rejected.  The refereeing process is partly a random process.
The worst case is it takes a year for the journal to decide to reject your paper, and science moves on and your paper is now out-of-date and will not be publishable anywhere reputable.
In addition, the editor and others involved will now associate you all with making errors.  A good reputation is worth a lot in academia.
Comment: I agree, in one way or this other this is likely going to spoil your reputation with the editor.
Comment: Given how ridiculously hard it is to get good reviewers, as everybody is overworked and paper production keeps increasing, the editor dealing with your paper will truly detest you; you retract and resubmit without any good reason?? Actually you've already communicated your fraudulent reason to them... Bottom-drawer time.  Expect to be scooped if possible, so it becomes unpublishable.  This will absolutely reflect bad on you, and the same reviewers review for other journals, and they know each otehr professionally and personally.
Comment: One of the few cases where the ethical right thing is also advantageous.
Comment: And not only that. If I would be the editor I would probably reject the second submission at desk, at least unless the paper meantime became a very different one. While the strategy of the boss would be understandable without date issue, it is really awkward given the circumstances.
Answer: I agree with you that this is unethical. There may be some gray area around assigning paper credit to certain funding sources, but it pretty clearly exceeds that gray area to tweak an acceptance date without an independently valid reason merely to attach it to newer funding.
It seems especially foolish to do this when both the funder and journal are aware you'd like to do this and when you've been informed it's not allowed.
It would be like trying to cash a check addressed to you and another person, being rejected by the bank, then trying to white out their name and walk back into the bank with it. The first ask is clearly a potential honest mistake - you didn't know you can't do that. When you come back with a workaround, it's clear you're cheating the system (and in the scenario I describe you've made pretty good evidence for intentional fraud).
Comment: @LeonShutikoff I do think that makes it less likely that one would be "caught", but doesn't really change the ethics of the situation. I was hoping maybe the threat of the ruse being identified would help you in your argument, but alas, you may be stuck with mere integrity. As Libor implies in a comment on your post, you have a thing of value to **you** right now in an accepted paper in a good journal; it seems silly to me to put it in jeopardy for this reason. It's not like this attribution will guarantee future funding or cost it.
Comment: Thank you for the reply! I should probably clarify that my coauthor did not ask the funder a direct question about the paper and he wrote a rather clevel e-mail to the journal (which I sent under his supervision) asking whether it is possible to make some changes in the paper and  whether it will affect the acceptance date. So, I am not entirely sure that both the funder and the journal are aware of what he wants to do. I am not trying to justify his actions. I find them unethical and dishonest. I just wanted to point out that the situation is a little less clear-cut than it might seem.
Answer: Your coauthor is asking you to commit academic misconduct bordering on fraud. It's unethical and pathetic, would mislead the scientific community and funding agency, and would waste the journal's resources without any justification. And now that you've posted the question apparently using your own name, your coauthor's intentions are publicly stated, which makes the behavior very risky to both your reputations if carried out.
The only way to achieve what your coauthor is trying to do in an ethical way is if your coauthor gets approval from the funding agency to acknowledge it as a funding source despite the acceptance date being earlier than the date of the grant. This actually seems to me like a reasonable thing to ask for, considering the fact that articles typically still undergo minor revisions after being accepted, and that working on such revisions requires time and effort. So my suggestion is to make such a request — it may not work, but seems worth trying.
Comment: Funding can be offered after the fact, but such funding is typically framed as a either a grant for future work (moot since OP was already given funding) or an award for past work.  OP has already indicated that funder will not accept OP's paper if the submission date predates the funding date.  I can't say I blame the funder; being identified as a funder of research that took place without using your funds may open up the funder to fraud (i.e., because the funder is indirectly lying to their donors by dishonestly claiming that their money is what allowed the paper to exist).
Answer: In computer science, very few people dares to retract and resubmit a paper.
The risk is so high. When your paper is accepted, it is because your method is faster, more precise, etc than state-of-the-art approaches. But after one year, things may change rapidly, your awesome experiments can become inadequate. You risk never publishing that paper again.
Of course, this is unethical, but people do it all the time, I'm afraid.
Answer: My ethics says I would have to take my name off the paper.
You might also run the risk of retaliation by your boss and getting fired.
Could you change the wording to say you were promised consideration by group x and hope to be getting funding?
You could tell the editor  your dilemma and ask him to remove the funding sentence when published.
Sorry but sometimes in life doing what is right will cost you.


What date would this be? 2010 February 12th or 2010 2nd of December? Fiji color Crystal Archive

Question:
What is the date on this picture (1129 2010100212 Walgreens)
Comment: Please note that the note has been transcribed incorrectly: the picture says "20100212" and the written annotation says "2010100212" with the "10" repeated.
Answer: When dates are in the form using a trailing year such as 02/12/2010 there is an ambiguity between U.S. usage of month/day/year (Feb 12) and most of the rest of the world which uses day/month/year (Dec 2) in ascending order.
With a leading year such as 20100212, I have never seen an interpretation other than Year Month Day. So I would say Feb 12.
Comment: I was thinking the same thing, about the format, it was printed in the here US. so wouldn't they stick to an American format. But it makes sense as I read it out loud. But that's strange the only photo I have in the format. Thank you so much.
Comment: It could also be 20 October, 0212. ;-)
Comment: For the record format YYYYMMDD is used in Japan
Comment: The American and European formats are complicated to sort. With the ISO format (leading year) sorting dates alphabetically also sorts them in time order.
Comment: I too hope that this is ISO 8601 date format:
https://en.wikipedia.org/wiki/ISO_8601
because any other date format is unscientific.
Answer: The usual (and ISO standard) is that it would be yyyymmdd.
However I've been burned enough times, that it's worth going through the images and look for numbers greater than 12 in the last 2 pairs.  This will confirm it for that particular processor.  If you are faced with a single image from a shoebox, lean toward mm being the 5th and 6th characters.
Date strings on cameras where they are on the image are more problematic.  I've seen

'yy mm d
'yy dd mm
dd/mm/yy
mm/dd/yy
dd hh:mm

Again, look at a bunch, and try to deduce it.  Don't forget that the pouch that the images came back from the processor may have date information on it it.
This is one of the dangers of 'scanning originals and chucking the paper copies.'
You have to develop the mindset of a packrat.


Page templates in SharePoint 2010

Question: Can templates of web part pages be made? I have a web part page that contains several web parts all with different views of 2 different lists. I want to be able to template this page and allow users to re-create it at will.
The list also contains a workflow. Would this workflow and list(s) be included in the page or would I just be best to template the whole site with the page, lists and workflows included?
Regards
Answer: If i understand your requirement correctly, you need to create a page layout with all the web parts that you want to have with the design or structure. you can either create it from SharePoint designer or deploy it from Visual Studio.
Let me know if you have any questions.
Comment: Yes but I want a couple of lists to be included not just the layout - if that makes sense!
Comment: Lists are part of site structures, so you have to create your structures behind, independently from if/how you're going to present their data in your pages. You can include some web parts (such as ListViewWebPart in your case) static in the web part zone in a page layout.
Comment: JazzyN,

  Yes you can even do that in the methods i mentioned above. follow http://www.jamestsai.net/Blog/post/How-to-use-event-handler-to-add-web-part-to-web-part-page.aspx for more detailed information.

   As you are planning to allow the user to create the page with all the pre defined structure of web parts loaded into the page, I'm suggesting it.

let me know if you have any questions.

Page templates in SharePoint 2010


Will I lose muscle memory for a sport if I've been injured for a few months?

Question: I play football(soccer) and I've gotten a knee injury for about 4 months now and I should be fully fit by the end of the year. Will I get significantly worse when I return or will the muscle memory for the skills acquired in my training still be at the same level as it was before injury?
Comment: Speaking from personal experience, you can retain muscle memory for years without ever using the skill involved, and carry on without any functional loss. However an injury may change the muscle and bone movements, so changing the effective outcome of the (unconscious) skill.
Answer: I think it really depends on how long you've been playing football since before the injury. Say if you have been playing for a good 6-7 years, then you should bounce back to normal in no time. You may may face issues with stamina and getting back into shape initially, but your muscle memory should stay intact. If you've started playing recently enough for a good chunk of muscle memory to be relatively new, then you may feel that you aren't able to access the same set of skills and techniques.  However with a good recovery routine and practice with growing intensity as time progresses, you should be able to get back on the pitch in no time! Hope this helps.


PS4 Controller only works when plugged in

Question: When I plug my PS4 controllers in, they turn on and work perfectly but the moment I unplug the cords from the controllers, they completely shut down and when I press the PS button I get no light or anything, it's just dead. I tried resetting the controllers but the same thing still happens. Is it somehow the battery?
Comment: Perhaps they aren't charging when plugged in? If it's multiple controllers doing this, its unlikely they all have failing batteries.
Comment: Also, are they Sony brand PS4 controllers, or a third party manufacturer?
Comment: Mine does this when I use certain charger cables. The controller is powered but doesn't charge.
Answer: Firstly, if it is a third party manufactured controller that could happen. Notwithstanding the fact that the controller is wireless, you can manage playing games like the long old PS2 wire controller.
Secondly, some particular USB cable are not compatible with PS controllers just the way some USB cable are not compatible with some other devices such as phones, tablets and so on.
Lastly, if the battery of the controller is bad, it would have to be replaced because such issue you are experiencing may occur or worst.
Now there are couple of ways you can fix this problem. These ways are as follows:

Plug your PS4 into your laptop or another device to charge it: Sometimes your controller may have problem charging with the console so try some other device to charge it to test it problem.

Swap out the charging cable: The issue may not be with the controller itself but with the charging cable. Try a different cable or try using that cable to charge another controller.

You can also check the cable for physical signs of damage such as fraying on the cord or built-up grime in the plug.

Check out the charging port: Built-up dust or grit may be interrupting the power flow and keeping your controller from charging. A quick pass with a wooden toothpick or compressed air may help.

Reset and re-pair your controller: Go to the Settings menu on your PS4 and under "Devices," remove all devices from the list. Then, on your controller, press something into the small hole on the underside of the controller and hold it for five seconds. A toothpick or bobby pin, for example, may do the trick.
Finally, re-sync the controller to the PS4 using the PS button.

Conduct a power cycling on your PS4: Turn off your PS4 console and controller, and unplug the PS4's power cord from the outlet. Wait 5 to 10 minutes, and with the PS4 still unplugged, hold down the power button for 30 seconds to drain all its leftover energy. Then, plug the PS4 back in, turn it on, and see if the issue has been fixed.

If more info is needed, you can visit this website for help https://www.partitionwizard.com/partitionmagic/ps4-controller-not-charging.html


I'm getting artifacts when setting up a cavity node shader

Question: There are white lines and dots I cannot explain where they come from. The mesh in the areas is flat, there is no non-manifold or loose geometry. The normal maps appear fine.
The normals are fine - all blue when I make face orientation visible. In fact, I can bake out a normal map and there is nothing abnormal visible in the affected areas.
Some areas are higher poly than others, because of dyntopo sculpting in some areas. If I bake it into a diffuse (cavity) map, it carries over to the low poly.
It's in cycles and the effect works as expected and is visible. The problem is it creates also these artifacts which look like someone drew with a white Sharpie over the mesh. It is directly related to the color ramp node - I can change the color and intensity of the artifacts when changing the values of that node.
It affects several meshes and moving them to a new file with the default blender template doesn't fix the problem.
In the screenshots you can see one of the meshes in object mode, then edit mode (2 million verts), then a close up of the topology where a white line is drawn. Nothing unusual, no 2 overlapping faces or similar. In the mesh options, there is also no custom normals or anything as far as I can see.
Answer: The white artifacts are caused because the scale of your mesh is either too small or too big.
Scale the high poly (and the lowpoly if you wanna bake) up/down and apply the scale each time. If you hit the right scale the white lines should disappear.

I’m getting artifacts when setting up a cavity node shader


How do I format a text box in MapInfo

Question: I want to import a table (created and formatted in MS word?) to appear as text in the MapInfo layout window.  Obviously this isn't individual data records which appear in the MapInfo browser window.  So would I need to format the MS Word table, save the file as a JPG/png format then import into MapInfo as a raster file?  Is there another way in MapInfo of doing this - just type the table contents as text into the layout window then draw a rectangle around the text and make this box transparent but with a border?
Answer: Both of the methods you mention are possible but only really suited to data that remains static; although they will give you a lot more control over the styling of the table.
If your data is likely to change, you could save the table as an Excel spreadsheet and then import this into Mapinfo.
Open a browser window and adjust the size and style and then add to your layout window as you would add a map/legend etc.
This will allow you to easily update the data and layout within Mapinfo without any hassle (or if you use a linked XLS or MDB, then the data will automatically refresh when you next load it).

How do I format a text box in MapInfo


CGS of resistance

Question: What's the CGS unit of resistance?
Is it the same as that in SI system, i.e. ohm (Ω)?
I googled but found no explicit answer.
Comment: https://en.wikipedia.org/wiki/Abohm
Answer: It is ab$\Omega$.
$$1 ab\Omega = 10^{-9} \Omega $$
In CGS system, unit of current is Biot (or Bi) which is equal to $10 \ \text{ampere}$.
Dimension of resistance is $ML^{2}T^{-3}A^{-2}$
In SI system mass is $10^{3}$ times; length is $10^{2}$ times; time is same while current is $1/10$ times. That makes $\Omega$ as $10^9$ times $ab\Omega$.
Answer: Ohm's law in terms of $emu-cgs$ units

When a current of one abampere (1 abA) flows through a resistance of 1 abohm, the resulting potential difference across the component is one abvolt (1 abV).

1 $\Omega$ = $10^{9}$ $ab\Omega$
You can find more at https://en.wikipedia.org/wiki/Abohm

CGS of resistance


Having several SQLiteOpenhelper in one appli Android

Question: I would like to know if it is possible to have several DbOpenHelper in the same app Android but to use them to write and read in the same database?
because I'm trying to create tables from 2 different OpenHelper (with different names) and only the first one seems to create. when I try to run the 2nd one, i get an error...
Answer: Looks like You can't have more than one helper for each DB. Here's explained why: http://blog.foxxtrot.net/2009/01/a-sqliteopenhelper-is-not-a-sqlitetablehelper.html
Comment: Indeed, that answers my question, I will have to merge my OpenHelpers and create my tables all at the beginning of my App.
thx matekm
Answer: Add the TABLE_CREATE statement to onOpen(SQLiteDatabase db) to ensure that the second table gets created in case the database connection is already opened. Further, the TABLE_CREATE statement should include IF NOT EXIST in case the table already exists.
Reference: http://jiahaoliuliu.wordpress.com/2011/09/26/sqlite-create-multiple-tables-with-different-sqliteopenhelper-in-the-same-database/


How to know what optimizations are done automatically by my compiler

Question: I was going through this link Will it optimize  and wondered how can we know what optimizations are done by a particular compiler.
Like does VC8.0 convert if-else statements to switch-case?
Is such information available on msdn?
Comment: You probably don't want to be dependant on this information.
Comment: For GCC it is part of the online documentation.
Answer: As everyone seems to be bent on telling the OP that he shouldn't worry about it, there is some useful although not as specific as the OP requested) information about compiler optimization (options).
You'll have to figure out what flags you're using, especially for MSVC and Intel (GCC release build should default to -O2), but here are the links:

GCC
MSVC
Intel

This is about as close as you'll get before disassembling your binary after compilation.
Answer: It depends on the level of of optimization you choose for compiler.
you can find a very nice article about it here
Answer: First of all, if optimization took place then your program should work faster usually. After that you could inspect disassembly code to find out what kind of optimizations were performed.
Answer: I don't know anything about VC8.0, so I'm not sure how you would access that information.  However, if you are generally interested in the kinds of optimisations that go on and want to experiment, I recommend you use LLVM.  You can look at the unoptimised, disassembled byte code generated from the default C front end, and then run various optimiser passes over it to see what the effect is each time.  Because it's a nicer, abstract assembly code, it tends to be a little easier to figure out what is an optimisation derivable from the code and what is a machine-specific optimisation.
Answer:
Like does VC8.0 convert if-else statements to switch-case?

Compilers do not do magically rewrite your source code. And even if they did, what would that tell you? What you really would want to know is if the compiler compiled it into a jump table or into multiple compare operations. Any dis-assembler will tell you that.
To clarify my point: Writing a switch-case statement does not necesseraly imply that there will be a jump table in the binary. Not needing to worry about this is the whole point of having compilers.
Answer: Instead of figuring out which optimizations are done by the compiler in general, it's probably better to NOT have any dependencies on such compiler-specific knowledge.
Instead start out with a good design and algorithm, writing (as much as possible) portable code that's easy to follow. Then profile the code if it's too slow and fix the actual hotspots. Compiler optimizations are useful no doubt, but better is to apply some investigation to what's actually happening in the code. Algorithmic/design improvements at the source level will typically help performance more than the presence or absence of optimizations like transforming if/else into switch-case.
Answer: I'm not sure what "convert if/else to switch/case" means. My processor doesn't have a hardware switch/case instruction.
Typical compilers have several different ways to implement switch/case. A well-known one is using a jump table, but this is only done if appropriate.
For if/else, certainly it is normal for compilers to analyse a digraph of execution flow. I would expect a compiler to notice if each condition references the same variable, and I would expect the compiler to treat equivalent forms of conditionals the same way in general. But this isn't something I'd worry about.
IIRC, the general policy in GCC is that regressions in optimisation are tolerable so long as preferred improvements result. Optimisation is complex and what is "generally" a good optimisation isn't always that great. Plus for perfect optimisation, the compiler would have to know things it can't know (e.g. what inputs it will encounter in real life).
The point is that it really isn't worthwhile knowing that much about specific optimisations unless you happen to be a compiler developer. If you depend on something being optimised by V8, that particular optimisation might not happen in V9 or V10.


List  New Class takes up memory? Do I need C=null; in the code?

Question: List  New Class takes up memory?
Do I need C=null; in the code below?
//class Category
public List<Category> SelectAll()
{
  List<Category> LV = new List<Category>();
  string command = "SELECT * from categories";
  SqlCommand sc = new SqlCommand(command, new SqlConnection(GlobalFunction.Function.GetConnectionString()));
  sc.Connection.Open();
  SqlDataReader dr = sc.ExecuteReader();

  using(dr)
  {
    while (dr.Read())
    {

      // My Question is does this cause a memory problem...
      Category C = new Category();

      C.CategoryID = Convert.ToInt32(dr["CategoryID"]);
      C.Name = dr["Name"].ToString();
      C.DisplayOrder=Convert.ToInt32(dr["DisplayOrder"]);

      LV.Add(C);

      // I was told to add this because if not it would cause a memory leak.
      C=Null;

    }
  }
  sc.Connection.Close();
  return LV;
}

GridView1.DataSource = List<Category>;
GridView1.AllowPaging = true;
GridView1.PageSize = 5;
GridView1.DataBind();

Comment: FYI, this code seems broken - you set C to null at the end of the loop, and then in the next iteration assign values to its members which will cause a NullReferenceException.
Comment: Thanks I edited the code as I had moved the wrong line in my retyping of the code.  Thanks I figured I would not need to set C=null;  which was the main question.  I had the bug fixed in my real code.  However thanks.
Answer: No, you do not need to explicitly set C to null.
The garbage collector determines if an object can be freed by seeing if there are any outstanding references to the object.  As soon as the function SelectAll returns, the only reference to the object should be in LV, from LV.Add(C).  The out of scope stack variable will not cause an additional reference, and does not need to be set to null.
Comment: Is there not still a reference to C due to LV.Add(C);? Not saying this will cause a memory leak, just that C will persist beyond this function.
Answer: C will go out of scope when the function returns and will be eligible for garbage collection so, no, you should not set C to null before exiting.
Now if C had some system resource as a member variable, e.g. a file, thread or some other limited resource that you wanted to get released as soon as possible then it should implement IDisposable, in which case you could do something like
using (Category c = new Category())
{
    // Do stuff here
}

and that would force Dispose to get called at the end of the using block.
Answer: No, there is no need to set the reference to null, that is just unneccesary code that uses up CPU time and clutters up the code.
You have another problem in your code, though. You are only creating one instance of the class, which you reuse for each item. As you put the values into the same object they will overwrite the previous values, and you end up with a list full of references to the one single object.
Also, you are creating a new instance of the list for each iteration, so you throw away the previous list and end up with a list only containing the last item.
You need to create the list outside the loop, and create a new instance of the object inside the loop:
...
SqlDataReader dr = sc.ExecuteReader();

List<Category> LV = new List<Category>();

using(dr) {
  while (dr.Read()) {

    Category C = new Category();

    C.CategoryID = Convert.ToInt32(dr["CategoryID"]);
    C.Name = dr["Name"].ToString();
    C.DisplayOrder=Convert.ToInt32(dr["DisplayOrder"]);

    LV.Add(C);

  }
}
sc.Connection.Close();
return LV;

Answer: No, you don't need to explicitly set C to null.
But I don't think that code does what you think it does.  You create C as a new Category instance, and then you loop through the records returned from the database, set properties on C, and then add it to a List<Category>.
The problem with that is that you only create one Category object, C, and fill the LV list with references to that same object.  Because you mutate the object C each time through the loop, by the end of the loop you will have n references in the list, where n is the number of rows returned in the SqlDataReader, but all n references will point to the same object, which will have its properties set according to the last record processed.
So a simpler answer would be: just move the line C = new Category(); to inside the while (dr.Read()) loop.
Also, as a side note, you might want to look into LINQ-to-SQL, which would make it much easier to do the kinds of things you're trying to do here.
Answer: In short, no.
The reason someone would think you need to do this, is that in lower level languages, like (the language) C, you would have to deallocate the memory when you were done with it. You are working in a higher level language with Garbage Collection. GC keeps track of the number of references to a particular piece of memory, and when there are none remaining, deallocates it automatically.
I believe (the Category object) C will end up persisting beyond this function, due to LV.Add(C), but later, when all the references ARE gone, it will be taken care of.
As mdenomy points out, there are some cases you do need to take action, but those are the exception not the rule. See his post for details on those exceptions.