Sublime Text 3 - Sidebar Font Face Change

Question: Is it possible to change font_face property in Sublime Text 3? I tried changing in predawn.sublime-theme theme file, section with "class": sidebar_label without success. I know this worked in version 2, it that changed somehow?
Comment: You actually got it working in Sublime Text 2? Do you remember exactly how you did it? Because I'm just trying to, and it just blanks out all the labels... http://stackoverflow.com/questions/24337160/how-do-you-change-the-font-face-sublime-uses-for-the-sidebar
Answer: You almost got it. In "class": sidebar_label just add a comma after the last entry and on the next line put the following:
"font.face": "Comic Sans"

(or whatever font you want). If the size is off, just add a comma and another line:
"font.size": 10

(or whatever size works).
Comment: Thanks. Where I was wrong is, that I tried with `font_face` instead of `font.face` ;)
Answer: There is several "class": sidebar_label. First of all, set font.face and fon.size together or it craches! It's better to set it in the first of all "class": sidebar_label.
Example:
      // Bullet Tree Indicator

{
  "class": "tree_row",
  "settings": ["material_theme_bullet_tree_indicator"],
  "attributes": ["selected"],
  "layer1.texture": "Material Theme/assets/commons/tree_highlight--bullet.png",
  "layer1.inner_margin": [22, 16, 0, 0]
},

{
  "class": "sidebar_label",
  "color": [96, 125, 139],
  "font.bold": false,
  "font.italic": false,
  "font.face": "Fira Code Retina",
  "font.size": 8,
  "shadow_color": [255, 255, 255, 0],
  "shadow_offset": [0, 0]
},
...


jQuery UI Datepicker and bassistance.de validation plugin problem

Question: I have the jQuery UI Datepicker and the bassistance.de validation plugin working except for one problem.  When a date is selected with the date picker, it causes a validation error even though the date is correct.  I have tried it on different sites and I get the same problem.  It doesn't cause a validation error when you click submit.
Answer: I think I found the answer. The problem is that the jQuery validation plugin is validating on the click, keyup, or onfocusout event. Not sure which one. I just disable these so it would only do it on submit which looks cleaner for my implementation anyway.
These are the values I set to false:
onfocusout: false,
onkeyup: false,
onclick: false
Comment: alternatively, add this to the datepicker:   , onSelect: function(dateText, inst) {
  $(this).focus();
 }
Answer: I had this problem when I used the datepicker with default settings.
When I stepped through, it looked like the issue is validation gets called when you select a new date on the picker, but gets passed the existing value, not the one you've just selected.
After the picker closes, you're no longer in the input, so the validation doesn't fire again, meaning it never gets called with the correct value.
Using a button and the fix at JQuery UI Datepicker loses focus when selecting date with mouse I was able to get the two playing nicely together.  That is, after selecting a new date, the focus is still on the date input, and tabbing/clicking out causes validation to fire correctly.


What is the abbreviation for 'who are'

Question: My school homework asks for abbreviated versions of words, one of which is 'Who are' can this be abbreviated to 'Who're or would it be 'Whom'? Jessica, aged 8
Comment: *Whom* is not an abbreviation of *who* under any circumstances ever.
Comment: Most writers don't use this particular orthography for the "contracted" form. It's tedious wading through text that pointlessly tries to replicate every aspect of any given utterance in this way. It should be enough to *occasionally* include a few of those contractions that are more commonly reflected in the orthographic form, and leave it to the reader to assume this extends to other words uttered by the same speaker. Note that nobody ever says ***Whom are you?*** anyway (but a few fuddy-duddies still use that form in "object, not subject" contexts like *Whom are you calling?*).
Comment: Hello, Jessica. I know we're all still learning English (and if we're silly enough to think we're almost there, it goes and changes), but our sister site, ELL, is perhaps more suitable for those who're as far from the fuddy-duddy stage as you are. // Deciphering FumbleFingers' comments, _who're_ is the only contraction used for _who are_, and is often heard in conversation as it's informal, but is correspondingly seldom seen in print (except to faithfully record conversation).
Comment: @RegDwigнt: Riffing off *What are you like!* in the sense of *You're outrageous!*, how about ***Who'm I like!***
Answer: For some explanatory context, a possible reason "who're" isn't often written is because it looks a lot like "whore" (especially in condensed type) a word considered offensive by most, and at the least, distracting from the intended meaning.
Comment: Answers are expected to stand by themselves, therefore you should include a full answer of what the accepted abbreviation is and how it's used before saying why it isn't common in print.
Answer: The answer is "who're". Contractions have an apostrophe: '
Loosely, "whom" is the the object form of "who".
The subject of a sentence is the one doing the verb. The direct object of a sentence is the thing the verb is being done to.
"Bob ate food." Bob is the subject. Food is the object.
I love whom? (We use whom because it is the object of the sentence, the one being loved)
Who loves me? (We use who because it is the subject of the sentence, the one doing the loving)
Thank you for the question, Good luck!

What is the abbreviation for 'who are'


Import Data... Loading 99% fail. Help

Question: I have problems when importing data. What can I do to fix it ? 99% loading.... fail :(
Answer: Add below line at beginning of sql file

SET foreign_key_checks = 0;

and

SET foreign_key_checks = 1;

at the end of sql file and try to import again.
read more here MySQL – Disable Foreign Key Checks or Constraints

Import Data... Loading 99% fail. Help


Netboot PXE and usage extremly slow

Question: I tried to use the netboot feature of the RPi3 and booted via network. Therefore I used dnsmasq of pihole, tftpd-hpa and NFS on another Rpi3. I want to use the RPi headless. The Boot takes up to 30minutes and the ssh logon took more than 5 minutes. I checked the average loads and they had values greater than 10 but the cpu-usage is lower than 20%. The original image is much faster and there is no lack. How to analyze the problem better? I can't imagine that's normal.
Answer: What model exactly do you use from the RPi3 family? Only model 3B+ is optimized for PXE boot. It may be possible also for model 3A+ because it is a stripped down 3B+ but I don't know. So if you use model 3B it may be one reason for your problems.
Then with dnsmasq, pihole, tftpd-hpa and NFS there are some sophisticated applications that must be made to play together. In particular pihole and tftpd-hpa are not needed and complicate things unnecessary. A tftp server is already provided by dnsmasq.
How to setup a proper booting PXE only with dnsmasq and nfs-kernel-server you can find at Netbooting multiple "workers" RPi from a "master" RPi. You may give it at try.
Answer: I've not done PXE boot with an RPi, but with x86 PXE, it is definitely slower than an RPi.
You didn't mention...Is the RPi WiFi or hardwired?
Comment: PXE boot can only be used on wired connections.
Comment: Doh...I know that. Not sure why I thought it was an important (albeit stupid) question to ask at the time.

Netboot PXE and usage extremly slow


UDP broadcast packets across subnets

Question: Is it possible to send a UDP broadcast packet to a different subnet through a router? I'm writing an app to discover certain devices on the network, and the PC might be on a different subnet than the devices it's looking for.
Answer: Yes, and no.
It's actually do-able, so long as the intervening routers don't have no ip directed-broadcasts or similar configured.  However these days that's the default because allowing normal broadcasts to traverse routers is a DoS problem.
If you really want to broadcast across subnets then you should be using IP Multicast instead.  That still requires that the intervening routers are configured appropriately, but it is the "right" way to do it.
Comment: How could you broadcast, what would then be the broadcast IP to reach all the subnets?
Answer: Short answer:
No.
Long answer:
Maybe. DHCP works this way, but the routers are configured to let the UDP broadcast on the DHCP port through. If you had complete control of the network hardware you could open up any/all UDP ports to allow broadcast across subnets. Without control over the configuration of the routers, see the short answer.
Answer: Greetings Jon,
Cisco routers usually contain a UDP IP Helper address mode that you can use to cross the subnet.

UDP broadcast packets across subnets


How to include large school projects in CV for Freshers

Question: I am a fresh graduate of Software Engineering and I need help on creating a good CV for freshers. As I have no work experience, I want to include some of our large academic software projects which I contributed in. I need help on what are some good formats of listing them. Should it include project name(of course), my role, duration, and technologies/skills used in the project,etc? Thanks!
Comment: possible duplicate of [As a student, how should programming language familiarity be described on a CV/Resume](http://workplace.stackexchange.com/questions/1209/as-a-student-how-should-programming-language-familiarity-be-described-on-a-cv-r)
Comment: I don't agree this is a duplicate to the question linked, because this question is about representing student project work in lieu of work experience, and not just about listing skills learned during those projects.
Comment: Sorry, but I am asking of school projects like:
Projects Detail
1 - Library Information System [National Library, NY,USA ]
Duration: Mar 2005 - Jun 2005
Team Size: 3
Role Played: Developer and Tester
Skills Used: Pro*C, Red Hat Linux, MySQL
Comment: Other than indicating it is a school project, how is it formatted any different than a work project you list on your CV?
Answer: I'm speaking here as both a hiring manager and as someone who has taught university courses in employment portfolio creation for new graduates.  Yes, including university projects in lieu of professional work experience is a very good thing to do, as is being as complete as possible without being too verbose.
You have several options for displaying that information -- just remember the ultimate goal should be to make it as clear to understand as possible for the reviewer.  The person reviewing your resume for entry-level or junior positions should already be oriented toward reading about student or non-traditional work experience, so none of the following options (or one you make up on your own) should come as any great shock to them.
Instead of a "Work Experience" section of your CV, you can just use a "Student Project Experience" section, or something similarly titled.  The information you list in your question is very good information to include.  You can format it something like this:

Team Member, Project X (Advanced Widgetmaking course, Spring 2013)

Brief description of project

Brief description of your specific work on the project

Technologies used: list goes here

Or, you could combine all the technologies/skills used under a single "Skills" heading, and list as you would on a traditional resume.
Similarly, you could instead highlight the advanced/elective/special/interesting coursework you took (all the good stuff beyond intro courses), and list the projects under each course listing.
Personally, I've always preferred the first option I gave, because it looks most like what your traditional work experience will look like once you have it.  And, once you have that professional experience, the project experience should start to be deemphasized on your resume -- but don't feel like you need to do that immediately, especially if your course projects were comprehensive and applicable to your career.
Answer: I usually put everything up on GitHub and have a link to my profile on my Resume.
Also, you could use LinkedIn to do the same, where you explain the projects you worked on and they role that you had in the group!
Hope that helps!


php.ini locked as read only even for root

Question: I will give some background first. I have several websites that I am running on Ubuntu 20.04 Server. I also have another computer running Kali Linux. When I used OWASP ZAP from the Kali Linux computer to check all of my websites, it gave me some flags for the sites:
Cookie No HttpOnly Flag
Cookie Without Samesite Attribute
X-Content-Type-Options Header Missing
So, I wanted to edit my php.ini file and change the following (will deal with headers later):
session.cookie_httponly = 1
session.cookie_samesite = Lax
When I try to edit my php.ini file, I get the message that the php.ini file is read only; even when trying to edit as root.
Here is what I have done and found.
I am running:
Ubuntu 20.04 Server
Apache 2.4
php 7.4
Everything is updated/upgraded.
I tried:
sudo vi /etc/php/7.4/apache2/php.ini and got a warning saying that php.ini was read only.
Also tried sudo nano /etc/php/7.4/apache2/php.ini and got same warning
ls -l php.ini produces -rw-r--r-- 1 root root 73053
I then switched to root using su root and ran vi /etc/php/7.4/apache2/php.ini still gives warning of read only.
Running as root, I then tried chmod 655 /etc/php/7.4/apache2/php.ini and it gave me the: chmod: changing permissions of '/etc/php/7.4/apache2/php.ini': Operation not permitted
I tried cd /etc/php/7.4/apache2 and then ls command. This produced:
conf.d  php.ini  php.ini~  php.iny~  php.inz~
I tried editing php.ini~ file and was able to edit it.
Used systemctl restart apache2 which successfully restarted apache
Ran OWASP ZAP again; still same flags.
I then ran the following command:
php -i | grep 'Configuration File' this produced:
Configuration File (php.ini) Path => /etc/php/7.4/cli
Loaded Configuration File => /etc/php/7.4/cli/php.ini
I then edited this file: vi /etc/php/7.4/cli/php.ini
I was able to edit this file and then restart apache.
After running OWASP ZAP again, I still get the warnings.
I was wondering if someone had an idea of what I am missing. Maybe all my /etc files are read only?
Thanks
Answer: OK, I just figured it out. I ran the command lsattr php.ini and it came up with: ----i---------e----- php.ini
I then used the command: chattr -i php.ini
Running lsattr php.ini again: --------------e----- php.ini
I can now edit /etc/php/7.4/apache2/php.ini


Cheapest (and hopefully fastest) option for family to transfer from CDG to ORY

Question: My husband and two young daughters (6 & 3) are needing to get to ORY from CGD for a connecting flight that leaves 6 hours after we land.  I have ready about Air France Bus, which sounds the most stress free but for 84 EU sounds expensive.  Are there any recommendations for cheaper but just as stress free options that might (by some miracle) cost less?
Comment: This sounds dangerously close to a shopping question to me http://blog.stackoverflow.com/2010/11/qa-is-hard-lets-go-shopping/. Might it not be better to edit it into a general "options for travel from A to B" question?
Comment: Have you considered [Uber](https://www.uber.com/cities/paris)? They advertize 20 eur + 30 eur from ORLY to city center and then to CDG which is way below the air france bus and the taxi option. You might want to give them a call. (Disclaimer, I've never used Uber before nor am I affiliated with them, I just read about them and this sounds like an interesting option).
Comment: @pnuts as I said, I have no prior experience with them. It quoted 50 euros which I consider way below the 90 euros a taxi would cost for the comparable 'private, from one place directly to another' ride. Even if it's 60, it's still a 30 euro save.
Comment: @StephenKennedy On the contrary, the answer to "options from A to B" would be the right page on http://adp.fr/ whereas an answer to a specific situation (X hours, children) is a specific question that we can answer with specific expertise.
Answer: By public transport, the most stress-free by far is the direct Air France bus.
It's a little cheaper and still not too stressful to take the RER B line across Paris and to Antony where you change for the Orlyval shuttle. Buy combined tickets at CDG. The ticket price is 54.20€ (children under 4 travel free). There is good signage all the way. Most trains from CDG stop at Antony but check the screens at the station to confirm. If there's a strike or other traffic disruptions on RER B, take the Air France bus.
You can also take RER B to the Denfert-Rochereau stop in Paris and change there for the Orlybus bus service. At CDG, buy tickets for Paris, and then buy Orlybus tickets at the bus stop. The transfer is fairly painless even with luggage. The total fare is €48.85 — this option is cheaper for adults but not so much for children because as far as I can tell Orlybus has no reduced fare (I think children under 4 do travel free however). The only advantage of this option is that you get to spend a few minutes in Paris (Denfert is a nice spot to have a croissant in a café), but this is probably not convenient with children.
I think you can get all the way through Paris for €5.10 per person by a combination of local buses and the metro (there may even be a €3.40 option), but that's not something I'd do with luggage let alone children.
Answer: Public transport options could be a bit cheaper but might not qualify as "stress free" for you. You would need some combination of RER and buses with at least one connection in the center of Paris. Six hours is plenty of time so there is no need to be really worried but I can imagine that it could be quite stressful to find your way through an unknown city with bags and kids. Unfortunately, you still need to buy four tickets so you would not save that much money compared to the Air France bus.
Taxi might actually be a good option for you. For an individual, it's more expensive but because you must effectively multiply the price of other options by four, it would still be competitive for a family. I am not sure of the exact price, however. There are some private shuttle services too (main difference is that you have to book them in advance and they can't wait at the taxi stand) but they do not seem cheaper.
Air France cars, taxi and private shuttles should all take about the same time and are very dependent on traffic but with 6 hours between the flights I would not worry.
See also Transfers between Paris and its airports and Transfer from Paris CDG to ORY.
Answer: i would highly recommend the use of public transportations. it's cheap and fast. Use the RER and ORLYVAL. Be only carefull of strikes, so if is anounced, plan to use taxi. It is expensive and highly depends on traffic conditions. (rush hours, accidents...). From CDG to ORY, a smart driver won't get stucked but it will cost you high $$$.
hope it help
André (from France)


Photo backup and management

Question: I have run out of space on my 16gb iPad . Over 7.2 go are my photos and video. Is it possible to separate my photos and keep most on iCloud or iTunes, accessing only when I wish to review them.  How can I do so if possible.  I need to free up space. Also, any quick way to delete duplicate photos or files?
Answer: Mac or PC? It makes a difference.
Recently on the PC my wife was having a similar problem. The phone will sync everything in the pictures folder. So I created a sub folder called iPhone and set the sync in iTunes to only sync with that folder and not the whole pictures folder. Now she just has to move the pics she wants on the phone to that folder.
On the Mac (going from memory here, so...) you can actually select which iPhoto albums you sync with the iPad. So instead of all photos/videos select only the albums you want/need on the iPad itself.
Make sense?

Photo backup and management


Does intensity increase if we increase energy of photons?

Question: I've been told that the definition of intensity of any radiation is 'the energy crossing unit area in unit time.'
So, I understand that if we increase the number of photons passing through an area by keeping their energy constant, the intensity increases.
But, my doubt is let's say if we kept the number of photons passing through a fixed area constant and increased their energy (by increasing frequency), will the intensity increase?
I think it should increase according to the definition. But in books, it says it doesn't increase.
What's the correct explanation for this?
Answer: Intensity is the total amount of energy falling (or going through) per unit area per unit time i.e, $\frac{J}{m^2.s}$.
For monochromatic radiation,
$Total\space energy = Number\space of\space photons\space \times Energy\space  of\space  one\space \space photon$
and $E_{photon}=h\nu$
$Intensity = \frac{Number\space of\space photons\space \times Energy\space  of\space  one\space \space  photon}{At}$
$I=\frac{nh\nu}{At}$ $\tag{1}$
For constant area and time,
$I \propto n.\nu$
This is a very important result. You can increase the intensity of the radiation by either increasing the number of photons in it or increasing energy of each photon, or both.
As for option (C), if you increase energy of each photon but  decrease the number of photons emitted by the source per unit time by the same factor then the intensity will remain the same as before. For instance, if the number of photons emitted by the source per unit time is halved, doubling the intensity will give you the same intensity as before.
This is evident from equation (1). Therefore, option (C) is not necessarily correct but (A) and (B) are.
Answer: There are many ways of defining the intensity of light, but if you are just measuring the energy per unit time per unit area then yes increasing the frequency while keeping the number of photons constant will increase the intensity. If your book says otherwise you need to provide us with a link to the book so we can check it, or maybe post a photo of the relevant part of the book.
Comment: Can you explain the (C) option? I'm thinking that if more energetic photons are emitted then the intensity of light should increase. BTW the answer is only (A)&(B)
Comment: @user157725: the question asks what happens if the intensity of the light source is increased. While it isn't explicitly stated, this implies that every else remains unchanged i.e. the frequency doesn't change. In that case the photon energy cannot change.
Comment: Surely the only one that's always true is (B); whether (A) and (C) are true depends on how the increase in intensity was achieved (frequency and/or number of photons). And (D) is always false.
Answer: Perhaps it is not mentioned in books that with increase in frequency of radiation intensity does not increase. In fact increasing frequency of radiation means we have taken a source of radiation of higher power and with increase in power of the source, intensity of radiation will increase. I think that you have a confusion that with increase in frequency and keeping the number of photons srtiking a given area of the surface, photoelectric current with increase or not. It will not increase because during Photoelectric effect photons o suffer one-to-one perfect inelastic collision with electrons. So one Photon can eject only one electron in spite of its large energy content and hence photo electric current will not increase.


Decidability of differential equations

Question: Is there anything well-known about the algorithmic decidability of the satisfiability of an ODE $\dot{x}=f(x)$, $x: [0,1]\to R^n$ with an initial condition $x(0)=x_0$, given that $f(x)$ belongs to some specified class of functions -- for example, component-wise polynomial?
Comment: The Theorem you mention only gives local solution (on some neighborhood). My question is about the existence of a global solution, on [0,1] (or, (0, infty)..)
Comment: Please define "satisfiabiity".
Comment: Existence of a $C^1$ solution.
Comment: I think the standard Picard existance theorem would answer the question as posed, and it only requires that $f(x)$ be Lipschitz. But then it's not clear to me what the "decidability" and "differential-algebra" tags have to do with the question.
Answer: If $f$ is a polynomial, then $C^1$ solution is the same as analytic solution.
For analytic solutions, very similar questions are considered in the paper
MR1011182
Denef, J., Lipshitz, L.
Decision problems for differential equations.
J. Symbolic Logic 54 (1989), no. 3, 941–950,
which also contains a survey of earlier results.
I suppose that one can conclude from this paper, and the results cited in it, that the question is undecidable. They also mention some cases when it is decidable.
Comment: If you are in a US university, and your library does not have it, use ILL service (interlibrary loan). If you are in other country, ask your librarian.
Comment: If none of the above helps, write to the authors, and request a copy.
Comment: Do you maybe know where I can find the paper you are referring at? Do you maybe have a link? Or can you send it to me?
Answer: In the the paper Boundedness of the Domain of Definition is Undecidable for Polynomial ODEs by Daniel S. Graça et al. (preprint version) they prove the undecidability of deciding the boundedness of the maximal domain of solution of a polynomial ODE.

Decidability of differential equations


Are brute-force attacks made more difficult by removing the LUKS header?

Question: If the LUKS header is removed from the LUKS partition, will this make the brute-force attack much more difficult? Can software tell which type of partition is it?
Answer: If we look at a sample Luks header ( The tables taken from here )

Luks Partition Header (PHDR) consists of the necessary information to decrypt/encrypt the luks device as followings,

<code>-------------------------------+-----------------------------
|   Partition Header Contents  |      Output by luksDump    |
-------------------------------+-----------------------------
|  Magic Byte                  | LUKS                       |
-------------------------------+-----------------------------
| Luks version                 | 1                          |
-------------------------------+-----------------------------
| Cipher Name                  | serpent                    |
-------------------------------+-----------------------------
| Cipher Mode                  | xts-plain64                |
-------------------------------+-----------------------------
| Hash Type                    | whirpool                   |
-------------------------------+-----------------------------
| Payload offset               | 4096                       |
-------------------------------+-----------------------------
| Master Key Bits              | 512                        |
-------------------------------+-----------------------------
| Master Key Digest            | 8a 90 77 7e ...            |
-------------------------------+-----------------------------
| Master Key Salt              | ca f3 40 fc ...            |
-------------------------------+-----------------------------
| Master Key Digest Iteration  | 23250                      |
-------------------------------+-----------------------------
| Partition UUID               | 46927c7d-7f17-4312-...     |
-------------------------------+-----------------------------
                          Table - 1
</code>
<code>
2. 2nd portion of partition header (PHDR) consists of 8 key-slot descriptors i.e information about key-slot as following,
</code>
<code>------------------------------+------------------------------
| Key Descriptors             |      Output by luksDump     |
+-----------------------------+------------------------------
| Activation status           | Enabled                     |
+-----------------------------+------------------------------
| Iteration                   | 146285                      |
+-----------------------------+------------------------------
| Salt                        | 1e c1 94 24 36 4c 98..      |
+-----------------------------+------------------------------
| Key Material Offset         | 8                           |
+-----------------------------+------------------------------
| AF Stripes                  | 4000                        |
------------------------------+------------------------------
                         Table - 2
</code>

will this make the bruteforce crack much more difficult?

One will see that an attacker will lose a lot of information about the header like cipher name, cipher mode, iteration, hash, key slots, etc.
The easy attack on the LUKS is brute-forcing the password (hashcat can do this) if the password is weak. When the LUKS header is lost, the attacker cannot test the password anymore; the user passwords decrypt the related key slot to release the Master Key (MK). If there is no data to decrypt, it is a random process that is not better than brute0force.
The rest is brute-forcing the MK. For 128-bit encryption algorithms, except for a foreseeable Cryptographic Quantum Computer (CQC), it is infeasible. When one uses a cipher with a 256-bit key it is safe from all targets including CQC.

Can softwares tell which type of the partition is?

No!
And, make sure that you removed the header without leaving a trace, i.e. secure erase.
Comment: Note that this particular header indicates a 256-bit cipher in XTS mode, which means the effective security is actually 384 bits (not 512, but that's due to a meet-in-the-middle attack).
Comment: So I guess if the attacker gets the LUKS disk without LUKS header, he/she/they have to guess to rebuild the LUKS header first, but it is hard to test every try, and every try leads so many tries... Is it also work for quantum computer in the future? They say quantum computer crack the algorithm and encryption.
Comment: @kytebucks000 Rebuilding is not really possible since there is no encrypted MK anymore. As I said, quantum attacks really depend on the key size though even 128-bit is arguable since it is not clear how one can run the sequential calls of Grover's machine..
Comment: brilliant answers!
Comment: @kytebucks000 well, in SO network, upvote (10Pts)is used to show that ( you need 15 points for this and  If you edit a post, you will get +2 points) and accepting the answer (15pts to the answerer and 20pts to you) is performed by clicking the checkmark. This indicates the other that the problem is solved. Have fun.


Is there any console command that grants invincibility on a target?

Question: I want to practice a combo skill on a hero. Is there any cheat that makes the target immortal? I just want to be able to cast my skills on him, then refresh; over and over until I can do it properly.
Comment: Isn't there a way to create a custom game with bots and you being the sole human? I know it's possible with LoL and if possible with Dota 2, would give you plenty of time to practice.
Comment: @JonathanDrapeau Yes, but I think the problem here is that the bots eventually die.  I think melvnberd wants an immortal enemy to practice on.
Comment: @JohntheGreen There's still plenty of minions coming out, waves after waves, giving him lot of targets to practice on. I understand what he wants but I'm pretty sure the best solution is a custom game. I don't see how, without having your own server to change the settings, you'll get a immortal target.
Comment: @JonathanDrapeau Yes, there are targets, but moving ones that tend to die on their own.  His is actually a fairly common request, and there is a commonly used workaround.  You aren't wrong, though: the best solution *is* a custom game. One with cheats that lets him spawn in enemy heroes to practice on.
Comment: I must say the new title is a lot better.
Answer: It would appear not.
What I see most people do is spawn in an enemy Centaur Warrunner and give him 6 Hearts of Tarrasque, which should let you practice your combo a few times at least, and give him tons of regen.
In theory, that should be possible with this:
-createhero centaur
-givebots item_heart
-givebots item_heart
-givebots item_heart
-givebots item_heart
-givebots item_heart
-givebots item_heart

Optionally you can throw in -lvlbots 25 to level your centaur up to 25 for that awesome strength gain.

You may or may not have to add enemy after centaur, depending on which side you are.  It seems to be tied directly to radiant/dire rather than which side is actually your enemy.
Comment: I see its impossible to have a non-moving target though.. but thank you @john the Green for giving me an alternative to work on..
Comment: @melvnberd The enemy centaur this should create for you to practice with should be very much non-moving.
Answer: You can spawn an Abbadon and use the wtf mode. This means his ultimate does not have a cooldown, which makes him nearly invincible. Except if you deal over 400 damage in one instance you are able to nuke him down to zero without activating his ult.
But this have a downside: his ultimate removes any negative buff. If you need a specific negative buff (ethereral blade, orchid, hex) for your combo, you have to stay with the tanky centaur.
Comment: Clever solution, though bear in mind this means you'd have wtf mode on your hero too, which I don't think should usually matter, but it might :)


Can letting players take resources from others prevent inflation despite the lack of money sinks?

Question: For a long time I've been idly thinking about a competitive game with strong collection elements with such a rule that players will win or lose resources at the expense of each other during each match.
Sorry if this seems unclear; let me provide a concrete example: Chess with an ecosystem.
Each player starts with a standard set of a king, a queen, two bishops, two knights, two rooks, eight pawns. Each time, during a match, a figure or pawn is captured, it permanently goes to the player who captured it (promoted pawns count as pawns for this purpose, not as whatever they were promoted to). This is the only way players can earn pieces¹.
The game is divided into several leagues: each league restricts the total value of pieces both players may start with. As long as each player only uses pieces they own and their value doesn't exceed their league's maximum, they can start with any pieces they desire. Thus each player who's just founded their account will start at a mediocore league that enforces the total value of pieces of up to 43 (8 pawns * 1 + 2 bishops * 3 + 2 knights * 3 + 2 rooks * 5 + 1 queen * 9 + one king * 4 = 8 + 6 + 6 + 10 + 9 + 4 = 43); if they lose pieces they will lose access to the starting league and be demoted to lower leagues, down to the lowest league that only accepts the total value of pieces of 5 (meaning that, aside from the mandatory king, it only allows one pawn); if they earn pieces they are promoted to higher leagues that allow them to start with more total material. (Players may also play lower leagues than their league if they wish, but not higer). If they lose so much pieces they cannot even play at the lowest league, they lose permanently and have to start with a fresh account.
Now from this follows that since there are no sinks and the total material of the game will only be increasing with people founding more and more accounts. From this we can expect that as more and more players lose permanently, we will have more and more players having hundreds and thousands of pieces, so inflation happens.
But if, regardless of their league, players are always matchmade according to their elo and if there are so many players that the matchmaking works and is unpredictable (granted, big 'if's...), their winrates should sit at 50%! Thus their earn/lose balance should be around zero. Pieces have a fixed cost: Getting them requires winning against an opponent of equal skill.
Ugh... Looking at the problem from these two different perspectives yields conflicting results. What am I missing? Would inflation happen in such a game?
Note this chess example is really only an example: I only provided it because it is the only concrete example I could muster. However, we can easily think about a collectible card game with a system similar to this, and I suppose such a TCG example would be even better here.
¹ Well, almost. If a player loses a king and have no more kings they must buy another king. To this end they must sell other pieces: pawns for one gold piece each, knights and bishops: three pieces each, rooks for 5 gold pieces each, queens for 9 gold pieces each; this in-game currency goes to the 'king fund' that will be used to buy kings from the in-game shop, 4 gold pieces for each king. No other pieces can be purchased for gold gained in such a way.
Comment: If you can make a new account at any time in order to get back up to the basic collection, why not make a new account as soon as you've lost more than you've won, instead of waiting until you've lost everything?
Answer: The average winrate between a player who loses all their pieces and one who gains all those pieces is 50%, but the player who loses all their pieces then goes on to make a new account, so now amongst those two people there are three complete sets of pieces, and you have inflation.
As for the middle and high-rank players accumulating more pieces over time despite not getting any better in rank: Imagine a ladder of people who are each just a tiny bit better than the one before them, close enough that they get matched against the adjacent players: on average, each player will collect pieces from the slightly worse player, and give pieces to the slightly better player, so over (a probably pretty long) time pieces will go up the chain, from the bottom where new pieces are generated, to the top where the greatest players are.
Answer: This will cause inflation.
Having the total material increase with people creating more and more accounts is a sound argument.
The argument that win rates should be around 50% and thus the pieces will remain constant is flawed:
For the average win rate: Initially, how many pieces a player has corresponds to their win rate. Players who lost all their pieces would have a win rate of less than 50%. When you give a player pieces to "reset" them, you're increasing how many pieces they have, but you're not increasing their win rate, so the number of pieces no longer corresponds to the win rate. Thus the win rate can remain 50% while the total number of pieces increases.
Alternatively, if you consider these to be new accounts, you're removing accounts with a sub-50% win rate and replacing them with new accounts. This would increase the average win rate and thus also the total number of pieces.
For the individual win rate: every player will not have a win rate of 50%, even in a perfectly balanced skill-based game. The best players can consistently win, since there's no-one who can beat them. The worst players can consistently lose. If these players are put back in the middle, they will likely drop again and other players at the same ranking will win more often. The ranking of those players will increase, which will pit them against stronger players, who will beat them, which will decrease the ranking of the weaker player back to where it was and increase the ranking of the stronger player. This effect will keep going (albeit slowly) until it gets to the top players, who have no stronger players to play against, thus their win rate and ranking will simply increase.
Players quitting can also cause inflation
The above only exactly applies to a closed system (one where no players are added or removed) or when players are added and removed randomly.
If players at the top no longer feel challenged or like there isn't anything more to achieve, they may stop playing. This could cause negative inflation to counteract the inflation discussed above, but frequently having your best players quit is usually a pretty bad sign.
Players at any level may simply get bored with the mechanics of the game. For arguments sake, one might assume this happens at every level with equal likelihood (although this may happen more frequently at lower ranking, since these players may miss some of the nuances and complexity making the game more fun for higher ranking players).
Other players may quit out of frustration. This would almost certainly happen much more frequently with players losing too often, especially ones who has mostly been losing since they started. These players would likely have a sub-50% win rate and thus them quitting would increase the average number of pieces per player, which is inflation.
What to do instead
Having ranking tied so directly to strength (through number of pieces) will always be a problem.
If you want to do something like this, you could:
Limit the number of pieces per player
There are two ways this could be done:

Limit on the number of pieces each player can have.
This may cause a whole lot of players eventually reaching the maximum instead of fewer players having more and more pieces, which is still not great, but may be preferable.

Have players pick a subset of pieces to play with (and there's a limit on how many they can pick).
Having players constantly gain unusable pieces may not be that much fun for them, but this may also be better than the alternative.

A piece upgrade system
You could have players upgrade pieces to improve them by combining pieces together. This is assuming you can define an upgrade system which makes sense in the context of your game.
If pieces are taken, the other player gets a piece with no upgrades.
This would be a sink for pieces, which could counteract inflation.
Alternatively, you can let players take the upgrades too. In that case, the upgrades should probably be very minor, so a better player can still beat a weaker player with much better upgrades. There would still be inflation, but this could slow it down an extreme amount.
A minimum number of pieces
I'm assuming that playing with very few pieces wouldn't be all that much fun.
So I'd suggest, instead of having players go down to zero pieces, you can have them go down to a minimum. When at the minimum, any taken pieces will not be removed from the losing player, but instead just give the winning player a duplicate.
Then remove the idea of "resetting" a player's pieces, since this is no longer necessary.
This doesn't really address inflation, but should make the game more fun for the players with lower ranking.
This also has the added benefit of not constantly resetting weak players, where they'll then play against stronger players.
Take only one piece per game
When winning, you only get one of the opponents pieces (either one which was taken or any which was played with, which can either be picked or random).
This wouldn't stop inflation, but it would be slower than having all taken pieces go to the other player.
Tournament format
Have constant tournaments, each with a fixed start and end date. Pieces only last for the duration of the tournament and gets reset when another tournament starts.
There would be inflation, but this might even be a good thing when you're just resetting everything at some point.


Who pays for the destruction of an insured car in GTA Online?

Question: In GTA Online, I have heard that the players that blow up your PV (personal vehicle) will have to pay for your insurance. But in my case, when other players blow up my PV, I have to pay for it. Is this a glitch and if so how do I fix it?
Answer: Who pays the insurance claim changes depending on the person that destroyed the vehicle and where it was. The cost of the insurance claim changes based on the total price of the vehicle including modifications:

For vehicles under GTA$100.000, is the 10% of the total cost
For vehicles over GTA$100.000, it is always GTA$10.000

A couple of examples showing who pays and what price:

If you are playing in PC, the insurance claim is free for the vehicle owner, no matter who destroyed it

This was done by Rockstar Games to prevent an exploit that allowed cheaters with mod menus to drain other player's bank accounts by impersonating them (here is an example)

If your vehicle is destroyed in a mission, the insurance claim is free

Player A blows up the Armored Kuruma of Player B during Pacific Standard - Convoy. Because it was during a mission, neither Player A or Player B pays for the insurance. Player B can claim a new vehicle for free.

If a player destroyed your vehicle in freeroam, that player pays the insurance

Player A blows up Player's B stock T20. Because it costs more than GTA$100.000 (GTA$2.200.000), the insurance cost is reduced to GTA$10.000. Player A pays GTA$10.000.

If he does not has the GTA$10.000, the owner needs to pay the rest of the money missing from those 10k.

If you destroyed your own vehicle directly in freeroam, you pay the insurance

Player A blows up his own Buzzard. Because he was the direct cause of the destruction of the vehicle, he needs to pay the GTA$10.000 of the insurance (the Buzzard costs GTA$1.750.000).
Comment: This may answer the question - if players who destroyed user74165's vehicle didn't have enough money to pay the entire insurance, then he would have had to pay. Unfortunately in this case, there isn't anything user74165 can do except to avoid having his vehicle destroyed
Comment: Are there differences between console & PC, and enhanced & non-enhanced versions? A [discussion here \(reddit gtaonline subreddit\)](https://www.reddit.com/r/gtaonline/comments/ff4ite/i_hate_ppl_who_use_the_oppressor_to_grief_others/fjw233d/?context=99) states that the insurance bill could be as high as $20K in the console version.
Comment: I have destroyed high-end cars on PS3 and PS4 and is always GTA$10.000. On PC, Xbox One, Xbox 360, PS3 and PS4 is the same on the current update.
Comment: I was wrong. On PC nobody pays the insurance, no matter who destroyed the vehicle. There was (is?) an exploit that allowed cheaters with mod menus to drain money from other users by doing an "insurance fraud" that impersonates the other player and destroys cars remotely. There is some information in the [Claims section of the Mors Mutual Insurance wiki article](https://gta.fandom.com/wiki/Mors_Mutual_Insurance#Claims). I updated the answer with this info.
Comment: What happens when someone blows up my vehicle but they don't have money and I also don't have money?
Comment: In Freemode you pay, in Missions nobody pays.
Comment: Ok but another player in a plane directly blew up my car with rockets and i had to pay the full 20k as if i had blown it up myself. (PS4 Toreador)
Answer: This used to be the case. At least last I played (like 2 months when it GTA Online first came out). If someone used a rocket, C4, or other means of directly destroying my vehicle, they had to pay for it. There have been plenty of times this has happened, especially when all those rich kids got tanks...
However it looks like now that has changed. Testing it with a rocket, C4, and a tank, someone blows up my Adder and now I'm the one paying $12,500.
Answer: People now abuse the system by letting themselves run out of money then start blowing the hell out of cars.
If you do not have the money for the insurance, you will pay as much as you have, i.e.:

You have $200.00 in your wallet + bank account;
You blow up my Adder;
You pay $200.00;
I pay the other $12.300.

And that's one of the ways some people just end up getting away with blowing up our vehicles.
Answer: If the player blows up your car they pay the insurance fee. If they only have 1000$, and your insurance fee is 27,500(t20 supercar). They pay 1000$ because thats all they have. I have never had to pay the difference(ps3) for the insured vehicle they destroyed, and they couldnt afford to pay for. (All from personal experience). A way that players can destroy your car, an you have to pay the full premium is using the cargobob to pick your car up an drop it into the ocean, or other bodies of water.


Win32 BitBlt -- mirror image horizontally

Question: So I've read that StretchBlt can mirror images horizontally and/or vertically by negating the nWidthSrc/Dest and nHeightSrc/Dest parameters. I'd like this functionality without the performance overhead of a StretchBlt. I tried the same technique with BitBlt but it didn't work.
Is there any way to mirror an image with something as simple as BitBlt, without the overkill of a StretchBlt? Or will StretchBlt not affect performance if the source and destination sizes are the same?
Answer: BitBlt will only perform mathmatic operations (or, xor, etc) on the individual pixels in question, it will not resize the image in any way.  That is exactly what StretchBlt is for, and StretchBlt (compared to any other graphics resizing operation) is insanely fast as in most cases it can use the graphics card to accelerate its performance.
Answer: All Win32 functions are probably going to be extremely optimized.
What makes you think StretchBlt will be a big performance hit?
Have you profiled your application using StretchBlt?
You could reverse all of the bitmap data yourself and see if you can do better that StretchBlt.
Here's a link that might help you out:
http://www.codeguru.com/cpp/g-m/bitmap/specialeffects/article.php/c1739
Answer: To mirror an image you just need to loop through the pixels in reverse order.  Such as if you want to mirror horizontally you just need to do the following:

expand image canvas to double the size
start at the bottom of the image and work you way up writing the pixels in to the mirrored area from the top down.
do step 3 from left to right.

I don't know what language you are using, but most of them allow you to manipulates the pixels or bits on an individual basis using GDI.
Answer: No way you are going to be more efficient that StretchBlt, unless you know some extra information about the image (e.g, there is a border so you don't have to flip certain pixels.


Linking errors to the right field in WTForms FieldLists

Question: I am using WTForm to validate a form that I submit directly from a javascript model (filled through  knockout). In my form I have a list of bank accounts which can be added/removed dynamically. On the python side I have something like this :
class Account(Form):
    acc_name        = TextField('Account', [validators.Length(min=2, max=35)])

class InformationForm(Form):
    account_list = FieldList(FormField(Account))

The json data that is received for validation is the following :
'account_list': [{'acc_name': 'aaaaa'}, {'acc_name': 'b'}]}

The problem is then when I validate I receive something like this where there is no way to know which account in the list is the source of the error:
'account_list': [{'acc_name': [u'Field must be between 2 and 35 characters long.']}

How can I do to link the error to the right account ?
EDIT : the way I did it in the end is that I added a getErrors method to my InformationForm class, which builds a dictionnary indexed by a unique Id for each Account where the values are each Account error. I then return that as json to my application. I keep the question open in case there is a "natural" solution...
Comment: Could you provide a link to your `getErrors` implementation? I don't believe there is a way to do this in WTForms itself, yet. I wish it'd return an error list like `[None, ["first error on second element", "second error on second element"], None]`.
Comment: I opened a [GitHub issue](https://github.com/wtforms/wtforms/issues/49) for this.
Answer: Each individual element in a FieldList is a field in and of itself. If the FieldList contains a TextField, then each entry is a TextField. If it contains a FormField then it's a FormField (which then contains a form with its own fields) The FieldList entries can be accessed either by iterating a FieldList or by accessing the .entries attribute of the FieldList.
So instead of looking at form.account_list.errors look at the enclosed field's errors.
So for your use, something like this:
{% for subfield in form.account_list %}

    {{ subfield.form.acc_name() %}
    {% if subfield.errors %}
        {% for error in subfield.form.acc_name.errors %}

{{ error }}

        {% endfor %}
    {% endif %}
{% endfor %}

You probably want to abstract this out to a macro instead of doing this for every specialty field setup, if this is something you need to do consistently and often.


Doing a wrong thing for the right reasons?

Question: So let's say an army officer is caught by the enemies and wants to spill the beans. The patriot officer can either lie and mislead the enemy and get killed or can betray the country by telling all the secrets of the state. So according to Buddhist principles which is worse? Lies or betrayal? Can you lie for a greater cause? If one's intentions are for the greater good can it still be bad karma?
Comment: Possible duplicate of [Should a person never lie?](http://buddhism.stackexchange.com/q/12093/254)
Answer: I Buddhism what matters is the roots (greed, hatred, delusion, non greed, non hatred, non delusion).
Greed, hatred and delusion are unskillful as they give results which you would perceive unfavorably hence resulting in a unpleasant sensation in the future. They are unskillful as they reap an undesired result and is not connected with the goal in Buddhism which is to be free from unsatisfactoriness which is to transent the sphere of perception and sensation (sanna vedayita nirodha).
Non greed, non hatred, non delusion are skillful as they reap experiences which you perceive favorably in the future.
So it depends on the root or volition behind the action. The same action can be done with different motivation which decide whether it is skillful or not.
Answer: I'd think the officer could simply remain silent, and avoid both assisting the enemy and incurring the karma of lying.
Answer: As of my understanding if he did any wrong, it will come to him as bad Karma. And Good will come as good Karma. Lets say the officer here lied and protected his country. He will be punished for lies and will be blessed with the good work of protecting the country.
Can anyone lie with a not lying intention? I think we can't. If we want to lie. Then we are lying and we know we are lying. Purposes may be good. But the real intention can't be good (In here, lying is wrong, but the purpose of lying is good).
This is how I understand.
Answer: The officer could just do nothing or better yet the officer could send loving-kindness and compassion to the "enemy". Loving the enemy well is a good tool  to get out of that situation.
Both lies and betrayal are wrong because they will lead to suffering in the future if not right away according to the Buddha's teaching (Buddhism).


Syntax of fat arrow functions (=>), to use or not to use {} around the body

Question: I am looking at this code - https://facebook.github.io/react-native/docs/network.html
return fetch('https://facebook.github.io/react-native/movies.json')
      .then((response) => response.json())
      .then((responseJson) => {
        return responseJson.movies;
      })

From what I understand .then((response) => response.json()) translates into:
.then(function(response) {
    return response.json()
}

but I can't figure out what does this translate into? there is an extra {} in it
.then((responseJson) => {
        return responseJson.movies;
      })

Comment: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
Comment: it allows you to have more than one statement.
Comment: Same thing, but with curlybraces
Answer: The basic syntax of fat arrow functions is:
(arg1, arg2, ...) => { ... }

However:

You can omit the () around the argument list if there's exactly one argument:
arg => { ... }

You can omit the {} around the function body if you only have a single expression in the body, in which case return is also implied:
arg => arg.foo
// means:
(arg) => { return arg.foo; }

Since callbacks of the form function (arg) { return arg.prop; } are extremely common in Javascript, these two special cases to the syntax make such common operations extremely concise and expressive. E.g.:
arr.filter(foo => foo.bar)

Answer: (foo) => 'bar';
does exactly the same thing as
(foo) => {
  return 'bar';
};

If your function is multiline, use the second form.
Here are some docs: MDN Arrow function
Answer: If you don't wrap the body of an arrow function with curly brackets, it will evaluate the expression and return the result implicitly. If you wrap it with curly brackets, the result is not implicitly returned and you have to do it explicitly.
For this reason, the second part 'equals' the following:
.then(function(responseJson) {
    return responseJson.movies;
})

Answer: Another tip - if using the implied return shorthand, i.e.:
foo => foo.bar
you are able to write the return expression as multi-line. The only catch is you must include () around the expression. This happens often in React, for example, to improve JSX readability
const myButton = props => (
  <Button color={props.color} >
    My Button text!
  </Button>
)

Answer: As a sidenote, if you want your function to return an object literal, you'll have to go with the extra curly braces and the explicit return:
foo => { bar: "baz" } // will not work!

This example will not work as the curly braces will not be interpreted as the delimiting characters of an object literal, but as the delimters of a block. Inside a block, bar: "baz" obviously is a syntax error. So to return { bar: "baz"  } you need the xtra curly braces and the explicit return:
foo => { return { bar: "baz" } } // will work


Kohen Gadol Yibum

Question: Is it ever possible for a Kohen Gadol to perform the Mitzvah of Yibum. After all, every case of Yibum involves a widow which the Kohen Gadol is not allowed to marry?
Comment: Maybe a Kohen Gadol can marry a 'widow' if the original marriage was never consummated.
Comment: Are you asking if its Hutrah or Hudcha?
Comment: @SimchasTorah even if it's hutrah, who said the widow prohibition was also permitted. Really just asking for bottom line.
Comment: What are hutrah and hudcha?
Answer: Indeed he can't perform yibbum - he would have to perform chalitzah instead. The reason is that while yibbum is a positive mitzvah, it's opposed by the positive mitzvah to marry a virgin (Lev. 21:13) and the negative mitzvah to not marry a widow (ibid. :14) - and a positive mitzvah can't override a positive plus a negative one.
Even if the original marriage was never consummated, there's still the problem of her being a widow. It is true that then the positive mitzvah of yibbum ought to override that - but this would only apply to the first time they have relations. Since the Sages were concerned that he might continue to cohabit with her afterwards too (and then he'd be violating the prohibition without performing any positive mitzvah), they banned him from performing yibbum at all.
(Yevamos 61a; Rambam, Hil. Issurei Biah 17:12)
Comment: What if he's the only brother and he has no legs?

Kohen Gadol Yibum


Automated Comment Cron Job No Longer Working: Fatal error: Uncaught OAuthException: Bad signature

Question: A few months ago, I wrote a small app that would parse a string from my client's blog page and post it as a comment to their Facebook wall, which I have the credentials to manage.
The client only had to authenticate my app ONCE, and then, via the now-depricated "offline_access" permission, I could post on their behalf to their wall.
The code no longer works despite whether I use the old SDK or the latest SDK. I have attempted to migrate my code (below) to the latest version of the SDK and latest protocols for handling authentication to no avail. I have also had the client re-authenticate my app with the "manage_pages" scope (which I've had in place since day 1) with no difference.
The error I get is Fatal error: Uncaught OAuthException: Bad signature
I have been in circles between Facebook's documentation and the wise sage of Stack Overflow and I'm at my wit's end. I think my problem lies in not being able to generate a "long-lived" access token, but I have to be able to do this without the client having to log-in to Facebook every time (or at all, for that matter). So how do other apps like those that mirror a user's Twitter status to Facebook handle offline posting with no subsequent user login/authentication?
I noticed that my code works if I use Facebook's Graph API Explorer. But that requires me to see a dialogue and this will not work in my client's case. (Login/Re-Authentication was NEVER needed a few months ago.)
I have been pulling my hair out for the past week trying to find the answer, and I keep going in circles:
https://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens
https://developers.facebook.com/roadmap/offline-access-removal
Facebook API: How to post to own application wall without login
http://facebook.stackoverflow.com/questions/11839544/how-to-avoid-fatal-error-uncaught-oauthexception-when-using-cron-job
...to name a few. I feel like a spider trapped in a bathtub.
If someone could share a practical code example that suits my particular case, that would be tremendously appreciated, thanks. Here is the code that was working that I have tried to adapt to the latest Facebook PHP SDK and protocols:
<?php

require_once 'facebook.php';

$facebook_access_token_url = "https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=" . FACEBOOK_APP_ID . "&client_secret=" . FACEBOOK_APP_SECRET;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $facebook_access_token_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$facebook_access_token = curl_exec($ch);
curl_close($ch);

$config['appId'] = FACEBOOK_APP_ID;
$config['secret'] = FACEBOOK_APP_SECRET;
$config['fileUpload'] = false; // optional
$facebook = new Facebook($config);

$facebook->setAccessToken($facebook_access_token);

$page_id = FACEBOOK_APP_PAGE_ID;
$facebook_access_token = "";
$result = $facebook->api('/' . FACEBOOK_ACCOUNT_ADMIN_ID . '/accounts');
foreach($result['data'] as $page){
    if($page['id'] == $page_id) {
        $facebook_access_token = $page['access_token'];
        break;
    }
}

$facebook->setAccessToken($facebook_access_token);
$attachment = array(
    'access_token' => $facebook_access_token,
    'message' => 'Test message',
    'scope' => 'manage_pages,publish_stream,publish_actions'
);

$result = $facebook->api('/' . $_GET['post_id'] . '/comments', 'post', $attachment);

?>

Comment: At which point in your code do you get the error?
Answer: If you get the page access token using a long-lived user access token, the page token will not expire by default – so offline_access deprecation is no actual problem in such a scenario.


How do I know that my traffic is not being monitored by my relay?

Question: What is the possibility or probability that a relay that my browser is using can see and record my traffic?
Answer: It's mainly the exit node you'd need to be worried about, as that's where the last layer of encryption added by Tor is stripped off. The other two relays in your circuit (i.e. the entry node and middle node) can't see what's going on because of the encryption added by Tor before it leaves your computer.
So what about the exit node? As Alexey says, the Tor Browser comes with HTTPS-Everywhere enabled by default, and therefore enforces the use of HTTPS (i.e. TLS). Attempts to connect to sites that don't support HTTPS will generate a warning and be prevented. This means you're safe from Man-in-the-Middle attacks by rogue exit nodes.
However, there are other things you should be aware of when assessing your threat model, such as correlation attacks. There's a page on the Tails site (an OS that enforces the use of Tor for all network connections, not just the browser) that would be worth reading in understanding the other threats.
Comment: Thank you Richard - I see in the Tools Dropdown that the HTTPS Everywhere entry has a drop down arrow but when I mouse over it or click on it nothing happens. How do I know if it is active and can I administrate it in the TOR browser Options anywhere? Thanks for your patience, the learning curve is steep but I am sure it levels out quickly.
Comment: Hmm, the dropdown works in my browser (I'm Linux-based). In you're just trying to click it on the Tor welcome page, try visiting an innocuous website, and then try clicking it. Failing that, navigate to `about:config`, accept the disclaimer, and search for `extensions.https_everywhere.globalEnabled`. It should be set to `true`.
Comment: Actually it turns out that extensions.https_everywhere._observatory.enabled was set to false. I downloaded the software to my Firefox Browser and it worked perfectly there so I was able to compare the settings to find the solution. Thank you for giving me the solution and for your patience.
Comment: No problem :) Welcome to the site.
Answer: the probability is 100% at exit node =) It's an exit node who receives a packets that it sends for you outside. But if you're using SSL/TLS verification - you should not worry about any interventions in your network traffic. About a plaintext traffic there's nothing unusual : it IS insecure, inside Tor, outside Tor or even in your home LAN.
Comment: Thanks Alexey - my question was more of a privacy one. For instance if a "bad Guy" sets up a relay to get information I send or receive such as passwords or other sensitive information can he identify me, where the information came from or in any way compromise me? I may be missing something basic here but it seems that using "volunteer relays" leaves me open to all kinds of intrusive activities? Maybe you can point me to some more informative writing about TOR privacy issues>
Comment: @ron If you're **actively** verifying SSL/TLS **and** enforcing verification checks - then he is unarmed in all the questions you've mentioned.


Find user/item listed in DLP Report

Question: I've started doing some testing with our Office 365 Tenant and the DLP policies. I have a couple (PII and Credit Card) running in test mode and when I look at the policy matches report, the Item and Last modified by are encoded (all start with PII:H101 prefix). Is there any way to actually determine what user/item are in violation? I would like to determine if we're getting valid results.
Answer: Office 365 DLP policies creation template provide different options to trigger emails to both the owner of the content as well as to the site collection administration with pre-defined or customized email content.
Once you configure those settings, you will be receiving emails with direct links to the documents or list items where the rule is matched.
Comment: True, but it doesn't help if I'm trying to see it from the macro level. I did send an email to a contact at Microsoft and it appears that I should be seeing the user and document path/name instead of the encoded placeholder. If I get a resolution from him, I'll post it on this thread.

Find user/item listed in DLP Report


Claims/Priority Dates

Question: Will method claims receive the same priority date if they are filed after product claims are filed first, or can there be a combination of both in one patent application?
Answer: One patent can have both method and product claims. Method claims can be how to use it, how to make it and also a method a product executes when activated.
However, a priority filing that doesn't explain a method is not valid priority to a claim for that method. Each claim must have support in the specification or a priority filing.
Also, an examiner can issue a restriction requirement that tries to separate out either product or process claims. You can fight it and often win, or let one type be examined and try to bring the other type in later, or (in US) file a divisional application to pursue the other claims.

Claims/Priority Dates


Do I need "a/an" or "the" in this sentence?

Question: Suppose that I have submitted a job application.
And now I am waiting for the result.
Do I say
      "I am waiting for an answer from the company"  or
      "I am waiting for the answer from the company" ?
Which article do I use?
Answer: Well, when it comes to such situation, this is what I've heard in common...

I'm waiting for their reply.

When you submit your resume, that's the better way to say because you did not ask anything to what they'd answer!
Still, let's consider that you want to use that sentence only. Then I'd prefer the.

I'm waiting for the answer.

The reason for that is you are waiting for an answer that is the reply to your job application and not anything else. It's not a reply in general. It's specific to your job application. You, yourself, used "I am waiting for the result!" Does not it answer the question? :)
Maybe, this is helpful to clarify it.

Yes, I also applied for the position and you know what, the reply was positive!

Here, the is used because that reply is unique to that application.
Comment: @cpp_noname Probably because it gives the wrong answer for the wrong reason.
Comment: Somebody downvoted this answer. Why ???
Comment: @snailplane enlighten me :)
Answer: Both are possible.
Using "an" is simply stating the fact, without it there would be a mistake in the sentence.
Using "the" will leave the impression that you know or believe that their will be an answer, either because this company always replies to everyone or because you have connections there and were told that they will respond or simply because you prefer to believe there will be one. The reason for that is that as a definite article "the" refers to something particular, something that we are familiar with.
Comment: But I don't think one would say "I am waiting for *the* answer from the company.". Doesn't sound right.
Comment: What do you think is wrong with it?
Comment: It is not a question, it is a job application and that is clear from the context. I really don't think there is anything wrong with it.
Comment: Sorry I missed that. I'll drop my comment.
Answer: I would say:

I am waiting for an answer from the company.

because you probably do not know what the answer will be in advance.
If it were known (for "answer" it probably has to be after the fact), you could say something like:

The answer I received from the company was positive.
Answer: I would use "an," since you still don't know if you are going to be accepted or not.
If "the" is used, it makes me feel that you are expecting only one answer (and you are not considering any other option).
Comment: using of any article has nothing to do with employment here.


Conflict of Interest in the Hiring Process

Question: I work at Big 5 Sporting Goods. I want to work at Foot Locker. I went in for the interview at Foot Locker and told them that I work at Big 5 but am willing to quit if I was hired at Foot Locker. The manager I was interviewing with stopped me, said there was a conflict of interest because they are competitors and the interview was over. Was this legal to do? Is there a conflict of interest?
Comment: If your new employer expects you to sign a 'non-compete' clause as part of employment, then they are likely to expect you to honor one you've made with their competitor.  Typically such agreements run for a year after you leave the employer.  If they know that your present employer routinely asks employees to sign non-competes, then they have to stop the interview.  If they know that some but not all of their competitor's employees have signed these, then they don't know whether you're covered by one or not.
Comment: Is it legal and is there a conflict of interest are both asking for legal opinions.  What is it you hope to achieve by asking this quesiton.  Do you want to go back into footlocker and say, "Hey you dumb Foot Locker manager the interweb people say you are wrong!"  That is not going to help your situation.
Answer: Disclaimer: for legal advice go see a lawyer.
It depends. You should check what exact paper work you have signed with your current employer. It's possible  that Big 5 has an extensive non-compete and that they have already been in a fight with Foot Locker (or another competitor) on that.  In which case the hiring manger will treat you like a dead rat: no potential employee is worth a prolonged and painful legal battle.
If nothing if this sort is going on, it's a bid odd. Hiring from the same business segment is perfectly normal since that's where the actual skill set is. General Motors hires people from Chrysler all the time (and vice versa).
Answer: Now, you don't say what position you occupy and would occupy. The higher-up folk in each company might have non-compete agreements (which the competition might be aware of).
The only other way I can see this making sense is if you are in a high up marketing or other position where you'd have deep knowledge of Big 5's operations. In such a case, Foot Locker may not want the appearance of impropriety by hiring you - the fact that you know you need to leave the trade secrets and such at the Big 5 door doesn't mean someone isn't going to think you didn't.
Beyond that it's perfectly normal to hire your competitor's employees in every business. It's certainly not a conflict of interest (how the heck else are you going to get experienced people?), and in fact agreements to not do so are generally fraught with legal peril. Apple and friends found that out the hard way.
Answer: I think the problem is in the way you couched your answer.  "Willing to quit" is different than "Intending to quit."
While it is legitimately possible to work for both of those companies at the same time as a line-level clerk, it is not possible to do so in any sort of leadership position.  Even as a line-level employee, you are aware of corporate communications and promotions before the public is, and there is legitimate concern.  If you keep the information to yourself, you are being true to company A.  If you share the information, you are being true to company B.  It isn't possible to be true to both.
I worked in a production company that produced commercials for concerts.  We had tour information weeks before the press.  I had a colleague who worked with me duplicating the productions (This was before everything was done over the Internet).  He got a part-time job at a radio station.  They paid him a bonus for getting the tour dates for that market before they were publicly available.  That cut the concert promoter out of some arrangements with local businesses and other media.  The person had to be fired.  There wasn't a way for him to be loyal to both companies.
You should have made it clear in the beginning that you were looking to CHANGE jobs, not to ADD a side job.  What you (probably) intended was the right thing to do, but it's not what you communicated to the hiring manager.
Chalk this up under "Lessons Learned."  Communication without regard to perception is dangerous.
Best of luck to you in your job search.
Comment: Thank you everyone for helping me with this. I went to the manager again just so I could have a better understanding of why I couldn't be hired. He said "Foot Locker is a very strict company. I've been working here for 33 years and I know that this would not have worked out." I still wasn't satisfied with his answer but then he added "and we already filled the position." I was extremely qualified for the job and he was impressed with my resume. He was really disappointed he couldn't hire me. Why couldn't I have had my start day after I had given my 2 weeks notice at Big 5? Just disappointing
Comment: @Joe - You could have had other factors against you, too.  Sounds like this manager has a personal beef with Big 5, or may have been "burned" by a bad hire from them in the past.  It stinks, because it's nothing to do with you personally.  In the end, maybe the answer is to be happy you didn't end up working for him after all.  I once got turned down for a contract job I was (IMO) perfect for.  I was upset for a while.  Then a year and a half later the owner of that company murdered his CFO in the office.  Now I'm thankful I never got picked.  Not saying this applies to you, but just sayin ...


Does native EE have good menuing options?

Question: I've used Taxonomy or NavEE previously, but I'm now considering keeping it simple, if possible, and using native EE controls for menuing. Anybody have good solutions?   That is, something for my content author to use to manage the menu that isn't hard-coded templates. Perhaps some way of utilizing categories (the only thing I know of that has hierarchy)?
Answer: I found Structure works well, it allows the user to add and move around pages easily and gives you way to generate menus: http://buildwithstructure.com/


Unbased spectral sequences

Question: Suppose we have a tower of fibrations of spectra $\{X_k\}_{k\in\mathbb{N}}$ with inverse limit $X_\infty$, and let $F_k$ be the fibre of the map $X_k\to X_{k-1}$.  There is then a spectral sequence $E^1_{jk}=\pi_j F_k \Longrightarrow \pi_{j+k} X_\infty$.  If we instead have a tower of fibrations of based spaces, then we still have something like a spectral sequence except that some of the entries may be nonabelian groups or just pointed sets, and the sense in which $E^{r+1}$ is the homology of $E^r$ must be modified to take account of this.  The details are in the book 'Homotopy limits, completions and localizations' by Bousfield and Kan.  Now suppose we have a tower of fibrations of unbased spaces.  I think I have heard it said that there is still some kind of spectral sequence building up to $\pi_\ast(X_\infty,a_\infty)$, where the basepoint $a_\infty$ is not given in advance but is chosen iteratively by lifting basepoints $a_n\in X_n$ as we work through the spectral sequence.  This makes life difficult because $F_{n+1}$ and $\pi_\ast(X_n)$ are not defined until we have chosen $a_n$.  Has any theory of this type been worked out in detail?
Comment: Tom, might you be thinking of Bousfield's "Homotopy spectral sequences and obstructions" (Israel J. Math vol. 66)?  It does something like this for unbased _cosimplicial_ spaces, rather than a general tower of fibrations.
Comment: I have the impression that there is a paper of Bousfield that does something like this.
Comment: @Tyler: thanks for the pointer.  If you want to promote that comment to an answer, then I will accept it.
Answer: As requested, I am reposting this comment as an answer.
Bousfield covers this material in "Homotopy spectral sequences and obstructions," Israel J. Math 66.  The discussion is specific to cosimplicial objects (e.g. the discussion of obstruction cocycles in Section 5) and the general method of obtaining "partially" defined spectral sequences without basepoints would have to be extracted.  However, I believe that all the necessary content is already there.
Comment: Sadly the masters of the library have ordained that I must descend into the bowels of the earth and retrieve a dead tree before I am worthy to study this work in detail.  I might get there next week ...
Comment: Just answering myself, I *wasn't* right.
Comment: Interesting! Am I right if I say that treating the case of cosimplicial spaces is enough since the spectral sequence of a tower of fibrations would be the same as the spectral sequence of the associated cosimplicial space constructed as a kind of André-Quillen resolution using the nerve of the category $\mathbb N$?

Unbased spectral sequences


Always showing cookies error for a first time visitor trying to login

Question: I am using WPBrigade plugin "LoginPress" and has a login page which is created from file: wp-login.php.
If a new visitor is logging into the site, it displays an login_error with the following warning:

quote Error: Cookies are blocked or not supported by your browser. You must enable cookies in order to use WordPress.

If the user tries to login again without clicking on the link provided by the error message and do not adjust browser settings regarding cookies the login works fine and the user is logged into the site. If they click on the link they are redirected to wordpress official site regarding cookies. If they then return to the site it works fine (since it's a second attempt like in the first case).
My problem is that I want the user to be able to login without having this warning that disturbs the user experience. The login process is now 2 steps with a mandatory second try that works. I want it to work the first time. I can't seem to find the solution plugin documentation, and niether on wordpress site.
Answer: Check the issue by enabling the debugging in WordPress
https://wordpress.org/support/article/debugging-in-wordpress/


How to move the "All" tab to the right in Jenkins?

Question: Is it possible to move the "All" Jenkins tab from the main view all the way right? It's just my browsing preference to see it at the end to not obstruct my always specific habit of using views. In other words, I would like my first view to be what I see at the beginning on the left.
Comment: dragging but it didn't work
Comment: What did you try?
Answer: One option is to add a new view, remove the "All" view, create a new view, select  "All" and let it start with "z", e.g. "z-all" as the view is sorted alphabetically.
There is an open issue that indicates that the ordering of tabs in Jenkins is alphabetically sorted and cannot be changed at the moment, e.g. change the order manually.
Comment: This is something that has bothered me about Jenkins for the longest time! The "z-" prepend option was the only solution I could find, but it's FAR from ideal....
Answer: I don't have currently any Jenkins instance to test it but what worked 4 years ago is that when you rename tab if you place a space (" ") symbol as name prefix and save it does not show up (since HTML hides trailing and leading spaces) but it takes part in alphabet sorting. So you could move part of tabs to the left or right, or even mix them all as you wish.


Using django-email-login for authentication but disabling email verification

Question: Regarding the django-email-login app, how do i get it not to require email verification by the user? I find that this extra activity that the user has to go through by logging into their email account to validate their email could reduce signups.
Answer: I assume you are referring to this django-email-login: https://bitbucket.org/jokull/django-email-login/src, and not my django-email-login: https://bitbucket.org/tino/django-email-login/overview, (sorry for the confusion, I hadn't seen his repo until I bumped into this question and started searching) as I don't do any signup.
However I would like to advice you that you might be more likely to get an answer when you post your question as an issue on bitbucket, as there people that use the app will actually see it.
From a quick look at the code I would say you need to write your own RegistrationBackend, one that doesn't need validation. The backend used in jokull's code is actually the one from django-registration, so you should take that as an example.


easy way to make many pojo into one pojo

Question: Am having a registration form which has multiple pages. So, I am mapping one page to one pojo. Finally, when I processing with database, I want to make it as single pojo to commit. Any idea to simplify this model.
Thanks :)
Answer: You can create a wrapper POJO which holds your other POJO's with additional helper methods in the master POJO.
Answer: What is wrong with sending multiple POJOs to your service level to commit to the database.  Koekiebox's suggestion of a wrapper POJO will work, but also will add another place to make changes to if you add or remove POJOs.
If the data truly belongs together why not increase the number of fields in your POJO and use just one for your form and database.


Maximum wireless output power

Question: What is the maximum wireless output power allowed by the FCC in the US without a license?
I am specifically wondering aboot IEEE802.15, but I'm assuming that it would be the same as IEEE802.11.
Answer: Look here.  According to what I found, 4 watts EIRP at the antenna.
Comment: No worries.  Glad to help
Answer: So as not to encroach on the reserved areas of the adjacent frequencies, you need to stay within the limits of +20dBm (100mW) maximum output power.
There is also the consideration of which class of Bluetooth (I'm assuming that Bluetooth is what you are using) you are implementing.  The class limitations are listed here:
Class 1: 20 dBm Max. (100mW)
Class 2: 4 dBm (2.5 mW)
Class 3: 0 dBm (1mW)

I Hope This Helps...

Maximum wireless output power


How could a deserter go West in 1863?

Question: A man deserted from the Armory Square Hospital in DC in Feb 1863. His next recorded presence was in 1865 Iowa when he got married under an assumed name. I am curious to know how he might have made it west. Trains seem unlikely. Walking? Wouldn't a twenty something guy walking have raised an eyebrow in 1863?
Comment: A horse.......?
Comment: Lots of people made it to the West... You may have some inaccurate impressions about the extent of civil war conscription; the vast majority of Union troops were volunteers.
Answer: This question seems to be predicated on two assumptions:

a twentysomething guy walking through town would be suspicious. I'm not sure that is completely true.  I don't know what the migration patterns for that era are, (I know the data exists, but I can't find it),  I believe there were still a lot of people going West.  The deserter could take any normal form of transportation (horse, coach, etc.). If challenged, the deserter could merely state that they were joining their family in the West.
An unstated assumption that anyone who was of an age for military service should be in the military, rather than heading West.  I think this is where @Semaphore's point is critical; Northern troops were largely volunteers, not conscripts.  The first problem with this assumption is that conscription was not yet the law at the time of the desertion "The Enrollment Act, 12 Stat. 731, enacted March 3, 1863" Wikipedia.
Furthermore

Exemptions from the draft could be bought for $300 or by finding a substitute draftee. history.com

The policy of substitutions was continued throughout the war. The problem with substitution was that it provided substitutes with powerful incentives to desert soon after enlisting. Career "jumpers" made a living off of enlisting as a substitute, collecting their compensation, deserting before their units were dispatched to the front, and repeating the process. The problem was well known to the military commanders who regularly saw the same recruits repeatedly. In addition, troops furnished by substitution were considered to be of an inferior quality in comparison to regulars and volunteers. Wikipedia
Answer: Maybe Mhw has seen too many thrillers set in fascist or communist states, where police officials go through trains demanding to see the papers of all the passengers.  Or maybe he imagines that police would ask to see travelers' identity papers at the borders between the various counties and states.  That didn't happen in 1860s America.
Remember that American society was not nearly as automated and mechanized as today, and only a minority of healthy men could be spared from ordinary jobs to serve in the army, and many of them would sometimes be traveling for work reasons, looking for new jobs, or moving west.  One of the main advantages of the Union over the Confederacy was its more mechanized agriculture that enabled a lot of farm workers to join the army without lowering food productions.
A lot of men who didn't want to be conscripted headed out west to the frontier.  One army officer sent west after the war found his region full of confederate sympathizers, draft dodgers, deserters from the Union army, and other sinister characters.
The US Army had a provost marshal's bureau dealing with military law and order, including tracking down deserters.  But that didn't stop a small number of "bounty jumpers" from enlisting for the enlistment bounties paid by the federal, state, and local governments to encourage voluntary enlistment, deserting as soon as they could, and reenlisting in another unit for another bounty, over and over again. Even though the maximum possible penalty for desertion was death, the percentage of deserters caught was small enough that many thousands of soldiers deserted once, and there were even those "bounty jumpers" who deserted over and over again.
Comment: I appreciate the insights into that period. No doubt I have many misconceptions about it, which is why I asked.He did volunteer in Aug 62 and desert 7 months later. I knew desertion was common... I have several family members who did, though they went back home to PA. I didn't know a lot headed west, though it makes sense.
Comment: I have also heard of a place in western Pennsylvania where deserters and escaped POWs from the Union and confederate armies were said to have built forts to defend themselves against capture.

How could a deserter go West in 1863?


User that left the organization and came back is unable to access SharePoint site

Question: We have a user that is trying to access a site collection. I've given her owner rights but she is still unable to access the site collection.  I think it's worth mentioning that this user left the organization for awhile and came back.  It almost appears as though her profile isn't syncing properly.  Is there a way to force a resync with Active Directory?  We aren't currently using the User Profile Sync service to my knowledge.
Comment: Ask your helpdesk/sysadmins what was done with this person's Active Directory account when they left and returned. Profile has nothing to do with it.
Answer: If the user's AD account as deactivated, and then reactivated, then they should still have access. If their account was deleted and then recreated, then they have a new SID and are not the same user.
I think the Move-SPUser PowerShell cmdlet will help you fix this. (Do a web search first.)
https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/move-spuser?view=sharepoint-ps


Why is there a hole in my basement wall?

Question: I just bought a house & I am curious as to what or why there is a hole in my basement wall. Inside is just the foundation wall and dirt floor. Why would a builder create such a thing? Can the area be finished & habitable? Can you dig deeper & create another level?
Comment: Is that a crawl space access for getting under other parts of the house?
Answer: The clue here is that the hole leads into an area that is under another part of the upper building structure. It is highly likely that the corresponding part of the building in that area does not have full headroom clearance and thus leaves that area as a "crawl" or "access" space. The hole is what allows you to enter that space if there is need for maintenance and/or repairs. The hole also allows for some air circulation from that area into the rest of the basement to help control humidity and temperature.
I would advise that you do not want to try to dig down the dirt floor space in that area because that would most likely cause you to be digging below the foundation levels in that access space. You do not want to be digging below the foundation levels as that can lead to foundation movement or long term failure.
Comment: Thanks Michael. The room above it is the living room (or is it family room? Idk.... ) There is a fireplace in that room straight back. The "space" is just that area/ room as to the right of it and above is the garage.
Comment: Can I at least level the dirt & lay cement to make a storage space?
Comment: On the first glance I do not see any reason to prevent using it for storage or preparing it for storage. How does the dirt level compare with the adjacent basement floor on this side of the hole? Seems like it would be a bit of a challenge working in that space. My first house had a similar low clearance area under a split level entry way. In that case the builder had continued the basement floor all the way across the space and yes I had put shelves in the space for storage even though the head clearance was about 3.5 feet.


Zend Framework 2 query to Oracle in incorrect format

Question: I guess that the way Zend use to build sql statement don't work with Oracle.
I'm using Oracle in my local Windows PC.
My PHP works correct with Oracle already with oci8 extension, I configured following the link below:
http://www.oracle.com/technetwork/articles/technote-php-instant-084410.html
I'm trying to connect ZF2 with Oracle. I'm using the tutorial code at Zend website:
http://zf2.readthedocs.org/en/latest/index.html#userguide
This code works perfectly with mySQL. I'm changing the database configuration to use Oracle instead.
Below is my config:

global.php

< ?php
return array(
      'db' => array(
    'driver'         => 'Oci8',
    'host'         => 'localhost/orcl',
),

'service_manager' => array(
    'factories' => array(
        'Zend\Db\Adapter\Adapter'
                => 'Zend\Db\Adapter\AdapterServiceFactory',
    ),
),

);
?>

local.php (this work because I created a user 'test' with privileges on Oracle with, I tested this user with PHP and SQL script)

< ?php
return array(
'db' => array(
  'username' => 'test',
  'password' => 'test',
),

);

After configuring, I try to browse the url, the error appear say "table or view does not exist". This is Oracle error, it means Zend connected to Oracle but something wrong in SQL statement.
After some debug, I see the sql statement is:
SELECT "album".* FROM "album"

It' error because Oracle don't want to receive double quote.
I tried some hard-code in file /Zend/Db/Adapter/Driver/Oci8/Statement.php, function setSql line 112, change to:
public function setSql($sql)
    {
        $this->sql = $sql;
        $this->sql = "SELECT album.* FROM album";
        return $this;
    }

(remove double quote on query)
It's work!!!
I think there're some other configuration so make Zend work correctly.
Please help me! Thank you
Comment: Have you tried setting the table name to upper case? Seems to come up a few times from a quick google.
Comment: Hi, I tried it. I think the problem is that Oracle don't receive double quotes, but Zend build the statement have these.
Comment: @AydinHassan: Hi, you're right. Change all table names and field names to upper case will make the code work! Thank you
Answer: Same problem was here: ZF2 IBM
Solution: quote_identifiers == false:
   'db' => array(
    'driver' => $dbParams['driver'],
    'connection_string' => $dbParams['database'],
    'username' => $dbParams['username'],
    'password' => $dbParams['password'],
    'character_set' => $dbParams['character_set'],
    'platform_options' => array('quote_identifiers' => false)
),


get views customfield php value in another field

Question: i create a views in drupal 6.24.set up some field like username and uid,
in third field used customfield php .with my custom php code filled this filed,
in another customfield php want use the value of customfield php value ,how can i do it?
i know with $data->uid (if userid exist im my views filed) can get current row uid.
i test $data->phpcode but return null to me. please tell me about how can i get customfield php in views?
Answer: You should use the views_php module instead. It is the successor of Views Customfield PHP. The current module you are using does only render content, but has no value. views_php introduce the possibility to define both value and rendering settings. You should then be able to use the generated value in other fields.
Comment: with spend some hour search about this ,finally i use views_module but this module can provide my request, i want determine 5 field, 3 field are php, calucate some value in first and second and i third i want use pervious php field, i use ***$row->php*** ,and ***$row->php_1*** but return null to me !!!!
Answer: the correct way  to this is add your desire code in value section ,with return it,
and in output section  use
<code><?php
 print $vlaue;
 ?>
</code>
with this method we can access all pervious variable in current and next php global field.
this descriptions are all about views_php module ;)
i hope this be useful for futures user with this problem,


Why cant a .net 4.0 project reference a 4.5 assembly?

Question: I am working on a project targeting .NET 4.0 and now I need to reference a third party dll which was built targeting .NET 4.5. It seems that visual studio does not accept that? Why? VS shows me that dll name does not exist in current context.
Answer: Because you are referencing to the higher version. Microsoft can be backcompatible, but not "future compatible". You need to convert your entire project to higher vesion, in order to be able to use that binary.
Don't know what tecnology you are talking about exactly, but if that asp.net, consider that in vNext you are able to deploy your own version of the cloud clr on the server. So you may have 2 versions of your app, one targetting 4.5, other 4.0.
Introducing vNext. Repeat, if this concerns you.
Answer: A project targeting .NET 4.0 can run on the 4.0 runtime. A DLL targeting .NET 4.5 cannot.
If allowed; you would be able to build projects that appear to work in 4.0, and fail when they tried to load the 4.5 components.
You can reference things going the other way; as a 4.0 DLL can be loaded in the 4.5 runtime.
You will need to either request a 4.0 version of the DLL from the third party; or target .NET 4.5.
Answer: The application domain will be running under the 4.0 runtime and so cannot reference newer dotnet version, only the reverse is true.
4.5 is a different .net runtime so it is not possible to load a 4.5 in an older version.
You must remember that the runtime will need to interpret the Intermediate Language (IL) into machine code. If the IL was created on 4.5 a 4.0 runtime would have no idea how to interpret it.
Answer: Create a console app in 4.5 and then execute a cmd from 4.0 to get the data you needed from 4.5, might be a quick solution. Not idea but it does the job :)
Comment: You may use one of Windows IPC mechanisms to communicate between processes. (E.g. I like `IpcServerChannel`).