What flow of trigger execution when lead is converted?

Question: I am new to salesforce. I wanted to know that what will be the flow of trigger execution when the lead is getting converted.
like before/After trigger on lead,Account and contact.
Comment: Possible duplicate of [Lead Conversion Trigger Order of Execution](http://salesforce.stackexchange.com/questions/3956/lead-conversion-trigger-order-of-execution)
Answer: The usual order of execution detailed at http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm still applies with some special considerations
The Before triggers and validation rules do not fire unless that checkbox is ticked under Customise > Lead > Settings. Note that for orgs created prior to '08 you'll need to contact support to enable this (related answer)
After triggers still always fire irrespective of the above setting
To check if a Lead has been converted and do custom lead conversion logic, the best home for such is the LeadAfter trigger, where you can check
If (trigger.isUpdate && Lead.IsConverted && !trigger.oldmap.get(lead.id).IsConverted)
//do your stuff

Here you will have access to the convertedAccountId, convertedContactId, ConvertedOpportunityId and any OpportunityContactRoles
This is also a good place to re parent any custom related list records from the converted Lead to either of Company or Contact
Just added some debug logs to triggers, and here's the order of execution : (This is with the Enforce Validations and Triggers on Lead Conversion Enabled)

Account Before                 (Fires based on lead settings)
Account After
Contact Before                 (Fires based on lead settings)
Contact After
Opportunity Before             (Fires based on lead settings)
Opportunity After              (OCR's not available)
Lead Before
Lead After                     (OCR's available)

If the Enforce Validations and Triggers setting is turned off, none of the Before triggers fire. The After triggers however still fire.
Source : Lead Conversion Trigger Order of Execution
Answer: Once you create a lead the lead status will be 'open-not contacted'
When you convert it the contact information will go to 'Contacts' object, Company details will go to 'Accounts' and lead will be converted to opportunity. That is the status will change to closed.
Lead
->Accounts
->Contacts
->Opportunity
This is the flow.


Are there any mantras that directly salute both Lord Shiva and Lord Vishnu?

Question: It is well known that "Om Namah Shivaya" is dedicated to Lord Shiva,and "Om Namo Narayana" to Lord Vishnu.
Is(are) there any mantra(s?) that is dedicated to both Lord Shiva and Vishnu at the same time?
Comment: The mantra of Harihara is the one you are searching for.
Answer: The Shiva Vishnu Bhujanga Prayata Stotram attributed to Sankaracharya:
https://www.hithokthi.com/viewstotra.php?g_id=1&cat_id=1&story_id=106

Bhujanga prayata is a meter for writing poems in Sanskrit. It means moving of a snake. Adi Shankara has written several prayers using this meter. There is a very interesting story about this stotra. Adi Shankara reached his mother's death bed before she died. He wanted to help her get salvation. So he composed a great stotra called Shiva Bhujanga Prayata Stotra in praise of Lord Shiva. As soon as it was completed, The servants of Lord Shiva came to take Shankaras mother to heaven. But she was terrified to see them, because they wore the dresses of the forest and dressed in tiger skin with belts of snakes. Understanding her problem, Shankara humbly requested the servants of Lord Shiva to go back and composed this prayer to Lord Vishnu in the Bhujanga prayata meter. Once he recited it, the servants of Lord Vishnu, who had polished God like looks came to accompany Shankaras mother to heaven. She was extremely pleased to go with them.

Anadyanthamadhyam, param thathwamartham,
Chidakaramekam, thurreyam thwameyam,
Haribrahma mrugyam, Parabrahma roopam,
Mano vagatheetham maha shaivameede.

Swashakthyadhi shakthyantha simhasanastham,
Mano hari sarvanga rathnabhi bhoosham,
Jataheendugangastha sasyarka moulim,
Param shakthi mithram nama pancha vakthram.

Namasthe,Namasthe Jagannata Vishno,
Namasthe,Namasthe Gadha chakrapane,
Namasthe,Namasthe prapannarthiharin,
Samasthaparadham Kshamaswakhilesa.

Mukhe mandahasam, nakhe chandrabhasam,
Kare charu chakram, suresadhi vandhyam,
BHujange sayanam, bhaje Padmanabham,
Harenanya daivam na manye na manye.

translated from  https://www.youtube.com/watch?v=ZNrVfBaA4K8

I meditate on that great light called Shaiva, Which has no beginning nor end, Which is the real meaning of philosophy, Which is the only one form of holy knowledge, Which is thureeya, the blissful fourth state, Which is the unknown which was, Searched by Lord Brahma and Vishnu, And which is the form of ultimate truth.

I salute that God with five faces, Who sits on the throne of Adhishakthi, Using his own strength, Who wears mind stealing ornaments, Made of jewels all over his body, Who wears mated locks, snake, Moon and the river Ganga on his head, Who has moon and sun as his eyes, Who is the eternal god, And who has always with him Shakthi as consort.

Salutations and salutations to Vishnu who is lord of universe Salutations and salutations to him who carries a mace and a wheel, Salutations and salutations to him who destroys sorrows of his devotees, And Oh Lord of everything, be pleased to pardon all my lapses.

I salute the God with lotus flower on his belly Who has a smile in the face and the shine of moon in nails, Who holds pretty Chakra in the hand and Who is being saluted by devas and who sleeps on a serpent, And again and again affirm that there is no God except Hari.


Why Media file is not deleted automatically from blob storage in Sitecore 10.3 when I delete it from Sitecore?

Question: I recently enabled Azure blob storage in Sitecore 10.3. If I delete a file from Sitecore, it is not deleted from blob storage. I deleted the item from Recycle Bin of Sitecore and I ran database blob cleanup as well.
Answer: No, they are not deleted, not even orphan blobs. However, orphan blobs can be deleted from Sitecore XP:
(Control Panel => Administration tools => Database Cleanup => Database Name => Cleanup Blobs => Execute Cleanup)
For more details see the blog post: Sitecore Media in Database Vs. File Directory Vs. Blob Storage

What is the way to migrate existing media files that are stored in a
file system?

Yes, you use the blob migration tool to help migrate blobs from SQL Database to Azure Storage and vice-versa. Use the blob migration tool
Comment: what is the way to migrate of exiting media files that is stored in file system
Comment: I have updated the answer.
Answer: A potential reason of this behaviour can be the "soft delete" setting in Azure Blob Storage. When it is turned on, Azure will not delete blobs immediately and instead will keep them for the specified retention period. This is useful for cases when a media file is deleted accidentally and needs to be restored.
You can check if this is enabled on your instance or not by going to Azure Portal, selecting your Storage Account and navigating to the settings under Data Protection → Recovery. Find the settings Enable soft delete for blobs and Keep deleted blobs for (in days).

You may want to reduce the retention period to delete blobs sooner but I would not recommend disabling "soft delete" completely just in case you will need to restore accidentally removed or overwritten items.
Please see Sitecore and Microsoft documentation for reference.


Package : PostInstall script

Question: I'd like to give users the possibility to create sample Data after installing a package, but I want them to do this only if they want, so I don't provide the data creation directly in the postInstallScript.  In fact I have a custom VF tab with a button that , if pressed, creates the sample data. The solution that I'm reaching for would be to have a situation where IF the package is installed for the first time (context.previousVersion() == null) the user has the possibility to create the sample data (creation handled by a class, this is not a problem), but if it's an upgrade, or if the user has already created the sample data, the action is avoided. So I need a static variable to store the information about wether or not data was created (IsSampleDataAlreadyCreated, something like this). How can this requirerment be accomplished? Is custom setting the solution?
Answer: Yes, I'd imagine you'd want a custom setting for this. Static variables only exist within a single transaction, so there would not be a way that a static variable would persist from one install to the next.
Comment: @ToninoTripodi Correct: "All data for the custom setting is hidden from the subscriber." Your package is not the "subscriber" and not subject to these limitations (otherwise, protected custom settings would be literally useless). Protected Custom Settings are designed to be an area your code can use to store data that literally cannot be accessed outside the package (without some sort of API to allow access), so you can guarantee that customers cannot tamper with your data. These settings can be accessed even during an InstallHandler script.
Comment: Yes , I know that static variable only "lives" within an execution context, I was wondering what kind of custom setting to choose, and related solutions. I'm thinking about a solution that provides a custom setting in the package, and a post install script that (if it is the first installation) create an instace of this custom setting (that has a checkbox field). So, the method that creates the data, can check the value of the checkbox and decide wether or not the data was already created.
Comment: But, for example, I ve some questions about the kind of custom setting. Protected or not? If protected, post install scripts cannot create instance in subscriber org, if public , instead, someone could delete the instance of that custom setting . Do you have other tips?
Comment: @ToninoTripodi As far as I'm aware, protected custom settings are available to install handlers, the same as any other code (except for a Known Issue regarding batchable classes). Do you have any documentation that suggests otherwise?
Comment: https://help.salesforce.com/HTViewHelpDoc?id=design_your_app.htm&language=en_US

 CTRL+F "custom settings"

Package : PostInstall script


What does a field represent in QFT?

Question: In quantum mechanics we work using wave functions, which represent (if we take the module squared) the probability of finding a particle in a certain position or momenta. On the other hand in the case of QFT we work with fields. Now, I fail to understand the physical meaning of the field in QFT: in the classical case, for example, a field is associated with a physical quantity that we can measure, like the Electric field, and at each point in space the field associates the value of the quantity. Now the same interpretation doesn't seem be true for the quantum field and I don't really understand what its value at a certain spacetime point represents. It looks like the quantum field is much similar to a quantum mechanical wave function, in the sense that in order to extract physical information you have to perform some operations on it (like taking the module square for the wave function). I'm also wondering if the quantum field and the quantum mechanical wave function are related in some way or if, when doing QFT, we just throw away the concept of wave function.
Comment: Related/possible duplicates: https://physics.stackexchange.com/q/54603/50583, https://physics.stackexchange.com/q/13157/50583
Comment: IMHO the best answer to your question is given in Chapters 2 to 5 of Weinberg's The Quantum Theory of Fields, Vol. 1. Fields are introduced because they are convenient building blocks to construct relativistic interactions obeying cluster decomposition. *Personally* Weinberg's perspective is the one that makes most sense for me.
Comment: @Gold Does cluster decomposition (CDP) even apply in the non-relativistic case with *any* potential? W motivates fields (start of ch. 5) as the solution to a problem arising from wanting CDP and wanting creation/ann.. operators to implement it, but this looks irrelevant non-relativistically (NR), we can set up NRQF's for any NR multi-particle problem in about 3 steps from the HUP (See Landau vol. 3 Ch. 1 & 9, it's actually a completely general argument) - it doesn't seem like W's approach makes sense as anything but one possible plausibility argument that misses e.g. NR stuff, or does it?
Answer: Quantum field theory is emergent from the basic quantum mechanical postulates and principles first used in bound state problems that led to the wave functions and the probability distributions for the observations of bound states.
As scattering experiments became dominant in the study of particle interactions it was necessary to formulate a theory for more than two particles in the interaction. This led to the use of Feynman diagrams for calculating crossections with the development of Quantum Field Theory.
The quantum field theory for calculating with Feynman diagrams, is based on differential operators operating on the plane wave solutions of the relevant quantum mechanical equations, i.e. with zero potential. Dirac for fermions, Klein Gordon for bosons, quantized Maxwell for photons,( for particle physics, for QFT of other subjects the appropriate equations).
Creation and annihilation operators operate on the plane wave solutions of the corresponding particles , which represent the fields  in QFT, covering all space : electron field, photon field etc.
There are other formulations isomorphic to this , that lead to theoretical studies, but when coming down to basics, it is the success of Feynman diagram calculations that makes  QFT a physics theory .

What does a field represent in QFT?

The fields of QFT, in this representation, are the plain wave solutions  on which the differential creation and annihilation operators operate. These functions, representing the fields of electrons, muons, .... are like a mathematical coordinate system on which the creation and annihilation of the corresponding particles  can model the behavior of  particles that are observed in experiments. Similar to the real field of the (x,y,z) coordinate system that allows to model the trajectory of particles in classical mechanics.

when doing QFT, we just throw away the concept of wave function.

No, it is in the underlying level of which QFT is a meta level, in the mathematics of the plane wave wavefunctions that the creation and annihilation operators work on. It is what makes the results of QFT calculations related to probability distributions.
Answer: It's not very well known that QFT as well as classical field theory can be constructed geometrically, just as is done for GR.
The relevant geometry here is the theory of principal and vector bundles and these are both incarnations of fibre bundles.
Here, a field, in its most general incaranation is a section of a fibre bundles and they assemble into a sheaf of fields.
Physically, we should see a quantum field as a quantisation of a field of harmonic oscillators. This is how the creation and annihilation operators make their appearance.
There are other formalisms, for example Kevin Costellos axiomatisation of perturbative QFT. This uses his notion of a factorisation algebra and which is indebted to Segals axiomatic notion of a conformal field theory.

I am also wondering whether the quantum field and quantum mechanical wave function is related in some way.

They are. QFT in zero dimensions is essentially QM. It's an exercise in the first chapter of Srednicki's book on QFT.
Answer: (tl;dr) A field represents an integration of every possible wave function associated with its every possible creation and annihilation states.
--
Quantization can happen in two levels. First is, obviously, quantization of classical mechanics: you introduce wave function to treat an observable of a particle as the eigenvalues of its operator acting on that wave function. A formalism that governs the wave function of a system.
But wave functions have problem when you try to formalize many-body problem. Why? Because, from statistical mechanics, we know that quantum particles of the same sort are indistinguishable. So, trying to extract some state of, say, particle #1 and that of particle #2 doesn't mean anything, because they are exactly identical. In other words, applying operators $\hat{S}_1$ and $\hat{S}_2$ which are for particle #1 and #2, respectively, to $\psi$ is simply nonsense, because you cannot label the particles.
What you want to do instead is trying to count how many particles are there occupying each possible state. This basically means you need new formalism that governs the occupation numbers of a system. You can say that this is also a quantization, a quantization of occupation numbers (often called the second quantization). We know that wave functions live in the Hilbert space. Analogously, occupation numbers live in the Fock space.
In a Fock space, operators acting on a Fock state is just annihilation and creation operators, which is straightforward because all you need to change an occupation number is addition or subtraction. For example, say a particle in a many-particle system has three possible eigenstates $\psi_1$, $\psi_2$, and $\psi_3$. Then the general form of a Fock state of this system can be expressed by $|n_1,n_2,n_3\rangle$. If the system is fermionic, then each occupation number is either $0$ or $1$, whereas for bosonic, any non-negative integer. Consider the Fock state $|0,1,0\rangle$ which evolves to the state $|2,0,0\rangle$. All you need to do is simply applying creation operator $\hat{a}^\dagger_1$ for eigenstate $\psi_1$ twice and annihilation operator $\hat{a}_2$ for $\psi_2$ once to the initial state so that $\hat{a}^\dagger_1\hat{a}_2|0,1,0\rangle=|2,0,0\rangle$ which is just $\psi=1/\sqrt{2}\left(\psi_1\otimes\psi_1+\psi_1\otimes\psi_1\right)$ in terms of eigenstate. Notice that the annihilation and creation operators commute each other, because this is a bosonic system.
When you turn all these quantum mechanics into field-theoretic formalism, i.e., making occupation numbers more or less continuous, then any field can be simply expressed in terms of an integration over the conjugate momentum space of the general linear combination of annihilation and creation operators acting on the eigenstates associated with a conjugate momentum. For scalar field $\phi$, which is often used to model the Higgs boson, pions, etc,
$$\phi(x)=\int\frac{\mathrm{d}^3p}{\sqrt{(2\pi)^3 2E}}\left[\hat{a}_p\mathrm{e}^{-ip\cdot x}+\hat{a}^\dagger_p\mathrm{e}^{+ip\cdot x}\right]$$
where $\mathrm{e}^{\pm ipx}$ are simply the eigenstates (or eigenwavefunctions if you like) whose conjugate momentum is $p$.

What does a field represent in QFT?


Pod setup cannot find cocoapods

Question: After installing cocoapods with sudo gem install cocoapods, attempting to run "pod setup" returns this error:
Could not find 'cocoapods' (>= 0) among 22 total gem(s) (Gem::LoadError)

Output from "pod setup":
/Users/Kevin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:313:in `to_specs': Could not find 'cocoapods' (>= 0) among 22 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/Kevin/.rvm/gems/ruby-1.9.3-p194:/Users/Kevin/.rvm/gems/ruby-1.9.3-p194@global', execute `gem env` for more information
    from /Users/Kevin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:322:in `to_spec'
    from /Users/Kevin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /Users/Kevin/.rvm/rubies/ruby-1.9.3-p194/bin/pod:22:in `'

When I check the directory listed in GEM_PATH, it includes:
...
drwxr-xr-x   5 root   staff   170B Jun 16 23:35 cocoapods-core-0.33.1/
drwxr-xr-x   5 Kevin  staff   170B Jun 16 23:41 cocoapods-downloader-0.6.1/
drwxr-xr-x  15 Kevin  staff   510B Jun 16 23:41 cocoapods-plugins-0.2.0/
drwxr-xr-x  11 Kevin  staff   374B Jun 16 23:41 cocoapods-trunk-0.1.3/
drwxr-xr-x  15 Kevin  staff   510B Jun 16 23:41 cocoapods-try-0.3.0/
...

So the files are there, though its core is root since I used sudo gem install cocoapods.
Solutions suggested on previous Stack Overflow questions that I've tried:

Install cocoapods without sudo: Suggested here. However, even following these instructions I get permission denied when trying to use gem install cocoapods.
Sudo pod setup: Suggested here. However, pod tells me that I can't use it in sudo.
Change permissions for cocoapods files: Suggested here. I tried running the lines provided by the top answer but it says that those files do not exist.

How do I get pod setup to work?
Comment: Did you uninstall it with `sudo gem uninstall cocoapods` before trying to install again without `sudo`? Please read [this answer](http://stackoverflow.com/a/23767092/3453503) again.
Comment: Thanks! Yup, I had tried that. For those with the same problem, I ended up uninstalling and reinstalling ruby which solved the problem for me--though may have been overkill.
Answer: Don't use sudo.
1: sudo gem uninstall cocoapods

2: gem install cocoapods

3: pod install

Answer: I had the same issue. I solved it by

Removing cocoapods
Reinstalling it using rvmsudo instead of sudo
rvmsudo gem install cocoapods

Hope it helps!
Comment: This answer was very helpful for me, because i believe i couldn't install pod as "sudo". Thank you for the help.
Answer: if your osx is 10.11
use
sudo gem install -n /usr/local/bin GEM_NAME_HERE
Answer: Run command rvm use system in Terminal,then the installation worked even though the system Ruby is 2.0.0.

Pod setup cannot find cocoapods


Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN

Question: I followed many tutorial about leveraging browser caching nevertheless I couldn't configure it succesfully, in fact GTmetric (PageSpeed and YSlow) notified me many static file that don't have a cache expire header.
That's my GTmetrix result (pagespeed):

I tried to find the problem looking at compatibility test on W3TC and it notified me many Apache modules missed which are required for browser caching:

I followed some tutorial to enable these modules but it seems they are alread enabled, in fact they are already uncommented on my /opt/bitnami/apache2/conf/httpd.conf
This is my .htaccess
Thanks in advance for your assistance
Answer: I have the same configuration as you and I too have run into this problem.
Assuming that you have got the modules enabled (see below), I think you can safely ignore the results of this part of the compatibility test.
W3 Total Cache reports missing modules because mod_php is disabled by Bitnami due to their view that it is not secure.
From the Bitnami AWS documentation

During installation, W3 Total Cache may display an error stating that some Apache modules are not detected on the server, when they are in fact installed. This error is a known bug in the W3 Total Cache plugin and may be safely ignored.

This references a Plesk article

W3 Total Cache cannot read the state of an apache module if the website is not run with mod_php on a apache server. mod_php is disabled in Plesk by default because it is not secure (mod_php is outdated).

So just make sure you have uncommented all the required modules in  /opt/bitnami/apache2/conf/httpd.conf. I used the list that W3TC says was "missing" as a reference for what I needed to uncomment.
Then restart your server to let the changes take affect: sudo /opt/bitnami/ctlscript.sh restart
In case it helps someone else, I was also confused as to why changes I made to the "Browser Cache" settings in W3TC didn't seem to have any affect. Specifically changing the "Expires header lifetime" under "Media & Other Files" didn't result in any change to the value that I'd see when examining the headers of the object in the browser.
I think this may be due to W3TC expecting to be able to modify the .htaccess file to put these values into operation, but instead bitnami uses a single htaccess.conf file

Bitnami stacks recollect all the htaccess information in a single file, /opt/bitnami/apps/wordpress/conf/htaccess.conf in your case and the AllowOverride option is set to None. Therefore, please add what you modified at /opt/bitnami/apps/wordpress/htdocs/.htaccess to that file and then, restart Apache.

In otherwords, you need to manually change the values in /opt/bitnami/apps/wordpress/conf/htaccess.conf


Ordinary least squares - change response and explanatory variable

Question: In a simple regression model using OLS, why is it not, at least in general, possible to move the $x_i$'s to the left-hand side of the model and the $y_i$'s to the right hand side when I want to switch the explanatory and response variable? Intuitively, it seems fairly clear that if ${\hat \beta ^{OLS}}\left( {Y,X} \right) = \mathop {\arg \min }\limits_{\beta  \in \mathbb{R}} \sum\limits_{i = 1}^n {{{\left( {{y_i} - x_i^T\beta } \right)}^2}} $ and ${\hat \gamma ^{OLS}}\left( {X,Y} \right) = \mathop {\arg \min }\limits_{\gamma  \in \mathbb{R}} \sum\limits_{i = 1}^n {{{\left( {{x_i} - y_i^T\gamma } \right)}^2}} $, the simple "switching of sides" would not work since I'm minimizing two different sums. But is there any more formal explanation why it cannot be done?
Comment: How more formal than you have already wrote?
Answer: Not sure if these fit within your notion of formal here, but:

The meaning of your errors and residuals changes, since they are defined by deviation from the left hand side of the model.
After the switch, if there are multiple $x$s on the left side, this would imply a possibly correlated errors (multivariate) model, or a mis-specified model if you start from least squares multiple regression, and do not move to a multivariate model.
If your data are derived from a study design that supports causal inference, then you may be violating causality by reversing causation (e.g. heart attacks causing people to have a smoking history). This can extend to cross-level fallacies depending on the kind of inference you make out of your results (e.g. if $x$s are compositional population-level variables and $y$ is an individual-level variable, you may be asserting that individual experiences are creating (non-compositional) population-level contexts).
Comment: Thank you, I think this response should be formal enough, also the reversing causality is a thing I did not realize before, or at least not to such extent.
Comment: Skumin - When you say "I think this response should be formal enough" --- formal enough for *what* exactly? What thing do you need a formal response to?


How to change name of the foreign key used to map an association in Grails

Question: I'm trying to get a project up and running using Grails.
I have 2 tables, areaserver and serverprotocol.
areaserver has a one-to-many relationship with serverprotocol (one areaserver to many serverprotocols).
The entity class AreaServer has an assigned string primary key.
I've manually configured the AreaServer's id key to be an assigned string,
and I've configured the ServerProtocol class as the many in the AreaServer's many-to-one relationship, but when I try and set the foreign key manually in AreaServer's "mapping" section, Grails uses the conventional approach where it assumes AreaServer's foreign key is an auto-incrementing id with value "id"
Heres my AreaServer entity class:
class AreaServer {

String serverId
...
...
static hasMany = [ serverProtocol : ServerProtocol ]

static mapping = {
        serverProtocol lazy:false
        id name: 'serverId', generator: 'assigned'
        serverProtocol column: 'server_serverId'
}

}
Here is my ServerProtocol entity class:
class ServerProtocol {

long dbId
....
....
static belongsTo = [ areaServer : AreaServer ]

static mapping = {

     id name: 'dbId'
     version false
}

}
When Grails creates the database and tables the "serverprotocol" table has a foreign key that is named "areaServer_id" instead of "server_serverId" which I configured it to do in AreaServer's mapping section.
Configuring the foreign key like I am attempting to do is supposed to be a standard procedure as shown under "table and name columns" in the Grails.org document http://grails.org/doc/latest/guide/5.%20Object%20Relational%20Mapping%20%28GORM%29.html
For some reason altering the foreign key name (when the foreign key is nested within the "many" table of the one-to-many relationship) just doesn't work, which the documentation says that it should.
I know that Grails standard convention is to expect each table to have an auto-incrementing primary key called "id", and that is why the foreign key is being named "areaServer_id" (since AreaServer is referenced as areaServer in ServerProtocol).
Does anyone know why Grails wouldnt allow me to modify the foreign key's name manually like it says is possible in the Grails's documentation?
Thank you for any help in advance!
Answer: Something like this may work I think:
class AreaServer {
    static hasMany = [serverProtocol: ServerProtocol]
    static mappedBy = [serverProtocol: "server"]
}

class ServerProtocol {
    static mapping = { server column: 'server_serverId'  }

    AreaServer server
}


Create a content for taxonomy vocabulary

Question: I have one task to do but i'm not sure where to start. I have to create a content for storing current and historical data for each term in "extaxvoc", the current data will be shown on Search pages for "extaxvoc". I have no idea where to start with it as the task seems strange to me but at the same time i'm completely new to drupal cms overall.
Answer: It seems like a little too many extra steps for me. You can use fields in taxonomy terms as well, if you want to store data. You can adjust the search to show terms afterwards, besides nodes(content entities). In any case, if this is mandatory, you can always add an entity reference field in the content type(the one you create for adding content which will store historical data and so on) and just add the needed fields there. Each node will be categorized by the category it references from "extaxvoc".


How to learn & play sheet music with diatonic harmonica

Question: I think 'just learn to read notes and which holes do what' isn't probably the best way - since there are harmonicas tuned to twelve different keys and all differ in note placements.
So I did some research, haven't found anything conclusive, but here's my theory of what is probably going to work:

Despite the layout of actual notes differing on harmonicas, their position relative to the key is fixed. So it seems to be possible to learn stuff like '4 blow is always key' or '5 blow is always major third of key'.
now if one could learn to read music in that terms instead of note names, one would have much easier time playing different harmonicas.

Is that approach practical? Are there people actually playing that way? How would one learn to read notes in that manner? It seems like it might be just moving the problem - instead of learning twelve different hole layouts you'd have to learn twelve different ways of reading the score.
Comment: I don't really understand what you are asking, but could you possibly be meaning this? https://en.wikipedia.org/?title=Transposing_instrument
Comment: I don't think so. As far as I know music for diatonic harmonica is notated in concert pitch. It's just that it's not a chromatic instrument, so you don't have all the notes available. And that's why you need to have/learn different harmonicas to play in different keys.
Comment: @Barnaba, there ARE chromatic hamonicas.  http://us.playhohner.com/instruments/harmonicas/chromatic/
Comment: But still - isn't the diatonic harmonica a transposing instrument? I'm not sure, but I think it would be needlessly cruel to *not* transpose, for example, the D flat harmonica.
Answer: Different people's minds work in different ways, so there is no right or wrong, only what works for you.
Whatever way you choose, you're going to have to be able to switch your brain into different "modes".
An obvious way would be to learn the mapping from (stave position) to (hole position and breath direction). This would necessitate having a mental mode for each instrument key.
This would work for some people. I don't think it would work for me; it's up to you whether it fits how you think.

The way I would choose is to have a mental mode for every written key. So, I look at the key signature, think "OK, this is G major", and put myself in that mental mode: The root is the 2nd line from the bottom of the treble stave, the octave is above the top line, the fifth is two lines above, and so on.
You can probably just set some mental "markers" at key intervals. You don't need to consciously remember that the space above the root note is the second. It's easy to work out, and it will become instinctive unconsciously soon enough anyway.
So here you have a mental mode for every key you want to play in. You don't have to learn the keys corresponding to all 12 root notes; some keys are more common than others. This is familiar to chord-oriented guitarists.
On your diatonic harmonica, now, you just learn how hole positions and breath directions map to positions in the scale. This is what you've described "4th hole blow is the root note"
There are lots of advantages to looking at music like this, to the extent that I'm sure some pianists think about scores this way.
On a harmonica, if you look at scores this way, you can transpose written music just by switching instrument. A pianist who's learnt this way of reading music can transpose by putting their reading mind in one mode and their hands in another (a good trick; some people can definitely do it).
Reading scores in this way also helps contextualise the notes, which helps with anticipation and expression, and helps with learning pieces. You don't just read a 'G' you read a 'root note' and that has some influence on how you might choose to play the note.

However, one complication -- on a C harmonica, you don't always play in C major (nor A minor). Blues musicians usually use "second position" (aka "cross position"). So you would learn another "mental mode" in which the root is "2nd hole draw". A lot of written music is going to be very difficult to play in this position, but it's the position in which the classic rock/blues harmonica sound is played.
Answer: Yes, all diatonics are layed out the same way, relative to the key.  This is especially true of the central octave (holes 4-7).  Some experiment with different notes on the lower, incomplete octave (holes 2 and 3).
The easiest thing for a beginner is to get a C harmonica, and seek out tunes in the key of C (or A minor).  There's lots of those.
In addition there are lots of songs written in harmonica tabs - replacing the notes with hole numbers (usually negative number for sucking).  These are easy for the beginner to use, and they avoid most copyright issues.
The toughest thing for a beginner is producing single notes, as opposed to the 3/4 notes of a chord.  By the time you master that you should be comfortable with both tabs and the C scale.
At some point you'll want to play tunes in another key, such as the easy ones F and G.  The main value to getting a harmonica in a different key is that you can then play with others.  But for your own practice, transposing will work just as well.  You might start doing this on paper, converting, for example, the notes to tabs.
Most computer programs that handle scores will do the transposing as well.  I'm most familiar with ABCNotation.
Solfège, the do-re-mi notation is used in two ways, fixed and movable.  In some languages, like Spanish, it is an absolute pitch, where do is our C.  But in English it is often used in a relative sense - do is the major key root.  A diatonic harmonica, in any key, can be played in that movable sense.
With a tuner app set to solfege, the notes on my C diatonic are:
      1  2   2   4  5  6   7  8  9   10
blow: do mi  sol do mi sol do mi sol do
draw; re sol si  re fa la  si re fa  la

But viewed as moveable solfege, all other keyed diatonics have the same (relative) notes.
In tabs the middle octave, regardless of key, is
4 -4 5 -5 6 -6 -7 7

fa and la are missing in the lower octave, but can be played (in theory) as bends.  si is missing from the upper octave.
A chromatic has (typically) 3 octaves, each layed out like the middle one.  Pushing in the slide raises each note semitone. It can handle all keys in those octaves with about the same ease as keyboard.
Answer: I think learn to read in D with a D harp treble clef f# and C#.Then play any harp C,G, A etc. as if they're in D
If you have some sheet music in C transpose to D on paper read it playing a C harp.You will be able to read and transpose notation. Treat the harmonica as a transposing instrument.
Answer: Some good points have already been made regarding whether this is typical and how feasible it is. One thing you will definitely need is a good understanding of how the harmonica is laid out. This is something that educators have struggled to expedite in their students because the best tools have been the harmonica itself, which is obviously opaque while learning, or pen and paper which is inflexible and time consuming in its own way.
That's why I made an app called Harp Guru. The promo video linked below will explain the features in 4 minutes and the Android play listing is included in the link below that. How it helps.

https://play.google.com/store/apps/details?id=com.jslog.harpguru
Answer: Note:  I don't play the harmonica

Is that approach practical?

I do not think this would be a practical way to learn the harmonica.  As you said, it would most likely just move the problem.  It would definitely be a good idea to know what the note's relation to the key (chords, harmonizing, etc.), but not as your sole way of reading a piece of music.  At some point, you'll also have to need to know the names of the notes and where they are.  If someone asked you to play an E, you wouldn't have to think for a moment to figure out what hole that was.  To me, it would be better to spend time memorizing the 12 layouts at the beginning, than memorizing 12 different names for notes.  I think it would be much more difficult when actually trying to play a piece to have one name to remember.

Are there people actually playing that way?

I wouldn't know.

How would one learn to read notes in that manner?

You'd have to come up with a way of labeling the notes, maybe using Roman numerals for distance away from the key.  For example, C would be i, B would be ii, A would be iii, etc.
I think you should definitely try both ways and see what helps you the most.  If you were going to just memorize the note layout, you might want to color code your harmonicas (not sure if this would do anything, but it might be easier to see a green harmonica and associate that with a key, then just a metal colored one.)
To avoid this, you might want to go with a chromatic harmonica.  You would be able to avoid all the transposition stuff (but it would be easier for you to transpose if you learned in the beginning).  Read about chromatic harmonicas here.
.


How to use our own crypto currency for transactions in smart contract

Question: I have created my own crypto-currency and tried sending it to an address through my ethereum wallet but can anyone tell me that how can I use this crypto-currency in another smart contract for transactions instead of ether?
Answer: If you created an ERC20 standard contract, then you would have to reference the token contract in the new contract. Specifically the transferFrom method.
This is just a sample of what it could look like:
// Please don't use this code as it might contain security issues...
// It's just an example!

// Contract interface
contract TheTokenContract {
    // Copy Method Headers
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
}

contract YourNewContract {

    // Send TheToken
    function sendTheToken(address _from, address _to, uint256 _value) public {

        // Set token contract address
        address tokenContractAddress = <TokenAddress>;

        // Connect to TheTokenContract
        TheTokenContract token = TheTokenContract(tokenContractAddress);

        // Use TheTokenContract methods from Contract interface
        bool sendSuccess = token.transferFrom(_from, _to, _value);

    }

}

Comment: I have tried what you have said but getting an error which says "It seems this transaction will fail.If you submit it,it may consume all the gas you provide" while executing that contract. Can you help me to resolve it?


Mirroring PC screen to android via USB

Question: There seems to be slight variations of this question that have been asked to no avail, but is there a way to mirror my pc desktop to my android device STRICTLY using a USB cable?
I've seen may solutions for this using wifi such as splashtop and windows remote desktop, but my I don't have access to wifi or mobile data on my android device.
Answer: No. Both ends lack functionality for this. USB isn't designed to output in this way without pricey adapters that act as port replicators, forcing your CPU to act as a virtual video card, then outputting through a video port on the replicator, and adding USB, Ethernet, etc. But then you'd need to go from that adapter to your phone, and your phone has no inputs for this type of communication, or software functionality to handle it.
Answer: Yes you can using "Mobile Pc Monitor" you can do just that. there is also Twomon USB but that cost $9.
Download the free "Mobile Pc Monitor" app from google play and the server from http://www.usbmobilemonitor.com
after installation go to display properties on you pc and click detect. change the mode to mobile pc monitor display and it should work depending on your phone.  (and no pc reboot)
"TurboFool" apparently doesn't know much about data cables or software...
in the end its all 1s and 0s and usb data cables and computers love those things.
DVI, and HDMI cables are designed FOR monitors to connect directly to the displays control board.
that gives the best refresh rates, and quality. Some phones even have Mini HDMI ports to steam video.
I been doing the same thing with my psp via data cable and pspDisplay so it was a matter of time to find a program that does the same for my android phone.
You can stream video over usb via software and thats exactly what the app I mentioned does.
The server program running on your PC captures the video thats sent to the monitor changes it to a usable format and sends that to the phone via data cable. The app then interprets those signals and displays the image.
I been looking for the same solution for days and just found it. It works on my Galaxy S4 np.
you can definitely send those 1s and 0s though the usb cable but at some loss of quality.
Both those programs give you the ability to extend your display to the phone as if it were another monitor. Thats something "PspDisplay" didn't do.
you can also just duplicate one of your monitors to the phone.
touch screen works as a mouse as well so its not just a monitor its a whole new input device.
Answer: Try installing a VNC server on your computer.
With VNC installed, you can use this: https://f-droid.org/en/packages/android.androidVNC/
Answer: Maybe I'm a bit late to the party ;P but it's not all "doom-n-gloom" on this front.
An (apparently) Argentinian software company has published a software which claims to do exactly what you ask here -- the company's name is Shape -- you can read about them here --> http://www.shape.ag/en/company/
The name of their software widget is iDisplay but they claim it works with iOS, macOS, Android and Windows. You can read more about it here --> http://www.getidisplay.com/ and even download it -- it's supposed to be free of cost.
DownLoadCrew's review:

Blockquote

Run out of space on your desktop? There is no need to rush out to the shops to buy a new monitor, particularly if you are one of the millions of people who own an iPhone or iPad, or an Android tablet or mobile. iDisplay is a tool that can be used to transform your mobile device into a second display for your Mac or PC so you can take advantage of a little extra desktop workspace.
The software is made up of two different components – the desktop software which needs to be installed on your PC or Mac, and the mobile app which is available for both iOS and Android – and you have the option of connecting over a USB connection, or wifi. iDisplay can be used in to different mode with the first turning your mobile device into an extension of your desktop, and the second enabling you to mirror what you see on your monitor.
iDisplay can be used in various ways. If you have your computer connected to your TV, you could use your phone to house an onscreen remote so you can control playback from the sofa. When you are working at your desk, you can limit distractions by using your tablet's screen to display your Twitter feed or Facebook timeline. It can also be used to move control panels out of the way of other program windows.
iDisplay has numerous benefits over a regular monitor, the first of which is portability. While it is possible to change the configuration of a multi-monitor setup, cables and desktop space mean that this is not going to be something you want to do all that often. In the case of iDisplay, all you need to do is re-position your phone or tablet and then use the configuration tool to indicate where it is in relation to your monitor. The wireless aspect means that it is also possible to use the app to keep an eye on your desktop when you step away from your computer, so you need never be out of touch.
Verdict:
A low-cost and incredibly useful way to gain extra work space and a very helpful way of interacting with your computer.

Blockquote

Disclaimer: 1) I have not downloaded, installed or tried out this software.
2) I do NOT work for the publishers of this software or represent them commercially or in any other capacity. I just encountered their software / website during my routine Internet research on Android apps.
But I hope iDisplay meets your specific requirement(s) / resolves your issue(s).

Mirroring PC screen to android via USB


How To Show Latest Reply in Threaded View in Evolution Mail?

Question: Evolution mail supports threaded view for email threads. However, it shows the first message received at the "top" in the Messages list. How can I configure the system to show the latest received at the "top" of the conversation thread?
Answer: Currently this is not possible. Check if the following gsetting is true (which it should be by default)gsettings get org.gnome.evolution.mail thread-latest.
This still show you the first message at the "top" but uses the date of the latest message in a thread for sorting.
See the bug tracker for more details and a workaround which makes the sorting a bit more intuitive: https://gitlab.gnome.org/GNOME/evolution/-/issues/862#note_758759


Can an electric resonator (like a microwave) be used to effectively heat things other than water at different frequencies?

Question: For example, could you determine the resonant frequency of slag in an ore sample and melt it by putting it in an electric resonator at the appropriate frequency?
Answer:
Can an electric resonator (like a microwave) be used to effectively heat things other than water at different frequencies?

MAYBE as long as it's not explosive like petroleum-based.
Microwave is not the most efficient, but it conveniently fast and does have the advantage of a rotisserie and good penetration by radio waves less sensitive to the insulation of air.  However, it does work well with any other mediums when there is an ionic transport dissolved in it. i.e. salt
e.g. Pizza or leftover salty chicken heats up very fast while bee's wax stays cold for a long time and is also an excellent electrical insulator like deionized water which has very extremely conductance at DC and 60 Hz.
There are also variable frequency induction heaters in large industry that use very large coils and capacitors perhaps the size of oil drums with electrodes filled with oil to generate very high voltages and currents at relatively low frequencies (100kHz).

could you determine the resonant frequency of slag in an ore sample

Yes, you can determine the RLC properties yes with a vector impedance meter for a known geometric shape.  But rarely, would it have a sharp (high Q) resonant frequency even highly crystalline coal (graphite).  High electrical Q's are derived by insulators more than conductors and I guess slag is in this middle zone.
For example, pure Quartz is highly insulating but between gold plated electrodes with a critical angle of cut will appear as a lossy inductor of several Henries and fempto-farads of motional piezo effects that create the high Q's of 10k. Several Henries is like a good solenoid or relay but then electronic crystal or MEMs resonator can only handle 10uW typ. of heat in the crystal lattice due to the nanosize and large power density
But I hope someone proves me wrong.  That doesn't mean there isn't a resonant frequency of the industrial arc furnace due to the plasma gas electrode gap to slag, because there will be and that's about the best radio jammer you can find.  Also, the megawatt transformers used for smelting must be designed in a special way to tolerance these negative resistance high arc currents.

and melt it by putting it in an electric resonator at the appropriate frequency?

Unless purified and strictly controlled by geometric portions, that won't work.
I believe, the melting process is done by conduction and the plasma gas air buring in contact after an arc is struck.


Accurate measurement using inaccurate tools

Question: Is there a good way to systematically increase the accuracy and precision of a measuring tool using only mathematical means?  For example, average 10 measurements can create a better one. Or using two independent tools.  I don't know if measuring theory or statistical quality control or other subject can help.
Comment: R. A. Fisher once said something like: Very often, when the most elaborate statistical data analysis possible could increase the precision by only a few per cent, yet a different design involving little, or no additional experimental labour, might increase the precision two-fold, or five-fold or even more.
Answer: I don't know much about measuring theory, but I do know a lot about how the tools work and accuracy and precision. Accuracy, is how close you are to the actual answer. Suppose a length is 10 cm and you get 9.8, then you are accurate. Precision, on the other hand, is the measure of how steady you are in taking measurements, in other words how well can you carry out the same experiment multiple times and still get the same result. For example, you can do 10 experiments and if you're measurements are all very close every time, you are precise, your accuracy is a different matter.
To answer your question, accuracy depends on the quality of your tools and your methods, if you have a bad scale with wrong calibration, there is nothing you can do mathematically to make your answers accurate. For precision, multiple experiments will help you find your answer with more precision, so yes that can be helped. Using different tools will help with accuracy, if either of the tools are well calibrated, but you could just use the one that's better and get the answer. So yeah, maths can't help your accuracy, but can help precision.
Comment: Is there a book or website or reference systemtically explains this? thanks
Comment: You can Wikipedia or Google "accuracy and precision". It has images that help. I learnt this in the first week of chem 100 so it should be in any intro to chem books. Am forgetting the one that we used.
Answer: this is a standard topic treated in any college-level statistics or SQC class.
You can in practice increase the precision of a poorly-repeatable tool by increasing the sample size, which increases your confidence in the validity of the average of those measurements.
However, there is no mathematical trick to improve the accuracy of an out-of-calibration tool.


Copy to USB memory stick really slow?

Question: When I copy files to the USB device, it takes much longer than in windows (same usb device, same port) it's faster than USB 1.0 speeds (1MB/s) but much slower than USB 2.0 speeds (12MB/s). To copy 1.8GB takes me over 10 minutes (it should be < 3 min.) I have two identical SanDisk Cruzer 8GB sticks, and I have the same problem with both. I have a super talent 32GB USB SSD in the neighboring port and it works at expected speeds.
The problem I seem to see in the GUI is that the progress bar goes to 90% almost instantly, completes to 100% a little slower and then hangs there for 10 minutes. Interrupting the copy at this point seems to result in corruption at the tail end of the file. If I wait for it to complete the copy is successful.
Any ideas? dmesg output below:
[64059.432309] usb 2-1.2: new high-speed USB device number 5 using ehci_hcd
[64059.526419] scsi8 : usb-storage 2-1.2:1.0
[64060.529071] scsi 8:0:0:0: Direct-Access     SanDisk  Cruzer           1.14 PQ: 0 ANSI: 2
[64060.530834] sd 8:0:0:0: Attached scsi generic sg4 type 0
[64060.531925] sd 8:0:0:0: [sdd] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[64060.533419] sd 8:0:0:0: [sdd] Write Protect is off
[64060.533428] sd 8:0:0:0: [sdd] Mode Sense: 03 00 00 00
[64060.534319] sd 8:0:0:0: [sdd] No Caching mode page present
[64060.534327] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[64060.537988] sd 8:0:0:0: [sdd] No Caching mode page present
[64060.537995] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[64060.541290]  sdd: sdd1
[64060.544617] sd 8:0:0:0: [sdd] No Caching mode page present
[64060.544619] sd 8:0:0:0: [sdd] Assuming drive cache: write through
[64060.544621] sd 8:0:0:0: [sdd] Attached SCSI removable disk

Comment: It is 2019 now, and I still have this issue. Amazing how they are not able to fix this.
Comment: You gave me the confidence to just wait...
Comment: Linux defers disk writes in exchange for performing other tasks faster.  Just a guess, try running `sync` and see if it doesn't speed up the process. <--untested but possible
Comment: that doesn't make sense that it would defer it for one type of USB but not another. Also I seem to recall linux calls sync every 30 seconds or so? Might be outdated. I'm expecting this is some kind of driver or compatibility issue since it depends on the type of device.
Comment: The being faster on other USB thumbdrives isn't in your question.  If it were, I would have suggested looking in to hdparm.  So it makes sense if you view it from the perspective of someone who doesn't know your whole set-up, but depends on your question for details
Comment: "I have a super talent 32GB ___USB___ SSD in the neighboring port and it works at expected speeds." it was in there, but well hidden I will admit :) So what's this hdparm stuff you allude to?
Comment: Okay, SSD and flash memory are SO not the same thing.  But moving along, hdparm is a utility that lets you set access/spin speeds for drive manually
Comment: can you supply us with the output for both slow and talented drives separately. Their device names you can find by looking at the tail of /var/log/syslog

    udevadm info --name=sdd1 --attribute-walk
    udevadm info --name=sdb1 --query=all
Comment: As @zuba suggests, comparing the output from `udevadm` for a fast versus slow usb drive may provide some insight. I doubt you could use his commands directly since he "hard codes" the device names. But here is a [*man page*](http://linux.die.net/man/8/udevadm). You might also try comparing the results of `lsusb -v -d xxxx:xxxx` where *xxxx:xxxx* is the USB drive's hexadecimal `ID` value returned by running `lsusb` with no options.
Comment: Probably similar to http://unix.stackexchange.com/questions/107703/why-is-my-pc-freezing-while-im-copying-a-file-to-a-pendrive
Comment: It is now 2020. I just installed Ubuntu 20.04 to give it a spin. Tried to copy a couple of repos off my 32GB USB. Over 5 hours for 9GB (about 30K files). Totally unacceptable that a modern OS would require mounting / unmounting and tech workarounds to handle such a simple task like file transfer to a USB drive. Maybe Ubuntu 25.04 will get it right. Back to OSX for me.
Answer: Why is copying to my USB drive so slow in Linux (and faster in Windows)?

Reason 1. File caching can make writes appear slower or faster

The problem I seem to see in the GUI is that the progress bar goes to 90% almost instantly, completes to 100% a little slower and then hangs there for 10 minutes.

One thing you need to understand is file caching. Linux (and Windows) will use otherwise "empty" RAM to cache read/write operations and make them faster on subsequent accesses. Caching copy operations to slow devices results in the behavior you see -- the "fast completion" is actually writing to the cache, and then it slows and stops because the actual flushing of the data in the cache (sync) to the slow device is taking very long. If you abort at that point, the data is corrupted (as you noted) since the sync never finished.
Such copying in Windows may seem faster (including the reported MB/sec speeds) because sometimes Windows will not wait for the sync, and declare the job completed as soon as the data is written to cache.
Reason 2. Writing lots of files, especially small ones, is slow

To copy 1.8GB

Because of the way flash memory and filesystems work, the fastest throughput (speed) is achieved when writing very large files. Writing lots of small files, or even mixed data containing a number of small files can slow the process down a lot. This affects hard drives too, but to a somewhat lesser extent.
Reason 3. Write speeds of a USB stick and an SSD cannot be compared

I have a super talent 32GB USB SSD in the neighboring port and it works at expected speeds.

A garden variety USB stick usually consists of flash memory chips that are written to serially (sequentially), and does not have any cache of its own.
An SSD, on the other hand, contains a controller which writes to the flash memory chips parallel, increasing the throughput by a factor of 2 or more over the USB stick.

If your 32GB SSD had 4x 8GB chips, it would still be 4x faster than the USB stick at any write operation.
The SSD also contains RAM cache (like hard disks), so it can quickly store incoming data in the cache and tell the OS that it's done, while it still has to actually write that data to the flash memory.

So, with one large file, your 32GB GB with the 4x structure we assumed, would be 4x as fast; with many small files, it would be 10x or more faster because it could intelligently store them in its cache.

To sum up, these are the reasons why file copying to USB sticks may appear slower in Linux. Is it actually slower because of a hardware/driver issue or whatever....
Doing a proper comparison of write speeds between Linux and Windows

First of all, forget about the SSD because of reason 3. It's like oranges and apples.
To negate the effects of reason 1 (caching) and reason 2 (small files), you need to test with a single large file, larger than the amount of RAM on the test system.
In Linux you can create it with dd if=/dev/urandom of=largetest bs=1M count=7500, which gives you a 7500 MB test file. Assuming your system has less than 4GB or so of RAM, it's good enough. Copy that to a freshly formatted Sandisk 8GB stick, and time it.
Reboot in Windows, and copy largetest from the USB stick to your hard disk. Reboot again (to remove it from the cache). Then format the USB stick (same vfat/FAT32!), and copy largetest from the hard disk to the stick.
How do the times compare?
Comment: @zrajm that's true. However for people like me bumping in the same problem, this is **very** helpful.
Comment: cc: @Eloff  Re *Reason 1*: Yes, cache syncing can certainly affect apparent write times. But would cache alone explain why it *hangs there for 10 minutes*?? I think we need more details from OP. Re *Reason 2*: Why do you assume this transfer consisted of many small files? I do not think the OP provides any details about this 1.8GB transfer, does he? Re *Reason 3*: Yes, SSD is a different beast. It also would probably be attached via SATA and not USB. I think the OP simply mis-spoke and referred to a USB stick as an SSD. But again, no way of knowing unless we get more details from the OP.
Comment: This answer blatantly ignores how the question was formulated. The question clearly talks about *one big* file, and the fact that interrupting the copy results in a mangled file.
Comment: How to disable this caching behavior then?
Answer: It's 2019 and I'm still having this same issue. So I figured I search the internet for a solution. I found the following page that suggests one: https://gist.github.com/2E0PGS/f63544f8abe69acc5caaa54f56efe52f
It says:
Execute the following commands in a console to see if it fixes the problem for you. You might need to sudo su first to have the required permission.
echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

If it works you could make this change persistent across reboots by pasting the two lines at the end of your /etc/rc.local file.
For me it had the following effect:
Prior copying large files to an USB drive would start out really fast (like 60 MB/s) and become slower and slower (< 10 MB/s) until it looked like it would never finish.
Now it starts out slower, but gets faster and faster and finishes sooner than before. So it does seem to "solve" the problem or at least have a positive effect.
Comment: These `echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes` two command exactly make copy really fast in Ubuntu 18.04, x86_64 Linux 5.3.0-40-generic.
Comment: In ubuntu, as `/etc/rc.local` doesn't exist, you can add these **2 lines** at the end of `/etc/sysctl.conf` file. First line: `vm.dirty_bytes=50331648` Second line: `vm.dirty_background_bytes=16777216`  [Source](https://gist.github.com/2E0PGS/f63544f8abe69acc5caaa54f56efe52f#gistcomment-3541494)
Answer: Found the fix all i did was unmount, remove drive, and run sudo modprobe ehci_hcd in the Terminal. Insert drive and agian sudo modprobe ehci_hcd when I put the drive in and
wow 20/mbs thought i would share. Hope I dont have to do it every time... but it's not to hard...
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/177235
says they fixed the bug.
Comment: @irrationalJohn I didn't provide the answer, I just cleaned it up. Secondly just because a bug report is old, doesn't mean it's not still valid. It's being triaged according [this](https://bugs.launchpad.net/ubuntu/+source/linux/+bug/500069)
Comment: Seriously?? That bug report is from December of 2007 and references Ubuntu gutsy 7.10. (FYI: @MarcoCeppi)
Comment: @MarcoCeppi Yes, I know you only edited. That's why I prefaced with "*FYI:*". I figured if you edited it you might (or might **not**) be  interested. I figured if you didn't care, you'd just ignore the notice. As for an old bug report still having relevance ... Over 4 years ago and I think at least 8 (?) releases later? For a performance bug? Sure, it may be possible, but it's not the first place I'd look. FWIW.
Answer: I think the chances are very low that it is a port issue. It is more likely a LINUX (or linux configuration) issue - googgle around and you will find thousands of issue reports about slow USB in linux/ubuntu.
For me it is almost a showstopper for linux - I now have an Ubuntu 12.04 LTS and still have this issue (so I rather use the Win7 setup - mainly/only because of this). This issue (or something with similar symptoms) is there for several years now, apparently no fix. And during this time I tried several physical PCs with several different ubuntu versions (default config) and 2-3 different USB sticks....
Answer: Just umount the device if it is automounted already, and manually mount it to /mnt/foldername.
In my case,
umount /media/usb0
mount /dev/sdb1 /mnt/sam

After that it is coping very fast.
Comment: This didn't make any difference to my situation. Also, this isn't really a solution without some theory as to *why* this is supposed to make a difference.
Comment: This, along with `rsync` instead of `cp` seems to do the trick.
Comment: @Irfan No, rsync does slow down too...
Answer: If you switch to a USB 3.0 , you will go from 1mb/s to a woping 5-8mb/s. I switch to a 3.0 USB pci and external HD and haven't looked back.
Answer: When you look in /etc/mtab, do you see that the device has been mounted with the "flush" option?
If so, this could be the cause of the problem (it was for me).  Just unmount the device and remount it, it shouldn't be set by default.
Comment: The flush option is set by default, any way to stop this?
Comment: @ Ben Lutgens - Yes, you can put your own entry in /etc/fstab that doesn't have the flush options. Use sudo blkid to find the relevant device UUID and put an entry such as UUID="your device uuid here" /mnt/ uid=1000,gid=1000,fmask=0022,dmask=0022 0 0. Change the uid, gid to match the userid and groupid of the normal user that you use (as found by getent passwd ).
Comment: When I do this, all that changes is that I get no more progress bar for the copying and the copying only seems to really kick in/finish when I try to unmount the device and it tells me "don't unplug until operation is finished".
Answer: I had some problems also with transfer rate on a WD external disk, after opening it in a windows SO, i always used LINUX, after that the transfer rate was like 1.5mb/s than i unmount the external hard drive runed dmesg there it was saying that sdb1 it was unporperly unmounted, runed a fsck, that made a few repairs and after that 20mb/s of transfer rate again when copiyng from sda to external disk. fsck is always a risk if you have data, but it worked for me, with no data loss.
Answer: This is an old question. Also I had the same problem for a long time. Recently I found the solution here. What I did is:
Reformatting USB from FAT to NTFS.
Comment: this is NOT recommended for sticks >=32GB. Reason: Fast sticks rely on exFat - formatting. All USB 3.0 and 3.1 do need exFat to work fast. Try yourself ....
Answer: Try the NTFS-3g driver
Switching to the NTFS-3g driver increased the write speed from 1 MB/s to 231 MB/s for my Patriot Supersonic Rage 2 512 GB USB flash drive on Ubuntu 23.10.
This is how the drive gets auto-mounted (which gives mostly just 1 MB/s write speed):
$ mount | grep /dev/sd
/dev/sdb1 on /media/user/Rage2 type ntfs3
  (rw,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2)

Re-mounting with the NTFS-3g driver:
$ umount /media/user/Rage2
$ sudo mount -t ntfs-3g -o nosuid,nodev,relatime,uid="$(id -u)",gid="$(id -g)",iocharset=utf8 /dev/sdXX /mnt
$ mount | grep /dev/sd
/dev/sdb1 on /mnt type fuseblk
  (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,
  allow_other,blksize=4096)

Testing the performance:
$ time cp -ai 360GB_of_files /mnt; time sync

real    24m36.252s
user    0m0.587s
sys     4m18.616s

real    1m24.520s
user    0m0.000s
sys     0m0.206s

One-minute average transfer speeds (from iostat -dm 60 /dev/sdb):

From 83 MB/s to 356 MB/s

Total average transfer speed, including the sync at the end:

231 MB/s

Maybe the default NTFS driver writes to the flash drive in a way that is very suboptimal for this particular drive. From https://www.storagereview.com/review/patriot-supersonic-rage-2-usb-flash-drive-review:

When switching to random large-block transfers, the Supersonic Rage 2 posted 242.96MB/s read and 0.995MB/s write.
[...]
Our last flash drive benchmark measures 4K random transfer performance in IOPS. In this benchmark, the Supersonic Rage 2 posted pretty low numbers; 1,546.4 IOPS read and 0.57 IOPS write.
Answer: I also had this problem, but I use the cp command and you update your usb stick in seconds;
cp -r -u /home/user/Muziek/ /media/user/Audiousbsti
cp -r -u /home/user/Muziek/ /media/user/4F49-4A65/

I think it is a very late answer but it is still open.
Comment: This isn't an answer.
Answer: Okay, I had the same problem for three days and how I managed to backup my 1TB hard drive was by using rsync, I  know that it is used for backing up but it got the job done, even when transferring large files I use it to do that job. If you would like to use it with a GUI I suggest installing Grsync which is a graphical version of rsync since rsync runs on the terminal.
Hope this helped

Copy to USB memory stick really slow?


Can packet latency fluctuate?

Question: Can the time it takes for a packet to be transmitted from a client to the server fluctuate?
Answer: The IP protocol, atop which TCP and UDP are constructed, specifies that datagrams are neither guaranteed to arrive in order, nor via the same route, nor, for that matter, at all (thanks Trevor for the reminder). So, irrespective of whether TCP or UDP is used, latency will fluctuate. Latency is partly due to distance travelled, which changes if the path changes, and partly due to protocol stack translation on the routing devices along the chosen path -- which also change if the path changes.
This is part of the self-repairing nature of the internet, enabling it to do what it does  every day: if one route becomes less suitable according to heuristics programmed into various routing devices along the way, another route will be chosen instead. This can be either momentary, or long-term. Remember that before it was the internet, it was the ARPANET -- a defense network designed to deal with eg. the instant removal of vast sections of the network (think nuclear warfare), without the network as a whole going down. By routing around damaged or otherwise non-ideal areas, the greater network continues to function (albeit, perhaps, suboptimally).
Comment: Worth adding that datagrams aren't guaranteed to arrive at all.  They can just silently be dropped at any point along their journey.  It's only TCP's transport built on top of IP that adds an illusion of reliability to network communications.
Comment: Also see Danny Pflughoeft's answer, he rightly adds that TCP will suffer additional delays due to the way it operates -- if packets are lost, they'll be re-requested and resent, adding an additional full round trip time onto the message latency. And that can happen arbitrarily many times. UDP overcomes this by sending a continual stream of updates, and where the simulation can move ahead in spite of packet loss (much more to think about and plan for in this sort of system, however).
Answer: This is probably not game development question, but yes. In normal IP connection, each packets may go through different intermediary "hops", and each different "hops" may have different latency.
If you're using TCP to transfer your data, the protocol abstracts that for you and will reorder packets to deliver the packets in the order they were originally sent; however if you're using UDP, the packets can and do arrive out of order, depending on the latency of each individual packets.
Comment: In particular, if the UDP and TCP packets are being routed the same way and the UDP packets are routinely arriving out-of-order, this translates to "lag spikes" over the same connection using TCP instead.
Answer: Absolutely everything about an IP network can change at any time.
The following article discusses how things like latency, packet loss, and throughput can vary and why:
DEI Tech Note 0021: Loss, Latency, and Speed
Answer: Aside from what's already been said, don't forget that routers are allowed to arbitrarily drop packets, meaning in TCP a packet could theoretically take arbitrarily long to reach its destination (and in UDP, it might never reach its destination!).

Can packet latency fluctuate?


How extra-bibilical is the extra-biblical tag?

Question: In my opinion extra-biblical is different than apocrypha, but it's not the same as every-other-book, like books written about Mohamed in 700 AD.  What defines a book as extra-biblical for the purposes of tagging questions? (it it even a necessarily a book? my shoes are extra-biblical).
Answer: The extra-biblical tag is for secular historical records. But it really only makes sense to use it for questions asking for records from roughly the same time period as the Biblical texts.
Comment: yes, that makes more sense, like (see-also:Josephus)
Comment: I wonder if it would make sense to merge it with [tag:history] and rename both. To what, I'm not sure. But both, I think, attract questions that really don't fit, because of their misleading names.
Answer: After pondering the dark wander's answer for a minute or two, I think I'd like to offer up the option that it is completely useless to us as a tag and should be nuked.
If there are to be questions about works sacred to the various sects and faith traditions, they should be tagged with what they are, not using the blanket tag extra-biblical.  I don't think there are any sacred works that wouldn't merit their own tag and the existence of a nebulous tag is confusing.
Comment: If we look at the general guidelines for tagging in SE, I think Peter's point is a solid one.  Test criteria; can this tag stand alone or does it always have to have another tag associated with it?  More test criteria: if you just put that tag in and search, does it actually help you find questions/answers on the topic you are interested in?  I suggest that we nuke it from orbit.  It's the only way to be sure.
Answer: It's for Christian Sacred texts that aren't argued to be a part of the Bible by the people using them.  So it doesn't apply to the apocrypha or The Ethiopian Book of Josippon, but it would apply to the Book of Mormon (although we already have another tag for that), the Didache, and other such works held to be sacred, yet not a part of Biblical canon, by a group of people identifying as Christians.  Obviously this tag only is meaningful for groups where the Bible is somehow distinct from the set of all doctrinal sacred writings for that group.


Petrovic and Jensen inequaltiy

Question: I have been reading a book on some classic inequalties and i have stumbled upon this: Let $f:[0, +\infty]\rightarrow \mathbf R$ be a convex function and $x_1,x_2,...,x_n$ a sequence of positive numbers. It can be proved that :$$\sum_{i=1}^nf(x_i) \le (n- 1)f(0) + f(\sum_{i=1}^nx_i)$$
This is apparently called Petrovic inequality. I have also read that it can give a two-sided predicition of $\frac1n \sum_{i=1}^nf(x_i)$ when paired with Jensen inequality:
$$f(\frac1n\sum_{i=1}^nx_i) \le\frac1n\sum_{i=1}^nf(x_i) \le\frac1n[(n- 1)f(0) + f(\sum_{i=1}^nx_i)]$$
My question is: Did someone actually use this and where?
Answer: It's Just Karamata for $(0,x_1,...x_n)$:
$$f(0)+f(x_1)+...+f(x_n)\leq nf(0)+f(x_1+...+x_n)$$
Because we can assume that $x_1\geq x_2\geq...\geq x_n>0$ and
$$(x_1+x_2,...+x_n,0,...,0)\succ(x_1,x_2,...,x_n,0)$$

Petrovic and Jensen inequaltiy


Do journals avoid you as a reviewer if you are too fast?

Question: A couple of years ago, when I started publishing in my field, I received several requests of review from 4/5 different journals in a row. Because I happened to have free time, I submitted those reviews (done conscientiously, although in just one or two pages) in 24/48 hs. I know this is super fast. Then nobody has asked for my review in several months. I recently read that there was a scandal, I think in China, where journals discovered that reviewers answering in 24 hours were the authors themselves in disguise. My question is: are editors letting me rest? Were my reviews too short? Or, might they have mistrusted my reviews because they were too quickly done?
Comment: What field?  How long are these papers?  If a review usually takes three months and you did one in half a day, I am going to be suspicious.  You say super fast, but does this mean 1/3 the usual time or 1/100?
Comment: @EarlGrey My only conclusion is that there is something very wrong either with Publons or with those reviewers. There are people on that website that claim to write 3 reviews/day even on Sundays.
Comment: Note that the review process may be managed by artificial intelligence (AI).  In my areas, the review process is carried out by an AI that invites reviewers.  So it does not really matter.  If the editor is suspicious, then he/she can look up a reviewer.
Comment: @TerryLoring Philosophy. Probably 1/100, given that reviews always take months.
Comment: Have a look at the best reviewers, and on which topic, according to publons,
https://publons.com/wos-op/awards/2018/excellent/?order_by=place
and then draw your conlcusions ...
Comment: _Were my reviews too short?_ - How do your reviews compare with ones you've received?  Are they in line or very different?
Comment: @Prof.SantaClaus What? Who uses AI to assign reviewers?
Comment: Also, had you seem some of the papers before?  Sometimes I am asked to review a paper I just read.
Comment: Related: https://academia.stackexchange.com/q/149155/17254
Comment: @FedericoPoloni exactly, I have no other explanation either, so I let OP think about it themselves, I am not sure if we can apply the same metrics to reviews of, let's say Phys.Let.A and more specific journals publishing experimental tests of steel alloys.
Answer: In my experience, the unusual thing is not that you haven't been asked to review recently but that you had a batch of review requests all at once.
Most journals that I have worked with, as either editor or reviewer, prefer to use the same reviewer no more than 2-3 times per year, in order to maintain a diversity of perspectives and in order to avoid burning out reviewers.  If nothing happens across an editor's desk that makes them think of you, it could be years before a particular journal asks you to review again.
Referrals also play a role in being asked to review. Editors will often use at least one of the reviewers suggested by the authors. Also, if somebody declines a review due to being too busy, the editor will often ask the person declining for suggestions of alternate reviewers.
Thus, my guess is that you had an unusual coincidence of referrals early on, and that you've now reverted to a more normal rate of review requests. If you want to have more review requests, start spreading the word through your professional network, and people are likely to start pointing to you in their referrals.
Comment: @MassimoOrtolano I'm sure this is one of the areas where there's a lot of variation. I've certainly explicitly been told to rate-limit and been provided tools that say when the last time a person reviewed.
Comment: "prefer to use the same reviewer no more than 2-3 times per year". I have a different experience: I've found that typically journals tend to assign manuscripts to review until one starts rejecting.
Answer: I am not sure if you made the journals suspicions, but here is what I do when my reviews take extra-short or extra-long time.  I let the editor know what is going on.  For example, I just finished a long programing project and the referee task was a welcome change.   Or, this paper relates to an active project so I needed to read this right away for other reasons.  Or, in the other direction, I might say that I found part-way through the paper that I needed to review a math topic I had not worked on for a decade and the paper is fine. Even with this, communication does break down and editors end up mad at me.
I seriously doubt that any editor is going to be much concerned that one review came in fast.  This happens sometimes for valid reasons.  Just make it a habit of adding comments to the editor to let them know the context.  Editors are humans.
Answer: I can add a sample size of one from personal experience here:
In my field (somewhere between physics and applied mathematics), the actual workload of a peer review is at most one day of work while the average time for peer review is one month. The main reason reviews take so long is that reviewers need to find time for the review during their other duties (this applies to every field).
When I started reviewing (on my own), I was handing in most reviews within a few days. (The main reason for this was that my other duties were long and flexible, so a task quickly done was a welcome change and whether I did the review immediately or after two weeks would delay my other duties all the same.) I consider my reviews to be thorough and certainly not overly positive.
As a result, I became an "emergency reviewer" for one big publisher. They never officially told me, but I clearly got only sent review requests where the authors had been already waiting an overly long time, e.g., because one of the original reviewers failed to deliver or they needed an additional opinion. Mind that I did not get review requests at a high frequency, but those which I got were only "emergencies". Other journals continued to request me as a reviewer in a normal manner.

Were my reviews too short?

It's naturally hard to answer that. At least in my field and many others, reviewers are "trained" by starting to work on reviews collaboratively with an experienced reviewer (usually their supervisor). If you have undergone such a process, you should be aware what constitutes a good review in your field. If not, you might have committed mistakes that you don't even notice.

Or, might they have mistrusted my reviews because they were too quickly done?

Unless your review time was below the actual workload of a proper review, I doubt that. The usual hallmarks of bad reviews are being overly positive or negative or too superficial. I would expect that journals focus on these criteria, since bad reviews can also take a long time – many people have received useless two-sentence reviews after months of waiting. On the other hand, if a low-quality review coincides with a short delivery time, this should fuel any suspicions and bad impressions.
Answer:
Do journals avoid you as a reviewer if you are too fast?

No.

might they have mistrusted my reviews because they were too quickly done?

No.  Reviews are judged by the contents.

are editors letting me rest?

Some journals do have a policy of not asking for more than one review every x months.
Comment: Terry Loring says he would be suspicious, though.
Comment: Well, surely it depends on how fast.
Answer: My first instinct is that this is improbable. I can imagine one journal with such a policy but think it unlikely that four or five would, or would communicate on this.
You could consider asking the editors of those journals. They might be pleased to find another willing reviewer.


update gnome in centos 6.4

Question: my current version of gnome is : 2.28.2 and I want to update it to version 3.
is there a way to do that ?
I searched a lot about this problem , but all of the results is about installing gnome on a minimal centos .
Im using centos 6.4
Answer: There is no practical and reasonable way to do this. Wait for RHEL7 or
switch to Fedora if you want Gnome3.

update gnome in centos 6.4


How can I do incremental backups of my Lightroom library?

Question: I'm already backing my entire computer (Mac) up to an external drive using Time Machine but I have a fireproof hard drive that I put my most critical documents onto, as well as my photo library. The way I used to do it with Aperture was use the vault functionality which just backed up the changes to my library when ever I told it to. However, I can't seem to find a similar option in Lightroom which means that every time I backup I have to just delete the photo library off the hard drive and recopy the entire thing. This takes about 2 hours rather than the 2 minutes Aperture would take. Also, I can't use Time Machine because this drive doesn't have nearly enough space to backup my entire Mac, just the important stuff.
Comment: Have you considered using an off-site service instead? I've used Backblaze and have heard good things about Crash Plan. I'm sure there are others, but it might be worth a look. I would think (hope) their software does incremental backups when appropriate. I use Time Machine + offsite and have had good experiences with it. I recently had to get my spouse a new laptop and restore from a (Time Machine) backup, as the old computer just died and wouldn't reboot.
Comment: Is your fireproof harddrive also burglar proof?
Comment: @user1118321 I had but I already have this hard drive so I just figured why not use it
Comment: @pete when not in use it lives in a safe that is bolted with a 1.5" screw to the floor, so I'd say so!
Answer: Really this has nothing to do with Lightroom or Photography. The solution is the same regardless of which type of files you need to back incrementally: rsync
This a utility to synchronize file-systems by only copy differences. It can do quite a lot actually as there are dozens of options. I use it on Linux as part of my backup procedure. A simple command such as:
rsync -Sax /pictures /backup/pictures

Does the right thing most of the time for me. Check the documentation online from Apple to see what is the right command from you. In my workflow for images, nothing ever gets deleted or overritten. For cases where you delete files, you can add the --delete flag too.
Comment: I never knew that this was a command! I had actually been using cp but this is perfect. Thank you!
Answer: If you don't wanna use TM to back up to the fireproof drive, then consider other backup options. If you don't wanna use a command line tool like rsync, consider other backup software: there's Data Backup by Prosoft, Mac Backup Guru, and maybe even one of the cloning applications like SuperDuper or CarbonCopyCloner. They can make incremental backups or clones, probably using rsync under the hood. Or even  just drag and drop; IIRC the Finder will ask whether you want to replace all or just add. BTW, Data Backup can do versioned backups, as TM does, as well as clones and incremental copies.
Answer: It isn't clear from your query whether it is the Lightroom catalog or the photographs themselves that is the issue in regards to backups.
All your photographs should be under a single directory and can therefore be incrementally backed up using Time Machine, File History (for Windows) or using rsync as mentioned in a previous reply. This is setup independently of Lightroom - remember Lightroom does not store any of your photographs it just indexes them (and may import/copy them to your photos directory).
The Lightroom Catalog is essentially a single database file (there are some other cache files too but they don't need to be backed up). A backup of it is essentially a copy of the whole file - there is no incremental option and neither is it necessary since it isn't a very large file. You can specify catalog backup options in Lightroom and have those backups be on a different disk to your main working disk. I set mine to produce one backup per day (when I am using Lightroom).
If you are looking at offsite options for you photographs that would be a whole bigger question. Personally I don't consider any of the cloud options suitable or cheap enough yet for amateur use so backup to a portable HD which I store at work. If I was a professional then I would use one of the professional paid for cloud services.


Is there a hidden joke on the spacesuits in Austin Powers: The Spy Who Shagged Me?

Question: On Dr. Evil's spacesuits in Austin Powers: The Spy Who Shagged Me we can see a list of chemicals. The first two are obviously water and oxygen. But the final one, P^2 is not the notation for any chemical that I know of. "Pee squared" doesn't sound like something that I'd want in a spacesuit. Is it some sort of isotope? Or is it a joke or mistake?
Answer: Considering the rather lowbrow humour of the Austin Powers franchise, I'd say this is almost certainly a "pee" joke. As a matter of fact, real-life astronauts wear special diapers under their spacesuits, so they can go to the bathroom without soiling them or having to take them off.
As a side-note, P2 is the chemical formula for diphosphorus, but I doubt that's the reference here (note the subscript '2', as opposed to the superscript '2' on their suits).
Comment: I understood it to refer to Pee and Poo, or P-squared.
Comment: Since the lettering spells out "HOOP", I wonder if it might be an obscure reference into Hitchhiker's Guide to the Galaxy.
Comment: @CGCampbell perhaps also pee-pee or poo-poo, and the ambiguity works for extra gross-out value.


SQLite3 simple database design question

Question: I'm an ruby hobbist with no experience at all related to databases. I'm writing an application that is going to gather and backup tweets and blog posts (via rss feed) in an SQLite3 database.
The first version had support just for backing up a specfic user's tweets as I wanted to create a backup for my twitter account. So the SQLite3 schema was easy: 1 database, 1 table per user.
Now I want to add backup support for: Location based tweets (i.e. Tweets from Germany), username based tweets, and hashtag based tweets plus support rss feeds.
Since SQLite3 does not support any sort of sub-tables and I'd like to create a schema that will not need change as soon as I begin testing, I'd like to have opinions on how to approach this.
I've read a lot or articles online about SQL db design and found a couple of book also. Didn't purchase any yet, I'm just considering reading some basics about db design since I don't need an extensive book just an intro I'm evaluating. I'm not sure if these articles confused me more or not.
What I came up with a db schema is an INDEX table which user's info will be held and then a table per option per user, like:
➜  lib git:(dev) ✗ cat sqlite_scheme.txt
SQLite3 Table Scheme

MRParent
--------
db_key
table_id
twitter_id
twitter_option {what and how}
feed_url
short_description

MRChild-id-tweet-usr
---------
db_key
tweet_id {from MRParent}
table_id
tweet_date
tweet_location
tweet_text

MRChild-id-tweet-location
-------------------------
db_key
table_id {from MRParent}
tweet_id
tweet_date
tweet_location
tweet_text

MRChild-id-tweet-hashtag
------------------------
db_key
table_id {from MRParent}
tweet_hashtag
tweet_id
tweet_date
tweet_location
tweet_text

MRChild-id-rss
--------------
db_key
table_id {from MRParent}
post_author
post_date
post_title
post_text

So all tables will link to the INDEX table via table_id (which I've not deciced if it's gonna be a sort of hash or a combination of user's data, ideas here also welcomed).
Does this schema look 'rational' for an SQLite3 db or not? Any comments and/or questions are welcome.
Thanks for your time!
PA
Answer: After reading a lot around and receiving a hint about SQL data normalization I came with this schema. The rest will be handled by simple requests:

Table MRindex - All details about a entry will be listed here: key db | user_made_id | description | date | blob_picture | rss_feed | twitter_alias/keyword/hashtag |
Table MRtwitter - All twitter related data will be stored here: key db| index-at-table1| tw_option|tw_user | tw_date | tw_location | tw_name |tw_text
Table MRrss - All rss data will be stored here: key db | index-at-table1| rss_post_author | rss_post_date | rss_post_title | rss_post_text

Any comments & hints would be more than welcomed :-)
EDIT: To clarify a bit...
MRIndex (also referred as table1) holds basic data, filled by the user: Might be user tweets, hashtags or location based tweets. Once this entry is filled up
MRtwitter will hold the tweets and related info. The field index-at-table1 is the "link" to table MRindex.
MRrss it's the the same for blog posts. Same thing applies for 'index-at-table1'.
For MRindex:
description: short user description
date: date of creation
blob_picture: a picture if any (jpg, png, etc)
rss_feed: An RSS_feed URL belonging to this user
twitter_alias/keyword/hashtag: either @user, Greece (for location) or #hashtag
Comment: I'm afraid I don't quite understand what a 'specific entry' is.  At first glance those data stored there are unrelated.
Comment: Sorry, bad English. Not specific, just 'entry'. What do you mean by 'unrelated'? (I removed the word 'specific')
Comment: I mean that I can't see how do those thing belong together.  Maybe a bit of clarification on what description, date etc. is could help.
Comment: I added some clarifications above. I'm not sure I've answered your question though.

SQLite3 simple database design question


Is it possible to force network traffic through Wifi or the TMobile network?

Question: I'm wondering if, with the G1, it's possible to force the network traffic to pass through the Wifi or through the Cell GSM network.  I need to force an application to connect through the tower network to get some login information.  Is this possible?  Anyone have any ideas as to how this would be possible?  I'm trying to accomplish this inside an app with the Android SDK (Sorry I wasn't more clear about that originally)
Answer: It turns out to be possible using the WifiManager object to disable and then re-enable the connection.  You can block it for the duration of a network call if you want to force data over the cell network.  I imagine there is a similar GSM network manager out there which will do a similar task for the cell connection.
Answer: I'm assuming that you can simultaneously communicate via either channel, so at some level there aught to be separate network interfaces for each. Since android is based on linux, you could try using ifconfig or a library function to determine which interfaces are available, and which does what. If you can accomplish this, there should be a way to explicitly send/recv via the channel you want (i.e. by communicating via the ip for that interface).
Sorry I couldn't be more specific.
Comment: Sadly, I'm trying to do this through the SDK, which, I don't think, lets me manipulate the raw network interfaces
Answer: What you are looking for on the G1 is to set the default route. You may do so using the linux utility aptly named route, the default route is going to be to ip 0.0.0.0 and then the  gateway.
Not sure if you can do this per application, but you can do it system wide!


How to make a call to nft programs by '@solana/web3.js' and "@solana/spl-token"?

Question: I want to make a call to nft programs but i dont know how. I've been looking for the official documentations and other resources for a long time, but I couldn't find examples related it. Could you please let me know if you have any information on this? Thanks.
Here is the example contract: https://explorer.solana.com/tx/f5wgi5WZYARV2QB8GfcNMqc8YVgVt1SBLagYXFiPwDPVbosk77G32mMDzwxZfeRiEHEm665G725dxAojBDWrmV7
Answer: If you're interacting with NFT programs, you're likely looking at different deployments of the Metaplex suite of programs.  You can find more information on their GitHub: https://github.com/metaplex-foundation/metaplex


How do I open an obj file?

Question: I tried to open an .obj file using import but all I got was the workstation with the block. Yes, I'm a total beginner.
Comment: If you do your import and then look in the Outliner (topmost item in the rightmost column, by default, IIRC), what items do you see listed?  You should probably see a scene, renderlayers, world, camera, cube, and lamp -- if you see another entry then it's possible your OBJ imported correctly but isn't visible (e.g. it's really far away, very tiny, etc)
Comment: @AC pretty sure you can post this as an answer as it happens a lot because of the scale difference between the source and blender's workspace
Answer: Only <code>.blend</code> files can be opened by Blender. Other file formats can be only imported.
Obj Import
Go to File ‣ Import ‣ Wavefront (.obj) and choose the file.
Remember to save the Blender file as a .blend file. If you wish to export the obj file go to the menu item File ‣ Export ‣ Wavefront (.obj).
Answer: File > Import , select the file you want to import but don't click Ok
On the right menu, before you import there is a list of options, choose a number , don't leave it at 0.0.,m then clik Ok. A black square will show click  Enter.

How do I open an obj file?


How do users create these dense-keyword prompts for leonardo.ai?

Question: I recently used leonardo.ai (freemium) for the first time.  I tried it out with my own prompts; some looked okay, but others not so much, and then I ran out of my daily tokens.  I then browsed some lovely images, like the following (click to enlarge):

This is so much better than anything I came up with.  I noticed the prompt for this image is ultra specific:

Prompt details:

(((best quality))),(((ultra detailed))),(((masterpiece))),illustration, Woman, lively, energetic, cheerful, radiant smile, captivating, youthful, graceful, slender maiden, tall and upright, charming, fresh and unique, fashionable, colorful, short hair, jeans, canvas shoes, letter prints, chain bags, bohemian, street, city, sunlight, inspiration, vitality, hope, sunny and soft, refreshing, Van Gogh

Negative Prompt:

EasyNegative disfigured, bad anatomy, futa, sketches, paintings, multiple nipples, (worst quality:2), (low quality:2), (normal quality:2), low res, normal quality, ((monochrome)), ((grayscale)), dark and unclear, unclear objects, bad weather, blurry, bad contrast, poor lighting, unnatural colors, unnatural shadows, unnatural reflections, overexposed, underexposed, noisy, bad composition, poor framing, empty, uninteresting, chaotic, litter, unnatural facial features, unnatural body features, unnatural attire, unrealistic beauty standards, unnatural post-processing, excessive makeup, unrealistic retouching, unnatural pose.

It doesn't use human language, but rather a dense list of keywords along with brackets.
Question: How do users create these dense-keyword prompts for leonardo.ai?
I could imagine someone asking ChatGPT or something to write them, or I could imagine a lot of trial and error.  Or maybe they just copy each another.
Comment: I don't know how leonardo is set up, but be careful since most of the time those "prompt sharing" site forget one small, innocent thing.... That the OP used a Lora file...
Answer: I have no experience with leonardo.ai, but have experience with MidJourney.
Try using a "prompt crafter" or "prompt builder", which itself is a ChatGPT prompt to help you write image prompts. Eg

https://word.studio/tool/midjourney-prompt-builder/