text:
11/26/08, 12:52 AM   #1
Splot
Womble

Night Elf Druid

Saurfang

[top]Introduction

Please see the "simple questions" thread for day to day questions. I will be pulling relevant questions and answers from there into this thread as I find them. Hopefully this will reduce the amount of repetitive questions being posed over at the Warlock Simple Questions/Answers thread and provide a useful reference. Questions that should be in a FAQ will be in this thread.

This guide is intended to form a reference for those interested in playing demonology. It will be a work in progress. Covered are the areas that should be useful for demonology locks. If you see something missing or incorrect, please either message me or post. I will be going through the other warlock threads again for updates.

This guide is written to provide information based on patch 3.1

[top]FAQ's

Q. Why does my pet miss 8% of the time?
A. Because the dodge from behind is not able to be mitagated.

Q. What should I do if somebody asks about pets missing 8% of the time in the thread?
A. Report them for not reading the opening post.

A. Yes, start here

Q. Do I need mana feed?
A. This talent has changed from 3 points to 1 point and moved to the 21 point talent for Demonology. For the single point invesment this talent is well worth it.

Q. Wouldn't using the imp be better?
A. No, unless you are demo/conflag.

Q. Why don't you recomend using the infernal or doomguard?
A. Because are enslaved pets and as such they don't activate deep demo talents. If you have to re-summon your pet, throwing an infernal down and then rapidly re-summoning your main pet once it dies may be a good option.

Q. This <insert honorific> warlock <insert name> has this, why haven't you recommended it?
A. I'm not <insert name>, this thread isn't <insert name>'s thread. We're trying to build up a start place for raiding demo locks and a thread to capture the relevant theory.

Q. Why should I cast <insert dot name>?
A. Because the simulator suggests that it should be an increase in DPS.

Q. Should I cast CoD or CoE rather than CoA?
A. If it is an overall DPS increase for you and your raid, then yes. This is especially true where no other class is able to provide the CoE equivilant debuff. Fel/Ember could look to use CoD where the boss will be alive for more than 60 seconds but this will impact molten core up time.

Q. Should I wear <insert crappy item> or <insert other crappy item>?
A. Have a look in the tools and see what they say.

Q. Would you please test my new spec for me and tell me if it's good?
A. Untested spec posters need to read this thread and submit all requests for spec testing there.

[top]Tools

Use these tools first as most gear and spell usage questions can be answered via the spreadsheet and Rawr. These tools are not a substitute for you working out what you need yourself. They are an aid only.

ToolPurpose
RawrDynamic graphical tool for gear comparisons.
The SpreadsheetCurrently does not support demonology in 3.1
SimulationcraftStatic tool for running simulated fights based on set parameters

[top]Acronyms/Short forms/Definitions

TermDefintion
DemoDemonology
DestroDestruction
MetaMetamorphosis
EmberEmberstorm
CorrCorruption
CoACurse of Agony
CoDCurse of Doom
ImmoImmolate
Soft Hit CapThe hit cap required after modification by raid buffs and racical modifiers
RotationSince 3.0 this is more of a spell priority list, based on the priority the warlock needs to decide what to cast next
ConflagConflagurate

[top]Talent Specs

The pve specs have been lifted from the post 3.1 simulationcraft thread. The Demo/Conflag build from the same thread is a hybrid spec that uses an imp and pops conflag on cooldown. If you think a spec will perform better than those below, please get it included in the simulation thread and I'll pick it up from there when I review the current performing demonology specs.

Build NamePoint LayoutPurposeDescription
Meta/Ruin0/56/15DPS with raid supportThis build focuses on providing good DPS combined with a raid buff equal to 10% of the Warlock's +spell power.
Felguard/Emberstorm0/41/30DPSThis build provides higher DPS to the Warlock but has no significant raid contribution
Meta PvP3/58/10Meta based PvPThis build has the survivability talents for the warlock built in and the +hit talent to allow better gem/enchant choices
Imp/Conflag0/40/31DPSDemo/Conflag build
Meta/noDP3/52/16DPSMeta with no demonic pact (lower raid contribution)

[top]Talents

This talent list is based around the talents that are used to build the most common PvE specs. They are a reproduction from information else where, but with the added notation of what is core and which build. I have not covered out the PvP talents.

TalentTreeTalent TierDesireabilityBuildDescription
Demonic Embracedemotier 1 CoreallIncreases your total Stamina by 10%.
Fel Synergy demotier 1 CoreallYou have a 100% chance to heal your pet for 30% of the amount of spell damage done by you.
Demonic Brutality demotier 2 CoreallIncreases the effectiveness of your Voidwalker's Torment, Consume Shadows, Sacrifice and Suffering spells by 30%, and increases the attack power bonus on your Felguard's Demonic Frenzy effect by 3%.
Fel Vitality demotier 2 CoreallIncreases the Stamina and Intellect of your Imp, Voidwalker, Succubus, Felhunter and Felguard by 15% and increases your maximum health and mana by 3%.
Soul Link demotier 3 CoreallWhen active, 20% of all damage taken by the caster is taken by your Imp, Voidwalker, Succubus, Felhunter, Felguard, or enslaved demon instead. That damage cannot be prevented. Lasts as long as the demon is active and controlled.
Fel Domination demotier 3 CoreallYour next Imp, Voidwalker, Succubus, Felhunter or Felguard Summon spell has its casting time reduced by 5.5 sec and its Mana cost reduced by 50%.
Demonic Aegis demotier 3 CoreallIncreases the effectiveness of your Demon Armor and Fel Armor spells by 30%.
Unholy Power demotier 4 CoreallIncreases the damage done by your Voidwalker, Succubus, Felhunter and Felguard's melee attacks and your Imp's Firebolt by 20%.
Master Summoner demotier 4 CoreallReduces the casting time of your Imp, Voidwalker, Succubus, Felhunter and Fel Guard Summoning spells by 4 sec and the Mana cost by 40%.
Mana Feed demotier 5 CoreallWhen you gain mana from Drain Mana or Life Tap spells, your summoned demon gains 100% of the mana you gain.
Master Conjurordemotier 5 CoreallIncreases the combat ratings gained from your conjured Firestone and Spellstone by 300%.
Master Demonologist demotier 6 CoreallGrants both the Warlock and the summoned demon an effect as long as that demon is active.
Demonic Empowerment demotier 7 CoreallGrants the Warlock's summoned demon Empowerment.
Demonic Knowledge demotier 7 CoreallIncreases your spell damage by an amount equal to 12% of the total of your active demon's Stamina plus Intellect.
Demonic Tactics demotier 8 CoreallIncreases melee and spell critical strike chance for you and your summoned demon by 10%.
Decimation demotier 8 CoremetaWhen you Shadowbolt or Incinerate a target that is at or below 35% health, the cast time of your next Soulfire is reduced by 60%. Soulfires cast under the effect of Decimation cost no shard. Lasts 10 sec.
Improved Demonic Tactics demotier 9 CoremetaIncreases your summoned demons critical strike chance equal to 30% of your critical strike chance.
Summon Felguard demotier 9 CoreallSummons a Felguard under the command of the Warlock.
Nemesis demotier 9 CoremetaReduces the cooldown of your Demonic Empowerment, Metamorphosis, and Fel Domination spells by 30%.
Demonic Pact demotier 10 CoremetaYour pet's criticals apply the Demonic Pact effect to your party or raid members. Demonic Pact increases spell power by 10% of your Spell Damage for 12 sec. Does not work on Enslaved demons.
Metamorphosis demotier 11 CoremetaYou transform into a Demon for 30 sec. This form increases your armor by 600%, damage by 20%, reduces the chance you'll be critically hit by melee attacks by 6% and reduces the duration of stun and snare effects by 50%. You gain some unique demon abilities in addition to your normal abilities. 3 minute cooldown.
Improved Shadow Bolt destrotier 1 Coremeta Increases the damage done by your Shadow Bolt spell by 5%, and your Shadow Bolt causes your target to be vulnerable to spell damage, increasing spell critical strike chance against that target by 5%. Effect lasts 30 sec.
Banedestrotier 1 CoreallReduces the casting time of your Shadow Bolt. Chaos Bolt and Immolate spells by 0.5 sec and your Soul Fire spell by 2 sec.
Aftermath destrotier 2corefel/emberIncreases the periodic damage done by your Immolate by 6%, and your Conflagrate has a 100% chance to daze the target for 5 sec.
Cataclysm destrotier 2corefel/emberReduces the Mana cost of your Destruction spells by 10%.
Ruin destrotier 3 CoreallIncreases the critical strike damage bonus of your Destruction spells by 100%.
Demonic Power destrotier 4fillerfel/emberReduces the cooldown of your Succubus' Lash of Pain spell by 6 sec. and reduces the casting time of your Imp's Firebolt spell by 0.5 sec.
Intensity destrotier 4corefel/emberReduces the pushback suffered from damaging attacks while casting or channeling any Destruction spell by 70%.
Destructive Reach destrotier 4corefel/emberIncreases the range of your Destruction spells by 20% and reduces threat caused by Destruction spells by 10%.
Improved Immolate destrotier 5corefel/emberIncreases the damage done by your Immolate spell by 30%.
Devastation destrotier 5corefel/emberIncreases the critical strike chance of your Destruction spells by 5%.
Emberstorm destrotier 6corefel/emberIncreases the damage done by your Fire spells by 15% and reduces the cast time of your Incinerate spell by 0.25 sec.
Conflagratedestrotier 6coreDemo/ConflagIgnites a target that is already afflicted by your Immolate or Shadowflame, dealing fire damage and consuming the Immolate or Shadowflame spell

[top]Mechanics

There are now three styles of play available to the demonology warlock in flavour. The first is based on the meta/ruin talent build, the second is based on the the felguard/emberstorm and the third is the demo/conflag. Each of these builds has a distinct set of effects that they are trying to bring into play. The VW build is a specific build used for tanking certain fights. (note:find reference to bliz saying this isn't intended in raids.) Included in this section are those talents and glyphs that combine with the build to make specific builds stand appart.

[top]Meta/Ruin

Meta/Ruin is the raid contribution build of the demonology specs. It combines higher sustained burst damage with a damage increase for the raid casters. The combination of the deep (41+) demonology talents and the increased damage while in meta provide for a solid DPS combination.

Demonic Pact
Demonic Pact is the major raid contibution a Meta Lock makes to the raid. 10% of your spell power to the raid for 12 seconds provides a significant boost to parties and, at high damage levels, exceeds the bonus of the shaman totem.

$\text {Uptime}= 1-(1-\text{crit chance})^{(\frac{\text{period}}{\text{hit frequency}})}$
With cleave and haste, frequency is in the 1.2-1.5 seconds per hit range. Unless crit chance is 100%, it's not going to have 100% uptime. With 14.5% crit and 1.5 second intervals:

$\text {Uptime}= 1-(.855)^{(\frac{12}{1.5})} =71\%$

Ref post here.

Metamorphosis
This is the defining talent for this build, it provides a 20% DPS increase and increases melee survivability in PvP. Given the significant DPS increase of this talent it is best to delay using it at the start of combat to avoid stripping agro quickly. In a fight that has a DPS race it may be best to save for the heroisim/bloodlust. There is greater support for metamorphosis with talented cooldown reduction and glyphed extended duration.

Demonic Tactics
The increased critical strick from this and improved Demonic Tactics combine to give a significant boost to Demonic Pact uptime. The uptime is based on the critical strike rating of the felguard and both of these directly increase critical strike, and hence Demonic Pact up time.

[top]Felguard/Emberstorm

Fel/Ember is a personal DPS build of the demonology specs. In Simulationcraft and WWS parses it is consistently demonstrated as a sustained DPS build with little variation in rotation regardless of the fight stage. The combination of the felguard and the mid tier (down to 30) destruction talents provide a solid DPS combination. If Immolate drops the DPS of this build drops significantly.

[top]Demonology/Conflagrate

Demo/Conflag is a personal DPS build that resembles the destruction lock style of play. It involves keeping up the three dots, using incinerate as a filler and using conflagrate on cooldown. The conflagurate glyph is essential for making this build work. The pet for this build is imp.

[top]General Demonology Mechanics

Both Felguard builds are highly reliant on their pets for sustained damage. Judicious use of life taps, fel synergy and paying attention to positioning make the Felguard a potentially great source of damage. Fundamentally, all builds apply 3 dots, spam a filler and keep the dots going.

Souldrain is no longer a suitable execute for either spec as there is now soulfire available to execute from 35%. Soulfire requires application on the landing of either Incinerate or Shadow bolt, then casting of soul fire. Effectively this makes for a 2:1 rotation of filler to execute in the worst case and 1:1 rotation in the best.

[top]The Basic Rotation

The Demonolgy priority is the same for the PvE DPS specs. They have a focus on keeping DoTs up and using a single filler spell to do the majority of the damage. The rotation is no longer king. Look at priorities, they'll tell you what to do next. The rotations below are not law but an indicator of priority. If you have chosen to go conflagrate, then you need to be using it on every cool down while Immolate is on the target.

[top]Stats

The Combat stat ratings thread has covered stats more fully.

In general, hit rating is preferred to get soft capped, then damage becomes more important. Hit rating is not always the cheapest way to increase DPS even when not capped. Haste, Crit and Spirit are similar in value and at a raid level of gearing all offer a similar DPS gain. Demonic Pact warlocks should prioritise Crit to ensure a good uptime and hence raid buff.

[top]Hit Rating

Note: there is NO MAGIC NUMBER for hit rating. These caps are posted so that they are not exceeded. If in doubt, use the spreadsheet. It is possible to maximise performance with less than hit cap, but it is generally advised against. From the combat rating thread with 26.23199272 hit rating required for each percentage of hit required.

[top]Hit rating caps at level 80

Mob Required Rating w. Druid/SP w. drenai
Boss 17 446 367 341
82 6 157 79 52
81 5 131 52 26
80 4 105 26 0

[top]Affects Hit Rating

Reduces by:
3% for Moonkin or Shadow priest
1% for Drenai
1% for each point in Suppression
Soft hit capping is still required if you want to remove resists on soul shatter. The importance of this depends on whether you can get to being threat capped.
Gems, Precision and Icewalker enchants can be used to improve hit rating.

[top]Pets

The choice of pet for a Demonologist is normally simple. If you've got 41 points in the tree, get the Felguard else use the imp. The pet inherits your hit rating, but the Felguard applies that rating in the same way that melee does. The pet requires 8% hit rating to avoid misses (as per 2H weapon in melee combat), but has zero expertise. This means that normal parry and dodge apply in the melee hit table. Please when reading a WWS parse, don't read dodge/parry as miss, you'll only look foolish when complaining here about pet misses. The pet thread is here.

Pet Attack Power to DPS Conversion
Taken from here and here.

It appears the attack pets of the Felguard and Succy get 1 DPS per 11.11 AP, not 14 like melee classes. This means the DPS from the tooltip is affected by a percentage-based boost - 26%, to be exact (14 / 11.11 = 1.26) for DPS pets. Unholy Power the main culprit, contributing 20%. The extra 6% come from a modifier applied to each DPS pet and a reduction of up to 20% applies to the Voidwalker and Felhunter.

The formular for calculating the actual DPS is:

$\text {DPS}= (\frac{\text {Base damage}}{\text {Weapon Speed}} +\frac{\text {Attack Power}}{14} )*1.2*\text {PetModifier}$

The modifying coefficients appear (through testing) to be:
• Felhunter = 0.80
• VW = 0.86
• Succy = 1.05
• FG = 1.05

Felguard
Felguard is the staple pet of the Demonology Warlock. A Lock is able to use the following to buff the Felguard:
Kibler's bits is the preferred pet food as it does not use northern spices.

Typical usage of a Felguard in PvE is defensive stance and letting the pet engage on first cast. With the Fel Synergy talent and Mana Feed the Felguard is a very low maintenance. In fights with high movement and tank movements the Felguard is prone to being cleaved and needing to be withdrawn and sent back in. In some fights the Felguard is not able to be used effectively and the ranged imp must be used. In a raid situation you should not need mana feed.
Doomguard
High DPS pet that requires completion of a quest chain to obtain. Creates a higher shard usage pattern and uses 1g reagents for each 15 minute summon. Doesn't activate deep Demo talents.
Infernal
Gimmic pet, lasting 1 minute and doing high dps. Requires completion of a quest chain and forces the resummoning of the original pet once the minute is up. WWS is indicating approx 2.5x Felguard damage for the duration but does not activate deep Demo talents.
Succubus
Lower DPS fragile pet with the ability to CC.
Felhound
Lower DPS pet with “buffs” and a cooldown dispel.
Imp
The Imp is the core pet for the Demo/Conflag warlock. It uses the same raid buffs as the warlock and has no pet food that assists it. It is also a useful alternate for felguard locks that are in a melee unfriendly fight.

[top]Character differentiation

This section reflects thinking on the way to customise your character and improve performance. Please use the simulator and spreadsheet to validate any decisions prior to investing gold.

[top]Recommended Major Glyphs

GlyphBuildFunction
Glyph of Life TapCommonWhen you use Life Tap, you gain 20% of your spirit as spell power for 20 seconds.
Glyph of FelguardAll felguardIncreases the Felguard's total attack power by 10%
Glyph of MetamorphosisMetaIncreases the duration of your Metamorphosis by 6 seconds
Glyph of IncinerateFel/EmberIncreases damage of Incinerate by 5%.
Glyph of ImmolateDemo/ConflagIncreases theperiodic damage of your Immolate by 10%

[top]Recommended Minor Glyphs

GlyphBuildFunction
Glyph of Drain SoulsallChance of granting an additional soul shard on drain soul
Glyph of SoulsallReduces the mana cost by 70%
Glyph of Unending BreathallIncreases the swim speed of targets affected by your Unending Breath spell by 20%.

[top]Recommended Gems

ColourOptions
MetagemChaotic
RedRuned (damage) or Veiled (hit/damage)
YellowRigid (hit) or Veiled (hit/damage) or Reckless (haste/damage)
BluePurified (spirit/damage)

Below the spell hit cap aim for hit rating and specific colours to activate a meta gem.

[top]Gear

Use the spreadsheet first and foremost, most answers on what is better can be answered through plugging in the gear and seeing the affect. This site or this site may help you find upgrades.

[top]Professions

Taken from here, the conversation didn't concluded on any of this so it will need to be a work in progress.
Tailoring: The Lightweave tailoring enchant now sometimes grants a temporary spell power bonus instead of dealing direct damage to your target. This is now the equivilant of the other profession upgrades.
Enchanting: 38 spell power atm (2x this enchant).
Blacksmithing: 38 spell power atm (2 extra sockets for 19 spellpower each). Once epic gems are introduced, this will rise to 46.
Leatherworking: 37 spell power (using this recipe, which adds 67 compared to the 30 which can be applied by an enchanter).
Inscription: 37 spell power (using this inscription, which adds 61 spell power and 15 crit rating compared to 24 spell power and 15 crit rating which can be obtained from the Sons of Hodir at reputation status exalted).
Alchemy: 37 spell power when using a Flask of the Frost Wyrm.
Herbalism: No dps increasing affects
Jewelcrafting: The benefit is 39 spell power straight, when comparing 3x32 to 3x19 spell power gems. This will be reduced to 27 spell power. There is a lot of conversation on prismatic gems and meta function.

[top]Enchants

SlotEnchant Options
WeaponMighty Spellpower
ChestPowerful stats
CloakWisdom or Haste
GlovesExceptional Spellpower
BootsSpirit or Icewalker

There are lesser versions of the spellpower enchants and boot enchant.

[top]Consumables

TypeName
Elixir Accuracy or Spellpower combined with spirit
FoodIn general use spellpower food unless you are not soft hit capped as it gives the best value for stat investment. Generally either salmon or shoveltusk are preferred for maximising spell power. Snapper or worg are preferred for maximising hit rating.

There are no must have Demonology specific addons.

[top]Macros

There are no must have Demonology specific macros.

[top]Known Bugs

This article is the original work of Splot and relevant Elitist Jerks forums contributers. The article and all future versions of the article are licensed under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. Reproduction of the article in full or in part, or derivative works based on the article, including translations, are permitted as long as:
• The reproduction or derivative work includes a direct link to the original article (permanent link) and prominently displays the name of the original author.
• The reproduction or derivative work is not used for commercial purposes or for profit.
• The reproduction or derivative work is also released under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
The full text of the license agreement may be viewed here or via written request to Creative Commons, 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.

[top]Change log

v1.0.0 090424 First release

Last edited by Splot : 04/23/09 at 9:16 AM. Reason: Continuing updates

 11/26/08, 1:31 AM #2 LCN Von Kaiser   Lechez Orc Warlock   Darksorrow (EU) You're missing Glyph of CoA from the list. I have no data to back it up, but I'd imagine it being more efficient than the nightfall one. Also, here's a spec I was considering. The 2 points in demonic empathy are questionable, if they'd be better used in demonic resilience for pet survival or not. I haven't had the chance to test it properly as I'm not 80 yet though. I'll report back with my findings when I have. edit: As your gear improves the hit talents are due for re-assignment.
 11/26/08, 2:21 AM #3 Lominen Von Kaiser   Kamilo Orc Warlock   Kazzak (EU) Glyph of Souls has been changed quite a while ago. It now reduces the mana cost by 70% instead of removing the shard cost (great idea Blizzard).
 11/26/08, 4:56 AM #4 • Zakalwe The Chairmaker   Gobuchul Orc Warlock   Balnazzar What data and/or math do you have to back up your claim that 0/56/15 is the highest dps demo spec? I don't have any hard evidence of my own to counter your claim, but if you drop meta, some of the more lackluster high-tier demo talents, and isb, you can pick up devastation, improved immolate, emberstorm, and molten core. Surely that would be a good trade, making 0/41/30 the highest dps demo spec? The only reasons I can think of that would explain 0/56/15 outperforming 0/41/30 are: a) There's some ability gained in meta form that gives it a dps advantage beyond the 3.33% flat damage increase it averages out to. b) Shadow bolt is inherently stronger than incinerate to such a degree that a shadow-based build outdoes a fire-based build, even with emberstorm. Are either of the above true? Or am I missing some other factor here?
11/26/08, 6:59 AM   #5
Splot
Womble

Night Elf Druid

Saurfang
 Originally Posted by Zakalwe What data and/or math do you have to back up your claim that 0/56/15 is the highest dps demo spec? I don't have any hard evidence of my own to counter your claim, but if you drop meta, some of the more lackluster high-tier demo talents, and isb, you can pick up devastation, improved immolate, emberstorm, and molten core. Surely that would be a good trade, making 0/41/30 the highest dps demo spec? The only reasons I can think of that would explain 0/56/15 outperforming 0/41/30 are: a) There's some ability gained in meta form that gives it a dps advantage beyond the 3.33% flat damage increase it averages out to. b) Shadow bolt is inherently stronger than incinerate to such a degree that a shadow-based build outdoes a fire-based build, even with emberstorm. Are either of the above true? Or am I missing some other factor here?
I haven't gone back and re-found all the posts to reference yet. I'm basing stuff on what threads agreed and what the spread sheet is saying. I'll work through referencing over the next few days. I am happy to adjust wording and recommendations based on maths.

 11/26/08, 8:00 AM #6 MrTie Glass Joe   Mørt Orc Warlock   Arak-arahm (EU) I "lvled" in demono ( > all elit mob ^^ ) and at 80 and i continue to use Void star talisman , it is good or i could put it in my bank ? (i think about raid utility) For Metamorphosis, i wait a bad event to use hit or i use it on a burst boss @ 20% hp (meta macro > Guldan+meta+bloodfury), it is good? ps: sorry for my english im a French player Last edited by MrTie : 11/26/08 at 8:08 AM.
 11/26/08, 11:03 AM #7 duhwhat Piston Honda   Jymahna Undead Warlock   Area 52 Talent Calculator - World of Warcraft That's Kalku's spec from his spreadsheet calculations, using glyphs of FG, CoA, and Immo. The spec yields higher DPS than 2/13/56.
 11/26/08, 12:27 PM #8 Nve Glass Joe   Nve Undead Warlock   Twisting Nether As 0/41/30: 1. CoE -> Immolate -> Incinerate Spam, with Glyph of Felguard, Immolate, and Corruption - Highest DPS on Patchwerk - Lowest DPS on movement fights - Most longevity (time before oom) - Doesn't make use of Glyph of Corruption 2. CoE -> Immolate -> Corruption -> Incinerate Spam, with same glyphs - Lowest DPS on Patchwerk - Medium/High DPS on movement fights - Medium longevity 3. CoA -> Immolate -> Corruption -> Incinerate Spam, with same glyphs - Medium DPS on Patchwerk - Medium/High DPS on movement fights - Shortest longevity Things to consider: - Obviously Patchwerk-style fights/moments don't come often - Longevity can be a null-issue in certain raid comps and fights - Need to experiment with glyph of agony
11/26/08, 2:04 PM   #9
Trickykid
Don Flamenco

Gnome Warlock

Turalyon
 Originally Posted by Nve As 0/41/30: 1. CoE -> Immolate -> Incinerate Spam, with Glyph of Felguard, Immolate, and Corruption - Highest DPS on Patchwerk - Lowest DPS on movement fights - Most longevity (time before oom) - Doesn't make use of Glyph of Corruption 2. CoE -> Immolate -> Corruption -> Incinerate Spam, with same glyphs - Lowest DPS on Patchwerk - Medium/High DPS on movement fights - Medium longevity 3. CoA -> Immolate -> Corruption -> Incinerate Spam, with same glyphs - Medium DPS on Patchwerk - Medium/High DPS on movement fights - Shortest longevity Things to consider: - Obviously Patchwerk-style fights/moments don't come often - Longevity can be a null-issue in certain raid comps and fights - Need to experiment with glyph of agony
You always want to have a shadow DoT up for molten core. If you are on CoE duty, then corruption should be used. It comes out to very close the DPCT of incinerate and gets you a good chunk of MC uptime on your fire spells.

 11/26/08, 2:20 PM #10 Akj Piston Honda   Akhanj Orc Warlock   Suramar CoD seems to do significantly more damage than CoA as 0/41/30. Has anyone done the math to see if the loss in molten core uptime is worth the increased dps & dpm by using CoD instead of CoA? E: Assuming corruption is always up of course.
 11/26/08, 7:37 PM #11 Ippocrate Glass Joe   Themis Human Warlock   Hakkar (EU) Since I still haven't seen it mentioned anywhere, has anyone already tried out or even considered a 0/31/40 (imp-based) instead of 0/41/30 (FG-based)? The last point in demo in this case could be conceivably put in mana feed, such that the imp would not run out of mana so fast, instead of putting it in DE. Something like this http://talent.mmo-champion.com/?warl...h=131203000000 with of course minor tweakings here and there. Coarsely speaking, you loose the FG, DK and overall 2% crit, but you do have an imp Imp and (more importantly) you gain shadow and flame. I think it might sound a weak point, but in general shadow and flame does grant a major dps contribution (I just regret I don't have any hard data to support this... and I might even be just plain wrong. I should be 80 this weekend though and hopefully will be able to test this by myself and post it)
 11/27/08, 12:18 PM #12 CrazyScot Von Kaiser   Cax Blood Elf Paladin   Kilrogg (EU) Long time reader of the warlock threads but first time poster here. I've been running 0/53/18 Warlock Talents since hitting 80. Now onwards to the point of the post, since most of us currently are running round with pretty poor stats raid buffed compared to no doubt what will come; has anyone done the maths on which talent from taking Demonic Empathy or Cataclysm provides the higher personal DPS. Instinct tells me the obvious fact that DE should provide higher DPS by not by a large margin and only at the cost of 3% "free" hit and 3% mana cost reduction on our largest damage output, also the ramifications of having an extra 3% hit from talents allows for stacking slightly more damage which provides more spellpower from your Felguard buff. *EDIT* Does your weighting of crit include the crit value as a DPS increase given to the felguard? Crit being worth less than 1 point of haste or 1 point of spirit to me seems insane. Last edited by CrazyScot : 11/27/08 at 1:53 PM.
11/27/08, 3:29 PM   #13
Splot
Womble

Night Elf Druid

Saurfang
 Originally Posted by CrazyScot Long time reader of the warlock threads but first time poster here. I've been running 0/53/18 Warlock Talents since hitting 80. Now onwards to the point of the post, since most of us currently are running round with pretty poor stats raid buffed compared to no doubt what will come; has anyone done the maths on which talent from taking Demonic Empathy or Cataclysm provides the higher personal DPS. Instinct tells me the obvious fact that DE should provide higher DPS by not by a large margin and only at the cost of 3% "free" hit and 3% mana cost reduction on our largest damage output, also the ramifications of having an extra 3% hit from talents allows for stacking slightly more damage which provides more spellpower from your Felguard buff. *EDIT* Does your weighting of crit include the crit value as a DPS increase given to the felguard? Crit being worth less than 1 point of haste or 1 point of spirit to me seems insane.
I pulled the numbers from the spreadsheet (which is by no means great at working out pets). Given the current state of flux on the tools they are guidelines more so than ever. The pet dps did go up when I played with the stats but not by a huge margin.

11/27/08, 5:20 PM   #14
CrazyScot
Von Kaiser

Kilrogg (EU)
 Originally Posted by Splot I pulled the numbers from the spreadsheet (which is by no means great at working out pets). Given the current state of flux on the tools they are guidelines more so than ever. The pet dps did go up when I played with the stats but not by a huge margin.
And that's where 50+ builds need to be looked at more in depth, at the moment the only thing at the most basic level keeping a warlock raiding as meta is pretty much the buff, which is being overwritten by an ele sham until (as I hope) we hit 2800 spellpower+. Our DPS in 10/25 man Naxx against a decently geared mage/rogue/fury warrior isn't comparable on most fights.

Pet scaling and indeed "personal" scaling through our pet needs to be looked at more in detail for this discussion to even become relevant, is a meta build viable past 2800 spellpower? Will it be outscaled by Aff (as you'd expect) or even destro which seems quite weak still.

 11/28/08, 2:06 AM #15 MSJoeDaddy Glass Joe   Unrighteous Undead Warlock   Uldaman I don't understand why you would cast any DoTs as demonology. Dots require a rotation which rarely can be kept on boss fights. Dots dangle when the rotation is broken and your dps suffers greatly. Dots take too long to be effective for trash fights. Dots can't proc improved shadowbolt or demonic empathy. As demonology, dots don't scale with haste, crit, and have low coefficients from spellpower. The only dot I will consider using is corruption. And that's because of glyph of corruption AND 2 piece tier 7 set bonus is a lot to turn down. I choose a 0/53/18 build personally. Meta offers a huge boost to damage, not only because of its 20%, but because immolation aura is extremely good.


text:
Expii

# Charles's Law — Overview & Formula - Expii

Charles's law, expressed as V ∝ T, states that the volume occupied by a gas is directly proportional to its temperature in Kelvin.

format: plain


text:
Home Theory Low level Bit Hacks that you must know

# Low level Bit Hacks that you must know

Here we shall discuss some very low level Bit hacks that can really speed up your program execution time when used effectively.

Every now and then we see bit level operators. Bit hacks are ingenious little programming tricks that manipulate integers in a smart and efficient manner. Instead of performing some operation (such as counting the 1 bits in an integer) by looping over individual bits, these programming nuggets do the same with one or two carefully chosen bitwise operations.

To get things going I’ll assume that you know what the two’s complement binary representation of an integer is and also that you know all the the bitwise operations.

I’ll use the following notation for bitwise operations in the article:

&   -  bitwise and
|   -  bitwise or
^   -  bitwise xor
~   -  bitwise not
<<  -  bitwise shift left
>>  -  bitwise shift right

The numbers in the article are 8 bit signed integers that are represented as two’s complement and they are usually named ‘x’. The result is usually ‘y’. The individual bits of ‘x’ are named b7, b6, b5, b4, b3, b3, b2, b1 and b0. The bit b7 is the sign bit (the most significant bit), and b0 is the least significant.

I’ll start with the most basic bit hacks and gradually progress to more difficult ones. I’ll use examples to explain how each bithack works.

#### BITHACK 1: Check if the integer is even or odd

if ((x & 1) == 0)
{
// x is even
}
else
{
// x is odd
}

I am pretty sure everyone has seen this trick. The idea here is that an integer is odd if and only if the least significant bit b0 is 1. It follows from the binary representation of ‘x’, where bit b0 contributes to either 1 or 0. By AND-ing ‘x’ with 1 we eliminate all the other bits than b0. If the result after this operation is 0, then ‘x’ was even because bit b0 was 0. Otherwise ‘x’ was odd.

Let’s look at an example. Let’s take integer 43, which is odd. In binary 43 is 00101011. Notice that the least significant bit b0 is 1 (in bold). Now let’s AND it with 1:

    00101011
&   00000001   (note: 1 is the same as 00000001)
--------
00000001

See how AND-ing erased all the higher order bits b1-b7 but left bit b0 the same it was? The result is thus 1 which tells us that the integer was odd.

#### BITHACK 2: Test if the n-th bit is set.

if (x & (1<<n))
{
// n-th bit is set
}
else
{
// n-th bit is not set
}

In the previous bit hack we saw that (x & 1) tests if the first bit is set. This bit hack improves this result and tests if n-th bit is set. It does it by shifting that first 1-bit n positions to the left and then doing the same AND operation, which eliminates all bits but n-th.

Here is what happens if you shift 1 several positions to the left:

1         00000001    (same as 1<<0)
1<<1      00000010
1<<2      00000100
1<<3      00001000
1<<4      00010000
1<<5      00100000
1<<6      01000000
1<<7      10000000

Now if we AND ‘x’ with 1 shifted n positions to the left we effectively eliminate all the bits but n-th bit in ‘x’. If the result after AND-ing is 0, then that bit must have been 0, otherwise that bit was set.

Let’s look at an example.

Does 122 have 3rd bit set? The operation we do to find it out is:

122 & (1<<3)

Now, 122 is 01111010 in binary. And (1<<3) is 00001000.

    01111010
&   00001000
--------
00001000

We see that the result is not 0, so yes, 122 has the 3rd bit set.

#### BITHACK 3: Set the n-th bit

y = x | (1<<n)

This bit hack combines the same (1<<n) trick of setting n-th bit by shifting with OR operation. The result of OR-ing a variable with a value that has n-th bit set is turning that n-th bit on. It’s because OR-ing any value with 0 leaves the value the same; but OR-ing it with 1 changes it to 1 (if it wasn’t already). Let’s see how that works in action:

Suppose we have value 120, and we wish to turn on the 2nd bit.

    01111000    (120 in binary)
|   00000100    (1<<2)
--------
01111100

#### BITHACK 4: Unset the n-th bit

y = x & ~(1<<n)

The important part of this bithack is the ~(1<<n) trick. It turns on all the bits except n-th.

Here is how it looks:

~1        11111110  (same as ~(1<<0))
~(1<<1)   11111101
~(1<<2)   11111011
~(1<<3)   11110111
~(1<<4)   11101111
~(1<<5)   11011111
~(1<<6)   10111111
~(1<<7)   01111111

The effect of AND-ing variable ‘x’ with this quantity is eliminating n-th bit. It does not matter if the n-th bit was 0 or 1, AND-ing it with 0 sets it to 0.

Here is an example. Let’s unset 4th bit in 127:

    01111111    (127 in binary)
&   11101111    (~(1<<4))
--------
01101111

#### BITHACK 5: Toggle the n-th bit

y = x ^ (1<<n)

This bit hack also uses the wonderful “set n-th bit shift hack” but this time it XOR’s it with the variable ‘x’. The result of XOR-ing something with something else is that if both bits are the same, the result is 0, otherwise it’s 1. How does it toggle n-th bit? Well, if n-th bit was 1, then XOR-ing it with 1 changes it to 0; conversely, if it was 0, then XOR-ing it with 1 changes it to 1. See, the bit got flipped.

Here is an example. Suppose you want to toggle 5th bit in value 01110101:

    01110101
^   00100000
--------
01010101

What about the same value but 5th bit originally 0?

    01010101
^   00100000
--------
01110101

Notice something? XOR-ing the same bit twice returned it to the same value. This nifty little trick can be used in many programming questions.

#### You may also like

October 18, 2016 - 15:48

Hey about checking even odd
Integer number which are odd had least significant bit in binary 1.
So when we do x &1 -> 3 & 1 -,> 011& 1 = 0 means it’s odd.
Odd and even conditions should be reversed

October 19, 2016 - 14:59

I would like you to check out this code.
http://ideone.com/TWdJzB
The condition is perfectly correct. :)

April 25, 2015 - 13:39

Cool. Good explanation.

April 28, 2015 - 02:52

Check out the new post for some advanced level bit hacks.

April 23, 2015 - 12:05

Really this post helped me a lot. You explained clearly about how the stuff works. Keep posting these kind of posts.

April 23, 2015 - 12:50

Thanks for the support Rajesh. Stay tuned for part 2 of the post, where we will study some advanced tricks.


text:
# Systemd: Managing multiple MariaDB instances

Many Linux distributions now come pre-installed with Systemd. MariaDB added support for Systemd in version 10.1. This support mostly came as a contribution from MariaDB community. In this post, I will discuss how to manage multiple instances of MariaDB server using Systemd. Once MariaDB packages are installed, the Systemd unit files can be located under /lib/systemd/system/.

As we are going to deal with multiple instances, we are interested in the last unit file. With the current implementation, there are two ways to handle multiple instances.

1. Individual configuration files for each instance

This is the default method for which you do not have to make any changes to the unit file. All you need is create separate configuration files for each MariaDB instance under the standard MariaDB configuration directory /etc/mysql/conf.d/ named with distinct suffixes (aka instance name) but common prefix “my”.

For instance, in my test setup, I have the following two option files:

That’s it. You can now start MariaDB instances using the following command:

So, why should configuration files have common prefix “my” but different suffixes? If you look into the unit file, the command used to start a MariaDB instance uses “%I” in –defaults-file option. This gets replaced by the instance name – the suffix used in the above command. Thus, MariaDB gets started with the corresponding configuration file.

2. Using separate group suffixes in single configuration file

This method makes use of MariaDB’s –defaults-group-suffix option. So, you can add options for all the instances in a single configuration file, such that options with values unique to a particular instance are placed in a group with a different suffix. The instructions related to this method are commented by default in the multi-instance unit file. So in order to use this method, the multi-instance unit file (/lib/systemd/system/mariadb@.service) needs to be modified.

• Comment – ConditionPathExists=/etc/mysql/conf.d/my%I.cnf
• Comment all ExecStartPre and ExecStart commands with –defaults-file
• Uncomment all ExecStartPre and ExecStart commands with –defaults-group-suffix

As you might have guessed by now, in this method the instance name “%I” is used in the –defaults-group-suffix (unlike the first method).

Thus, each instance is started with options from the group with specified suffix along with the option listed under common group(s) like [mariadb], [mysqld], [server] or [galera].

For example, the configuration file in my test setup has the following groups :

That’s all. Now, the same set of commands can be used to start/stop/restart/status MariaDB instances.

A word of caution: DO NOT use period in group suffix, as that will cause set-environment to fail.

Recent bug fixes:

• MDEV-10004: Galera’s pc.recovery process fails in 10.1 with systemd
• MDEV-10145: Systemd fails to start mysqld in multi-instance mode

While looking into a replication-related issue, I came across an interesting problem where I wanted to get the name of the largest event in a very large binary log file. So, I thought of putting Vaquita’s binary log API to a test. Here’s a simple program to read a binary log file and print the largest event and its size.

In this case, having RawEvents is sufficient as we are not interested in the actual content of the events.
Wiki : https://github.com/vaquita/mysql/wiki/Replication-Binary-Logs

Edit: Updated the above program to account for a recent change done to RawEvent(), which now returns error.

# Securing MariaDB Galera Cluster using SSL

In MariaDB Galera cluster, the data (writeset) is replicated across all the nodes over network. This data traffic can be secured by enabling SSL connection between the nodes. In order to achieve this, one needs to have SSL certificate/key pair (Here’s how to generate one). The certificate and key can then be copied to all the nodes. Once done, instruct the nodes to establish SSL connection on startup by simply pointing to the certificate/key files using wsrep_provider_options system variable.

wsrep_provider_options='socket.ssl_cert=/tmp/cert.pem;socket.ssl_key=/tmp/key.pem'

Following is the list of SSL options that Galera supports (details : Galera parameters:

• socket.ssl : Enable/disable SSL, explicitly
• socket.ssl_ca : SSL CA file
• socket.ssl_cert : SSL certificate file
• socket.ssl_cipher : SSL cipher list
• socket.ssl_compression : Enable/disable SSL compression
• socket.ssl_key : SSL key file
• socket.ssl_password_file : SSL password file, in case the key is encrypted

At the time of writing, there is no way to check if galera connection is encrypted using SQL (issue#165). The only way is to look into the node’s error log for the following :

150516 14:22:03 [Note] WSREP: SSL handshake successful, remote endpoint ssl://127.0.0.1:46661 local endpoint ssl://127.0.0.1:4000 cipher: AES128-SHA compression:
150516 14:22:03 [Note] WSREP: (6f49f928, 'ssl://0.0.0.0:4000') turning message relay requesting on, nonlive peers:
150516 14:22:03 [Note] WSREP: declaring 73263ae6 at ssl://127.0.0.1:4010 stable

Lastly, it is important to note that SST (snapshot state transfer) traffic is not affected, whatsoever, by the use of galera SSL options.

# MariaDB 10.1 : A new version of GRA_X_X.log file

When a MariaDB Galera cluster node fails to apply a binary log (or writeset, as we call it), the node dumps it into a file (GRA_X_X.log) under the data directory for further investigation. This process has been explained fairly well in this Percona blog). Since the dumped log file is header-less, one has to first prepend a binary log header to it in order to open it using mysqlbinlog tool.

Starting MariaDB 10.1.4, the node will automatically prepend the binlog header to the writeset before dumping it into the GRA_ log file. In order to differentiate it from the older log files, the file has been renamed to GRA_X_X_v2.log.

$./bin/mysqlbinlog data2/GRA_1_1_v2.log /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 #150414 17:50:20 server id 0 end_log_pos 248 Start: binlog v 4, server v 10.1.4-MariaDB-wsrep-debug created 150414 17:50:20 at startup ROLLBACK/*!*/; BINLOG ' nIstVQ8AAAAA9AAAAPgAAAAAAAQAMTAuMS40LU1hcmlhREItd3NyZXAtZGVidWcAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAACciy1VEzgNAAgAEgAEBAQEEgAA3AAEGggAAAAICAgCAAAACgoKAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAEEwQAZxODxw== '/*!*/; # at 248 #150414 17:50:20 server id 0 end_log_pos 76 Query thread_id=4 exec_time=0 error_code=0 use test/*!*/; SET TIMESTAMP=1429048220/*!*/; SET @@session.pseudo_thread_id=4/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C utf8 *//*!*/; SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/; SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; drop table t1 /*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; # Password validation plugins in MariaDB Let me start off with a phrase : “A chain is only as strong as its weakest link”. So, how to ensure that all the links (=passwords) are strong enough to keep the system secure? One of the key attributes to consider here is password strength. MariaDB 10.1.2 added support for password validation by introducing a password validation plugin API and two password validation plugins. These plugins can be used to ensure that the password used for the user accounts adhere to some required security standards. 1. simple_password_check 2. cracklib_password_check (requires libcrack2) 3. So, what passwords are now forbidden? Lets check : Password validation plugins only validate plain-text password (for obvious reasons!). So commands that contain password hashes are not validated. In order to reject such commands strict_password_validation system variable can be used. Lastly, it important to note that multiple password validation plugins can be loaded at the same time and the password must pass on all the plugins. # Understanding split brain in a Galera cluster Split brain is a condition when a cluster gets partitioned and each part is operating independently. This is an unwanted situation that one would always want to avoid. So, how is it handled in a MariaDB Galera cluster? In order to understand this, let’s first start by looking into the logs of a node from a split-brain(ed) cluster. In the event of a network partition, some nodes of the cluster may no longer be reachable from the other nodes. They try to reconnect to these suspecting nodes and later move them to partitioned list by marking them as inactive when no response is received. A voting for quorum is then taken on each node to see if they belong to the majority partition (Primary Component) using the following formula : $\frac{\sum&space;\left&space;(&space;p_{i}&space;\times&space;w_{i}&space;\right&space;)&space;-&space;\sum&space;\left&space;(&space;l_{j}&space;\times&space;w_{j}&space;\right&space;)}{2}&space;<&space;\sum&space;\left&space;(&space;m_{k}&space;\times&space;w_{k}&space;\right&space;)$ where, In a Galera cluster, nodes outside the primary component are not allowed to process queries. It is mainly done preserve data consistency. MariaDB [test]> select 1; ERROR 1047 (08S01): WSREP has not yet prepared node for application use Now, as shown in the logs above, when the cluster gets split into two partitions of equal size, (i.e. both the partitions get equal weight, split-brain), the quorum algorithm fails find the the primary component. As a result, the cluster has no primary component and can no longer process any queries. This can be resolved by finding the node with most recent updates and bootstraping the cluster using that node. # New Information schema tables for Galera membership and status MariaDB Galera server logs all the cluster related information like node status, cluster status, membership, etc. in the error log. MariaDB 10.1.2 introduces a new INFORMATION SCHEMA plugin WSREP_INFO that enables querying these information via INFORMATION SCHEMA tables. The WSREP_INFO plugin adds two new tables to the Information Schema, WSREP_MEMBERSHIP and WSREP_STATUS. The plugin is not enabled by default, so in order to use it, it needs to be installed first : MariaDB [test]> INSTALL SONAME 'wsrep_status'; Query OK, 0 rows affected (0.04 sec) MariaDB [test]> SHOW PLUGINS; +-----------------------------+----------+--------------------+-----------------+---------+ | Name | Status | Type | Library | License | +-----------------------------+----------+--------------------+-----------------+---------+ ... | WSREP_MEMBERSHIP | ACTIVE | INFORMATION SCHEMA | wsrep_status.so | GPL | | WSREP_STATUS | ACTIVE | INFORMATION SCHEMA | wsrep_status.so | GPL | +-----------------------------+----------+--------------------+-----------------+---------+ 52 rows in set (0.01 sec) MariaDB [test]> SHOW CREATE TABLE INFORMATION_SCHEMA.WSREP_MEMBERSHIP\G *************************** 1. row *************************** Table: WSREP_MEMBERSHIP Create Table: CREATE TEMPORARY TABLE WSREP_MEMBERSHIP ( INDEX int(11) NOT NULL DEFAULT '0', UUID varchar(36) NOT NULL DEFAULT '', NAME varchar(32) NOT NULL DEFAULT '', ADDRESS varchar(256) NOT NULL DEFAULT '' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 1 row in set (0.00 sec) MariaDB [test]> SHOW CREATE TABLE INFORMATION_SCHEMA.WSREP_STATUS\G *************************** 1. row *************************** Table: WSREP_STATUS Create Table: CREATE TEMPORARY TABLE WSREP_STATUS ( NODE_INDEX int(11) NOT NULL DEFAULT '0', NODE_STATUS varchar(16) NOT NULL DEFAULT '', CLUSTER_STATUS varchar(16) NOT NULL DEFAULT '', CLUSTER_SIZE int(11) NOT NULL DEFAULT '0', CLUSTER_STATE_UUID varchar(36) NOT NULL DEFAULT '', CLUSTER_STATE_SEQNO bigint(21) NOT NULL DEFAULT '0', CLUSTER_CONF_ID bigint(21) NOT NULL DEFAULT '0', GAP varchar(10) NOT NULL DEFAULT '', PROTOCOL_VERSION int(11) NOT NULL DEFAULT '0' ) ENGINE=MEMORY DEFAULT CHARSET=utf8 1 row in set (0.00 sec) MariaDB [test]> SELECT @@wsrep_provider; +----------------------------------+ | @@wsrep_provider | +----------------------------------+ | /usr/lib/galera/libgalera_smm.so | +----------------------------------+ 1 row in set (0.00 sec) Now that WSREP_INFO plugin is installed, lets look into the contents of these tables on a 3-node cluster. MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_MEMBERSHIP; +-------+--------------------------------------+----------+-----------------+ | INDEX | UUID | NAME | ADDRESS | +-------+--------------------------------------+----------+-----------------+ | 0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 | | 1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 | | 2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 | +-------+--------------------------------------+----------+-----------------+ 3 rows in set (0.00 sec) MariaDB [test]> SELECT * FROM INFORMATION_SCHEMA.WSREP_STATUS\G *************************** 1. row *************************** NODE_INDEX: 0 NODE_STATUS: Synced CLUSTER_STATUS: Primary CLUSTER_SIZE: 3 CLUSTER_STATE_UUID: 190604d7-8940-11e4-a084-ebee5211c190 CLUSTER_STATE_SEQNO: 2 CLUSTER_CONF_ID: 3 GAP: NO PROTOCOL_VERSION: 3 1 row in set (0.00 sec) As seen above, WSREP_MEMBERSHIP table shows information about current members in the cluster which includes node’s name and incoming address. WSREP_STATUS table, on the other hand, shows status information about the node and cluster as a whole. SHOW command can also be used to query these tables. Its quick and reduces the number of columns for WSREP_STATUS to fit to the screen. MariaDB [test]> SHOW WSREP_MEMBERSHIP; +-------+--------------------------------------+----------+-----------------+ | Index | Uuid | Name | Address | +-------+--------------------------------------+----------+-----------------+ | 0 | 19058073-8940-11e4-8570-16af7bf8fced | my_node1 | 10.0.2.15:16001 | | 1 | 19f2b0e0-8942-11e4-9cb8-b39e8ee0b5dd | my_node3 | 10.0.2.15:16003 | | 2 | d85e62db-8941-11e4-b1ef-4bc9980e476d | my_node2 | 10.0.2.15:16002 | +-------+--------------------------------------+----------+-----------------+ 3 rows in set (0.00 sec) MariaDB [test]> SHOW WSREP_STATUS; +------------+-------------+----------------+--------------+ | Node_Index | Node_Status | Cluster_Status | Cluster_Size | +------------+-------------+----------------+--------------+ | 0 | Synced | Primary | 3 | +------------+-------------+----------------+--------------+ 1 row in set (0.00 sec) # The curious case of lost data There is no doubt that Galera makes a fine clustering solution. The ease at which one can setup a cluster is incredible. Recently, a query from a user on #mariadb@freenode, however, revealed a caveat which I feel is quite important and worth sharing. Sep 10 14:16:09 <____> nirbhay: executive summary, my cluster was out of sync, and when i brought it back into sync the DB is now 3 weeks old. it updated the new node with the old node’s contents. Sep 10 14:16:23 <____> nirbhay: galera + maria 5.5 Let me first try to explain the problem. The user has a MariaDB Galera cluster – up and running – but with stale data (3 weeks old to be precise) and another MariaDB Galera node running outside the cluster storing latest updates. Now, the user takes this node and adds to the cluster, thinking that out-of-sync cluster nodes would receive latest changes from this joining node. Unfortunately, it turned out that opposite happened – and this joiner node instead became stale (losing 3 weeks worth of updates!) when into synced with the cluster. Actually, this is expected. When a node joins an existing Galera cluster, it receives data from one of the nodes (donor) of the cluster in order to get in sync with the cluster. During this process (aka snapshot state transfer) the node itself loses it own data (if any). This is precisely the reason why the joiner node (with latest updates) lost the recent changes in the above mentioned scenario. So, how to handle such situations? In cases like this, one should discard the existing stale cluster and bootstrap a new cluster using the node having latest updates. # Snapshot State Transfer (SST) methods in MariaDB Galera Cluster In a Galera cluster, when a node (joiner) joins the cluster, it receives a copy of entire data from one of the nodes (donor) in the cluster. This process is called Snapshot state transfer (SST). MariaDB Galera Cluster provides various methods for snapshot state transfer which can be configured using wsrep_sst_method option. MariaDB Galera cluster distribution currently includes the following SST methods : • rsync • It is the default method which uses rsync to transfer data files across the cluster. The donor node itself becomes READ-ONLY during the transfer by executing FLUSH TABLES WITH READ LOCK. It is important to note that even though the data transfer is fast, this method requires no authentication (wsrep_sst_auth). • mysqldump • This method uses mysqldump tool to get a dump of all the databases on donor node which is then played/executed on the joiner node. This method requires wsrep_sst_auth to be set with credentials to connect to the donor as well as joiner node. • xtrabackup/xtrabackup-v2 • This method uses Percona XtraBackup tool to take a backup (snapshot) of donor’s data directory which is then restored on the joiner node. This method requires wsrep_sst_auth to be set with credentials to connect to the donor node. # Configuring SELinux for Galera cluster Setting up a MariaDB Galera cluster can easily become tedious if its being setup on a Linux system with SELinux enabled. 140805 16:16:20 [Note] WSREP: gcomm: connecting to group 'my_wsrep_cluster', peer '' 140805 16:16:20 [ERROR] WSREP: Permission denied 140805 16:16:20 [ERROR] WSREP: failed to open gcomm backend connection: 13: error while trying to listen 'tcp://0.0.0.0:4567?socket.non_blocking=1', asio error 'Permission denied': 13 (Permission denied) at gcomm/src/asio_tcp.cpp:listen():814 140805 16:16:20 [ERROR] WSREP: gcs/src/gcs_core.c:gcs_core_open():202: Failed to open backend connection: -13 (Permission denied) 140805 16:16:20 [ERROR] WSREP: gcs/src/gcs.c:gcs_open():1291: Failed to open channel 'my_wsrep_cluster' at 'gcomm://': -13 (Permission denied) 140805 16:16:20 [ERROR] WSREP: gcs connect failed: Permission denied 140805 16:16:20 [ERROR] WSREP: wsrep::connect() failed: 7 140805 16:16:20 [ERROR] Aborting In a test environment one can disable/enable SELinux for mysqld using the following commands (Thanks to Daniel Black for the tip!) :$ sudo semanage permissive -a mysqld_t
$sudo semanage permissive -d mysqld_t Disabling SELinux for mysql works, but its certainly not the best solution. So, I tried to configure SELinux for a 2-node MariaDB Galera cluster on CentOS by using some tools provided to manage SELinux policies. The basic idea is to let the MariaDB Galera nodes run under permissive mode in order to get all possible operations (which SELinux would have otherwise denied) logged into the audit log and then create a policy module using allow2audit tool after carefully analyzing the “denials”. The resulting module can then be installed before enabling (enforcing) SELinux for mysqld again. Prepare the hosts * Install MariaDB Galera server packages ($ sudo yum install MariaDB-Galera-server)
* Setup MariaDB configuration options ($sudo vi /etc/my.cnf.d/server.cnf) * Install SELinux policy management tools ($ sudo yum install policycoreutils-python)
* Firewall settings (see resources below)

Generate the policy module
* Disable SELinux for mysqld on both the hosts. With SELinux in permissive mode, it logs all the denial operations as warnings instead of enforcing them.

$sudo semanage permissive -a mysqld_t • Once mysqld on both the hosts are in permissive mode, our goal is to trigger all sorts of events that can happen on a node in a MariaDB Galera cluster (the more extensive, the better!) like, starting the node as donor/joiner with different snapshot state transfer (SST) methods and incremental state transfer (IST). The idea is to let all possible denials get logged into the audit log, which we later use to generate the policy module. • Carefully analyze (sealert Messages) all the “denials” logged in the audit log (/var/log/audit/audit.log). If the denials are expected, create a local policy module using allow2audit.$ sudo grep mysql audit.log | audit2allow -M mariadb-galera
• Install the policy module.
$sudo semodule -i mariadb-galera.pp • Put mysqld back to enforcing mode.$ sudo semanage permissive -d mysqld_t

Resources


text:
# How to solve the partial differential equation $a\frac {\partial L}{\partial a}+b\frac {\partial L}{\partial b}= L$

I am trying to express the eliptic integral in series expression that depends on $a,b,\alpha$ and without integral

$$L(\alpha)=\int_0^\alpha\sqrt{a^2\sin^2 t+b^2 \cos^2 t}\,dt$$

$$\frac {\partial L(\alpha)}{\partial a}=\int_0^\alpha \frac{a\sin^2 t}{\sqrt{a^2\sin^2 t+b^2 \cos^2 t}}\,dt$$

$$\frac {\partial L(\alpha)}{\partial b}=\int_0^\alpha \frac{b\cos^2 t}{\sqrt{a^2\sin^2 t+b^2 \cos^2 t}}\,dt$$

$$a\frac {\partial L(\alpha)}{\partial a}+b\frac {\partial L(\alpha)}{\partial b}=\int_0^\alpha \frac{a^2\sin^2 t+b^2 \cos^2 t}{\sqrt{a^2\sin^2 t+b^2 \cos^2 t}}\,dt=\int_0^\alpha\sqrt{a^2\sin^2 t+b^2 \cos^2 t}\,dt$$

$$a\frac {\partial L}{\partial a}+b\frac {\partial L}{\partial b}= L \tag 1$$

Thanks a lot

Some boundary conditions: $$L(\alpha)|_{a=0}=\int_0^\alpha\sqrt{b^2 \cos^2 t}\,dt=\int_0^\alpha b \cos t\,dt =b \sin \alpha$$

$$L(\alpha)|_{b=0}=\int_0^\alpha\sqrt{a^2 \sin^2 t}\,dt=\int_0^\alpha a \sin t\,dt =-a (\cos \alpha- 1)= a (1- \cos \alpha)$$

$$L(\alpha)|_{b=a}=\int_0^\alpha\sqrt{a^2\sin^2 t+a^2 \cos^2 t}\,dt=\alpha a$$

-
–  Siminore Sep 13 '12 at 14:53
@Mathlover, although you create the PDE correctly, in fact express $\int_0^\alpha\sqrt{a^2\sin^2t+b^2\cos^2 t}~dt$ in series expression should only be done by other means method and the PDE approach is no helpful. You are an experienced user, why you ask such wrongly-directed question? –  doraemonpaul Sep 14 '12 at 0:21
For the PDE aspect, see this thread. But you should not try to reinvent the wheel. There are hundreds of formulas for elliptic integrals, including dozens of series representations. –  user31373 Sep 14 '12 at 3:06
@doraemonpaul: I have been self-studying on elliptic integrals. I like to try different approach to a problem. I am not so much experienced about some subjects such as PDEs. Actually I knew binom method but I tried to find a solution via a different way . Maybe I have lost myself in big PDE Ocean. Thanks for answer. –  Mathlover Sep 14 '12 at 7:20
@LVK: Thanks for advice. You are right but to rediscover some relations gives me deep understanding. It is just self-learning method. I am trying to learn to catch fish not to wait for a ready one in my stomach. Thank you for your understanding and links. I have been checking them. –  Mathlover Sep 14 '12 at 7:25

Just to expand on the method of characteristics as Siminore pointed out in the comments: the differential operator $$a \frac{\partial}{\partial a} + b \frac{\partial}{\partial b}$$ is represented by the radial vector field in the $(a,b)$ plane.

This means that all three of your "boundaries", $\{ a = 0\}$, $\{b = 0\}$ and $\{a = b\}$ are tangential the the characteristic curves. This means, in fact, that given just the data you gave us and the partial differential equation, your equation has infinitely many solutions!

Indeed, let $\omega = \arctan b/a$ and $r = \sqrt{a^2 + b^2}$. Then given any $2\pi$ periodic function $F$, the function $(r,\omega)\mapsto r F(\omega)$ solves the differential equation. Your boundary condition specifies $F$ at $\{0,\pi/4, \pi/2, \pi, 5\pi/4, 3\pi/2,\}$ and nowhere else.

-
Does your approach really helpful to express $\int_0^\alpha\sqrt{a^2\sin^2t+b^2\cos^2t}~dt$ in series expression? If not, your approach should be a waste to this question. –  doraemonpaul Sep 19 '12 at 8:55
(-1): Cannot provide evidence that your approach is really helpful to express $\int_0^\alpha\sqrt{a^2\sin^2 t+b^2\cos^2t}~dt$ in series expression. –  doraemonpaul Sep 20 '12 at 23:29
@doraemonpaul: the approach is generally useful for solving hyperbolic differential equations with non-characteristic initial data. In the specific case that the OP has in mind the answer points out that (i) the PDE is not solvable as stated (the data being characteristic) and so (ii) the OP cannot possibly obtain the desired integral by the displayed method of converting to and solving a PDE. –  Willie Wong Sep 24 '12 at 8:43
@doraemonpaul: the question actually asked here is on how to solve a PDE. I showed that the PDE is cannot be solved as stated. I find it incredible that you would downvote because I didn't address the motivation behind the question asked. –  Willie Wong Sep 24 '12 at 8:44

For expressing $\int_0^\alpha\sqrt{a^2\sin^2t+b^2\cos^2t}~dt$ in series expression:

$\int_0^\alpha\sqrt{a^2\sin^2t+b^2\cos^2t}~dt$

$=\int_0^\alpha\sqrt{a^2(1-\cos^2t)+b^2\cos^2t}~dt$

$=\int_0^\alpha\sqrt{a^2+(b^2-a^2)\cos^2t}~dt$

$=\int_0^\alpha|a|\sqrt{1+\dfrac{b^2-a^2}{a^2}\cos^2t}~dt$

For the binomial series of $\sqrt{1+x}$ , e.g. according to http://en.wikipedia.org/wiki/Square_root#Properties, $\sqrt{1+x}=\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!x^n}{4^n(n!)^2(1-2n)}$

$\therefore\int_0^\alpha|a|\sqrt{1+\dfrac{b^2-a^2}{a^2}\cos^2t}~dt$

$=\int_0^\alpha\sum\limits_{n=0}^\infty\dfrac{(-1)^n(2n)!|a|(b^2-a^2)^n\cos^{2n}t}{4^n(n!)^2(1-2n)a^{2n}}dt$

$=\int_0^\alpha\left(|a|+\sum\limits_{n=1}^\infty\dfrac{(-1)^n(2n)!|a|(b^2-a^2)^n\cos^{2n}t}{4^n(n!)^2(1-2n)a^{2n}}\right)dt$

Now for $\int\cos^{2n}t~dt$ , where $n$ is any natural number,

$\int\cos^{2n}t~dt=\dfrac{(2n)!t}{4^n(n!)^2}+\sum\limits_{k=1}^n\dfrac{(2n)!((k-1)!)^2\sin t~\cos^{2k-1}t}{4^{n-k+1}(n!)^2(2k-1)!}+C$

This result can be done by successive integration by parts, e.g. as shown as http://hk.knowledge.yahoo.com/question/question?qid=7012022000808

$\therefore\int_0^\alpha\left(|a|+\sum\limits_{n=1}^\infty\dfrac{(-1)^n(2n)!|a|(b^2-a^2)^n\cos^{2n}t}{4^n(n!)^2(1-2n)a^{2n}}\right)dt$

$=\left[|a|t+\sum\limits_{n=1}^\infty\dfrac{(-1)^n((2n)!)^2|a|(b^2-a^2)^nt}{4^{2n}(n!)^4(1-2n)a^{2n}}+\sum\limits_{n=1}^\infty\sum\limits_{k=1}^n\dfrac{(-1)^n((2n)!)^2((k-1)!)^2|a|(b^2-a^2)^n\sin t~\cos^{2k-1}t}{4^{2n-k+1}(n!)^4(1-2n)(2k-1)!a^{2n}}\right]_0^\alpha$

$=\left[\sum\limits_{n=0}^\infty\dfrac{(-1)^n((2n)!)^2|a|(b^2-a^2)^nt}{4^{2n}(n!)^4(1-2n)a^{2n}}+\sum\limits_{n=1}^\infty\sum\limits_{k=1}^n\dfrac{(-1)^n((2n)!)^2((k-1)!)^2|a|(b^2-a^2)^n\sin t~\cos^{2k-1}t}{4^{2n-k+1}(n!)^4(1-2n)(2k-1)!a^{2n}}\right]_0^\alpha$

$=\sum\limits_{n=0}^\infty\dfrac{(-1)^n((2n)!)^2|a|(b^2-a^2)^n\alpha}{4^{2n}(n!)^4(1-2n)a^{2n}}$

$~~~+\sum\limits_{n=1}^\infty\sum\limits_{k=1}^n\dfrac{(-1)^n((2n)!)^2((k-1)!)^2|a|(b^2-a^2)^n\sin\alpha~\cos^{2k-1}\alpha}{4^{2n-k+1}(n!)^4(1-2n)(2k-1)!a^{2n}}$

You can also try another approach that

$\int_0^\alpha\sqrt{a^2\sin^2t+b^2\cos^2t}~dt$

$=\int_0^\alpha\sqrt{a^2\sin^2t+b^2(1-\sin^2t)}~dt$

$=\int_0^\alpha\sqrt{b^2+(a^2-b^2)\sin^2t}~dt$

$=\int_0^\alpha|b|\sqrt{1+\dfrac{a^2-b^2}{b^2}\sin^2t}~dt$

But you should handle $\int\sin^{2n}t~dt$ , where $n$ is any non-negative integer instead

-
(+1) Thanks for help to show $\int\cos^{2n}t~dt$. –  Mathlover Sep 14 '12 at 8:21


text:
• Metric systolicity and two-dimensional Artin groups(1710.05157)

March 15, 2019 math.GR
We introduce the notion of metrically systolic simplicial complexes. We study geometric and large-scale properties of such complexes and of groups acting on them geometrically. We show that all two-dimensional Artin groups act geometrically on metrically systolic complexes. As direct corollaries we obtain new results on two-dimensional Artin groups and all their finitely presented subgroups: we prove that the Conjugacy Problem is solvable, and that the Dehn function is quadratic. We also show several large-scale features of finitely presented subgroups of two-dimensional Artin groups, lying background for further studies concerning their quasi-isometric rigidity.
• Hyperfiniteness of boundary actions of cubulated hyperbolic groups(1701.03969)

Aug. 28, 2017 math.LO, math.GR
We show that if a hyperbolic group acts geometrically on a CAT(0) cube complex, then the induced boundary action is hyperfinite. This means that for a cubulated hyperbolic group the natural action on its Gromov boundary is hyperfinite, which generalizes an old result of Dougherty, Jackson and Kechris for the free group case.
• A step towards Twist Conjecture(1708.00960)

Aug. 3, 2017 math.GR
Under the assumption that a defining graph of a Coxeter group admits only twists in $\mathbb{Z}_2$ and is of type FC, we prove M\"uhlherr's Twist Conjecture.
• Large-type Artin groups are systolic(1706.05473)

June 19, 2019 math.GR
We prove that Artin groups from a class containing all large-type Artin groups are systolic. This provides a concise yet precise description of their geometry. Immediate consequences are new results concerning large-type Artin groups: biautomaticity; existence of $EZ$-boundaries; the Novikov conjecture; descriptions of finitely presented subgroups, of virtually solvable subgroups, and of centralizers for infinite order elements; the Burghelea conjecture; existence of low-dimensional models for classifying spaces for some families of subgroups.
• Quasi-isometric classification of right-angled Artin groups I: the finite out case(1410.8512)

Sept. 16, 2016 math.MG, math.GR
Let $G$ and $G'$ be two right-angled Artin groups (RAAG). We show they are quasi-isometric iff they are isomorphic, under the assumption that $Out(G)$ and $Out(G')$ are finite. If only $Out(G)$ is finite, then $G'$ is quasi-isometric $G$ iff $G'$ is isomorphic to a finite index subgroup of $G$. In this case, we give an algorithm to determine whether $G$ and $G'$ are quasi-isometric by looking at their defining graphs.
• Determining the action dimension of an Artin group by using its complex of abelian subgroups(1608.03572)

Aug. 15, 2016 math.GT, math.GR
Suppose that $(W,S)$ is a Coxeter system with associated Artin group $A$ and with a simplicial complex $L$ as its nerve. We define the notion of a "standard abelian subgroup" in $A$. The poset of such subgroups in $A$ is parameterized by the poset of simplices in a certain subdivision $L_\oslash$ of $L$. This complex of standard abelian subgroups is used to generalize an earlier result from the case of right-angled Artin groups to case of general Artin groups, by calculating, in many instances, the smallest dimension of a manifold model for $BA$. (This is the "action dimension" of $A$ denoted actdim $A$.) If $H_d(L; \mathbb Z/2)\neq 0$, where $d=\dim L$, then actdim $A \ge 2d+2$. Moreover, when the $K(\pi,1)$-Conjecture holds for $A$, the inequality is an equality.
• Top dimensional quasiflats in $CAT(0)$ cube complexes(1410.8195)

July 29, 2016 math.MG, math.GR
We show that every $n$-quasiflat in a $n$-dimensional $CAT(0)$ cube complex is at finite Hausdorff distance from a finite union of $n$-dimensional orthants. Then we introduce a class of cube complexes, called {\em weakly special} cube complexes and show that quasi-isometries between their universal coverings preserve top dimensional flats. We use this to establish several quasi-isometry invariants for right-angled Artin groups. Some of our arguments also extend to $CAT(0)$ spaces of finite geometric dimension. In particular, we give a short proof of the fact that a top dimensional quasiflat in a Euclidean buildings is Hausdorff close to finite union of Weyl cones, which was previously established in several other authors by different methods.
• Commensurability of groups quasi-isometric to RAAG's(1603.08586)

June 5, 2016 math.GT, math.GR
Let $G$ be a right-angled Artin group with defining graph $\Gamma$ and let $H$ be a finitely generated group quasi-isometric to $G(\Gamma)$. We show if $G$ satisfies (1) its outer automorphism group is finite; (2) $\Gamma$ does not have induced 4-cycle; (3) $\Gamma$ is star-rigid; then $H$ is commensurable to $G$. We show condition (2) is sharp in the sense that if $\Gamma$ contains an induced 4-cycle, then there exists an $H$ quasi-isometric to $G(\Gamma)$ but not commensurable to $G(\Gamma)$. Moreover, one can drop condition (1) if $H$ is a uniform lattice acting on the universal cover of the Salvetti complex of $G(\Gamma)$. As a consequence, we obtain a conjugation theorem for such uniform lattices. The ingredients of the proof include a blow-up building construction in \cite{cubulation} and a Haglund-Wise style combination theorem for certain class of special cube complexes. However, in most of our cases, relative hyperbolicity is absent, so we need new ingredients for the combination theorem.
• Groups quasi-isometric to RAAG's(1601.00946)

March 16, 2016 math.GT, math.GR
We characterize groups quasi-isometric to a right-angled Artin group $G$ with finite outer automorphism group. In particular all such groups admit a geometric action on a $CAT(0)$ cube complex that has an equivariant "fibering" over the Davis building of $G$.
• Quasi-isometry classification of right-angled Artin groups II: several infinite out cases(1603.02372)

March 8, 2016 math.GT, math.GR
We are motivated by the question that for which class of right-angled Artin groups (RAAG's), the quasi-isometry classification coincides with commensurability classification. This is previously known for RAAG's with finite outer automorphism groups. In this paper, we identify two classes of RAAG's, where their outer automorphism groups are allowed to contain adjacent transvections and partial conjugations, hence infinite. If $G$ belongs to one of these classes, then any other RAAG $G'$ is quasi-isometric to $G$ if and only if $G'$ is commensurable to $G$. We also show that in this case, there exists an algorithm to determine whether two RAAG's are quasi-isometric by looking at their defining graphs. Compared to the finite out case, as well as the previous quasi-isometry rigidity results for symmetric spaces, thick Euclidean buildings and mapping class groups, the main issue we need to deal with here is the reconstruction map may not have nice properties as before, or may not even exist. We introduce a deformation argument, as well as techniques from cubulation to deal with this issue.
• Cocompactly cubulated 2-dimensional Artin groups(1510.08493)

Oct. 28, 2015 math.GR
We give a necessary and sufficient condition for a 2-dimensional or a three-generator Artin group $A$ to be (virtually) cocompactly cubulated, in terms of the defining graph of $A$.


text:
### Consecutive Numbers

An investigation involving adding and subtracting sets of consecutive numbers. Lots to find out, lots to explore.

### Have You Got It?

Can you explain the strategy for winning this game with any target?

### Counting Factors

Is there an efficient way to work out how many factors a large number has?

# Missing 9s

##### Age 11 to 14 ShortChallenge Level

Counting 300 places on Sara's list
Between 1 and 100, Sara won't list 9, 19, 29, 39, 49, 59, 69, 79, 89 or 90 - 99.
19 numbers will be missed between 1 and 100, 81 will be listed
100 will be the 81st number
81 numbers will be listed between 101 and 200
200 will be the 162nd number
81 numbers will be listed between 201 and 300
300 will be the 243rd number
301 will be the 244th number
...
308 will be the 251st number
310 will be the 252nd number
...
318 will be the 260th number
320 will be the 261st number
...
328 will be the 269th number
330 will be the 270th number
...
340 will be the 279th number
...
350 will be the 288th number
...
360 will be the 297th number
...
363 will be the 300th number

Counting in blocks with a diagram

Representing the numbers 1 to 100 in a square, the numbers Sara won't list are shown in red.

The numbers up to 100 on Sara's list make a 9 by 9 square.

81 numbers in this square

The square from 101 to 200 is similar
81 numbers in this square makes 162 altogether

The square from 201 to 300 is similar
81 numbers in this square makes 243 altogether
57 more numbers to reach 300

Rows from the square from 301 to 400
The rows are all 9 numbers long
9$\times$6 = 54 numbers in this block
3 more numbers to reach 300

300th number is 363

Using base 9
Numbers written in base 9 do not contain any 9s.

In base 9, the numbers 1, 2, 3, 4, 5, 6, 7, 8 are written as usual, but the number '9' is written as 10. Instead of having a ones column and a tens column and a hundreds (=10$^2$) column and so on, base 9 has a ones column and a nines column and an eighty-ones (=9$^2$) column and so on. For example, '18' is written as 20 because it is 2 nines and 0 ones, and '82' is written as 101 because it is 1 eighty-one, 0 nines and 1 one.

To find the 300th number on Sara's list, write 300 in base 9.
3$\times$81 = 243 < 300
4$\times$81 = 324 > 300
There are 3 eighty-ones in 300, remainder 57.

57 = 6$\times$9 + 3,

So 300 = 3$\times$81 + 6$\times$9 + 3
In base 9 it is written 363.

You can find more short problems, arranged by curriculum topic, in our short problems collection.


text:
TheInfoList

A perimeter is either a path that encompasses/surrounds/outlines a shape (in two dimensions) or its length ( one-dimensional). The perimeter of a
circle A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre; equivalently it is the curve traced out by a point that moves in a pl ...
or an
ellipse In mathematics, an ellipse is a plane curve surrounding two focus (geometry), focal points, such that for all points on the curve, the sum of the two distances to the focal points is a constant. As such, it generalizes a circle, which is the sp ...
is called its circumference. Calculating the perimeter has several practical applications. A calculated perimeter is the length of fence required to surround a yard or garden. The perimeter of a wheel/circle (its circumference) describes how far it will roll in one revolution. Similarly, the amount of string wound around a spool is related to the spool's perimeter; if the length of the string was exact, it would equal the perimeter.

# Formulas

The perimeter is the distance around a shape. Perimeters for more general shapes can be calculated, as any path, with $\int_0^L \mathrms$, where $L$ is the length of the path and $ds$ is an infinitesimal line element. Both of these must be replaced by algebraic forms in order to be practically calculated. If the perimeter is given as a closed piecewise smooth plane curve with :$\gamma\left(t\right)=\beginx\left(t\right)\\y\left(t\right)\end$ then its length $L$ can be computed as follows: : $L = \int\limits_a^b\sqrt\,\mathrm dt$ A generalized notion of perimeter, which includes hypersurfaces bounding volumes in $n$- dimensional
Euclidean space Euclidean space is the fundamental space of classical geometry. Originally it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean spaces of any nonnegative integer dimension (mathematics), dimensio ...
s, is described by the theory of
Caccioppoli set In mathematics, a Caccioppoli set is a Set (mathematics), set whose boundary (topology), boundary is measurable set, measurable and has (at least Local property, locally) a ''finite measure (mathematics), measure''. A synonym is set of (locally) fin ...
s.

# Polygons

Polygons are fundamental to determining perimeters, not only because they are the simplest shapes but also because the perimeters of many shapes are calculated by Approximation#Mathematics, approximating them with limit of a sequence, sequences of polygons tending to these shapes. The first mathematician known to have used this kind of reasoning is Archimedes, who approximated the perimeter of a circle by surrounding it with regular polygons. The perimeter of a polygon equals the summation, sum of the lengths of its Edge (geometry), sides (edges). In particular, the perimeter of a rectangle of width $w$ and length $\ell$ equals $2w + 2\ell.$ An equilateral polygon is a polygon which has all sides of the same length (for example, a rhombus is a 4-sided equilateral polygon). To calculate the perimeter of an equilateral polygon, one must multiply the common length of the sides by the number of sides. A regular polygon may be characterized by the number of its sides and by its circumradius, that is to say, the constant distance between its Centre (geometry), centre and each of its Vertex (geometry), vertices. The length of its sides can be calculated using trigonometry. If is a regular polygon's radius and is the number of its sides, then its perimeter is :$2nR \sin\left\left(\frac\right\right).$ A splitter (geometry), splitter of a triangle is a cevian (a segment from a vertex to the opposite side) that divides the perimeter into two equal lengths, this common length being called the semiperimeter of the triangle. The three splitters of a triangle concurrent lines, all intersect each other at the Nagel point of the triangle. A cleaver (geometry), cleaver of a triangle is a segment from the midpoint of a side of a triangle to the opposite side such that the perimeter is divided into two equal lengths. The three cleavers of a triangle all intersect each other at the triangle's Spieker center.

# Circumference of a circle

The perimeter of a
circle A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre; equivalently it is the curve traced out by a point that moves in a pl ...
, often called the circumference, is proportional to its diameter and its radius. That is to say, there exists a constant number pi, (the ancient greek, Greek ''p'' for perimeter), such that if is the circle's perimeter and its diameter then, :$P = \pi\cdot.\!$ In terms of the radius of the circle, this formula becomes, :$P=2\pi\cdot r.$ To calculate a circle's perimeter, knowledge of its radius or diameter and the number suffices. The problem is that is not rational number, rational (it cannot be expressed as the quotient of two integers), nor is it algebraic number, algebraic (it is not a root of a polynomial equation with rational coefficients). So, obtaining an accurate approximation of is important in the calculation. The computation of the digits of is relevant to many fields, such as mathematical analysis, algorithmics and computer science.

# Perception of perimeter

The perimeter and the area (geometry), area are two main measures of geometric figures. Confusing them is a common error, as well as believing that the greater one of them is, the greater the other must be. Indeed, a commonplace observation is that an enlargement (or a reduction) of a shape make its area grow (or decrease) as well as its perimeter. For example, if a field is drawn on a 1/ scale map, the actual field perimeter can be calculated multiplying the drawing perimeter by . The real area is times the area of the shape on the map. Nevertheless, there is no relation between the area and the perimeter of an ordinary shape. For example, the perimeter of a rectangle of width 0.001 and length 1000 is slightly above 2000, while the perimeter of a rectangle of width 0.5 and length 2 is 5. Both areas equal to 1. Proclus (5th century) reported that Greek peasants "fairly" parted fields relying on their perimeters. However, a field's production is proportional to its area, not to its perimeter, so many naive peasants may have gotten fields with long perimeters but small areas (thus, few crops). If one removes a piece from a figure, its area decreases but its perimeter may not. In the case of very irregular shapes, confusion between the perimeter and the convex hull may arise. The convex hull of a figure may be visualized as the shape formed by a rubber band stretched around it. In the animated picture on the left, all the figures have the same convex hull; the big, first hexagon.

# Isoperimetry

The isoperimetric problem is to determine a figure with the largest area, amongst those having a given perimeter. The solution is intuitive; it is the
circle A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre; equivalently it is the curve traced out by a point that moves in a pl ...
. In particular, this can be used to explain why drops of fat on a broth surface are circular. This problem may seem simple, but its mathematical proof requires some sophisticated theorems. The isoperimetric problem is sometimes simplified by restricting the type of figures to be used. In particular, to find the quadrilateral, or the triangle, or another particular figure, with the largest area amongst those with the same shape having a given perimeter. The solution to the quadrilateral isoperimetric problem is the square, and the solution to the triangle problem is the equilateral triangle. In general, the polygon with sides having the largest area and a given perimeter is the regular polygon, which is closer to being a circle than is any irregular polygon with the same number of sides.

# Etymology

The word comes from the Ancient Greek, Greek περίμετρος ''perimetros'' from περί ''peri'' "around" and μέτρον ''metron'' "measure".


text:
Corpus ID: 38342008

Black-Box Alpha Divergence Minimization

@inproceedings{HernndezLobato2016BlackBoxAD,
title={Black-Box Alpha Divergence Minimization},
author={Jos{\'e} Miguel Hern{\'a}ndez-Lobato and Yingzhen Li and Mark Rowland and Thang D. Bui and Daniel Hern{\'a}ndez-Lobato and Richard E. Turner},
booktitle={ICML},
year={2016}
}
Black-box alpha (BB-$\alpha$) is a new approximate inference method based on the minimization of $\alpha$-divergences. BB-$\alpha$ scales to large datasets because it can be implemented using stochastic gradient descent. BB-$\alpha$ can be applied to complex probabilistic models with little effort since it only requires as input the likelihood function and its gradients. These gradients can be easily obtained using automatic differentiation. By changing the divergence parameter $\alpha$, the… Expand
Perturbative Black Box Variational Inference
• Mathematics, Computer Science
• NIPS
• 2017
This paper views BBVI with generalized divergences as a form of estimating the marginal likelihood via biased importance sampling, and builds a family of new variational bounds that captures the standard KL bound for $K=1, and converges to the exact marginal likelihood as$K\to\infty\$. Expand
Generalizing expectation propagation with mixtures of exponential family distributions and an application to Bayesian logistic regression
• Computer Science, Mathematics
• Neurocomputing
• 2019
A generalized version of EP called generalized EP (GEP), which is a new method based on the minimization of KL divergence for approximate inference, which provides faster convergence and better performance than other state-of-the-art approaches. Expand
Nonlinear Kalman Filtering With Divergence Minimization
• Mathematics, Computer Science
• IEEE Transactions on Signal Processing
• 2017
Novel algorithms are proposed to approximate this posterior by optimizing the forward and reverse forms of the KL divergence, as well as the <inline-formula>-divergence that contains these two as limiting cases, which use Monte Carlo techniques to derive unbiased algorithms for direct optimization. Expand
Alpha divergence minimization in multi-class Gaussian process classification
• Computer Science
• Neurocomputing
• 2020
The results obtained show that one can do better than EP and VB by considering intermediate values of α, and the generalization properties of each of the proposed methods for different values of the α parameter are analyzed. Expand
Probabilistic inference of Bayesian neural networks with generalized expectation propagation
• Computer Science
• Neurocomputing
• 2020
The generalized version of expectation propagation (GEP) is instantiated to provide an effective and efficient approximate inference method for BNNs including fully connected neural networks and convolutional neural networks on multiple benchmark datasets and shows a better performance than some state-of-the-art approximate inference methods. Expand
Variational Inference based on Robust Divergences
• Computer Science, Mathematics
• AISTATS
• 2018
This paper proposes an outlier-robust pseudo-Bayesian variational method by replacing the Kullback-Leibler divergence used for data fitting to a robust divergence such as the beta- and gamma-divergences, and theoretically proves that the influence function in the proposed method is bounded, while it is unbounded in the ordinary variational inference. Expand
Dropout Inference in Bayesian Neural Networks with Alpha-divergences
• Computer Science, Mathematics
• ICML
• 2017
A reparametrisation of the alpha-divergence objectives is proposed, deriving a simple inference technique which, together with dropout, can be easily implemented with existing models by simply changing the loss of the model. Expand
Advances in Variational Inference
• Mathematics, Computer Science
• IEEE Transactions on Pattern Analysis and Machine Intelligence
• 2019
An overview of recent trends in variational inference is given and a summary of promising future research directions is provided. Expand
Pairing an arbitrary regressor with an artificial neural network estimating aleatoric uncertainty
• Computer Science
• Neurocomputing
• 2019
We suggest a general approach to quantification of different forms of aleatoric uncertainty in regression tasks performed by artificial neural networks. It is based on the simultaneous training ofExpand
Truncated Variational Sampling for 'Black Box' Optimization of Generative Models
• Computer Science, Mathematics
• LVA/ICA
• 2018
This work investigates the optimization of two generative models with binary hidden variables using a novel variational EM approach that is applicable without any further analytical steps and efficiently as well as effectively increases the variational free-energy objective. Expand

References

SHOWING 1-10 OF 30 REFERENCES
Black Box Variational Inference
• Mathematics, Computer Science
• AISTATS
• 2014
This paper presents a "black box" variational inference algorithm, one that can be quickly applied to many models with little additional derivation, based on a stochastic optimization of the variational objective where the noisy gradient is computed from Monte Carlo samples from the Variational distribution. Expand
ABC-EP: Expectation Propagation for Likelihoodfree Bayesian Computation
• Computer Science
• ICML
• 2011
It is shown that Expectation Propagation, a widely successful approximate inference technique, can be adapted to the likelihood-free context and the resulting algorithm does not require summary statistics, is an order of magnitude faster than existing techniques, and remains usable when prior information is vague. Expand
Stochastic Expectation Propagation
• Computer Science, Mathematics
• NIPS
• 2015
Stochastic expectation propagation is presented, called SEP, that maintains a global posterior approximation but updates it in a local way (like EP), and is ideally suited to performing approximate Bayesian learning in the large model, large dataset setting. Expand
Expectation Propagation in the large-data limit
• Mathematics
• 2015
Expectation Propagation (Minka, 2001) is a widely successful algorithm for variational inference. EP is an iterative algorithm used to approximate complicated distributions, typically to find aExpand
Practical Bayesian Optimization of Machine Learning Algorithms
• Computer Science, Mathematics
• NIPS
• 2012
This work describes new algorithms that take into account the variable cost of learning algorithm experiments and that can leverage the presence of multiple cores for parallel experimentation and shows that these proposed algorithms improve on previous automatic procedures and can reach or surpass human expert-level optimization for many algorithms. Expand
Distributed Bayesian Learning with Stochastic Natural Gradient Expectation Propagation and the Posterior Server
Stochastic natural gradient expectation propagation is proposed, a novel alternative to expectation propagation, a popular variational inference algorithm, and a novel architecture for distributed Bayesian learning which is called the posterior server. Expand
Adam: A Method for Stochastic Optimization
• Computer Science, Mathematics
• ICLR
• 2015
This work introduces Adam, an algorithm for first-order gradient-based optimization of stochastic objective functions, based on adaptive estimates of lower-order moments, and provides a regret bound on the convergence rate that is comparable to the best known results under the online convex optimization framework. Expand
Auto-Encoding Variational Bayes
• Mathematics, Computer Science
• ICLR
• 2014
A stochastic variational inference and learning algorithm that scales to large datasets and, under some mild differentiability conditions, even works in the intractable case is introduced. Expand
A family of algorithms for approximate Bayesian inference
• T. Minka
• Mathematics, Computer Science
• 2001
This thesis presents an approximation technique that can perform Bayesian inference faster and more accurately than previously possible, and is found to be convincingly better than rival approximation techniques: Monte Carlo, Laplace's method, and variational Bayes. Expand
Expectation Propagation for approximate Bayesian inference
• T. Minka
• Computer Science, Mathematics
• UAI
• 2001
Expectation Propagation approximates the belief states by only retaining expectations, such as mean and varitmce, and iterates until these expectations are consistent throughout the network, which makes it applicable to hybrid networks with discrete and continuous nodes. Expand


text:
# \csname error in defining in loop

In following snippet I try to use TeX programming to define commands \Ab, \Bb, \Cb and so on. Strangely, I get Missing \endcsname inserted error. What is my mistake? I hadn't read TeXBook, so it is a bit of magic for me.

\input repeat.tex

\repeat\for{charcode}\from{A}\by{1}\to{Z}\do{%
\edef\letter{\char\charcode}
\expandafter\gdef\csname\letter b\endcsname{{\bf \letter}}
}

\bye
-
I think I'd have picked a variable name other than '\charcode' here: makes life a bit confusing. Your problem is that \char<number> does not expand to the letter specified by <number>. Could you give more context so we can target what you actually need: there are various 'loop over all the letters' questions on the site already. –  Joseph Wright Mar 4 '13 at 17:30

\char is a non expandable instruction to typeset a character, it doesn't construct a character token usable in \csname. You want

\input repeat.tex

\repeat\for{xcharcode}\from{A}\by{1}\to{Z}\do{%
\begingroup\lccode\a\xcharcode\relax
\lowercase{\endgroup
\expandafter\xdef\csname a}b\endcsname{{\noexpand\bf \char\the\xcharcode\space}%
}}

\show\Qb

\bye

which makes

> \Qb=macro:
->{\bf \char 81 }.

Note that it is really unfortunate that repeat.tex calls its macro \repeat that name is used already in the existing plain (and latex) macro \loop so loading that file breaks a lot of existing code. You could just use \loop here.

{\count0=A
\loop
\begingroup\lccode\a\count0\relax
\lowercase{\endgroup
\expandafter\xdef\csname a}b\endcsname{{\noexpand\bf \char\the\count0 \space}}
\ifnum\count0<Z
\repeat
}
\show\Qb

\bye
-
Thanks! It works! Will google what this all means. –  KAction Mar 4 '13 at 17:38

There are many issues in your code.

1. \edef\letter{\char\charcode} doesn't expand anything, because \charcode is \count28 and so, together with \char, it's unexpandable; then \csname\letter b\endcsname becomes \csname\char\charcode b\endcsname which is illegal.

2. Even if that could work, you'd need \xdef and not \gdef, or any \Ab command (assuming the \csname problem has been solved) would expand to {\bf\letter}.

Actually, it's much simpler:

\input repeat.tex
\let\eijkhoutrepeat\repeat
\let\repeat\fi % restore the original meaning

\eijkhoutrepeat\for{tmpcount}\from{A}\by{1}\to{Z}\do{%
\begingroup\lccode`A\tmpcount
\lowercase{\endgroup\expandafter\def\csname Ab\endcsname{{\bf A}}}
}
\show\Ab
\show\Zb
\bye

The output is

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
restricted \write18 enabled.
entering extended mode
(./rep.tex (/usr/local/texlive/2012/texmf-dist/tex/generic/eijkhout/repeat.tex
> \Ab=macro:
->{\bf A}.
l.7 \show\Ab

?
> \Zb=macro:
->{\bf Z}.
l.8 \show\Zb

?
)
No pages of output.
-

As they are only 26 letters, a simpler minded method:

\def\definethem #1{\ifx #1\stop\else
\expandafter\def\csname #1b\endcsname{{\bf #1}}%
\expandafter\definethem\fi}

\definethem ABCDEFGHIJKLMNOPQRSTUVWXYZ\stop

\csname Ab\endcsname % or \Ab, by why should I make things simple?
\csname Bb\endcsname
\csname Cb\endcsname

\bye

-


text:
• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Generic dimension vector-matrix multiply?

## Recommended Posts

Hi peeps\gurus, I have a matrix with dimensions m, n and a vector with dimension n. I want to multply the two together giving an output (obviously) of another vector. How do I do this in the general case? I''m using it for multiplying neuron activation by weight matrix for an artificial neural network but for various reasons, cannot get my head around exactly whats going on. Thanks for any help you can give. int Width = Matrix.GetWidth (), Height = Matrix.GetHeight (); assert ( Matrix.GetHeight () == size () ); for ( int i = 0; i < ; ++i ) { for ( int j = 0; j < ; ++j ) { } }

##### Share on other sites
Well, for starters I'm going to have to make an assumption. Based on that assert statement you have I think you're looking at a representation like this:

[1 1 1 1 1] * [1 0 0 0]              [0 1 0 0]              [0 0 1 0]              [0 0 0 1]              [0 0 0 1]

      int Width = Matrix.GetWidth (), Height = Matrix.GetHeight ();assert ( Matrix.GetHeight () == Vector.size () );for ( int i = 0; i < Width; ++i ){   resultVector[i] = 0;   for ( int j = 0; j < Height; ++j )   {      // Note: Matrix[i][j] represents column i, row j      resultVector[i] += Matrix[i][j] * Vector[j];   }}

[edited by - jediknight219 on October 23, 2002 9:33:13 AM]

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627643
• Total Posts
2978363

• 10
• 12
• 22
• 13
• 33