How do you output custom code before a subset of posts in the loop?

I have a foreach loop for a custom post type ordered by date (meta key). If a post’s associated date is less than the current date (i.e., dates not in the future), I want to output some HTML. if ($ custom_post_date >= $ today && $ index === 1) The problem I am running into is that the HTML gets output after the first post that is in the past. How can I output the HTML before the first post that meets the criteria? Is there a way to go back in the foreach loop or something to that effect?

Online Fax Services Comparison – Why You Should Always Compare Before Buying

We have all been there, bought a produc  ARGENTINA FAX BROADCAST LISThttps://www.faxlistb.com/argentina-fax-broadcast-list/ or service only to find out later that it did not measure up to our expectations. Most times if we’re lucky, the purchased item can be returned and we are fully refunded. However, we have still wasted a lot of time and if you’re running a business, time means money. That’s why everyone should make it their own personal policy to totally compare and research a service or product before they buy.
That goes doubly true for a long term service like online fax. Usually, once you have received your fax number and start sending it out to all your contacts, you have made a commitment of sorts to having the service long term. You simply must do a little homework to make sure you get a service or provider that won’t disappoint you or your company down the road. Now that we have the Internet, that’s relatively very easy to do.
For those who are new to these types of services, it should be stated that Internet or online fax is simply using your present email account and your web connection to do all your faxing. You get a local or toll-free number which is connected to your email address, once you get a fax, you receive an email with the fax attached. Basically, you’re hiring the services of an online provider who will handle all your faxes in exchange for a small monthly fee. These web based fax services are paperless, very efficient, totally portable and much cheaper than conventional methods of faxing.
While some services do let you “port” your fax number, it’s best to pick the right provider the first time around. So you need to do your due diligence and carefully examine the different plans and different providers to meet your needs. One simple way to approach this problem is to just compare the different providers. Just compare some basic factors of each provider on your list to come up with the one best suited to meet your needs.
These factors would include: quality of the overall service, pricing, overage fees, amount of online storage, length of storage, support hours, number of email addresses, any hidden fees, set-up fees, corporate plans or services and whether or not the service has a free trial? All valid questions you should ask before signing up to any one of these providers.

Article Source: http://EzineArticles.com/6878262

checking whether turing machine passes at least k>2 states before accepting a word

$ L=\{<M,k>|\exists\,\,w\in L(M)\,\,such\,\,that\,\,M\,\,passes\,\,at\,\,least\,\,k>2\,\,distinct\,\,states\,\,before\,\,accepting\,\,w\}$

I try to think of reduction to prove that this language is neither RE nor coRE. How to approach this problem? Is there a hint, or intuition?

I usually check whether Rice can be used, but the question here is not about the language itself

Write gravity forms field values to server file before submission

I have a gravity form and I want to write the values of the fields to a server file, before submission, to capture people who don’t finish the form. I know there is a partial entries add on but I wondered whether this would be possible using node js?

I was thinking of an onblur event that writes the field value to a file.

If this is possible, how would I link this to the gravity form itself ? Where do I place the code? Can’t put js in functions.php so maybe use the css class option on the fields ?

Any advice appreciated.

Can I take a Skill Power before level 10 with a hybrid character?

Hybrid Characters, Gaining Additional Powers (PHB3 p135):

[…] However, if you have at least two poweers in the same category (at-will attack, encounter attack, daily attack, or utility), at least one of those powers must come from each of your hybrid classes.

Gaining and Using a Skill Power (PHB3 p164):

[…] Whenever you reach a level that grants you a utility power from your class, you can choose a skill power in place of a class power […]

Specific over general does not help here, as both are equally general (or specific).

If we go by the first, you need to have at least 1 from each of your classes, so only your third can be anything else, if by the second, any of your utilities can be a sill power.

Which is it? Can I take a Skill Power before level 10 with a hybrid character?

Visit given city before a given cumulative distance in the traveling salesman problem

I would like to add an additional constraint to the traveling salesman problem: that a given city is visited within a given distance (say 100) from start. Is there a way to do this? My question is related to this unanswered CS question.

I have a mixed integer program using the R package CVXR that find the shortest route without subroutes (see below). The city order is represent in the vector node_order. The strategy I’ve pursued so far is:

  1. Re-organize node_order so that the index is the order and the value is the city id
  2. Look up the associated distances in distances
  3. Compute a vector with the cumulative sum of these distances.
  4. Add the constraint that city i must occur before the first index in (3) exceeding the distance constraint for that city.

The issues I’ve encountered with this approach is that I have not found a way to include finding-index-by-value into the optimization in CVXR. This is needed in both step (1) and (4) above. Maybe this is possible after all, or there is another approach? I am willing to use other packages than CVXR and other software than R.


My current program:

library(CVXR)  # Make distances N = 10 distances = matrix(1:(N*N), ncol = N)  # Flag 1 iff we travel that path. 0 otherwise do_transition = Variable(N, N, boolean = TRUE)  # Minimize the total duration of the traveled paths. objective = Minimize(sum(do_transition * distances))  # Only go one tour. Order is 1:(N-1) node_order = Variable(N-1, integer = TRUE) ii = t(node_order %*% matrix(1, ncol = N - 1))  # repeat as N rows jj = node_order %*% matrix(1, ncol = N - 1)  # repeat as N cols   # Constraints constraints = list(   do_transition * diag(N) == 0,  # Disallow transitions to self (diagonal elements)   sum_entries(do_transition, 1) == rep(1, N),  # Exactly one entrance to each node   sum_entries(do_transition, 2) == rep(1, N),  # Exactly one exit from each node   (jj - ii) + N * do_transition[2:N, 2:N] <= N - 1,  # One tour constraint (no subtours)   node_order >= 1,   # This interval represents order as ranks (1 to N-1)   node_order <= N-1 )  # Find optimum solution = solve(Problem(objective, constraints)) 

A bit of code pertaining to my current (unsuccessful) attempts:

# Get tour order #tour = order(c(NA, result$  getValue(node_order)))  # R solution tour = rep(NA, N-1) tour[result$  getValue(node_order)] = 2:N  # Get tour distances distances_optim = diag(distances[tour, tour[2:N]])  # Tour cumulative distances distances_cumul = cumsum_axis(distances_optim) 

Can a PC take a utility skill power before level 6?

Having just reached level 4, I want my battlemind PC that’s just taken the feat Hero of the Faith (Divine Power 144)—picking the skill Streetwise—to retrain his level 2 battlemind utility power feather step to the level 2 skill power secrets of the city (Dragon #389 36). Player’s Handbook 3 on Gaining and Using a Skill Power, in part, says

You can gain and use only the skill powers associated with your trained skills. Whenever you reach a level that grants you a utility power from your class, you can choose a skill power in place of a class power. The skill power you choose must be of the same level as or lower in level than the class power you would have gained.

You can use retraining… to replace a class power with a skill power and vice versa, as long as the new power is of the same level as or lower in level than the replaced power. (164)

However, the Rules Compendium on Swapping Powers, in part, says

You might be given the option of swapping a class power for a power that is not from your character’s class [e.g. a skill power?]. You cannot make the swap if doing so would eliminate your character’s last class power of a particular type: utility power, at-will attack power, encounter attack power, or daily attack power. For instance, if your wizard has only one wizard utility power, you cannot swap that power for a nonwizard power. (90 and emphases mine)

Now, even though the skill power isn’t a battlemind power, I boldly assumed that the specific rules for skill powers overrode the general rules for swapping powers, so my battlemind was in the clear.

My confusion, though, comes from this thread that in 2017 has this question about this situation and received here the answer Yes, you can take the skill power at level 2 then received here the different answer No, you gotta wait until level 6. (To be extra murky, the Rules Compendium doesn’t acknowledge the existence of skill powers.)

Was this ever resolved? Is it okay for a level 2 character to take a utility skill power? (Or, in this case, for my level 4 character to retrain into one?) Or must a character wait until level 6 when he gets his second utility power to take his first utility skill power so that the character has one utility power from his class and a second utility skill power?

What happens when initiative allows a player to act before the player that started the combat?

This example is a somewhat simplified version of what happened during the last game I DMed for a bunch of friends. A party of PCs was trudging through the woods when they happened upon a very small outpost in a clearing containing hostile elves. The rogue goes and checks it out, and sees two hostiles patrolling, one near the northern edge of woods (Elf1), one on a stone platform about 15 ft from the southern edge of the forest (Elf2).

The rogue goes back and relays the information. If the warrior of the party would simply trudge into the middle of the clearing, all enemies would be aware of a threat and the enemy wouldn’t be surprised. They want to start combat with an edge, so they formulate a plan that would cause the enemies to be surprised: the rogue will go stealth up to the northern edge of the clearing, wait for Elf1 to get close, and sneak attack him. When that happens (it’s a small clearing, so it’s within his vision) the warrior in the party, who will attempt to sneak up to the southern edge of the forest, will run for Elf2 and beat him up. They both roll great stealth checks and head to their positions. So far so good.

The rogue waits for Elf1 to get close and attacks with his short sword. Time for combat, and this is where things got confusing, and where a discussion broke out between players:

According to page 189 of the PHB:

  1. Determine surprise — Both Elf1 and Elf2 are surprised, because they didn’t notice any threat.
  2. Establish positions — Should be clear from the description of the situation above.
  3. Roll Initiative — The warrior gets a 20, Elf2 a 15, the rogue a 5, and Elf1 a 1.
  4. Take Turns — The warrior can go first. However, as the party discussed before, he was supposed wait until he sees the rogue hit Elf1. The rogue’s attack is what started the combat encounter, yet the attack hasn’t been resolved yet due to his poor initiative roll. And you can’t delay your turn in 5th edition.

Option 1: Some people at the table argue that he can’t yet run into the clearing because that would pose a clear and noticeable threat and the elves would not be surprised. He should wait for the rogue to hit Elf1 and use the Ready action on his first turn. This option seems to punish the warrior for rolling well on his initiative.

Option 2: As determining surprise occurs before the initiative roll according to page 189 of the PHB, I would argue that the rules support that the warrior should be able to run up to Elf2 and hit him, without breaking surprise. The fact that the attack that caused the surprise hasn’t yet been resolved and that this goes somewhat counter against their agreed plan of waiting for the rogue to hit Elf1, makes this option incredibly unintuitive though.

Which of these options is the correct one? Or is there a hidden option 3?

Can you make a bonus-action to throw a dagger from Two-Weapon Fighting before you take your action? [duplicate]

So I have non-thrown one-handed-weapon in my main hand and light melee weapon with thrown property in my second hand. Can I throw my weapon in second hand before making a attack with my main hand?

Two-Weapon Fighting (Combat Rules) When you take the Attack action and attack with a light melee weapon that you’re holding in one hand, you can use a bonus action to attack with a different light melee weapon that you’re holding in the other hand. You don’t add your ability modifier to the damage of the bonus attack, unless that modifier is negative. If either weapon has the thrown property, you can throw the weapon, instead of making a melee attack with it.