summary
stringlengths 15
147
| text
stringlengths 1
19.3k
| answer
stringlengths 32
22.6k
| labels
float64 0.33
1
| answer_summary
stringlengths 5
164
|
---|---|---|---|---|
Is there added value in having your own presentation layout and using it consistently?
|
From the perspective of a Ph.D. student, how much of an added value is it to have your own presentation slides layout, that is used consistently throughout your Ph.D. conference presentations and other talks (and possibly throughout your academic career afterwards)?
Here is one such example from the Computer Science community.
This as as opposed to using existing Beamer templates with LaTeX, or built-in PowerPoint templates, or simply preparing each presentation on its own (without a specific layout).
A couple of axes I can think along:
Creating a signature layout that distinguishes one in their community
Ease of preparation of presentations (especially over time), maybe overcoming constraints with existing templates.
Note that I am not concerned with the question of content, but just design and layout.
|
Standardising layouts have three advantages:
You can reuse slides across presentation without changing the styling.
When you create presentations, you don't need to think about styling; the templates are already set up for you.
Creating templates and styling can be delegated to someone with design skills, and everyone else gets to use them.
The first two points are applicable whether you have your own signature style, or you follow a team or corporate style.
The last point is different. In theory, having a corporate style is a really good idea because everyone gets the benefit of using templates created by the design genius in the marketing department. In practice, corporate templates are almost universally awful.
So, if a corporate template exists, and you are lucky enough to like it, then use that. There's no point in reinventing the wheel.
If there is no template, or it is dreadful, then create one for yourself and stick to that.
Either way, you don't want to have to keep deciding on new fonts to use for every presentation that you make.
| 0.777778 |
How to reuse slides across presentation without changing the styling?
|
Do dice finish resolving before yielding Tokyo?
|
When does yielding occur in relation to dice resolution? Simultaneously? After all dice have resolved? After attack dice are resolved?
For example (A for attack die, H for heart):
Alice is outside Tokyo, Bob is inside. It is now Alice's turn.
Alice rolls: 3, 3, 3, A, A, H
? Handle VP and hearts?
Alice attacks Bob
Bob chooses to yield
Now consider the possibility Alice has a single shrink ray token, so she only rolls 5 dice:
Alice is outside Tokyo, Bob is inside. It is now Alice's turn.
Alice rolls: 3, 3, 3, A, H
? Handle VP and hearts?
Alice attacks Bob
Bob chooses to yield
She must choose if the heart is applied to heal for one, or if it will remove the shrink ray token. In this case, order of resolution for the attack/yield and heart matters (more/less information for Alice & Bob, inability to heal in Tokyo). Is there an order to the dice resolution (eg hearts then attacks), or is the yield not declared until after all dice have resolved?
|
It is my opinion that the dice indicate what happens to you at your current location. A heart dice would indicate that you healed, if your location permits it.
This is partially supported by the fact that one must take all damage rolled even if one cedes Tokyo. You should similarly be able to use all hearts even if you are forced to take Tokyo. There's absolutely no mention or implication of any other possibility.
Everyone I've played with has naturally come to the same understanding. You could view podcasts of people playing KoT, but I'm sure they've come to the same conclusion.
She must choose if the heart is applied to heal for one, or if it will remove the shrink ray token. In this case, order of resolution for the attack/yield and heart matters
No, it doesn't. According to the FAQ on BoardGameGeek, removing a bad counter counts as healing and is thus equally forbidden in Tokyo, so the order does not affect the choice.
| 1 |
a heart dice indicates what happens to you at your current location
|
Windows Software to Mount Volume/Partition Image File
|
Last night I had a BSOD a couple of minutes after moving a file. After a reboot, I found that the file was gone (it was deleted from the source partition and not present on the destination).
I took an image of the source volume (ie from the Boot Sector to the last cluster of the partition). Then I wrote a program to extract the unused clusters from a disk and save them as files.
Some of the free clusters on the original volume have now been overwritten so I need to use the image to do my final extraction. That means I need some software that can mount a volume/partition image, but all of the image mounting software I can find can only mount disk images (ie from the MBR—the master partition table—on).
Does anyone know of (hopefully free) Windows software that can do this?
I’ve already tried (without success): VirtualCloneDrive, DaemonTools, VirtualFloppyDrive (and probably a couple of others I can’t think of). They all either nag that the file is no good, or try to mount it, resulting in a disk that Windows complains has an unknown/corrupt filesystem.
Thanks.
|
OSFMount is a free program that can mount disk images containing just a single partition or entire drives with multiple partitions. Unlike most of the other programs I have tried, this one is aware of disk-structures, so it can detect the contents of image and lets your select what you want mounted.
If the image contains a partition table, it will display the contained partitions and let you mount either the whole drive, or select a partition. If it contains just a single partition, it mounts it as is.
It also lets you decide what type the mounted drive will be (hard-drive, optical, floppy, auto).
| 0.888889 |
OSFMount is a free program that can mount images containing just a single partition or entire drives with multiple partitions
|
Why don't banks give access to all your transaction activity?
|
In the era of big data, I find it surprising that banks and credit card companies only offer access to a ridiculously small number of transactions - often only your last 180 days, if that. The longest I've seen was 720 days going back. I suspect they do store everything, but intentionally limit access.
These transactions are text only, take up extremely little space, and storing an individual's lifetime worth of transaction would take less than 10MB of data; about the storage required by two MP3 files, and about 250k records per person per lifetime, if we generously assume everyone makes 10 transactions a day. But I'd be happy with only the last 10 years of transactions, so about 1MB per customer. One of the largest banks, JP Morgan Chase, has ~70MM credit card customers. That means 70TB of data for 10 years of records - hardly impressive for a corporation of that size, with $17B of net income in 2013, when 1TB of cloud storage costs $10 retail per month.
By comparison, would you put up with Gmail or any online email provider keeping only the most recent 120 days worth of email? (And emails do take a lot more space than transactions, are far more numerous, and have to be instantly retrievable.)
Storage requirements for transaction activity are trivial in an era where we're throwing around petabytes and zetabytes.
Is there a sound reason for banks not offering access to all your transactions, other than legacy software on their side?
|
Many good points have been brought up, and I'll just link to them here, for ease.
Source: I work at a credit/debit card transaction processing company on the Database and Processing Software teams.
1. Security
See mhoran_psprep's answer.
2. Tradition
See Chris' answer.
3. System Integrity
Believe it or not, banks don't expose their primary (or secondary) database to end users. They don't expose their fastest / most robust database to end users. By only storing x days of data in that customer-facing database and limiting the range of any one query, any query run against it is much less likely to cause system-wide slowness.
They most definitely have database archives which are kept offline, and most definitely have an employee-facing database which allows employees to query larger ranges of data.
4. No Added Value
What would a bank have to gain by allowing you to query a full year of transactions?
| 0.888889 |
Security See mhoran_psprep's answer.
|
What is a sci-fi system that would feel familiar to reluctant Pathfinder players?
|
For the last few months I've been running a Pathfinder campaign, and recently I told my players that I needed a break and they agreed on switching games for a few months. I'm a fan of the works of Isaac Asimov, Larry Niven and so on, and science fiction would be a great change of pace. So here is my opportunity! At last! Or not?
My problem is my players have never liked anything that isn't D&D or Pathfinder. We're all well into the thirties, and the majority have a taste for long campaigns (they really enjoy character development) and some big differences about what we want in a game. The one player who's also a regular GM has a greater appreciation for new games, but the rest is usually scared off by words like "indie", and "FATE".
I ran a Traveller campaign years ago using GURPS. They hated GURPS. I took off the GURPS part and added "Mongoose". They hated Mongoose. I tried Diaspora. They hate FATE. I talked about Ringworld, but I found BRP is not a good system for sci-fi. Jovian Chronicles? "It has to be as bad as Tribe 8." (Their words, not mine). Every time I suggest anything that's not Pathfinder it's the same song.
Though I find Traveller good enough, obviously now it's not an option. My latest reading has been a game based on FUDGE (far enough from FATE) inspired by movies like Alien, Predator and alike. I fear a one-session campaign and new "hate". It has to be a game that fits my group. Right?
Of course it may be that there's no such game and I have to deal with my players instead, so "There is no such game" is an answer I'll reluctantly accept.
|
The best way is to get buy-in from your players. One way of doing that is giving them a selection of games that you would enjoy and asking them to decide amongst themselves which to play. This leverages a bit of human psychology where we will invest in something more if we have a hand in choosing it, especially if, in the process of choosing it, we ever argue for its merits to a peer. Giving your players a choice of sci-fi games means that the one they pick will have at least a little bit of support from at least some of your players already built-in.
Pick three or four games and present them to your players. Say you're running one of these, but which is up to them. Don't defend the games if they disparage them, just ask them to pick the one they think they'll enjoy the most. (By not allowing them to make you a target of arguments, you prevent them from digging in their heels and deciding preemptively they'll hate it.) If they hate it, well, they chose it. Which specific games you present them is up to you, but if I were doing this and trying hard to keep them all as appealing to dedicated Pathfinder players as possible, I would include at least one of these three if not all of them:
Stars Without Number is based on an older edition of D&D, so it's as close as you will come to the feel of Pathfinder, mechanically, as a science-fiction system can get. As a bonus, it's free, and if your players like it, it's very well supported with for-pay supplements and print books.
As a fan of Traveller, you should find the GM's side of SWN to be pleasantly familiar too. It's built to accommodate a system-hopping game or a campaign that stays on one world, and the "tags" system for setting development means you have a constant supply of new ideas at the roll of a die. It will work for a one-shot as well as Pathfinder would – possibly better, because new characters are not quite as complicated, and it gives you tools for quickly "statting up" a world.
Thousand Suns is exactly aimed at re-creating the genre of Isaac Aasimov, Niven, Pournelle, and their kindred in classic science fiction. Written by a luminary of classic D&D blogging, James Maliszewski of Grognardia, it's a straightforward system that still has its roots in D&D, so it doesn't ask players coming from a d20 background to make a paradigm shift in "how RPGs work" like Fate does, and it doesn't have the explosion of complexity (compared to d20) that GURPS or BRP does. It has stats with unfamiliar names but familiar function, and a skill system that should feel familiar enough to them.
d20 Future is going to be very familiar to your players. It's a bit more generic in that it's aimed at creating all kinds of sci-fi, not just the sort written by the authors you mention, but it will do the job. Being a supplement to d20 Modern it does require more books, but the breadth of character options will probably be welcome to your players, since lots of "chunky" character build options (as opposed to the fine-grained ones of GURPS, et. al.) is one of the big draws of d20 for its dedicated fans. d20 Future and Modern both have SRDs online, which somewhat makes up for the extra materials you need by making them free.
I strongly suggestion one of those, but the most important part is to give them a shortlist of games you're willing to run and then make the decision theirs. They've already agreed to a change of game, and it's only for a short time, so they should at least be able to agree on one they think they won't hate.
And if they do hate it, all is not lost: you've played a bit of a game you want to play, and you've burned only one of thousands of games that you could try. Really, you could keep trying one-shots of strange new games regularly, and it would take you decades to go through even a fraction of the RPGs currently published, and there are more every year; so don't worry too much if they hate it. Enjoy it yourself, and give them some agency in the choice, and it will all turn out in the end.
| 0.777778 |
The best way to get buy-in from your players is to give them a selection of sci-fi games . if they
|
display tag and c choose tag
|
I use the following code. But it is always go to the otherwise condition. I checked the value , and those are correctly passed from java to the jsp. Any missing points?
<c:when test="${pCount > 0}">
<display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" />
</c:when>
<c:otherwise>
<display:column class="colPCount" title="${titlePCount}">&nbsp;-&nbsp;</display:column>
</c:otherwise>
For the pcount>0 items, still displaying as '-' in the display tag. Even I reverse the checking condition like pCount<0 in the first condition checking, the display tag always show the otherwise condition. It always pointing to the otherwise condition for every value.
Edited: Full Code
<display:table class="displayTable" id="itemList"
name="${sessionScope.itemList}" requestURI="listItem.action"
pagesize="15" defaultsort="2" defaultorder="ascending" sort="list">
<display:column class="colItemName" property="name"
title="${titleItemName}" sortable="true" headerClass="sortable"/>
...
<c:choose>
<c:when test="${pCount > 0}">
<display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" />
</c:when>
<c:otherwise>
<display:column class="colPCount" title="${titlePCount}">&nbsp;-&nbsp;</display:column>
</c:otherwise>
</c:choose>
</display:table>
|
I think you might be using the display tag library incorrectly.
It looks like what you are trying to do is to display row.pCount if the value is greater than zero, otherwise display -. But what you're actually doing is telling the library to display the entire column differently based on something (pCount, which probably does not exist in the scope you are referencing it... or you're going to have to show us some more code).
Try something like this:
<display:column class="colPCount" title="${titlePCount}" sortable="true" headerClass="sortable">
<c:choose>
<c:when test="${row.pCount > 0}">
<c:out value="${row.pCount}" />
</c:when>
<c:otherwise>
&nbsp;-&nbsp;
</c:otherwise>
</c:choose>
</display:column>
| 0.555556 |
Display tag library if value is greater than zero, otherwise display
|
Opamp Voltage Doubler Unstable (After Extended Operation)
|
I've been working on a circuit which would drive an industry standard pneumatic regulator (E/P transducer). The transducer takes a standard 0-10V command signal with a typical input impedance of 6.5 kOhms. The DAC that I've selected (ADI 12bit 8 channel) has an internal 2.5V reference and can output 0-5V.
After researching extensively, an opamp voltage doubler seemed like a good fit. This worked and was rock solid for about two weeks, but failed after a ~2 day period of continuous operation without warning. Now the opamp output is close to a correct 2.0 gain but constantly fluctuates as if the output is barely stable and poorly damped. Has anyone ever seen an opamp fail this way?
We're using a UA7812 linear regulator to supply 12V (from 24V) to the opamp quad (LM324AN) and admittedly it may not be sufficiently heatsinked (gets wicked hot to touch). Still, the 12V supply is solid at 11.83V and voltages supplied by the DAC appear correct and stable. The actual resistors on the board are 10k with 0.1% accuracy and each measure 9.95k precisely. Any advice in solving the problem is tremendously appreciated! It's essential that this be a robust circuit.
Below is our final opamp configuration (and the part number):
|
I presume that your 12V is also supplying the E-P transducer power (and perhaps other stuff) and that's why the regulator is getting hot. You should heat sink it so that the case temperature is reasonable if you want reliable operation, or use a switching regulator. The exact numbers depend on your ambient range and desired reliability, but "wicked hot" sounds like it exceeds the 60-70°C range that I'd like to see for general purpose applications.
The 'fluctuation' in op-amp output could be caused by oscillations. The LM324 is fairly robust with small capacitive loads (such as could be caused by cable to the transducer), especially for gain > 1, but you may still be having problems. I suggest this kind of output circuit:
simulate this circuit – Schematic created using CircuitLab
The input filter R4/C2 keeps high frequencies out of the input and matches the impedances looking out of the op-amp inputs so as to minimize the effect of the relatively large bias current on the LM324. The resistor R1 isolates the capacitive loading on the output from the internal output impedance of the op-amp. C1 forms a tight loop for AC to stabilize the op-amp. The feedback (R2/R3) is taken directly from the output so that R1 does not affect the output voltage when sourcing current (note that when sinking current the op-amp cannot get close to the negative rail when sinking more than 50uA or so, so the 0V output can't be approached even without R1). In most cases, the input of your transducer looks like a resistor to 0V so it's not an issue.
D1 and D2 conduct any transients to the power supply, saving U1 from damage due to ESD. R4/C2 and D1/D2 are optional as far as your immediate problem goes, R1 and C1 do the work. I strongly suggest you get that regulator temperature under control as well.
| 0.888889 |
'wicked hot' sounds like it exceeds 60-70°C range .
|
display tag and c choose tag
|
I use the following code. But it is always go to the otherwise condition. I checked the value , and those are correctly passed from java to the jsp. Any missing points?
<c:when test="${pCount > 0}">
<display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" />
</c:when>
<c:otherwise>
<display:column class="colPCount" title="${titlePCount}">&nbsp;-&nbsp;</display:column>
</c:otherwise>
For the pcount>0 items, still displaying as '-' in the display tag. Even I reverse the checking condition like pCount<0 in the first condition checking, the display tag always show the otherwise condition. It always pointing to the otherwise condition for every value.
Edited: Full Code
<display:table class="displayTable" id="itemList"
name="${sessionScope.itemList}" requestURI="listItem.action"
pagesize="15" defaultsort="2" defaultorder="ascending" sort="list">
<display:column class="colItemName" property="name"
title="${titleItemName}" sortable="true" headerClass="sortable"/>
...
<c:choose>
<c:when test="${pCount > 0}">
<display:column class="colPCount" property="pCount " title="${titlePCount}" sortable="true" headerClass="sortable" />
</c:when>
<c:otherwise>
<display:column class="colPCount" title="${titlePCount}">&nbsp;-&nbsp;</display:column>
</c:otherwise>
</c:choose>
</display:table>
|
I guess that the variable pCount = null. Try to check ${not empty pCount and pCount>0}.
| 0.666667 |
Variable pCount = null
|
Check if page has breadcrumbs from template
|
I want to add a CSS class to my body tag depending on whether the current page has a breadcrumb trail. So I would rather not add a new block, since I don't need any HTML output, but just a PHP array or boolean in my PHTML file.
I tried $this->getLayout()->getBlock('breadcrumbs') without success, because the property of Mage_Page_Block_Html_Breadcrumbs which contains the trail (_crumbs) is protected.
What is the best way to achieve my goal?
|
Personally I would go with what Pronto mentioned about using rewriting the class but if you do not fancy a rewrite you can get the breadcrumb array from the block's cache key information. The cache key information contains as serialized base64 encoded version of the breadcrumbs array so the following code snippet will allow you to get the crumbs array and then you can do what you want with it.
$breadcrumbs = Mage::app()->getLayout()->getBlock('breadcrumbs');
$cacheKeyInfo = $breadcrumbs->getCacheKeyInfo();
$breadcrumb = unserialize(base64_decode($cacheKeyInfo['crumbs']));
On pages with breadcrumbs this will be an array and on other pages this will be NULL.
| 0.888889 |
Breadcrumb array from the block's cache key information
|
When and why will an OS initialise memory to 0xCD, 0xDD, etc. on malloc/free/new/delete?
|
I know that the OS will sometimes initialise memory with certain patterns such as 0xCD and 0xDD. What I want to know is when and why this happens.
When
Is this specific to the compiler used?
Do malloc/new and free/delete work in the same way with regard to this?
Is it platform specific?
Will it occur on other operating systems, such as Linux or VxWorks?
Why
My understanding is this only occurs in Win32 debug configuration, and it is used to detect memory overruns and to help the compiler catch exceptions.
Can you give any practical examples as to how this initialisation is useful?
I remember reading something (maybe in Code Complete 2) that it is good to initialise memory to a known pattern when allocating it, and certain patterns will trigger interrupts in Win32 which will result in exceptions showing in the debugger.
How portable is this?
|
It's to easily see that memory has changed from its initial starting value, generally during debugging but sometimes for release code as well, since you can attach debuggers to the process while it's running.
It's not just memory either, many debuggers will set register contents to a sentinel value when the process starts (AIX sets its registers to 0xdeadbeef which is mildly humorous).
| 0.777778 |
Debuggers will set register contents to a sentinel value when the process starts
|
Is there a way I can share the 3.42 GB download of Windows 8.1 from Windows Store?
|
Windows 8.1 is out, and I would like to know if it is possible to share the Windows 8.1 download upgrade between different computers so that I don't have to download it over and over again?
This might be helpful for people who are on a metered connection. Store is downloading 3.42 GB of data so it must be stored somewhere. Is there a way I can copy it to my other computers and start the setup so that I don't have to download it over and over again on each computer I own?
|
I did the update earlier today though and it seems that there is a folder C:\$Windows.~BT that got created and downloaded. You might TRY to take and copy that folder to another 8 machine and see if running the setup file will work for you. If it does...awesome...
However if that doesn't work, Unless it changes later, currently you can get to 8.1 via 3 methods:
You can update each machine running 8 via the Windows Store
You can use a VL download or Technet/MSDN download. You'll have to have an account though, and I'm pretty sure it won't update non VL 8 machines.
You can buy a retail copy on Amazon or similar.
According to the MS Blog on 8.1 they aren't planning an ISO / IT Pro standalone installer:
http://blogs.windows.com/windows/b/bloggingwindows/archive/2013/10/17/windows-8-1-now-available.aspx
We're not releasing the ISO images to folks who don't have MSDN and
TechNet subscriptions. Best way for everyone else is to update through
the Windows Store. - Brandon LeBlanc (MSFT)
| 1 |
Windows Store - Updated Windows Store
|
How to fill a shape in photoshop and avoid white lines
|
This is something it will be useful for several things now that I started "photoshoping" - so I made some lines with the pen tool, then right clicked with the 'direct selection' and then 'stroke path' to paint the lines.
Now, this lines are closed, they make a shape, if I paint the inside with the bucket tool it creates white spaces inbetween the border and the filling!
How does one fill properly in photoshop?
|
When you right click to "Stroke Path" there's also a function to "Fill Path" you could use it. I suggest using it first.
Alternatively you can Right Click to Fill the Path then go to Layer > Layer Style > Stroke and this will give you much more control over the stroke.
There's rarely ever a reason to use the Paintbucket in Photoshop.
| 1 |
When right click to "Stroke Path" you could use it first.
|
Why is my fuse board buzzing when I'm using the shower?
|
I have used an electric shower for years no problems, but all of a sudden my fuse board started buzzing when I use the shower. I replaced the shower with the same size unit and it still makes a buzzing noise.
I have checked all the wires and they are tight and well connected. I changed the old cartridge fuse for an mcb 40amp fuse, and still it makes a buzzing noise.
Is this a sign that my wylex fuse board needs changing?
|
Any time you have buzzing coming out of a fuse panel or breaker panel, you need to get a qualified electrician in immediately to find out what's going on.
These things contain large buss bars and depending on your local electrical code, unfused power entry. Any minor loss of connection integrity that causes a loose connection anywhere whether it's inside a breaker, where the breaker/fuse attaches to the buss bars, broken buss bar insulation stand-offs or in the cable connection to the bars can unleash an arc in the 8000-10000 degree F range that burns through metal and instantly sets fire to any wood surrounds that heat gets transmitted into.
The best demonstration of the power of 220V (which did not blow the 50A range fuse) was a cook stove that had a weak spot develop in the element. It glowed bright orange in the break, burst into arc and burnt through the muffin tin my mother threw on it to contain the arc flame. The ion plume reached the ceiling and scorched a 3" dia area black. A water heater pulls enough current to cause such an arc wherever there's a loose connection.
| 1 |
Unfused power entry causes arc in 8000-10000 degree F range .
|
How do you map a virtual drive letter to a local path on Windows?
|
All in the title. I'm looking for how to reference a local, not network, path, as a virtual drive letter. An innocuous example: C:\Storage as G:
|
You can also map to your local drive as if it were a remote one with
net use G: \\localhost\c$\storage /persistent:yes
It does bind late in the login process though.
| 0.777778 |
Map to your local drive as if it were a remote one with net use G: localhostc$storage
|
No value for $TERM and no -T specified
|
I recently upgraded (with apt-get dist-upgrade) my Kubuntu and Lubuntu Linux boxes, and now every time I log into one of these machines, I get this message:
tput: No value for $TERM and no -T specified
Here is a screenshot of the exact message:
This happened on both my Lubuntu machine and Kubuntu machine, and it wasn't a problem until after I upgraded; so I suspect that it was not user error.
How can I fix this?
UPDATE
I have tracked this down to my .bashrc file, which is getting called by my .profile file. Though, the fact that my .bashrc file now runs when I do a GUI login whereas it didn't before I upgraded is a bit weird. And no, I haven't modified my .bashrc file or my .profile recently. Also, bash isn't my default shell.
The problem is that I am calling tput in my .bashrc file to set up variables for use in adding color to the prompt. But at the (inappropriate) time when my .bashrc file now gets run, $TERM is not set.
fgRed=$(tput setaf 1) ; fgGreen=$(tput setaf 2) ; fgBlue=$(tput setaf 4)
fgMagenta=$(tput setaf 5) ; fgYellow=$(tput setaf 3) ; fgCyan=$(tput setaf 6)
fgWhite=$(tput setaf 7) ; fgBlack=$(tput setaf 0)
bgRed=$(tput setab 1) ; bgGreen=$(tput setab 2) ; bgBlue=$(tput setab 4)
bgMagenta=$(tput setab 5) ; bgYellow=$(tput setab 3) ; bgCyan=$(tput setab 6)
bgWhite=$(tput setab 7) ; bgBlack=$(tput setab 0)
Updated question: How should I fix this? Should I set $TERM myself? Or should I just not set these variables if $TERM is not set?
UPDATE 2
One solution I tried was to check whether $TERM was set. But this didn't seem to work; I still got the same error message. Here's the code:
if [ ! "$TERM" = "" ]; then
#Do stuff here
fi
So apparently $TERM was set, but tput still concluded it wasn't.
|
For me, adding
export TERM=xterm
to /etc/profile was the only thing that solved the problem. Actually, the error gave us a hint: No value for $TERM
| 0.777778 |
Export TERM=xterm to /etc/profile
|
How to forcibly disconnect a application listening on a port
|
I have an app that doesn't properly stop listening on a port.
How do I force it to stop so I can open the application again/use that port again?
|
Yup - get TCPView from SysInternals, find the application and the connection, and close it. Failing that, restarting the application, unless the specific app has a way of doing this. Most apps won't.
| 1 |
TCPView from SysInternals, find the application, and close it
|
Change visa card type without changing number
|
Is it generally possible to change a credit card from one "specialty" to another, without changing the credit card number or expiry date?
For example, is it possible to switch from a TD Drivers Rewards Visa card to a TD Platinum Travel Visa card? Or, if TD Bank doesn't allow this, would you generally expect banks to allow this sort of change?
Obviously, you cannot change from a visa card to a mastercard; this necessarily would involve changing the credit card number. Also, for the sake of this academic exercise, assume the person switching would qualify for the new card.
|
It depends on if a new card would share the same bank identification number. The first digits of your credit card identify what bank issues the card. Looking over the list on wikipedia, some banks have multiple numbers based on card type. If that is the case, you would need a new number.
| 1 |
The first digits of your credit card identify what bank issues the card
|
Why don't electrons crash into the nuclei they "orbit"?
|
I'm having trouble understanding the simple "planetary" model of the atom that I'm being taught in my basic chemistry course.
In particular,
I can't see how a negatively charged electron can stay in "orbit" around a positively charged nucleus. Even if the electron actually orbits the nucleus, wouldn't that orbit eventually decay?
I can't reconcile the rapidly moving electrons required by the planetary model with the way atoms are described as forming bonds. If electrons are zooming around in orbits, how do they suddenly "stop" to form bonds.
I understand that certain aspects of quantum mechanics were created to address these problems, and that there are other models of atoms. My question here is whether the planetary model itself addresses these concerns in some way (that I'm missing) and whether I'm right to be uncomfortable with it.
|
This is just my 2 cents:
Electrons have so little mass they are at times a wave, their mass is so negligible don't think of them as planets, rather representations of energy.
Sometimes electrons do fall into the nuclei this is nuclear decay.
| 1 |
Electrons have so little mass they are at times a wave, their mass is negligible
|
"going to" vs "will"
|
I know several questions were asked about the difference between "going to" and "will".
Based on several answers (see, for instance, here, here and here), I understood that "will" is more spontaneous and "going to" is used with more planned actions.
So, it seems that everything is pretty fine. However, in this question, Kosmonaut has an answer in which he states:
"Let's say that tomorrow you will walk your dog from 7 - 8 AM".
On the one hand, you probably planned to walk your dog long before and thus I should use "Let's say that tomorrow you're going to walk your dog from 7 - 8 am".
On the other hand, since I'm saying "let's say...", I'm deciding right now (thus, unplanned) that you will walk your dog. So, even though in this hypothetical situation you made a plan, I'm in a more spontaneous mood deciding right now that that's what you will do tomorrow, and, thus, I should use "will".
Which one (if any) of the above explanations is right?
|
Any answer given on EL&U, given the constraints of time and space, will leave out some of the truth. That perhaps explains the limited nature of the earlier answers to this question to which the OP refers. In any case, non-native speakers usually want simple answers and these will suffice up to intermediate level.
This particular example introduces additional complications, because the speaker is not talking about the speaker’s own future acts, but about someone else’s. That makes the spontaneous/planned distinction inappropriate. In this case, going to seems the most natural expression, and it is indeed ‘often used as a general verb form for the future, especially in spoken English’ (‘An A-Z of English Grammar and Usage’).
English has no set of verbal inflections to express the future. It uses instead auxiliary verbs or, in some cases, the present tense or the present progressive construction. Although going to can be used in many cases, it can’t be used in all, and it certainly isn't invariably interchangeable with will. Native speakers will know intuitively when to say, for example, ‘Next year we’re going to have a holiday in Greece’ (not will) and when to say ‘Right, I’ll see you outside in half an hour’ (not going to). There is a clear difference in usage, reflecting the speaker’s intention in each case. Non-native speakers can only expect to distinguish such differences after considerable exposure to the language. The kind of quick fix found in the spontaneous/planned distinction will serve up to a point, but not beyond.
| 1 |
Non-native speakers can only expect to distinguish such differences after considerable exposure to the language
|
My site thinks it's a new install
|
I had an error (related to Date module I think? Can't remember.) on my site so I tried to do an update. Caused a WSOD so I svn reverted. Didn't help. Manually disabled each module in the database. Didn't help. Fixed some permissions. Helped... sort of.
Now I get this:
Drupal already installed To start over, you must empty your existing
database. To install to a different database, edit the appropriate
settings.php file in the sites folder. To upgrade an existing
installation, proceed to the update script. View your existing site.
Running the upgrade script gives this error:
PDOException: SQLSTATE[HY000] [2002] Can't connect to local MySQL
server through socket '/var/lib/mysql/mysql.sock' (2) in
drupal_get_installed_schema_version() (line 150 of
/public_html/includes/install.inc).
Any other page redirects back to install.php.
So it seems like it can see the database to know that it's not empty, but can't really connect to it... what does this mean? What do I do about it.
|
I figured this out. It's able to see the settings.php file but instead of the right database credentials it was showing this:
$db_url = 'mysqli://mynamedrupal:xxxxxxxxxxx@localhost/myname-drupal-6';
That's goofy! I'm not even using Drupal 6! There wasn't any updated version of this later in the file; this was the only database connection info. It makes sense that this was in here, since it was originally a D6 site that I upgraded, but it's unusual that it worked so long without an updated array of DB connection info.
So I pasted this in from another D7 install and changed the un/pw accordingly:
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'myname-drupal',
'username' => 'myname',
'password' => 'xxxxxxxxx',
'host' => 'server.host.com',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
I can't say for sure if this works because now I'm having different, unrelated problems. But I think this solved this particular issue, as far as I can tell, and now I'm on to troubleshooting the next thing. w00t.
| 1 |
Configure settings.php file
|
SOQL Showing null values as 0
|
If a record is not found, can I have it show a 0, instead of not appearing in my results?
For example: If I'm getting the total # of records for 5 different picklist values, and 1 picklist have has 0 records, I want it to show 0 instead of not showing that 5th picklist value at all.
|
No, SOQL won't show "empty" buckets in the result set, so it will be up to your code to properly render those zero-value entries.
| 1 |
SOQL won't show "empty" buckets in the result set
|
In a ContentByQueryWebPart, how to generate a link to the item's display form?
|
I'm building a custom Xsl to customize the rendering of a ContentByQueryWebPart. This webpart is targeting pictures
In the results, I would like to generate a link to the corresponding dispform.aspx, in order to show the details of the target picture.
How can I generate such link ?
By now, I have created this piece of Xsl to generate the link in my custom ItemStyle.xsl :
<xsl:variable name="DispFormUrl">
<xsl:value-of
disable-output-escaping="yes"
select="concat($SiteUrl, '/_layouts/listform.aspx?PageType=4&amp;ListId={',@ListId, '}&amp;ID=', @ID)"
/>
</xsl:variable>
This is working when I work at the root of the site collection. However, this does not works if the results are from another web within the site collection.
How can I correct my xsl to support any location ?
|
In order to provide the link to the picture item instead of picture url,
I recommend to modify SafeLinkUrl variable in ItemStyle.xsl that is used for Item Url:
<xsl:variable name="SafeLinkUrl">
<!--xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template-->
<xsl:value-of select="concat($RootSiteRef,'/_layouts/CopyUtil.aspx?Use=id&amp;Action=dispform&amp;ItemId=',@ID,'&amp;ListId=',@ListId,'&amp;WebId=',@WebId,'&amp;SiteId=',$SiteId,'&amp;Source=',$Source)"/>
</xsl:variable>
CopyUtil.aspx page
CopyUtil.aspx page is an application redirect page intended for redirection to the corresponding item or document.
The following parameters could be passed via URL:
Item ID
List ID
Web ID
Site ID
Source
List item
Action
InThisWeb
| 1 |
SafeLinkUrl variable in ItemStyle.xsl
|
Shalom alecha rebbi (u'mori)
|
What is the significance of the time it takes to say Shalom Alecha Rebbi (U'mori)?
|
Tosafos (Bava Basra 129b, s.v. vehilchesa) offers the following reason:
Suppose that a person is just completing a business deal, and as he's transferring the goods he realizes that he's making a mistake and wants to cancel the transaction. Now also suppose that, at the same moment, his teacher (or another prominent Torah scholar to whom he is obligated to show respect) passes by. He'll be caught in a dilemma: if he takes the time to greet them respectfully, as he should, then the deal will be final and he'll be unable to retract; on the other hand, it's disrespectful to finish his business and only then to acknowledge them. The solution? Allow him the time it takes to greet them with "shalom alecha rabi (umori)," and to still be able to cancel the deal immediately thereafter.
Once, then, this timeframe is established as the standard for the amount of time in which a person can retract a business deal, it is used in other halachic contexts too.
Ran cites the Raavad, who gives another rationale:
When reciting Shema, one may pause (even in the middle of a passage) in order to reply to someone out of yir'ah (Berachos 13a). Rashi there explains "yir'ah" to mean "fear of being killed," such as by a ruler who would take offense at not being greeted respectfully; but Raavad takes it to mean "awe," as in what one should feel towards his Torah teacher. Since, then, according to this understanding, greeting him (with this three- or four-word phrase) is not considered a real interruption of the Shema, then this establishes the precedent that the time it takes to say this phrase is not considered an interruption for other purposes either.
| 0.555556 |
Retract a business deal with a Torah teacher
|
business-class fiber to the home
|
Suppose you're some sort of crazy nerd fellow and you live in an area that's absolutely covered in fiber optics and network facilities. What kind of cost / infrastructure would be needed to hook in somewhere and get you're internet connection directly from a local datacenter?
|
You need to talk to a local ISP and get a quote on a high-end connection. They can tell you how much it'll cost to get set up.
Lot of times your regular "consumer" ISPs have high end data plans available, in which case the cost would probably be minimal. Cable and DSL use pretty much the same equipment for home/business connections. I have a satellite office that gets it's internet from a local cable company (Cox) and we get 15/3 for about what a T1 would cost (though it's less reliable).
| 0.777778 |
Cable and DSL use the same equipment for home/business connections
|
What is Pointer-chasing and how it is related to BFS
|
While reading a PPT on BFS (Breadth First Searching) I found that BFS can be used where we have " pointer-chasing" . What exactly is a pointer chasing and how is it related to BFS?
|
Pointers imply a graph on your data. BFS (breadth first search) is an algorithm to search in that graph.
Pointer chasing is just another word for following lots of pointers.
| 0.888889 |
Pointers imply a graph on your data
|
Best way to migrate text field to taxonomy reference field
|
I want to migrate a text field to taxonomy reference field( the Tags one).
I've 1200 nodes having a field "Organization name". Those creating the content are making mistakes like misspelled company names. I'm using the company name in the views to find all related nodes.
This will help those entering can simply choose the company names or if someone has entered IBM for International Business Machines then I can merge those terms when using taxonomy reference field.
Should I go and create a vocabulary, add all existing values as terms in vocabulary then programmatically assign the text field values to the taxonomy reference field? Then delete the text field and change references in the views etc.
|
Using the example/suggestion @Molot posted, I created a batch process and packaged it as a module. Thought I would share.
First, create your taxonomy terms and add your entity reference field to your content type, then create and enable your batch module. Be sure to update the **FIELDS** below.
/**
* Implements hook_menu().
*/
// Lets add a menu link to initiate the batch process
function convert_field_to_taxonomy_menu() {
$items = array();
$items['admin/batch'] = array(
'title' => 'Convert to Tax Batch',
'description' => 'Run batch operations.',
'page callback' => 'drupal_get_form',
'page arguments' => array('convert_field_to_taxonomy_form'),
'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
// And a button to click
function convert_field_to_taxonomy_form() {
$form = array();
$form['submit'] = array('#type' => 'submit', '#value' => t('Click here to Start'));
return $form;
}
function convert_field_to_taxonomy_form_submit($form, $form_state) {
batch_set(convert_field_to_taxonomy_setup_batch());
}
function convert_field_to_taxonomy_setup_batch() {
drupal_set_message('Updating Nodes');
// load all the nodes from content type
$nodes = node_load_multiple(array(), array('type' => "**CONTENT_TYPE**"));
$node_count = count($nodes);
// build the list of operation functions and function arguments
foreach($nodes as $nid => $node) {
// $operations[] = array(<function name>, <array of arguments to pass to function>);
$operations[] = array('convert_field_to_taxonomy_method', array($node));
}
//put all that information into our batch array
$batch = array(
'operations' => $operations,
'title' => t('Convert to Tax Batch'),
'init_message' => t('Initializing...'),
'error_message' => t('An error occurred'),
'progress_message' => t('Operation @current out of @total.'),
'finished' => 'convert_field_to_taxonomy_finished_method'
);
return $batch;
}
function convert_field_to_taxonomy_method($node, &$context) {
$context['results'][] = $node->nid.
' : '.check_plain($node->title);
// Optional message displayed under the progressbar.
$context['message'] = t('Processing snapshot "@title"', array('@title' => $node->title));
$vid = 38; // vocab ID
$edit = array('vid' => $vid, 'name' => $node->**SOURCE_FIELD**['und'][0]['value']);
$terms = taxonomy_get_term_by_name($edit['name']);
if (!empty($terms)) {
// term already exists
$first_item = array_shift($terms);
$tid = $first_item->tid;
} else {
// add term and get the tid
$status = taxonomy_term_save($edit);
$tid = $edit['tid'];
}
$node->**TARGET_FIELD**['und'][0]['target_id'] = $tid;
node_save($node);
$path = drupal_lookup_path("alias", "node/".$node->nid);
drupal_set_message("<a href='/$path'>".$node->title.
"</a> updated.");
}
function convert_field_to_taxonomy_finished_method($success, $results, $operations) {
if ($success) {
// Here we could do something meaningful with the results.
// We just display the number of data we processed...
drupal_set_message(t('@count terms processed.', array('@count' => count($results))));
} else {
// An error occurred.
// $operations contains the operations that remained unprocessed.
$error_operation = reset($operations);
drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE))));
}
}
| 0.666667 |
Using the example @Molot posted, I created a batch process and packaged it as a module
|
How to plan for the future when installing a new roof?
|
We're hiring a contractor to take off the existing roof, repair/replace any rotted sheathing and rafters, and install a new roof. We've also asked that they add a new plumbing vent stack for a new bathroom we'll add later, a bathroom exhaust vent, a whirlybird to vent the attic, a dryer vent, and supports in case we want to install a roof deck later.
This is a 4 floor row house with shallow pitch roof in mid-Atlantic US. There's a 6" to 3' pitched attic area with r30 batts on the ceiling joists. Also have HVAC compressor on roof and unit in attic.
What else should we think about along these lines? Green roof supports? Solar panel mounts? Additional insulation? What should we prepare for now, or at least consider?
|
The three things that I ask people to consider when they're replacing a roof is if they're in a wind or hail damage region, and if they're in a region with high solar gain (such as Texas) or an area prone to ice damming (such as New England or the upper midwest.)
If you're in an area that is prone to wind or hail damage (thunderstorms or hurricanes), you might want to look into a more resilient form of roofing material. Stone-coated steel shingles (which look just like standard asphalt shingles) are a great product that will resist most forms of damage that can be dished out. Your insurance may give you a discount on them because they have a longer lifetime.
If you're in a high solar gain area, look into some of the energy-star rated shingles. They again look just like stone coated asphalt shingles, but they'll help keep your attic cool in the summertime.
If you're in an area that gets a decent amount of snow, make sure that they install an ice & water barrier around any roof penetrations (like skylights or places where they replace a vent) and along the edge of the roof where you could develop ice damming problems. This material is a sticky membrane that self-sticks to the roof deck and basically keeps water from seeping through at all. Common brand name for this product are "Grace Ice & Water Shield" ... I also personally use it in roof valleys, gable crotches, and several other places where water tends to get blown up inside something and you really don't want it to soak through.
You definitely want to get your insulation up to the max, but that's something that you can do at any time using blown-in insulation. If you are replacing roof decking and have it open, you should make sure that you have plenty of soffit vents and that your soffit vents are baffled properly. (I like the Berger Accuvent, personally...)
You want to make sure that any damaged or rusted flashing is replaced, and that tar paper is replaced. Look into what kind of tar paper they're using (heavier the weight, the better...), because that's actually your roof. Make sure you know what kind of valleys you're getting. For standard asphalt shingles, I prefer woven valleys, but they're harder to do and therefore are more expensive.
| 1 |
If you're in a high solar gain area, look into a more resilient form of roofing material .
|
WordPress Show Single Post on Home Page with previous/ Next Button
|
I am new to WordPress and recently doing some stuff with WordPress.
I am using WordPress and want to make theme.
I want to show a full post on the home page and at the bottom I want to show next and previous post links.
There will only be one category in which I will post and only one post will display on the home page at a time.
|
Create a php template to display a Page of Posts. See codex.wordpress.org/Template_Hierarchy to ensure that the page you create will use this template.
Use the next_post_link() function and the related previous_post_link() function to display the links.
Create a page in WordPress to act as your front page (doesn't need to have any content in it).
In the WP Admin, under "Settings" > "Reading", set the front page to the page you created in #3.
| 0.888889 |
Create a page in WordPress to act as your front page
|
Why are MKPolyline and MKPolygon working in iOS 3.2.2 (on an iPad)?
|
As far as I can tell, technically MKPolyline and MKPolygon should not be functional/available when running on an iPad or any other device prior to iOS4. Nevertheless, when I installed 3.2.2, on the device, and updated my build tools with the latest (non-beta) iOS 4.2 SDK, they both work just fine, along with their associated views. What the hell?
I'm not exactly complaining here, given that the alternative would be NVPolyline and it doesn't play well with a huge number of points. I'm just confused. Can someone explain why these classes are available and working on the iPad?
I have not, however, had any success subclassing MKOverlayPathView on 3.2.2, even though MKPolylineView and MKPolygonView both descend from it.
|
The docs certainly claim that it was first available in 4.0, but I remember the new MapKit overhaul being part of the diff for 3.2. I think the docs just have the timeline of that update wrong.
| 1 |
MapKit was first available in 4.0
|
How to Implement composite primary key with Hibernate Annonations
|
I would like to know how to create a Composite Combination through Hibernate annotation method.
I have 3 tables Employee, Department & Employee-Department-Juntion
Since I want to make Employee and Department as individual table, i created a Junction Table in order maintain the Many-to-Many relationship.
I would like to know how to Create Composite Primary Key for the Department Table
For the column Center_Code & Depart_Code through Hibernate Annotations.
Could you please somebody help me how to solve this issue.
Below Here I also attached the Table Relation Ship and the Java POJO Class.
Table Relationship
JAVA POJO CLASS
package com.hibernate;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Id;
/**
*
* @author SPAR
*/
@Entity
public class Department {
@Id
private String cost_Center_Code;
private String dep_Code;
private String department;
private String sub_Department;
private String division;
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getDep_Code() {
return dep_Code;
}
public void setDep_Code(String dep_Code) {
this.dep_Code = dep_Code;
}
public String getCost_Center_Code() {
return cost_Center_Code;
}
public void setCost_Center_Code(String cost_Center_Code) {
this.cost_Center_Code = cost_Center_Code;
}
public String getDivision() {
return division;
}
public void setDivision(String division) {
this.division = division;
}
public String getSub_Department() {
return sub_Department;
}
public void setSub_Department(String sub_Department) {
this.sub_Department = sub_Department;
}
@Override
public String toString() {
return "Department{" + "cost_Center_Code=" + cost_Center_Code + ", dep_Code=" + dep_Code + ", department=" + department + ", sub_Department=" + sub_Department + ", division=" + division + '}';
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + Objects.hashCode(this.cost_Center_Code);
hash = 79 * hash + Objects.hashCode(this.dep_Code);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Department other = (Department) obj;
if (!Objects.equals(this.cost_Center_Code, other.cost_Center_Code)) {
return false;
}
if (!Objects.equals(this.dep_Code, other.dep_Code)) {
return false;
}
return true;
}
}
|
I think,what you are looking for is EmbeddedId,You can do something like below.
First take out these column from your Department class,and create a new class like below.
@Embeddable
class CenterDeptId{
@Column(name = "center_code")
private String cost_Center_Code;
@Column(name = "dep_code")
private String dep_Code;
// getter && setter
}
Use the above class in your Department class
@Entity
public class Department {
@EmbeddedId
private CenterDeptId centerDeptId;
private String department;
private String sub_Department;
private String division;
//getter && setter
}
| 1 |
Use EmbeddedId in your Department class
|
Is there a word specifically referring to the stand upon which a large book is displayed, opened to a page?
|
I'm thinking in particular of dictionaries or illuminated bibles being displayed on these stands, which are at least waist-high on a standing person, constructed of wood. Is there a particular word for this, other than "book stand"?
|
Various terms are used:
Book cradle of book exhibition cradle (source, source) are used for museum displays.
A tradename for a purportedly superior book cradle is the Benchmark Butterfly Bookmount. (source)
A search of book cradle shows that book stand (mentioned by nxx) is also used, apparently for less demanding displays.
| 1 |
Book cradle of book exhibitions are used for museum displays
|
Are comments considered a form of documentation?
|
When I am writing small scripts for myself, I stack my code high with comments (sometimes I comment more than I code). A lot of people I talk to say that I should be documenting these scripts, even though they are personal, so that if I ever do sell them, I would be ready. But aren't comments a form of documentation?
Wouldn't this:
$foo = "bar"; # this is a comment
print $foo; # this prints "bar"
be considered documentation, especially if a developer is using my code? Or is documentation considered to be outside of the code itself?
|
They are a form of documentation, but remember that documentation is in the eye of the beholder....
For some, self documenting code is enough. But that assumes a level of technical detail as the customer. We should be careful thinking that this is enough, because our ego may tell us "It is obvious what this code is doing" but time can prove otherwise. It also assumes you know in advance the skills of the reader.
For those looking at source code but with less technical expertise, comments could be ok. But that assumes someone is looking at the source code.
If you're technical, but lacking the time to read all the source code, a technical manual could be what's required.
An if the user lacks technical skills, but just needs to know what is happening, user documentation is what's needed.
So the real question is who is your customer? If you are, then self documenting code or comments is enough. If it's for someone else, you might want to broaden how you document.
| 1 |
Self documenting code or comments is enough.
|
Learning how to be a good rhythm guitarist before becoming a lead guitarist, where to start?
|
I have recently been trying to hone in my improvisational skills. I'm stuck in the first position of the Am pentatonic box and can't move away from it. Whenever I try to move out of it, I randomize the next box that I go to, which most of the time leads to bad sounding improvisations.
I have narrowed the problem down to it being me having a bad sense of rhythm. I think I've got technique as a rhythm guitarist, but in regards to musicality, I don't.
I don't know which chords go together well, what goes after a chord, how minors, majors and 7ths are formed (don't know if this is important to be a good rhythm guitarist though), etc.
|
I'm addressing only your first paragraph. Assuming you want to stay pentatonic for now, and know the box in A based around the 5th to 8th frets, this should help. The box below that has basically two notes per string, as the box you know. Each higher note on each string is the SAME note as the lower one in your known box.So you already know HALF of it !! Guess what - the next box up uses for its bottom notes the same ones as the TOP notes of your known box. Thus you already know HALF of that one !! So - in order to use all three boxes, you only need to replicate the pentatonic notes around frets 2/3 and frets 7/10. If you start the higher box on 6th string, 8th fret, and use the Am pent. notes, you'll hopefully realise that it's actually C maj. pent. you're playing. It happens to use EXACTLY the same 5 notes, so you can solo along regardless.
| 0.888889 |
Pentatonic notes in A based around the 5th to 8th frets
|
Is it better to put "Preview" on an iFrame with a specific height or just show it in full?
|
We have a page that shows a preview of another page (newsletter) on an iFrame. Now we have two ways of displaying this:
Give the iFrame a specific height so that the user can scroll up / down within the iFrame to see the embedded page fully.
Dynamically resize the iFrame to the height of the embedded page so that it actually gets displayed in full (without the iFrame
scrollbars).
Is #1 better so that the users can access the buttons at the bottom easily (button is "Next") without scrolling 'till the end of the embedded page? (Although the disadvantage is that iFrame scrollbars are ugly.)
OR
Is #2 better so that the users actually feel like they're just seeing 1 whole page (and no scrollbars)? (Although the disadvantage of this would be the page could be very long depending on newsletter's height. But one can argue that newsletters are seldom very long and that users do scroll down.)?
|
I'm going to assume this is HTML and will be viewable online. One option is to add div element and have that be stuck to the bottom of the screen as a sort of non-intrusive "bar" for the users to users to skip between these pages.
Prehaps something like this:
<div class="bar">
<a class="prev" href="<link>">Previous</a>
<a class="next" href="<link>">Next</a>
</div>
And the CSS would go:
.bar {
width: 100%;
height: 36px;
background: rgba(255, 255, 255, 0.75);
position: fixed;
bottom: 0;
left: 0;
}
| 1 |
CSS is a non-intrusive "bar"
|
Is it possible to connect to already running session on Xubuntu 12.04 machine?
|
Previously I was connecting to my Xubuntu machine1 by running on it VNC server first and then using VNC client on machine2 to connect to machine1. The problem is that i had to login anew to my desktop, so I got new X11 session, I believe.
I would like to connect to my already running X11 session if it's running. Is it possible to do that? If yes, than what should I do?
Thanks in advance.
|
I install and use vino, and I believe it comes standard with regular Ubuntu (with a menu item called something like Remote Desktop). It puts a little icon in your system tray so you can easily access the program preferences. It works with any vnc client. You just have it start with your startup programs.
Run /usr/lib/vino/vino-server
After you login, it connects immediately to your running desktop.
| 1 |
Vino comes standard with regular Ubuntu
|
Can the word "facet" be used in a sentence like this one?
|
Leadership skills are also a valued facet in a friend.
Can facet be used in this way?
|
Usually you use the preposition "of" when talking about facets. And I've not seen it commonly being used when referring to persons. It's more commonly used when talking about inanimate objects or intangible ideas.
So a statement like "Decisiveness is an important facet of leadership" is perfectly natural and correct.
But "Leadership skills are also a valued facet of a friend" still sounds "off" to my ear.
Words like "trait" and "virtue" are preferred when talking about people.
Why not: "Leadership skills are also a valued trait of a friend".
Or: "Leadership skills are also a valued virtue of a friend"?
You can also substitute the preposition "in" for "of" in the latter two suggestions I gave.
| 1 |
"Leadership skills are also a valued virtue of a friend"
|
Is potential energy and "work done" the same thing?
|
Is potential energy and "work done" the same thing?
If they are not one and the same thing then why is potential energy always associated with "work done"?
Could you explain me with some examples?
|
Potential energy is a concept of the energy results from the object position
as a concept it refers to the work you have to do to move the object from $U=0$
To any another point
at $U= 0$ we call this point the reference point and it's like how to choose the origin of the coordinate system
| 1 |
Potential energy is a concept of the energy results from the object position
|
How to add a website to Safari Top Sites manually?
|
How to add a website to Safari Top Sites manually instead of viewing it so many times that Safari chose it for you?
|
You can add it by dragging URL to top sites window.
| 1 |
Drag URL to top sites window
|
Negatively curved metrics minimizing the length of a homotopy class of simple closed curves
|
Good afternoon everyone !
I have the following question of Riemannian geometry :
Let $M$ be a smooth closed orientable manifold of dimension at least $3$, and let $\mathcal{T} = \{ $ smooth Riemannian metric on $M$ with sectional curvature pinched between $-1- \epsilon$ and $-1$ $\}$ where $\epsilon$ is an arbitrary positive number. Assume that $\mathcal{T}$ is non-empty.
Let $\gamma $ be a simple closed curve in $M$. It is classical that for every negatively curved metric $g$ there is a unique closed curve in the free homotopy class of $\gamma$ that is length minimizing. Note $L_g(\gamma)$ the length of such a curve.
1) Is it known whether $ \inf_{g \in \mathcal{T} }{L_g(\gamma)}$ is positive or zero ?
2) Is it known whether $ \sup_{g \in \mathcal{T} }{L_g(\gamma)}$ is finite or infinite ?
3) Can one say more in specific cases, say when $M$ is hyperbolic ?
Obviously in dimension 2 Fenchel Nielsen coordinates show that $ \inf_{g \in \mathcal{T} }{L_g(\gamma)}$ is zero and $ \sup_{g \in \mathcal{T} }{L_g(\gamma)}$ is infinite. Nonetheless, the lack of topological symmetries for higher-dimensional hyperbolic manifolds make me hope that the opposite might be true.
Thanks for your attention !
|
We have $0<\inf_{g\in \mathcal{T}} L_g(\gamma) \leq \sup_{g\in \mathcal{T}} L_g(\gamma) <\infty$. In fact, there should be a universal bound on the ratio
$\sup_{g\in \mathcal{T}} L_g(\gamma)/ \inf_{g\in \mathcal{T}} L_g(\gamma)$ for all $\gamma \in \pi_1 M$.
This follows from a theorem of Belegradek, who proves that the class of such metrics (actually, with just a fixed fundamental group $\pi$) is precompact in the Lipschitz topology. In particular, all such metrics are uniformly bi-Lipschitz, and thus one has the bound on the ratio between maximal and minimal lengths, as well as absolute bounds.
Quoting from the paper:
Recall that the class of all compact Riemannian manifolds of a given dimension
has the so-called Lipschitz topology, namely, two manifolds $M$ and $N$ are said to be
$\epsilon$-close if there exists a diffeomorphism $f : M → N$ such that both $f$ and $f^{−1}$ are
$e^\epsilon$-Lipschitz. A class of manifolds is called precompact if for any positive $\epsilon$, every
sequence of manifolds in the class has a subsequence whose members are mutually
$\epsilon$-close.
Now, suppose there is no upper bound $C$ so that any two metric $g,h\in \mathcal{T}$ are $C$-close. Take sequences $g_i,h_i\in \mathcal{T}$, such
that $g_i$ and $h_i$ are not $N_i$-close, for a sequence $N_i\to \infty$. Passing to subsequences, we may assume that $\{g_i\}$ are mutually $\delta$-close for any $\delta>0$, and similarly for $\{h_i\}$. But $g_i$ is $\delta$-close to $g_1$, which is $C$-close to $h_1$ for some $C$ (since these are metrics on the same manifold), and which is $\delta$-close to $h_i$ for all $i$. Thus, $g_i$ is $2\delta+C$-close to $h_i$ for all $i$, a contradiction.
So we see that any two metrics in $\mathcal{T}$ are $C$-close for some $C$. This implies that $\sup_{g\in \mathcal{T}} L_g(\gamma)/ \inf_{g\in \mathcal{T}} L_g(\gamma)\leq e^C$ for all $\gamma \in \pi_1 M$. Moreover, comparing to any fixed metric in $\mathcal{T}$, we see that $0<\inf_{g\in \mathcal{T}} L_g(\gamma) \leq \sup_{g\in \mathcal{T}} L_g(\gamma) <\infty$.
| 0.777778 |
Riemannian manifolds of a given dimension are precompact in the Lipschitz topology
|
android using async http connection to get image bitmap
|
I am trying to use async requests to fetch the images from urls, to prevent the url from hanging. This is the piece of code i am using for this
private void setImg(final ImageView im, String url){
AsyncHttpClient client = new AsyncHttpClient();
client.get(url, new AsyncHttpResponseHandler(){
public void onSuccess(String response){
try{
byte[] imageAsBytes = response.getBytes();
im.setImageBitmap(BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.length));
im.refreshDrawableState();
} catch(Throwable e){
e.printStackTrace();
}
}
});
}
This is always showing this warning in logcat
12-29 01:55:33.043: D/skia(14414): --- SkImageDecoder::Factory returned null
I cannot find a proper reason for this. Any help?
|
I've been using lately the following library: UrlImageViewHelper. It uses an AsyncTask to download the image. Your code would be something like this:
private void setImg(final ImageView im, String url){
UrlImageViewHelper.setUrlDrawable(im, url) ;
}
Very simple now, am I right?
| 0.666667 |
UrlImageViewHelper.setUrlDrawable (im, url)
|
Which color scheme to choose for applications that require long work hours?
|
I'm working on a ERP / Accounting (lots of tables and data) web app and was wondering what color scheme would be appropriate for this type of application? Users will be sitting in front of their computers for 8+ hours enetering lots of data on daily basis and I would like to make that experience as comfortable as possible to their eyes.
Most of these application I've seen are using some sort of a white/grey/blue scheme with white being dominant but I'm concerned that this color might strain their eyes to much especially considering different brightness of monitors and working in the dark.
Any help would be appreciated.
|
While working on a data intensive project management app recently, I opted to use a light grey background (#f3f3f3), white (#fff) "cards" with a very subtle box shadow, and light-black (#333 of #585858) text on the cards. The area the user needs to read stands out, but is still white. The contrast between the text and the background is easy on the eyes. For links and other colors, I used "pastel" type shades so it's not too dark and not too bright.
I got this idea from looking at webapps like Google+, LinkedIn, Podio, and more. Check out these UI kit screenshots - it seems like this trend is quite common.
The question is: is this a trend or actually better for users? In my experience (taking a webapp that had darker elements and an all white background and then making it "flat", adding the grey background and "cards") this seems like a better route. This is based on feedback from users using the app heavily before and after the redesign.
| 0.888889 |
Is this a trend or actually better for users?
|
Do I need a transit visa for a layover in Turkey?
|
I have a flight layover of 12 hours at Istanbul. I have a official Indian passport and will have a Schengen visa as I will be returning from Germany.
Do I need a transit visa for city tour?
If yes, what is the procedure?
|
There is a page on Ministry of Foreign Affairs FAQ that answers your questions specifically:
Question: I will be flying to Europe. I know that our aircraft will land in İstanbul. I am not planning to leave the transit lounge. Do I need to get transit visa?
Answer: If you will not leave the transit lounge at the airport you are not required to have transit visa. Otherwise, you have to make visa application to the nearest Turkish Representation. Contact information of the said missions can be reached through www.mfa.gov.tr (Ministry/Turkish Representations).
| 1 |
Do I need to get transit visa?
|
Probability...coin toss
|
A coin having probability $p$ of coming up heads is successively flipped until the $r^{th}$ head appears. Let $X$ be the number of flips required. Find the probability $P(X=n)$.
So this means I need to find the probability that $n$ flips are needed to get the $r^{th}$ head. I am not sure how to proceed. Any help/clarification please?
Thank you.
|
I'm quite sure this question involves some sort of distribution. You might want to search about the Negative Binomial distribution. Given the probability of a success $p$, calculate the number of times, $n$, you will need to achieve $r$ successes.
I will shamelessly copy the equation from Shyam
$$P(X=n)=\binom{n-1}{r-1}p^{r-1}{(1-p)}^{n-r}\times p$$
There are 3 parts to this equation (RHS), namely:
Basically, the $\binom{n-1}{r-1}$ means there are these number of ways where you can select $r-1$ successes, out of $n-1$ tries.
The next part, $p^{r-1}{(1-p)}^{n-r}$ means, assuming the event of success is independent, once again, $r-1$ successes and $n-r$ failures. Consider that $(n-r) + (r-1) = (n-1)$, which is the total number of tries so far.
Multiply that with $p$, which is the probability of the last success, and you get your answer.
| 0.888889 |
Negative Binomial distribution
|
iptables -P FORWARD DROP, good or bad?
|
Is dropping all FORWARD packets bad? What are they used for? Why would I want to block them or keep them open?
(I fully understand INPUT and OUTPUT)
|
Is your machine a router? Is it expected to do something with packets that it receives that are not destined for your machine?
You can safely drop packets if you are not expected to forward them, though it's probably a sign of a misconfigured network if you are receiving them.
| 0.888889 |
Is your machine expected to do something with packets that it receives that are not destined for your machine?
|
Preventing player passivity in GUMSHOE?
|
I really like the game worlds of the various GUMSHOE games I have (Fear Itself, Esoterrorists, Mutant City Blues) but haven't run it yet. My big concern is that I've seen the "ablative skill system" kind of mechanic work very poorly in other games - players hoard their "uses," or use them all and then sit on their hands during the latter part of the game session because they know they're not going to be able to succeed at anything and trying will just get them killed.
In GUMSHOE, your skills are a "pool" of points that you spend either for benefits or for adds to the dice when testing. You basically roll d6 + spend vs a difficulty, typically 4 for general stuff but often going higher. Fighting works the same way, so if you have a Scuffling pool of 8, once you've used them all, you know you won't live through any meaningful combat.
For those that have run GUMSHOE or similar ablative systems, do you find that happening, and what are ways to avoid it? I mean, I don't mind trying to capture the "downward spiral" but it risks characters just checking out if they don't think whatever plot is at hand is really worth all their lives. "Let's try to save her next session..."
|
Tell them to spend Investigative at every opportunity. It's like Monopoly in that respect - if you land, you buy. Being allowed a spend is a reward.
The resource that you are managing is really spotlight time. General skills? That's different. If they are avoiding combat to save points for later, that's all good.
| 0.666667 |
Spend Investigative at every opportunity
|
More colloquial term for "confidant"
|
Is there a more colloquial term for a "confidant", or someone who has been entrusted with sensitive information to be disclosed only under certain conditions?
This is related to my previous question on trusted proxies.
|
In Harry Potter, they call that person a "Secret Keeper", although that also involves magic and whatnot.
In computer terms, a group of people who are entrusted with secret information (such as SSH keys) are indicated to be a part of (or within) a circle of trust.
In High School, girls call those people BFFs.
| 1 |
In Harry Potter, a "Secret Keeper" is entrusted with secrets .
|
Who was the "Starship Troopers" representative who appeared in "The Cat Who Walks Through Walls"?
|
From "The Cat Who Walks Through Walls" Wiki article:
During a meeting of the Council of the Time Scouts, representatives from every major time line and setting written by Heinlein appear, including Glory Road and Starship Troopers; and a reference is made to other authors' works as well.
Who was the representative from Starship Troopers?
|
The members of the Circle of the Ouroboros are introduced as:
Master Mobyas Toras of Barsoom (Timeline 1, Coded John Carter)
Her Wisdom Star, Arbitrar of the Ninety Universes (Composite timeline, Coded Cyrano)
Woodrow Wilson Smith, Senior of the Howard Families (Timeline 2, Coded Leslie LeCroix)
Dr. Jubal Harshaw (Timeline 3, Coded Neil Armstrong)
Dr. Hilda Mae Burroughs (Timeline 4, Coded Ballox O'Malley)
Commander Ted Smith (Timeline 5, Coded DuQuesne)
Captain John Sterling (Timeline 6, Coded Neil Armstrong Alternate)
Sky Marshal Samuel Beaux (Timeline 7, Coded Fairacre)
In Starship Troopers, the person with the rank of Sky Marshal commands Earth's entire military, so we can reasonably assume that the representative from Starship Troopers is Sky Marshal Samuel Beaux.
| 1 |
The Circle of the Ouroboros members are introduced as: Master Mobyas Toras of Barsoom
|
GIN/GiST Full Text searches through openlayers, geoserver and postgres
|
I have a a web app that automatically maps recent tweets and allows you to search for certain keywords. it uses Postgres for the database, geoserver as the server, and openlayers as the cartographic library. Right now tweet keywords are done using the ILIKE query.
This works pretty well if the keyword i'm looking for is a commonly used word, like 'love' , 'friend', 'OMG', etc. but less common words like "geospatial" need to search through a lot more data in order to find the last n instances of the word. This is dead slow.
To combat my slowness I'm building a GIN index on my tweet field in postgres. Two days later and i'm still waiting for the index to complete. Once it's built though, I'll try a few queries using SQL view parameters and hopefully this will dramatically speed things up.
Even if this approach works though, it's not going to be all that useful if the index takes so long to create -- the maintenance of it will not be able to keep up will the incoming flood of data. I think I will try out the GiST index next and see how long it takes as I understand it is much faster to this build index.
Beyond this, what can I do next? Do options like Solr work with Geoserver?? Are there any common approaches to this type of problem and data size/rate?
|
You could use GeoAlchemy + Full Text Search (FTS). It can probably increase the speed of your queries. However, it seems that FTS needs to be adapted to do such work in GA. I put below some links that may give you some more insights on both tools:
GeoAlchemy:
http://frankpurcell.com/code/tutorial
http://www.geoalchemy.org/_sources/tutorial.txt
https://github.com/geoalchemy/geoalchemy/tree/master/examples
https://geoalchemy-2.readthedocs.org/en/latest/orm_tutorial.html
FTS (with SqlAlchemy, but it's already adapted to SA as a patch):
http://nibrahim.net.in/2013/11/29/sqlalchemy_and_full_text_searching_in_postgresql.html
| 1 |
GeoAlchemy + Full Text Search (FTS)
|
Which color to choose for food?
|
I'm building an Online Food Ordering website, where users can order food from their favourite restaurants. I'm confused in selecting the colors for the website, can any one help me with it.
Which colors should I use for website background or should I put delicious food images?
Which colors to use for the text?
I have read some article that Red, Green, Oranges are good options for food related websites.
|
For starters, I recommend looking at the answers to this question, which colors make you hungry as that can give you some inputs about what colors to for your site assuming you already dont have a defined branding guideline in place.
With regards to whether you should use color or pictures, that would eventually depend on the the design of the site but since the objective of your site is to allow users to order from online restaurants,your objective is to get them excited and hungry. Research has shown that pictures of food do make people hungry as quoted in this study
Max Planck researchers have proven something scientifically for the
first time that laypeople have always known: the mere sight of
delicious food stimulates the appetite. A study on healthy young men
has documented that the amount of the neurosecretory protein hormone
ghrelin in the blood increases as a result of visual stimulation
through images of food.
The combination of pictures and colors can help you come up with a design which should be focussed on informing users about the choices available and the primary call to action. Here are some good examples of sites who do it well by both using colors and pictures well.
Seattle - Eat 24 hours
Food panda
Quick Burp
| 1 |
What colors should you use for your site?
|
what is best way to Migrate Content from Tridion 5.3sp1 to 2011sp1
|
Our migration from 5.3sp1 to 2011sp1 will happen for period of 2-3 months, but content will be added on production during that time in tridion 5.3sp1.
After the migration activities we will have migrated system on 2011sp1,
But now i want to migrate new content from production(which is still in 5.3) to upgraded DB.
Content porter version 2.3(currently being used in 5.3sp1 ) is not supported in 2011.
What would be the best approach for this?
|
You might want to consider upgrading your content porter to 2009 SP1. It is compatible with 5.3 SP 1 and 2011 SP1 as well.
There is probably no way to carry out a migration without a freeze period but using a one-time database upgrade and content porter, you could keep it to a minimum.
You might also want to consider a design freeze ( no schema or template changes ), based on your blueprint and port ONLY content changes done later across 2 environments, keeping risk to a minimum.
I hope it helps. Good luck convincing the authors :).
| 1 |
Adding content porter to 2009 SP1
|
Mechanic says not to use top three/bottom two gears or the chain will throw
|
I just bought a BTwin Fit 5, all stock, fresh from the distributor, Decathlon. Took it for light pacing at the store and things seemed OK. About 100 metres out the door, I shift up to the top end of the range, pedalling firmly but not hard, and it promptly throws the chain to the outside.
Returning to the store, the mechanic puts the chain back on, adjusts the tension on the derailleurs and tells me not to use the top three or bottom two gears (i.e., the 3 highest resistance and two lowest resistance shift positions in the drive train's range), or the chain will throw again. I asked why, but unfortunately, I'm a foreigner and don't speak the local language well enough to understand any of his explanation. Please note I definitely did not misunderstand the bit about not using the gears; this was crystal clear.
Wild speculations on what he may have said about the reasons for this:
Chain tension or play due to the lateral shift between the inner and outer gears of the front and rear cassettes when shifting
Chain length
Something about the derailleurs
Again, there's a substantial language barrier and I have zero confidence in my understanding of what he said about why I shouldn't use those gears.
If you're not familiar with Decathlon, it's a sports department/box/super store. Definitely not a high end or dedicated bike shop. The house mechanic struck me as less than an expert, to put it gently. I've definitely read some reviews online griping about the inability of Decathlon staff to correctly set up the drive trains of new bikes. However, it's important to understand that this quality of expertise is representative of (or better than) that of every shop within an hour's travel.
This advice seems utterly mad to me. What on earth could be the reasoning behind this? What can I do about it? Aside from the obvious of taking it to a better mechanic, as that presents substantial difficulty for me on a number of fronts. The bike shifts without a problem, including before the throw. I did test out every gear during my test ride. I haven't yet experimented with trying to reproduce the problem yet; I'll do so in the next few days most likely.
The bike has a Shimano Sora groupset and Shimano Deore shifters. I'm an experienced rider but no mechanic; I haven't done anything beyond basic maintenance myself. I can provide additional pictures and am game to make relatively minor adjustments, but even just clearly nailing down the issue would be considerably useful.
Additional pictures, shifted to big-big.
|
Crossing chaining hasn't been any problem at all since the invention of bushless chains 20+ years ago and wasn't even a real problem back in the ancient days. It's a persistent myth that just won't die...
Your bike should leave the shop capable of shifting into any combo of gears possible and riding any amount of time you like in that gear. At most I would accept a slight extra noise in the extreme combos(big/big and little/little), but those components were designed to work in all the gear combos.
If you are mixing/matching components or running odd size gears, you might run into some problems with derailluer capacity, but any bike stock from the shop should be able to use all it's gears.
| 0.777778 |
Crossing chaining hasn't been any problem since the invention of bushless chains 20+ years ago .
|
How to start working in magento?
|
I am new in magento and a little confused to how to start work in it.
I studied the basics of magento and found its structure really complex.
I never worked on a CMS before and I have a little knowledge of php and html but I am not good in css.
Should I learn the css before start working in magento or it will not be a big problem.
What are the easiest steps for learning magento. Please give me some ideas.
Thanks.
|
It depends on what you wan't to do. If you just want to start off implementing simple theme's some knowledge of PHP and frontending (HTML, JS, CSS) should be enough.
But if you really want to get down and dirty with customising Magento, extensions and functionality you will need a good grasp on PHP, OOP, MySQL might be handy and Javascript, preferably prototype.
My advice, first get your PHP skills up to speed, afterwards follow some courses on Magento U and start off with a simple shop tweaking some minor stuff. All in all this should keep you busy for the upcoming 6 months. Just doing frontend stuff will take you less time but will limit you to implement theme's and installing extensions without being able to tweak them.
| 1 |
PHP, PHP, OOP, MySQL and Javascript are the key to customising Magento
|
Most effective way to increase programmer salary besides just doing your job?
|
If you have the time and resources, what would be the most effective way to increase your salary as a full-time programmer, outside of just doing your job?
By "salary" here, I mean salary (adjusted for location cost-of-living) coming from a single programming job.
|
If you want to raise your salary, raise your value to your employer/customer. Continuously align yourself with your company's goals (answer: how am I bringing aiding in bringing in more revenue?) and your client's goals (answer: how am I making the customer's life easier?). At times you will need to go to bat for yourself to remind those with the checkbook of how you can answer those questions above.
And as @bleakcabal stated, you've got to play the social aspect of your job. That will open more opportunities to increase your value to employeer and customers.
| 0.888889 |
Increase your salary to your employer/customer
|
Google Mail Keyboard Shortcut for delete on Mac
|
I use the Google Mail keyboard shortcuts a lot and I've just started working on a Mac. One shortcut I use a lot is delete, which Google Mail listens for the # key.
However, when I press the equivalent on the Mac keyboard (Alt+3) it doesn't work. I've tried pressing backspace and Fn+Backspace but no luck.
Anyone out there know the solution?
|
It is Shift+3 within a message for Mac.
It is the same in the inbox as well
You must move to the message with j/k
Select a message with x
Then press Shift+3
It could be that your keyboard layout is different.
Using a UK layout, it would be Option + 3 : ⌥ + 3, but this does not work (Not sure why).
You can also remap your keys with the Google Labs feature : Custom keyboard shortcuts
| 1 |
Shift+3 in a Mac message
|
how to send a mail by telnetting through some SMTP server?
|
I wanted to send a mail by telnetting through smtp server "telnet smtp_Server 25" and want to send mail. How is it possible..
Also, please share something about CISCO products and what kind of software they use in their products. If i wanted to gain some insight knowledge, where should go to..
Thanks..
|
That looks like two distinct questions...
SMTP is a fairly simple protocol (at least for just sending an email)... once you open a telnet connection on the right port you just need to issue the commands:
From Wikipedia: (commands you issue are prefixed with "C:" the servers responses with "S:")
S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <[email protected]>
C: To: Alice Example <[email protected]>
C: Cc: [email protected]
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
Good luck with Cisco... you should ask it a as a separate questions or explain how it's related.
| 0.666667 |
SMTP is a fairly simple protocol (at least for sending an email)
|
SQL server moved, now can't use as linked server
|
So I have a SQL server database that was controlled by an outside vendor. It is hosted remotely. Then he needed to move the server to a new host. Now, I'm able to connect to the server manually from SSMS and I can add it as a linked server, but I can't USE it as a linked server, or even browse the servers catalogs.
My instance is 2000, and I assume the remote server is 2008 or 2008 R2.
When I try to use the server (try to update a stored proc that points to the linked server) I get the following error:
Trying to browse the linked server's catalogs from SSMS throws this:
Failed to retrieve data for this request.
(Microsoft.SqlServer.Management.Sdk.Sfc)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied. (Microsoft SQL Server, Error: 17)
A friend suggested I run Exec sys.sp_change_users_login 'Report', but it turns up no orphaned records, and anyway, I can login using the credentials, so that doesn't look like the problem.
EDIT: Can't connect at all with IP, but hostname connects then gives above error. HUH?
|
I'm assuming that you are using a "sql server login" for the vendor's server, and you are using that when creating the linked server.
When you use a linked server, a query running on your server connects to the vendor's server. If a firewall blocks your local server from connecting to the vendor's server, your connection attempt will fail.
If connecting directly from your workstation to the vendor's server you go through a different firewall or no firewall, then the connection may succeed.
This scenario matches the behavior you describe. My usual tests would be:
1. Can I ping from my server to the vendor's server? Both by IP and by hostname? ping usually gets through firewalls.
2. Can I connect using SSMS from my server (using an RDP session) to the vendor's server? Both by IP and by hostname?
If you can ping OK but not connect with SSMS, this usually indicates that the ports for SQL Server probably need to be opened on the firewall.
In short, check all of the firewalls involved. That would include any software firewall on your server or on the vendor's server, or any hardware firewall between them.
In these situations, ping and traceroute are your friends. Ping and traceroute may help you locate the IP of the router that doesn't send your packets on to the vendor's server.
| 0.888889 |
How do I ping from my server to the vendor's server?
|
Can you book hotels on a prepaid credit card worldwide?
|
I tend to stay at smaller boutique hotels or local apartments when I visit a city but recently due to some credit card issues I will need to depend on prepaid Visa. But I noticed when I try to shop online a lot of retailers don't accept prepaid credit cards so I'm thinking hotels would be even stricter. Is there a list somewhere of countries or particular hotel chains than ban prepaid cards? If so, how does one book online or reserve a room without a card? Do all hotels worldwide accept cash?
|
TL;DR - Depends, on your pre-paid card, the hotel, and how you book the hotel.
There are a few different charges to consider here:
Pre-payment of the room at/shortly after booking
Holding the room on a flexible booking
Deposit at checkin
Room charge, meals, drinks, extras etc at checkout
With many OTAs and hotel websites, if you make a non flexible booking, or some kinds of flexible bookings, they will charge your card for the room rate during the booking process. With some others, they'll send your card details through to the hotel, who'll put it through their tills later. (Maybe that day, maybe during a weekly sweep). In order for this pre-payment to go through, your card will need to support offline / cardholder-not-present transactions. As long as your card advertises itself as "suitable for online shopping" or similar, and as long as the card issuer doesn't block travel booking, you should be fine. Speak to your card issuer to be sure.
Alternately, when reserving the room, you might opt for a flexible rate where you pay at checkout, with no pre-payment. This is typically offered on the hotel's own site, and some OTAs. They will normally ask for a credit card to "hold" the reservation, which would be charged in the event of a no-show, but as long as you turn up as planned the card won't be charged. These rates are normally a bit more expensive than non-flexible pre-paid ones, but this style of booking should be fine on any card.
At checkin, most hotels (but not all) will want to take some sort of deposit. Typically this covers any unpaid parts of the room rate, along with expected spend in the restaurant / bar / etc. The details taken would also be used in the event of damage. If you've pre-paid the room and don't plan to run up extras in the hotel, many hotels would let you not leave a deposit, but not all. Very small hotels may take a look at you, decide you look fine, and tell you to pay everything at checkout. Some hotels may want to take something no matter what.
For the deposit, this is normally done as a pre-authorisation. Not all pre-paid card support this, which would be a problem. Some pre-paid cards do support it, but badly, and might take a week or so to release the reserved funds, which could be a problem. Check with your card issuer about this. Alternately, many hotels which require a deposit will be willing to take a cash deposit, but they may well want a larger cash deposit than they'd normally authorise on a credit card. (They can't charge extras to the card later for example). Expect to leave a hefty chunk of cash as a deposit, expect checkin to take a while, expect several people to count the money, bills may be checked for counterfeits, and expect a receipt at the end. Speak with the hotel first to see if they need a deposit, and if they take cash ones. As a datapoint, I once got stuck in a checkin queue behind someone doing a cash deposit, he was asked to leave something like 4 nights room rate as a deposit on a 2 night stay.
Finally, we have settling up the bill at the end. If you pre-paid, and didn't eat there, you could well find there's nothing to pay, or just a few dollars / pounds / euros in city taxes. Alternately, if you didn't pre pay (or they didn't take it), ate in the restaurant lots etc, you could have a decent amount to pay here. You'll be present, so any card which supports in-person transactions will be fine for this. Well, as long as you have the money on it for the bill that is! If you did a cash deposit, you should get the choice between taking the bill off that and getting the remainder, or getting the whole deposit back in cash and paying on a card.
Oh, one more possibility - charges not noticed at checkout. Maybe you forgot to tell them about the minibar charges, maybe that morning's breakfast didn't go through, something like that. If you used a credit card for the deposit, expect them to charge it to that later when they notice. If you paid cash, expect to get a bill in the mail some time later.
Can it be done - sure! Can it be done at one specific hotel with one particular kind of pre-paid card on one specific rate booked one specific way? Depends...
| 0.777778 |
TL;DR - Depends on your pre-paid card, the hotel, and how you book the hotel?
|
Disable tap on current Tab (UITabBarController) iPhone App
|
Currently, Tapping on the same Tab (in which user is working), The App moves to the very first page of that Tab.
I want to disable the tap event on the Tab in which user is working currently.
Any Hint?
|
use like below it will work
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
if(self.tabBarController.selectedIndex==[[self.tabBarController viewControllers] indexOfObject:viewController])
return NO;
else
return YES;
}
| 0.888889 |
if(self.tabBarController viewControllers) indexOfObject:viewController
|
Can anyone learn to sing?
|
It may seem as a kinda dumb question, and I'm totally aware of this. But, what I'm going to ask may be specific enough to not get closed:
I've been playing guitar and also a few other instruments for quite a while now, but I just can't sing. I can hear a melody in my head, but even if I try to hit the first note, I will fail very often. Now what I want to ask is, can anyone learn to sing in a manner that "won't hurt the ear of a non-musician"? I'm not asking if anyone could be the next Freddie Mercury, but does anyone have the ability to sing some backing vocals if needed, without just sounding terrible?
I always find it hard to get question on music get to the point, so i'll try it with this: Can anyone achieve semi-professional level of singing, even if one doesn't have a "good" voice?
|
ABSOLUTELY! I'm very enthusiastic about this question, which I hope is conveyed by my use of exclamation marks. The reason being is because I can personally relate to this question.
I have always wanted to learn to sing since I learned to play guitar. I was very reluctant at first and very terrible. I was put down a lot by people telling me to stop singing or stop trying (including my loving mother), but alas I pressed on because I enjoyed it even if I was terrible.
I want to give you a few tips to learn to sing because I wish I had these tips when I was learning. I learned all on my own, and that's why I know anybody can.
First things first, the best piece of advice I can give you is to buy a good computer mic like the Yeti Silver (that's what I use) and it's currently at a big discount right now from Amazon. Then get a good pair of over-ear headphones. Connect your mic to your computer, and connect your head phones to your mic. Put em on and start singing. This is good because now you can hear yourself instantly how other people hear you and it lets you adjust your voice right away instead of recording and waiting to play the record back until you can hear yourself. Trust me there is a huge difference--while we can hear our own voices well enough to get the basics, it is a world of difference to hear yourself with a microphone.
Learn to accept that your voice has certain qualities that make it different from other voices. When I started I always tried singing with a sort of whispery head voice because I didn't like how my natural voice sounded and thought it to be aweful. The truth is, all of your voices (every part of your vocal system) can sound great with training. This includes falsetto which will sound bad until you practice and smooth it out. Actually I recently posed a question asking if I could make my falsetto like Brian Mcknight and I found out for myself not too long after because I was practicing it a lot. Check it out here.
Practice singing scales. It's good that you can play guitar because it gives you the advantage of having a musical ear over someone who doesn't play anything. Also it gives you something to guide your voice with. You know when you're tuning your strings to each other without a tuner--ie hit the sixth string on the fifth fret and make it so it sounds like the fifth string. Well you can hear when it's out of tune or not, so all you have to do is practice singing say a C scale. Sing it and when your voice is off fix it until it matches then go up and down. Practice the vocal dexterity of switching notes. I'll tab the C scale for you for convenience. At the bottom is the C scale tabbed for guitar.
Use Youtube to find vocal practice lessons. This is good to give you new ways of practicing your vocals. There's a lot more to singing that just being in tune, and you'll find that out as you sing more. Of course this can get kind of boring, but it's good to explore.
Pay attention to good singers. When you hear a good singer, pay attention to their vocals and what they are doing and how it sounds. The more I learned to sing, the more I could distinguish between different kinds of voices. (When I say voices, I'm referring to head, chest, and falsetto etc.) It's like when you can already play guitar and you hear a guitar song, you can pick out a lot more parts because you already speak the guitar langauge--bow chika wow wow. Did you just hear the wawaw pedal there? :)
ENJOY IT! Screw what anybody tells you about singing. You are your own person and if you want to be good at something or learn something you need to practice. When you start learning you're not gonna be good, but you need to have the conviction to keep it up and put other people's thoughts and comments out of your mind. One day you're gonna be good and they will eat their words. I was put down a lot when I was learning, but I kept learning because I wanted so bad to be good and I enjoyed it. Also, it helps to have a quiet place where you can practice to slowly gain confidence before you're practicing around other people.
Hope this helps. Good luck and keep practicing.
| 1 |
How do I learn to sing?
|
What is the best way to remove pet odor from concrete?
|
The concrete floor in my garage had been home to a large dog for several years. There is a visible stain and strong smell in one area of the garage floor. The concrete does not appear to be sealed or painted. What is the best way to remove the odor?
|
You could also try Drylok, http://www.ugl.com/drylokMasonry/masonryWaterproofer/latex.php. You probably won't be able to remove anything that is causing the odor in the concrete so I'd try to seal it in instead. I believe they also sell something that will etch the surface of the concrete so the Drylok will adhere better.
I haven't had any luck with enzyme products once the stain is dried and set-in over a long period of time.
| 1 |
Drylok etching surface of concrete
|
highcharts: stop chart from trapping mouse events, or capture mouse click on the ENTIRE chart
|
All,
I'm using HighCharts in a web app I'm working on, and generally, I like it very much.
However, I'm having a hard time figuring out how capture a mouse click on the ENTIRE chart.
In other words - I'd like to know when the user clicks ANYWHERE on the chart (e.g., the plot area, the title, the x- or y-axis, the margins and padding around the chart elements, etc.)
Or, I'd like to disable events altogether, so I can trap the event in the container itself.
More detailed version...
I have a DIV that contains my HighChart.
I want to know if the user clicks ANYWHERE within that DIV.
So - initially I tried attaching an "onclick" event to the DIV, but that never gets fired, presumably because the click is getting trapped by the HighChart.
So, in the code that sets up the HighChart, I added this:
var chart = new Highcharts.Chart({
chart: {
renderTo: "container",
events: {
click: function(event) {
// do something
}
},
...
}
...
});
This works OK IF the user clicks somewhere within the plot area, but not if she clicks anywhere else in the chart (e.g., the x-axis, the y-axis, the title, the padding around the chart elements, etc.)
So - how can I make the ENTIRE chart clickable?
Many thanks in advance!
|
I had this same issue.
Using the webkit inspector I can see that Highcharts binds a click event to the chart container (the div with the 'highcharts-container' class), and this seems to interfere with clicking.
Provided you don't want any of the functionality in that click event, you can remove it by setting
chart.container.onclick = null;
Otherwise, you'll need to use the built-in highcharts event properties to set your callbacks.
As the OP noted, there is an 'events' property for the chart object, which should trigger when clicking the plot background.
There is also an event property for the plot options which triggers when clicking the series itself.
For example, for area plots:
var chart = new Highcharts.Chart({
...
plotOptions: {
area: {
events: {
click: function(event) {
// do something
}
},
...
}
}
...
});
More more info see:
http://www.highcharts.com/ref/#plotOptions-area-events
| 0.666667 |
Highcharts binds a click event to the chart container
|
Conductivity of Aqueous Ionic Solutions as a Function of Time
|
It is well-known that an aqueous ionic solution can conduct electricity. Let's take the electrolyte NaCl for example. In the diagram below, the circuit consists of a voltage source, a light bulb, and a concentrated NaCl solution.
Initially, the bulb will shine brightly. Assume the voltage source can source energy forever. My question is: will the NaCl solution allow current to flow forever, or will the conductivity of the NaCl solution degrade over time?
|
This is really physical chemistry, but since the question is here:
When you electrolyse solutions you need to consider secondary reactions that might take place at the electrodes. For example if you produced sodium at the cathode it would immediately react with water to produce Na$^+$ and hydrogen. Therefore the cathode produces H$_2$ not sodium metal.
Likewise, if the salt solution is dilute the anode produces oxygen. So the net result is that you are splitting the water into hydrogen and oxygen, and as the water is removed over time the concentration of the sodium chloride will get higher and the conductivity of the solution will increase.
However as the concentration of NaCl increases, the reaction at the anode changes and starts producing chlorine instead of oxygen. This produces sodium hydroxide in the cell, which means the concentration of NaCl decreases and the concentration of sodium hydroxide increases. The molar conductivity of NaOH is greater than the molar conductivity of NaCl, so as before the overall conductivity carries on increasing with time.
The solution in the cell will eventually become saturated in sodium hydroxide, but the solubility of NaOH in water is extremely high: from memory it's about 50% by weight. At some point the mobility of the ions is going to start decreasing and the conductivity will fall. However I'm not sure at what point that will happen and whether it happens before or after saturation is reached. Eventually of course the cell will dry out completely and solid NaOH is an insulator.
| 1 |
When electrolyse solutions you need to consider secondary reactions at the electrodes
|
Free RF Simulation Software
|
What free tools are there to simulate RF circuits?
|
For normal lumped circuits, your favorite version of spice will work fine.
For analyzing matching networks, I've used gsmc.
For analyzing a layout and extracting parasitics and computing fields, I dunno. It's usually easier to just build the circuit and see what happens.
| 0.888889 |
gsmc is used for analyzing matching networks
|
Why don't banks give access to all your transaction activity?
|
In the era of big data, I find it surprising that banks and credit card companies only offer access to a ridiculously small number of transactions - often only your last 180 days, if that. The longest I've seen was 720 days going back. I suspect they do store everything, but intentionally limit access.
These transactions are text only, take up extremely little space, and storing an individual's lifetime worth of transaction would take less than 10MB of data; about the storage required by two MP3 files, and about 250k records per person per lifetime, if we generously assume everyone makes 10 transactions a day. But I'd be happy with only the last 10 years of transactions, so about 1MB per customer. One of the largest banks, JP Morgan Chase, has ~70MM credit card customers. That means 70TB of data for 10 years of records - hardly impressive for a corporation of that size, with $17B of net income in 2013, when 1TB of cloud storage costs $10 retail per month.
By comparison, would you put up with Gmail or any online email provider keeping only the most recent 120 days worth of email? (And emails do take a lot more space than transactions, are far more numerous, and have to be instantly retrievable.)
Storage requirements for transaction activity are trivial in an era where we're throwing around petabytes and zetabytes.
Is there a sound reason for banks not offering access to all your transactions, other than legacy software on their side?
|
If you need access to your data beyond the online availability, you download the transactions and manage the archive yourself. Six months to eighteen months is generally enough time for most people to manage their own archived data.
Big banks have the power to store and retrieve all the data online. Unfortunately, the older records are not frequently accessed. Why have these records online when they will be rarely accessed? Backing up data will take longer. Queries to retrieve data will take longer. Everything will take longer just so you can have records that 99% of customers will never access.
| 1 |
How do you manage your own archived data?
|
Can flexible plastics have reflective coating (vacuum metalized)?
|
Is it possible to achieve an optical mirror coating to a flexible plastic part?
If vacuum metalization is possible, would the reflective coating layer be durable enough to withstand the bending of a flexible plastic such as polyurethane or a thermoplastic elastomer, without cracking over time?
|
There are many techniques for metal-coated polymers, as linked by permeakra Generally, vacuum deposition is an issue because the metal is hot. Cold deposition techniques (e.g., sputtering, ink coating) often work better.
Common, commercially-available materials include:
Pyralux - copper-coated polyimide from DuPont.
Mylar - DuPont's name for biaxially-oriented polyethylene terephthalate (BoPET)
As mentioned in other answers, adhesion is an issue, and to my knowledge, the processes to bind Pyralux and metabolized Mylar are proprietary.
Chemistry.About.com does mention vapor deposition of metals into Mylar, though.
| 0.777778 |
Vakuum deposition of metals into Mylar
|
Most effective way to increase programmer salary besides just doing your job?
|
If you have the time and resources, what would be the most effective way to increase your salary as a full-time programmer, outside of just doing your job?
By "salary" here, I mean salary (adjusted for location cost-of-living) coming from a single programming job.
|
There are broadly 4 ways:
Build Seniority
If you're happy with your current company and want to stay there, a good way to be able to demand more is to become the senior resident expert at a vital technology and/or internal code base. I've watched people do this at several companies I've worked at. They became so obviously and publicly super-productive and good at what they do (and the thing they do was important) that they naturally gained a "senior" status - even without necessarily getting team leading or managerial responsibility per se.
I can only presume that they had more ammunition to ask for better raises at performance review time, and for some I knew for a fact that they were better paid than average.
Also, see this answer.
Change Employers
This is essentially this answer. You have to be careful with this one though. Lots of very short stints don't look good on a CV, even if there are reasonably good explanations for the moves. For contracts with fixed terms, it's not so bad, but you don't want to have a whole string of permanent salaried positions on your CV that are all under 1-2 years or so. 3-4 years and up is probably okay though, as an average.
Go Contracting/Consulting
This one is, in a way, Change Employers on steroids. If you find a good niche which has a shortage of qualified engineers and quite a bit of short term project work that needs doing, this can be an excellent option. But it's quite a different mindset and lifestyle than having normal permanent salaried jobs (I've never done it personally, but I've known lots of people who did).
Vertical Movement
I know you asked about "programmer salary", but it still feels like this is obligatory to mention. Rising to team leader and/or management roles is always a possible option. Note that this is often tied with the first option (Gain Seniority), but it doesn't always have to be. Sometimes it's a natural byproduct of being at a company long enough, taking ownership of things you were working on, and knowing all the people and processes well.
| 1 |
Build Seniority If you're happy with your current company, a good way to demand more is to become the senior resident expert at
|
Simanim on Rosh Hashanah
|
Halacha (Kitzur) brings that besides for the Simanim (symbolic foods) mentioned in the Gemara Horiyas and Shulchan Aruch you can Make your own according to the Language of the Country you live in, this had lead to some creative stuff lets see some original Ideas for the Yehi Ratzons and symbolic foods (the example in the Kitzur brings carrots(Meren) which in Yiddish the language of his country also means to inrease)?
|
Don't forget Dates for dates...
| 0.666667 |
Dates for dates...
|
Android checktextview now working
|
In my android code I have this
<CheckedTextView
android:id="@+id/rememberMe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/advancedMenu"
android:layout_below="@+id/logInMode"
android:checkMark="@drawable/bg_checkbox"
android:gravity="center|center_horizontal"
android:text="@string/rememberMe"
android:textColor="#ffffff" />
And bg_checkbox is
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked"
android:state_focused="false">
</item>
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked"
android:state_focused="true">
</item>
<item android:state_checked="false"
android:drawable="@drawable/checkbox"
android:state_focused="false">
</item>
<item android:state_checked="false"
android:drawable="@drawable/checkbox"
android:state_focused="true">
</item>
</selector>
This selector works for regular checkbox's, but for this, its not working, its just showing the unchecked state even if I click it.
Also, how can I put some space between the text and the checkbox?
Thanks.
|
Try using setCompoundDrawablePadding(int) (or android:drawablePadding in XML) to set some space between the text and checkbox.
Regarding getting the selector working, <CheckedTextView> extends TextView, so try setting
android:clickable="true".
Obviously, if you're using the CheckedTextView in a ListView, make sure your ChoiceMode isn't set to CHOICE_MODE_NONE.
| 1 |
Set CHOICE_MODE_NONE in Selector
|
'Bokeh' effect with autofocus switched off in manual mode (Nikon-D90)
|
I want to understand how focusing works in Manual mode in my D90. I switched off the autofocus buttons in the Kit lens and the camera body. I have changed to the manual mode. Now, when I try to focus on any specific object, I do not see any specific focus point being highlighted when I press the shutter button halfway. All the focus points on the view finders lights up in red and camera clicks immediately after pressing the shutter button fully.
I want to know why I am not able to focus on any specific object. For example, if I want to focus on the nearer object, so that the background is little blurred, then I dont seem to be able to do this. (I want to achive the 'Bokeh' effect)
|
keep the aperture as large as possible(low f-stop number) and then turning the focus ring to see the focus effect,,
Focus the front subject sharply and this will throw the background into a nice bokeh depending on your lens blades,,
| 0.888889 |
Keep the aperture as large as possible(low f-stop number)
|
Potentiometer protection circuitry
|
My question arose from my previous question about a wind direction measuring circuit.
Please have a look at the manual: http://www.fondriest.com/pdf/rm_young_05103_manual.pdf
And here is the figures about my questions:
In Figure A, the potentiometer is used to output voltage proportional to the wind vane rotation angle.
In Figure B, the potentiometer comes to an end at point 1 and causes a short between the lines WHT(wind excitation voltage) and GRN(wind direction signal). But in theory current flows from + to ground. Do you think there is a path for current to flow in Figure B?
In Figure C, it seems like the situation is safe. Although the lines GRN and BLK are shorted at point 2, there is no potential difference and no current flows. Is that right?
My real confusion is about D6 and D7 the transzorb diodes(zener clampers?). I couldn’t really figure out in which circumstances they function and what happens in the absence of them. Why do we really need them?
In the manual it states: “To prevent false readings, signal conditioning electronics should clamp the signal to excitation or reference level when this occurs.” Do you think one needs an extra circuitry at the output?
|
The transzorbs are there to protect your electronics from induced voltages on the cables. You could have very long outdoor cables from your electronics to the wind vane. Without some kind of protection the electronics would be wiped out during the next thunderstorm.
As to your second question, you left out the sentence before the one you quote. We don't know what the phrase "when this occurs" is referring to. However, adding some kind of input protection is good idea whenever you connect a long cable to sensitive electronics.
| 0.777778 |
Transzorbs are there to protect your electronics from induced voltages
|
Lego Star Wars - The Complete Saga: How do I save the game?
|
I just got Lego Star Wars - The Complete Saga for my son. It seems to autosave in some fashion. But it also warns me on exit that my progress will be lost since the last save. How can I save manually?
|
Go to the bar in the start of a new game and you can create a new autosave under the character option. You can visit bars within the game to save at anytime...
| 1 |
Go to the bar and create a new autosave under the character option
|
How to export PNG to be compatible with all browsers
|
I recently found our that some PNG files render a slightly different shade of color in Safari. (I think this is because Safari can't render PNG Gamma channel properly or what).
How do I export the PNG images so that they work perfectly fine throughout all the browsers.
(preferable using Adobe Photoshop)
|
See this thread from the Apple support, but Safari uses the monitor's colorspace, which is different than most browsers, which only use sRGB. Hopefully the article will have some good information for you.
| 1 |
Safari uses the monitor's colorspace, which is different than most browsers .
|
SQL Agent powershell context reference
|
At my new job, we have multiple named instances on each servers.
Server1\Dev
Server1\DevIntegrated
Server1\QA
I have a SQL PowerShell script in the works that calls out to the OS, invokes Foo.exe but needs to pass a command line parameter (the connection string). A SQL Agent job will exist on each instance, with a step of type PowerShell, that needs to know what the current context is. i.e. This execution began on DevIntegrated.
I have no desire to have every script start with
$thisInstance = "Dev"
eespecially as I'd have to edit that as we migrate to environments (new servers and named instances) in the upcoming months.
If I start SQLPS, I can determine my instance by slicing and dicing the results of Get-Location or running
(Invoke-Sqlcmd -Query "SELECT @@servername AS ServerName" -SuppressProviderContextWarning).ServerName
When the SQL Agent starts a job of type PowerShell, it starts in the C:\windows\system32 The Get-Location route doesn't work as it's not in the SQLSERVER context. I can change into that context but I'll be at the "root" of SQL Server and won't know what instance I should be in. Using the Invoke-Sqlcmd route won't work either for same reason (technically, it times out as there is no default instance)
To the best of my knowledge, I've enumerated all the basic "things" I can Get into the job log but nothing seems to show SQLSERVER:\SQL\Server1\DevIntegrated
Get-ChildItem
Get-Host
Get-Location
Get-Process
Get-PSDrive
Get-PSProvider
Get-Service
Get-TraceSource
Get-Variable
Get-Process seems like I could use that and some voodoo of trying to cobble things together by hitting the instances and matching spids but that just sounds like a bloody-hack from hell. There must be something basic that I'm missing, can anyone shed some light?
Alternatives to PowerShell investigated
I had investigated using other job types and didn't get a satisfactory resolution. Research indicated the PowerShell listed under SQL Agent was SQLPS and starting an instance of it by right clicking on the Agent automagically dropped me into the correct location. It was only when I pasted my interactive code into the job step that I learned of the difference as previously mentioned.
Job type of OS put me into an identical state in that I could not find a way to determine which instance dropped me into the command shell. Sure, I could sqlcmd and get the value of @@servername but if I knew what connection to start sqlcmd, I wouldn't need to to query the database ;)
TSQL could probably work if we enable xp cmdshell but I'm not sure if they have it turned on---government facility and they can be persnickety on non-default settings. Even then, I'm stuck futzing with dynamic SQL and losing a lot of the expressiveness and power that PowerShell lends.
While a bit ungainly, I thought defining a variable at the first step and passing that to successor steps but research turned up this article Handling Multiple Job Steps (BOL)
"Job steps must be atomic. A job cannot pass Boolean values, data, or numeric values between job steps. You can pass values from one Transact-SQL job step to another by using permanent tables or global temporary tables. You can pass values from one CmdExec job step to another by using files."
I can't use common tricks like a well-known file/environment variables/registry setting that Foo.exe looks for as that would prevent concurrent execution across instances.
tl;dr
In a SQL Agent Job step of type PowerShell, how can you determine the instance of SQL Server that launched the process?
|
Sad to say I have not done much with PowerShell scripts being called inside SQL Server. Nor am I at a computer that I could play with it right now.
I believe though instead of using the PowerShell type step that if you used CmdExec and just call your script as you would from a command line "powershell 'MyScript.ps1'" you could then pass a parameter that has the instance you are running from. Like "Powershell 'MyScript.ps1' MyInstanceName".
So the start of your script you have a param() setup to accept that value of MyInstanceName:
param(
[Parameter(Position=0,Mandatory=$True)]
[string]$InstanceName
)
#so if I wanted to use sqlcmd
sqlcmd -S $InstanceName -Q "SELECT @@VERSION"
As you started out stating the one step needed to know what instance it was on so the PowerShell script could call Foo.exe properly. However, later on you mention being able to pass the value to other steps. If this is true you might want to look at creating a small SSIS package that calls your PowerShell script and does whatever else you need. With SSIS you could be able to setup a global variable that the whole package could use.
| 0.777778 |
PowerShell scripts being called inside SQL Server
|
Security of running openpgp.js in a browser with the private key in HTML5 localStorage
|
If I were to write a web application using openpgp.js (http://openpgpjs.org/) for creating PGP encrypted/signed messages and if I stored the user's private key in localStorage, would this be vulnerable to the same complaints about JavaScript cryptography on Matasano's webpage (http://www.matasano.com/articles/javascript-cryptography/)?
As far as I can tell, the main points outline by Matasano are:
"Secure delivery of Javascript to browsers is a chicken-egg problem." (This could be fixed by using HTTPS)
JavaScript isn't well suited to cryptography
Browsers are too complex for cryptography since they have the potential to contain multiple attack vectors.
If localStorage isn't the best place to store something sensitive like a private key, what would be a better place?
|
HTTPS is still an absolute requirement, and Matasano's main point is that JavaScript can never replace HTTPS. A MITM attack could deliver a custom JavaScript payload that could read any secrets in localstorage, and an XSS payload could also compromise this data.
Matasano is wrong in regards to random number generators in JavaScript. Most browsers provide a very secure random number generator window.crypto.getRandomValues(). I guess Matasano hasn't read the w3c Cryptography API for JavaScript. This API contains a random number generator that uses the operating system's entropy pool.
| 0.777778 |
HTTPS is still an absolute requirement for JavaScript .
|
can a ring homomorphism map an integral domain to a non integral domain?
|
i understand that if two rings are isomorphic, and one ring is an integral domain, so must the other be.
however, consider two rings, both commutative rings with unity. is it possible that one ring contains zero divisors and one does not while there exists an ring homomorphism between the two?
there could not be a isomorphism between the two rings because there would be no one to one or onto mapping between the two rings. but could there be an operation preserving mapping between an integral domain and a commutative ring with unity and with zero divisors?
clearly if such a mapping did exists it would not seem to be one to one or onto, but does this rule out the potential of a homomorphism existing between the two?
|
The quotient map $f: \mathbb{Z} \to \mathbb{Z}/(4)$ maps an integral domain $\mathbb{Z}$ to a ring with a (nilpotent) zerodivisor $\mathbb{Z}/(4)$. Now, the quotient map $g: \mathbb{Z}/(4) \to (\mathbb{Z}/(4))/(2) = \mathbb{Z}/(2)$ maps this ring to the field $\mathbb{Z}/(2)$.
| 0.833333 |
quotient map $f: mathbbZ to
|
Get Custom Web template name programmatically , Sharepoint 2013
|
I am trying to get the web template name that is being used currently in order to create the site.
I have created and EvenReceiver and overriding WebProvisioned. in this method i would like to get the name of the template i am currently using in order to create the subsite.
I am using code below. GetCustomWebTemplates and GetWebTemplates gives list of all the templates but i am only interested in getting the name of the current one. Is it possible? any idea how can we do that? Kindly help.
using (SPSite thisSite = new SPSite(properties.FullUrl))
{
SPWeb thisWeb = thisSite.OpenWeb();
SPWebTemplateCollection stc = thisSite.GetWebTemplates(thisWeb.Language);
foreach (SPWebTemplate sc in stc)
{
string MyTempleName = sc.Name;
}
}
|
Use SPWeb.WebTemplate to get the name of the template.
using (SPSite thisSite = new SPSite(properties.FullUrl))
{
SPWeb thisWeb = thisSite.OpenWeb();
string MyTempleName = thisWeb.WebTemplate ;
}
| 1 |
SPWeb.WebTemplate to get the name of the template
|
Intuition Behind a Decimal Representation with Catalan Numbers
|
From $0 = 0.5 - 0.5 = 0.5 - \sqrt{0.25}$, we can adjust the subtrahend slightly to obtain
$$0.5 - \sqrt{0.249} = 0.001\ 001\ 002\ 005\ 014\ 042\ldots$$
where the decimal representation contains the first few Catalan numbers: $1, 1, 2, 5, 14, 42
\ldots$
We can see even more Catalan numbers (albeit spaced apart with more $0$s) by using more $9$s.
(For example, check the decimal representation of $0.5 - \sqrt{0.24999999999}$.)
My question is not how to show this formally; it is a straightforward problem to show how one derives, e.g., the decimal representation given above. (I'll include a derivation below for anyone who doesn't want to think this through her/himself.)
Instead, my question is: why would it make sense, intuitively, for the Catalan numbers to show up in these decimal representations?
Derivation:
Recall that the generating function for the Catalan numbers $c(x)$ satisfies $c(x) = 1 + xc(x)^2$. Rearranging, we find that $c(x) = \frac{2}{1 + \sqrt{1 - 4x}}.$ Then
$$\sum_{n = 0}^{\infty}\frac{C_n}{10^{3n + 3}} = \frac{1}{1000}\sum_{n=0}^{\infty}\frac{C_n}{1000^{n}} = x \sum_{n=0}^{\infty}C_n x^n = xc(x) = \frac{2x}{1 + \sqrt{1 - 4x}},$$
where we have simplified our computations by letting $x = \frac{1}{1000}$.
Evaluating at this value of $x$ yields $0.5 - \sqrt{0.249}$.
|
Whenever you want to invert a function you should think about Lagrange inversion. In this case you want to invert a quadratic function. Lagrange inversion happens to have an elegant proof using trees which can be found, for example, in Stanley's Enumerative Combinatorics (Vol. II). This proof interprets an implicit identity satisfied by a generating function (such as the one satisfied by the generating function for the Catalan numbers) as recursively describing a certain kind of tree; for much more on this point of view, see Bergeron, Labelle, and Leroux's Combinatorial Species and Tree-Like Structures. Specializing to this case gets you one of the flavors of trees counted by the Catalan numbers.
(But this is not the train of thought that would have actually occurred to me because the Catalan numbers are more familiar than Lagrange inversion; I just look for $\sqrt{1 - 4x}$ everywhere, and in this problem I see $\sqrt{ \frac{1}{4} - x}$, so... )
| 0.888889 |
Lagrange inversion inverts quadratic function
|
Fuzzy Logic in Finance
|
Has fuzzy logic been commercially applied in finance fields and has it been successful ?
I have got knowledge that it has been applied in Algorithmic trading and operational risk, but I want to know what are the other fields where they have been applied successfully on a commercial basis
|
Actually it has - in combination with Neural Nets. The NN is used to evaluate the fitness of fuzzy trading rules. A company that does these kinds of things is Siemens (esp. their research department 'Corporate Technology'). Siemens uses NNs quite successfully for their own trading/hedging commodities (e.g. copper, electricity)
Supplement: As a starting point please have a look at:
Siekmann, S.; Neuneier, R.; Zimmermann, H.G.; Kruse R.: Neuro Fuzzy Systems for Data Analysis, In: Computing with Words in Information / Intelligent Syst. 2; Eds.: Zadeh L. A., Kacprzyk J.;p. 35-74; Physica Verlag; 1999
Especially one of the authors, Dr. Hans-Georg Zimmermann is one of the most renowned experts in Neural Networks and Neural mathematics.
| 1 |
Neural Nets is used to evaluate the fitness of fuzzy trading rules
|
Is it possible to use "authorized_keys" to ssh into Cisco ASA 5510
|
I have created multiple ssh accounts on a Cisco ASA 5510. Users login with a password and everything works fine. I would now like to use the authorized_keys feature of ssh so that users can log into the ASA without a password. Is this possible?
Thanks!
|
No. Cisco's just starting to clue in to public key authentication in IOS version 15, but that's no help for the ASA line. This is, unfortunately, not possible.
| 0.777778 |
Public key authentication in IOS version 15 is not possible .
|
I can get visual studio for free through school, should I?
|
I am currently using dev++, I am a complete beginner, (Freshman CS major) learning C++. I can get one of the newest versions of visual studio (2008 or 2009 i think) for free through my school. Not sure if it is worth the trouble of getting. thoughts?
|
Point blank answer: YES.
You have to remember that, regardless of whether you get it from school (via the MSDNAA) or through DreamSpark, you are going to be using a version with an academic license. Technically, that means you're supposed to only use it for school, although I don't know that there are people going around and looking at the metadata of people's source code to see what version they used.
If you want an alternative to both VS and Dev++, you could also use Eclipse, which has a C/C++ version, which would also help you transition to Java, if it's part of your curriculum.
| 1 |
Using a version with an academic license
|
Getting rid of "Tethering Detected" popup on Android ICS 4.0?
|
I just got a Samsung Galaxy S3 that runs Android ICS 4.0.8. When I connect the Galaxy S3 to my Mac laptop and use PDAnet to tether, I often get this popup on the Galaxy S3 screen:
Tethering via PDAnet works great, but the popup can get annoying. I can close the popup, but it comes back a few seconds later.
How can I get rid of this popup permanently?
|
This to me looks like something your provider has added in to stop you getting free tethering on your data plan.
If you are rooted (which I assume you are as you are using a tethering app), then you can attempt to freeze the app that is responsible for this, using an app freezer such as App Quarantine ROOT.
If it isn't an app, then it may be part of the ROM directly, in which case you would have to install a custom ROM such as CyanogenMod. You should look at forums such as XDA-Developers to find a ROM for your device.
Using a custom ROM will definitely remove the message.
| 1 |
Free tethering on your data plan
|
Change of basis in non-linear Schrodinger equation
|
At the mean-field level, the dynamics of a polariton condensate can be described by a type of nonlinear Schrodinger equation (Gross-Pitaevskii-type), for a classical (complex-number) wavefunction $\psi_{LP}$. Its form in momentum space reads:
\begin{multline}
i \frac{d}{dt}\psi_{LP}(k) =\left[\epsilon(k)
-i\frac{\gamma(k)}{2}\right] \psi_{LP}(k)
+F_{p}(k)\,\, e^{-i\omega_{p}t} \\
+ \sum_{q_1,q_2} g_{k,q_1,q_2}\, \psi^{\star}_{LP}(q_1+q_2-k)
\, \psi_{LP}(q_1)\, \psi_{LP}(q_2).
\end{multline}
The function $\epsilon(k)$ is the dispersion of the particles (polaritons). The polaritons are a non-equilibrium system, due to their finite lifetime (damping rate $\gamma$). Therefore, they need continuous pumping with amplitude $F_p$ at energy $\omega_p$.
Finally, there exists a momentum-dependent nonlinear interaction $g_{k,q_1,q_2}$ that depends of the so-called Hopfield coefficients $X$ (simple functions of momentum) as:
\begin{equation}
g_{k,q_1,q_2}=g\, X^{\star}(k)\, X^{\star}(q_1+q_2-k)\, X(q_1)\, X(q_2)
\end{equation}
How can one transform the equation for $\psi$ to real-space?
|
The linear terms it seems you can handle. As piece of general advice, the meaning of these terms are always clearly if integrate over the momentum coordinates of each of the fields, using delta functions to preserve the value. So the non-linear term would be
$$\sum_{q_1,q_2,q_3} g(q_1,q_2,q_3) \psi(q_1)^*\psi(q_2)\psi(q_3)\delta(-q_1+q_2+q_3 -k)$$
Maybe you can also see this way that the structure is determined by momentum conservation/translation invariance. Now when I integrate this by $\int\!dk\,e^{ikr}$, the $k$ integral is resolved trivially and I'm left with fourier transforms over the $q$s. Since Fourier transforms take multiplication to convolution, you can calculate that we get
$$\int dr_{123}\,\tilde{g}(r-r_1,r-r_2,r-r_3)\tilde{\psi}^*\!(r_1)\tilde{\psi}(r_2)\tilde{\psi}(r_3)$$
Which is more or less the most general third order nonlinear term you can write. In your case you can also reduce this further by using the real space transforms of $X$, either by plugging in directly to the first equation I wrote, or by calculating $\tilde{g}$ and plugging into the second.
| 0.888889 |
Nonlinear term if integrate over momentum coordinates of each field
|
Persistent session cookies: remember session even after closing the browser
|
I would like to store anonymous users $_SESSION in a cookie so that their cart and other custom information is still available even after closing the browser.
I found this interesting post which tells me I should add this to my local.settings.php:
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 7);
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 7);
ini_set('session.save_path', '/home/yoursite/sessions');
So that session cookie would be available for a week.
But it also stands that we should use session_regenerate_id() elseway the cookie lifetime is not updated.
I could not find session_regenerate_idin Drupal 7 source code, but I believe Drupal might already handle this from what I read in the code comments.
My questions are:
is this a good approach to have persistent cookie sessions?
do I need to add to my local.settings.php session_regenerate_id() too?
Thank you very much for your advises
|
So far this in my local.settings.php seems to work just fine:
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 7);
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 7);
ini_set('session.save_path', '/home/yoursite/sessions');
| 0.888889 |
Ini_set('session.cookie_lifetime', 60 * 60 * 24 * 7); ini_setting('
|
k-center algorithm in one-dimensional space
|
I'm aware of the general k-center approximation algorithm, but my professor (this is a question from a CS class) says that in a one-dimensional space, the problem can be solved (optimal solution found, not an approximation) in O(n^2) polynomial time without depending on k or using dynamic programming.
A general description of the k-center problem: Given a set of nodes in an n-dimensional space, cluster them into k clusters such that the "radius" of each cluster (distance from furthest node to its center node) is minimized. A more formal and detailed description can be found at http://en.wikipedia.org/wiki/Metric_k-center
As you might expect, I can't figure out how this is possible. The part currently causing me problems is how the runtime can not rely on k.
The nature of the problem causes me to try to step through the nodes on a sort of number line and try to find points to put boundaries, marking off the edges of each cluster that way. But this would require a runtime based on k.
The O(n^2) runtime though makes me think it might involve filling out an nxn array with the distance between two nodes in each entry.
Any explanation on how this is works or tips on how to figure it out would be very helpful.
|
Hint: In algorithms, if you're not sure how to solve the problem, sometimes it is helpful to look at a scaled down version of the problem. I suggest you start by looking at the version of the problem where $k=1$. I suspect you'll find that the problem is super-easy, when $k=1$ and you are on the 1-D line.
Next, see if you can solve it for $k=2$. I think you'll find that case is pretty easy, too, using the ideas you got from the $k=1$ case.
The obvious next step is to generalize to arbitrary $k$.
| 0.666667 |
How to solve a scaled down version of the problem
|
PHP getting cover image from Google Books API
|
I'm trying to get the image from Google Books service, in the thumbnail. Reading the address in php via file_get_contents get all the web page of the book while I just want to get the cover image. I know that it can be done via the src tag of html img element but I need the image server side. Is there a way? Thanks
Here the code I've used:
$context = [
'http' => [
'method'=>"GET",
'header' => "Accept:image/png\r\nAccept-Language:it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3\r\nCache-Control:max-age=0\r\nConnection: keep-alive\r\nUser-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0\r\n"
]
];
$context = stream_context_create($context);
$result = @file_get_contents($bookThumbnail, false, $context);
|
You mean by scraping it? Theres probably legal issues if you do that...
But looking at their site (and only one result), the image is in this part of the html:
<div class="bookcover"><a href="http://books.google.com/books?id=btIQAAAAYAAJ&amp;printsec=frontcover&amp;source=gbs_ge_summary_r&amp;cad=0" ><img src="http://bks0.books.google.com/books?id=btIQAAAAYAAJ&printsec=frontcover&img=1&zoom=1&edge=curl&imgtk=AFLRE70zzwoUCkgdipXt2aghe0i9TUKTDTH4s71IXTEPNlUNi9dN-aiJDCtxor4tL3yqq8KrHzEiHTyysqSFu2vH2QNm3JNCjyjm3f-B_N2VKYZqrcaqHfUXDdOea2f3FBR3nFIUxtk7" alt="Front Cover" title="Front Cover" width=128 border=1 id=summary-frontcover ></a></div>
Use something like http://php.net/manual/en/class.domxpath.php to extract it. Should be quite straight forward. You will probably not want to just use file_get_contents() for the image though, use curl or something.
| 0.888889 |
How to extract the image from the html?
|
migrating a document library from sharepoint 2010 to sharepoint 2013 without using 3rd party tools
|
I have to migrate a document library from sharepoint 2010 to sharepoint 2013 without using any 3rd party tool. any nice approach to achieve it?
|
Their are 3 ways to get this done.
Export from 2010 and import in 2013(with little tricks)
Content Database Migration
3rd party tools.
Method 1.
Export the list from SharePoint 2010 using either the Central
Administration or PowerShell (Export-SPWeb). In the Central
Administration, go to Backup and Restore > Export a site or list.
Choose your list, and click Start Export
Copy the exported list (.cmp file) to your desktop and change the extension to .cab. You can then extract it using a software like WinRar.
Open the SystemData.XML file with an editor like NotePad++ and change the version from 14.0.0.0 to 15.0.0.0 , and the build version from your 14.0.x.x to 15.0.x.x (depending on the build you have on both your farms). Here is a screenshot with before and afte
Now we have to repackage it as a .cab file. I used a software called CabPack. Select your Source and Destination. Change the CabinetNameTemplate if you want, and click on OK.
Change the extension from .cab to .cmp
Copy the .cmp file back on the network share or directly on the SharePoint 2013 Server.
Open SharePoint 2013 Management Shell as an administrator. Run this command by changing the parameters of course! Import-SPWeb -Identity http://teamsite.vlad.local/ -Path \sp2010-itest\Exports\MyCusttomList.cmp -Verbose
Open up your SharePoint Site and your list should be there
source:http://absolute-sharepoint.com/2013/08/how-to-move-a-list-from-sharepoint-2010-to-sharepoint-2013.html
Method 2)
I am sure you already have you 2013 farm up and running.
Backup the Content Database of the Site Collection in which the list
is. (SharePoint 2010)
Create a Temporary Web Application in the SharePoint 2013 Farm.
Run SharePoint 2013 Management Shell as an administrator, and run the
following command to dismount the content database:
Get-SPContentDatabase -WebApplication http://sitename.com | Dismount-SPContentDatabase
Restore the Backup you took in Step 1, on the SQL Instance hosting
your SharePoint 2013 Farm. Make sure you give the farm account
db_owner permissions on the database.
In the SharePoint 2013 Management Shell, run the following command.
Mount-SPContentDatabase MyDatabase -WebApplication http://sitename.com
Navigate to the Site Collection, and if you didn’t have too many
development and custom things done, it should open no problem. Make
sure the list you want to export is ok.
Go in the Central Administration, go to Backup and Restore > Export a
site or list. Choose your list, and click Start Export
Open SharePoint 2013 Management Shell as an administrator. Run this
command by changing the parameters of course! `
Import-SPWeb -Identity http://teamsite.vlad.local/ -Path \sp2010itest\Exports\MyCusttomList.cmp -Verbose
Open up your SharePoint Site and your list should be there
| 0.888889 |
Export from SharePoint 2010 using either the Central Administration or PowerShell
|
Identifying sequential patterns
|
I am working with sequence data which are long lists of malware win-api calls. I am trying to cast the problem of identifying 'malware behavior' into one of finding sequential patterns. I treat each api call as a single item Itemset. The number of different possible items (api calls) is quite large.
Now, when I apply the SPADE algorithm (see also, Zaki, SPADE: An Efficient Algorithm for Mining Frequent Sequences, Machine Learning, 42, 31–60, 2001) I run into memory problems.
Is there a better alternative way to find sequential patterns among large high vocabulary sequences?
|
You can map the data into a feature space where sequence is important, along with both statistics calculated over sliding windows & cumulative statistics, and use that in a decision tree.
A decision tree could handle both sequences and non-sequential data. This may substantially reduce your data complexity.
| 0.777778 |
How to map data into feature space where sequence is important?
|
Saying Baruch Shepatrani for a girl
|
Do you say Boruch Shepatrani for a girl at her Bas Mitzva? If not, why not?
|
Rav Ovadya Yosef, in Yabia Omer 6 OC 29, writes that one should say the blessing (ברוך שפטרני מעונשה של זו) at the Bat Mitzva celebration without God's name, just as one should recite it without God's name at a boy's Bar Mitzva celebration.
| 0.777778 |
Rav Ovadya Yosef writes that one should say the blessing at the Bat Mitzva celebration without God's name
|
Travelling with electric violin under revised airport security rules
|
In light of suspected terrorist threat airport security has been tightened to include new restrictions on "electronic devices". For example, on Heathrow Airport's site they say:
Make sure your electronic devices are charged before you travel. If your device doesn’t switch on when requested, you won’t be allowed to bring it onto the aircraft.
I travel with an electric violin, not so that I can rock-out during business trips but so that my practise does not disturb people in neighbouring hotel rooms since the electric violin is near-silent without an amplifier.
Will my electric violin fall foul of new airport security restrictions? If so how does one prove that an electric violin (or any other active electronic instrument) is "turned on" without an amplifier to hand?
|
This security change in Airport exists because they fear that the batteries might have been replaced by explosives or that the device might be a fake one, so they ask you to switch on your electronic device in order to check that it's a real battery and a "real" working device.
Moreover, the targeted devices are mostly phones, tablets and laptops (I even read that they especially look for Samsung & Apple devices).
I guess an electric violin is quite similar to an (passive) electric guitar, so there is probably no battery on your device and not much electronics.
So you're probably okay with your instrument (regarding this specific safety rule change).
| 1 |
Security change in Airport
|
www links wont redirect to a no-www 301 redirect
|
I've just added the following .htaccess rules for a no-www 301 redirection:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
My domain www.example.net now perfectly redirects to example.net, but when I visit any of my articles with the www prefix www.example.net/2014/03/some-article/, the redirection wont happen. I see a broken page instead.
What's the issue here and what's the solution to fix it?
.htaccess:
# BEGIN All In One WP Security
#AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess>
order allow,deny
deny from all
</Files>
ServerSignature Off
LimitRequestBody 10240000
<Files wp-config.php>
order allow,deny
deny from all
</Files>
#AIOWPS_BASIC_HTACCESS_RULES_END
# END All In One WP Security
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
|
Your issue is probably related to the order your rules are being placed, since your redirects are last it might not be triggering due to the previous defined rules.
Given that you will have to change your file from:
# BEGIN All In One WP Security
#AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess>
order allow,deny
deny from all
</Files>
ServerSignature Off
LimitRequestBody 10240000
<Files wp-config.php>
order allow,deny
deny from all
</Files>
#AIOWPS_BASIC_HTACCESS_RULES_END
# END All In One WP Security
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
To:
# BEGIN All In One WP Security
#AIOWPS_BASIC_HTACCESS_RULES_START
<Files .htaccess>
order allow,deny
deny from all
</Files>
ServerSignature Off
LimitRequestBody 10240000
<Files wp-config.php>
order allow,deny
deny from all
</Files>
#AIOWPS_BASIC_HTACCESS_RULES_END
# END All In One WP Security
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Also keep in mind you have been using 301 redirect so your browser might have been cached, kindly use a different browser to let your old browser cache be freed and also make sure to clear your cache.
| 1 |
301 redirects may not be triggering due to previous defined rules
|
Will a 78S12 be cooler than a 7812 when handling the same load?
|
Given of course that both come in a TO-220 case. I wouldn't think so, right? I try to make it out from the K/W ratings but they seem to vary wildly from manufacturer to manufacturer. Anybody knows the answer?
|
I'm comparing the datasheets for ST Microelectronics' versions of these:
L78S12CV
L7812CV
The performance characteristics, such as Output voltage vs. junction temperature, is identical for both.
The operating (junction) temperature is different, 7812 is 0-125°C; 78S12 is 0-150°C.
In both cases, in a TO-220 package, the thermal resistance is the same: 5°C/W for junction-case, and 50°C/W for junction-ambient.
Based on this information, I would not expect the 78S12 to run cooler given the same load and heatsink. But it can handle higher operating temperatures, which may be a reason to favor it.
| 1 |
ST Microelectronics' L78S12CV
|
\jobname in Gummi
|
The command \jobname usually print the file name without the path and extension, so inside a file called foo.tex will print just foo. With pdflatex foo.test or compiling from LaTeXila certainly I obtained this result. But from Gummi what I obtain is .foo.tex
Does anyone know why Gummi compiles differently and how I could get the usual \jobname behavior in Gummi?
Edit:
Based on helpful answers of @JosephWright and @Herbert
I wonder if it is possible to do the \jobname correction in Gummi only if the source have the .swp extensión or .tex persist in \jobname.
That is, I would like a solution like:
\makeatletter
\let\JobName\jobname
\ifthenelse{\equal{\detokenize{foo}}{\jobname}}
{}
{
\def\@JobName.#1.#2\@nil{#1}
\def\jobname{\expandafter\@JobName\JobName\@nil}
}
\makeatother
This conditional works to check if the jobname is foo or not, but I want a general solution, independent of the file name (not limited to the string foo).
|
Taking a look at the 'Build Log' I get with a foo.tex test file, it seems Gummi actually compiles .foo.tex.swp, which is hidden on Unix due to the leading ., and which has extension .swp not .tex. So TeX is showing you the correct information. For example, with demo file
\documentclass{article}
\begin{document}
Hello world
\end{document}
saved as foo.tex I get log
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
\write18 enabled.
entering extended mode
(/home/joseph/Desktop/.foo.tex.swp
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/size10.clo))
(/tmp/.foo.tex.aux) [1{/usr/local/texlive/2012/texmf-var/fonts/map/pdftex/updma
p/pdftex.map}] (/tmp/.foo.tex.aux) )</usr/local/texlive/2012/texmf-dist/fonts/t
ype1/public/amsfonts/cm/cmr10.pfb>
Output written on /tmp/.foo.tex.pdf (1 page, 11541 bytes).
SyncTeX written on /tmp/.foo.tex.synctex.gz.
Transcript written on /tmp/.foo.tex.log.
I'm afraid I don't have a solution (other than 'use a different editor'), as there does not seem to be a Gummi setting to alter this behaviour.
The edited question asks for a 'flexible' approach based on Herbert's code. With the restriction that this assumes a simple case (the file name contains only a single . to separate the extension, except if it starts .where Gummi is in use):
\makeatletter
\begingroup
\def\@jobname#1.#2\q@nil{%
\ifx\relax#1\relax
\expandafter\expandafter\expandafter\@@jobname
\else
\expandafter\@@@jobname
\fi
\jobname\q@nil
}
\def\@@jobname.#1.#2\q@nil{#1}
\def\@@@jobname#1\q@nil{#1}
\xdef\jobname{\expandafter\@jobname\jobname.\q@nil}
\endgroup
\makeatother
| 0.777778 |
Gummi compiles .foo.tex.swp from Unix due to the leading .
|
generic helper to get ObjectResult<T> that will match any given EntityObject
|
trying to make a generic SQL Query via a method that will fetch data i was making this code
public ObjectResult<theSelectedTableNameModel> getUsersRes(string sqlStr, string ColNameAsfilter, string FiltersValue,string OrderByFilter="")
{
string SqlCmd = "";
string By = "";
if (OrderByFilter.isNotEmptyOrNull())
By = string.Concat(" ORDER BY ", OrderByFilter);
SqlCmd = string.Format("{0} WHERE {1}={2}{3}", SqlStr, ColNameAsfilter, FiltersValue, By);
return anEntityName.ExecuteStoreQuery<theSelectedTableNameModel>(SqlCmd);
}
i have copied my code and edited real names and other variables /parameters so i might have made a mistake, but the question is , how could i make it more generic than this ?
this is a working approach that lets me specify the query of the sqlCommand
i wanted it to fit any entity and any model/object/table
how could it be done ?
i guess there's a ready solution for this or the engeniring of EF not ment to be generic...
i'm using asp.net 4.0 , and latest EF..
|
why not consider passing in a collection of sql paramters in to the function call as a parameter. Once you do this, you can use any number of filters of multiple types
public ObjectResult<theSelectedTableNameModel> GetEntityBySQLCommand(string sqlStr, SqlParameter[] filterParams, string OrderByFilter="")
{
var commandTextToExecute = OrderByFilter.isNotEmptyOrNull() ? sqlStr : string.Format(“{0} Order By {1}”, sqlStr, OrderByFilter);
return yourObjectContext.ExecuteStoreQuery<theSelectedTableNameModel>(commandTextToExecute, filterParams);
}
Your sqlStr should look something like the following “SELECT * FROM Customer WHERE CustId = @custID and LastActiveOn = @lastActiveDate”;
custID and lastActiveDate should be passed in via the SqlParameter collection (filterParams)
| 1 |
Passing sql paramters in to function call as parameter
|
Is the following usage of "matter-of-factly" correct?
|
Most of the usage of "matter-of-factly" that I've seen is to describe a manner of speaking - "He said, matter of factly,...", etc.
A friend brought up the following usage, which seems wrong, but I can't pinpoint exactly what is wrong. "Matter of factly, I don't know. I know from my dad's experience."
What's the view on this?
Couple of points:
The adjective form "As a matter of fact, I don't know. ..." seems correct.
Similar usage of literally works: "I literally don't know." or "Literally, I don't know"
|
The issue with the second usage is that "matter-of-factly" means "in a matter-of-fact style"; it is not synonymous with "as a matter of fact". "As a matter of fact" is by itself already an adverbial phrase (meaning "actually"); tacking an additional -ly on the end to re-adverbialize it can't be right.
I'd be more inclined to express your friends' apparent intended meaning as "I don't know personally" or "I don't know directly".
| 1 |
"matter-of-factly" means "in a matter of fact style"
|
Call a chain of WebRequest.BeginGetResponse in sync'ed fashion
|
I am writing a Portable Class Library to be shared by desktop and WP8. In the library there is a method to get data from a website, in which method a chain of web requests have to be made in synchronized way and in certain order, result from each response feeds the next request, only the final response is interesting to user.
If this is a desktop .NET library, I would use GetResponse() and have all the logic in one method. I would invoke this whole method in a background thread to avoid blocking UI interaction.
In PCL/WP8 there's only BeginGetResponse(), is there a design pattern or syntactic sugar I can leverage to write the synchronized call chain in a sequential way instead of having a bunch of callback methods?
|
HttpClient would be a better choice. If you can't use it for any reason, wrap BeginGetResponse/BeginGetResponse with Task.Factory.FromAsync, as an extension method:
static public Task<WebResponse> GetResponseAsTaskAsync(this WebRequest @this)
{
return Task.Factory.FromAsync(
(asyncCallback, state) =>
@this.BeginGetResponse(asyncCallback, state),
(asyncResult) =>
@this.EndGetResponse(asyncResult), null);
}
Then you do a blocking call like this:
var response = request.GetResponseAsTaskAsync().Result;
If you do a series of request, one after another, you should keep this logic asynchronous and let the client of your PCL library to decide whether to block or not. Something like this:
static public async Task<WebResponse> GetManyResponsesAsync(string[] urls)
{
WebResponse lastResponse = null;
foreach (url in urls)
{
var request = WebRequest.Create(url);
var response = await request.GetResponseAsTaskAsync();
// .. process response
lastResponse = response;
}
return lastResponse;
}
The caller would have a choice to await on the result of GetManyResponsesAsync, or block with GetManyResponsesAsync().Result.
| 0.666667 |
Block with GetManyResponsesAsync
|
Faceted search - Filters than can be applied to only one type of content
|
I'm currently working on the global search of a site. When the user submits a search, he can see 3 types of content: company, contact and news. Filter options are available on the left side.
I have filters that can be applied to any kind of content (e.g. region) and filters that are relevant to only one kind of content (e.g. company size).
I'm wondering which approach is the best to deal with those 'conditional' filters:
Drill-down approach: when the user selects a content type, additional filters are added and they are only related to that type of content.
Example: Amazon.
All filters available at all time: if the user selects a filter that can be applied to only one type of content, the content type will be changed accordingly.
Example: LinkedIn.
Thanks for your help :)
|
I'd go with the drilldown approach and only display filters that are applicable to the currently applied filters.
If I understand correctly, the second approach would lead to a reset of the first option. E.g. if a user selects Contact first and then tries to apply the Company size filter would result in changing the content type to Company. This is not only confusing, it's also very frustrating for the user as they have to start all over again.
| 1 |
Using the drilldown approach to display filters
|
" not all code paths return a value" when return enum type
|
I have enum list and method and i get error: " not all code paths return a value"
Some idea whats wrong in my method ? I am sure I always return STANY type :/
Thanks for help :)
private enum STANY { PATROL, CHAT, EAT, SEARCH, DIE };
private STANY giveState(int id, List<Ludek> gracze, List<int> plansza)
{
// Sprawdz czy gracz stoi na polu z jedzeniem i nie ma 2000 jednostek jedzenia
bool onTheFood = false;
onTheFood = CzyPoleZjedzeniem(id, gracze, plansza, onTheFood);
if (onTheFood && (gracze[id].IloscJedzenia < startFood / 2))
return STANY.EAT;
// Sprawdz czy gracz nie stoi na polu z innym graczem
bool allKnowledge = true;
allKnowledge = CzyPoleZInnymGraczem(id, gracze, allKnowledge);
if (!allKnowledge)
return STANY.CHAT;
// Jesli ma ponad i rowna ilosc jedzenia patroluj
if (gracze[id].IloscJedzenia >= startFood / 2)
return STANY.PATROL;
// Jesli ma mniej niz polowe jedzenia szukaj jedzenia
if (gracze[id].IloscJedzenia > 0 && gracze[id].IloscJedzenia < startFood / 2)
return STANY.SEARCH;
// Jesli nie ma jedzenia umieraj
if (gracze[id].IloscJedzenia <= 0)
return STANY.DIE;
}
|
Replace this:
// Jesli nie ma jedzenia umieraj
if (gracze[id].IloscJedzenia <= 0)
return STANY.DIE;
With this:
// Jesli nie ma jedzenia umieraj
// (gracze[id].IloscJedzenia <= 0)
return STANY.DIE;
Leave the redundant line in the comment as documentation.
| 1 |
Leave the redundant line in the comment as documentation
|
How do you import members from another system to Wordpress and update passwords so they'll work?
|
Our current system ( not using Wordpress ) has 1000s of users that we need to port over to Wordpress. The problem we're running into is that the passwords can't stay the same.
In our current system the passwords are saved with:
md5( md5( $password ) . USER_SALT ); // USER_SALT is a defined constant
Not the best obviously, but not the worst...
We need to make these password hashes that we currently have work in WP as well. Is there a way we can run all new passwords through this setup first and then through WPs own hashing?
I know you can hook into the functions like:
function my_hash_password($password){
return md5( md5( $password ) . USER_SALT );
}
add_action('wp_hash_password', 'my_hash_password' );
For some reason that's not fully working either.
Surely somebody else has already gone through this before.
Thanks.
EDIT !!!!
So far there is some confusion. I am NOT asking no un-hash the hashed password that we have. What I am saying is that with our current system the passwords look like:
Password: password
Hash function: md5( md5( $password ) . USER_SALT );
Output: d372f9c033e9c358b111ff265e080d3a
I want to 'maybe' be able to take the hash above and feed it to the native WP password hasher so that:
d372f9c033e9c358b111ff265e080d3a
becomes...
$P$BdrwxndTzgTVHUozGpQ9TEMYd6mpTw0
after it goes through their function.
Then when a user logs in we send their plain text password back through our function and then through WPs to get a match.
UPDATE !!!
So following the advice from rarst below I've done this:
function my_check_password($password, $hash, $user_id = '') {
global $wp_hasher;
if ( $hash == md5( md5( $password ) . USER_SALT ) ){
if ( $user_id ) {
$check = true;
wp_set_password($password, $user_id);
$hash = wp_hash_password($password);
}
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
}
// If the hash is still md5...
elseif ( strlen($hash) <= 32 ) {
$check = hash_equals( $hash, md5( $password ) );
if ( $check && $user_id ) {
// Rehash using new hash.
wp_set_password($password, $user_id);
$hash = wp_hash_password($password);
}
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
}
// If the stored hash is longer than an MD5, presume the
// new style phpass portable hash.
if ( empty($wp_hasher) ) {
require_once( ABSPATH . WPINC . '/class-phpass.php');
// By default, use the portable hash from phpass
$wp_hasher = new PasswordHash(8, true);
}
$check = $wp_hasher->CheckPassword($password, $hash);
/** This filter is documented in wp-includes/pluggable.php */
return apply_filters( 'check_password', $check, $password, $hash, $user_id );
}
add_action('wp_check_password', 'my_check_password' );
But this is still not working. What am I missing?
|
You couldn't have a more perfect solution, since this is precisely what WordPress core itself has to handle.
See, in early years WP used just one pass MD5 for passwords. Then they went to better hashing, but obviously it should have kept working with old hashes.
Now if you take a look at wp_check_password(), what it is doing (at the moment user attempts to log in) is following:
Checks if hash looks "old"
If so verifies it in "old" mode
If so updates hash to "new" one (using password, which is available at this moment in runtime)
Otherwise verifies in "new" mode
You should simply follow precise same logic! Hook into check_password or override wp_check_password() altogether (it's so called pluggable function). Then implement same check & upgrade logic for your hashes.
| 1 |
Checks if hash looks "old"
|
Question-like structure (word order) in non-question sentences
|
Occasionally I see constructs like this in English sentences:
Not only is this true in this case, but ...
What puzzles me is the "is this" part of it. The sentence is not a question, yet it seems to have a question-like order. Isn't this correct/preferred:
Not only this is true in this case, but ...
Are there other cases where non-question sentences contain question-like parts (so to speak)?
|
Both forms are correct, but mean different things!
Not only is this true in this case, but ...
Means "This is true in this case. And somthing else. . ."
Not only this is true in this case, but ...
Means "This is not the only thing that is true in this case, the other thing is. . ."
The problem is what the word "only" modifies. "Only" will modify the next word in the sentence, so if the next word is "is" then it means "is" is the only thing that the subject does, but if it modifies "this" it means the subject is unique.
Normally "this is true" is a statement, and "is this true" is a question. But when you need to modify "is", you run into this problem. English is full of strange exceptions like this one.
| 0.888889 |
"This is true in this case. And somthing else."
|
Align Environment and Spacing
|
Possible Duplicate:
Blank lines in align environment
When I put a blank line between a line of text and the align environment, it will add two blank lines instead. It seems that the align environment automatically adds a set of blank lines. I don't want two sets of blank lines, but this makes my code very hard to read. Compare (the 'correct way')
\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}
In Heaviside's operator notation, this is
\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}
and
\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}
In Heaviside's operator notation, this is
\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}
This may seem trivial but in a large document it's really hard to read the first example and relatively easy to read the second.
Is there a way to change this, e.g. with a \renewcommand?
By the way, is there an easier way of putting code on this site besides hitting space bar 4 times for each line? I tried HTML tags but they don't work.
|
Use the comment sign % instead of a blank line.
\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}
%
In Heaviside's operator notation, this is
%
\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}
| 0.777778 |
% in Heaviside's operator notation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.