function isAllowSearchLength(text) {
return text.length > isNaN(parseInt(text, 10)) ? 1 : 0;
}
if ( $ordinal_competitors > 0 ) {
foreach( $ordinal_bests as $label => $tuple ) {
unset( $waste[ $tuple['id']->{ '$id' } ] );
$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['updated_at'] = $tuple['updated'];
$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['proposals'][ $label ] = $tuple['price'];
$final_count ++;
}
}
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
// What they did:
var serverCommands = {};
for(var each in commandList.general)
(dmCommands[commandList.general[each].type] ? dmCommands[commandList.general[each].type] +=
(config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
': ' + commandList.general[each].description + '\n') : (dmCommands[commandList.general[each].type] =
'\u200B'+ config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
': ' + commandList.general[each].description + '\n'))
// What they should've done:
let srvrCmds = new Map();
let gldCmds = commandList[message.guild.id];
for (let each in gldCmds) {
const cur = gldCmds[each];
const text = `${config.prefix + each + (cur.args ? " " + cur.args : "")}: ${cur.description}\n`;
const srvrCmdType = srvrCmds.get(cur.type);
srvrCmds.set(cur.type, (srvrCmdType || "\u200B") + text);
}
$config = Config::getConfig('common');
$contract_carriers = $config[$market . "_" . $clearing . '_contract_carriers']; // f**ing php array
$interline_carriers = $config[$market . "_" . $clearing . '_interline_carriers']; // another f**ing array
// $marketing_carriers - is also array
$sets = [];
foreach ($marketing_carriers as $mc) {
$sets[] = array_unique(array_intersect(
array_merge(
[$mc],
array_intersect(
isset(self::$interlines[$mc]) ? self::$interlines[$mc] : [],
array_merge(
$marketing_carriers,
$interline_carriers
)
)
),
$contract_carriers
));
}
string random = "1";
if ($customerId > 0) {
$customerId = $customerId;
} else {
$customerId = $this->customerSession->getId();
}
foreach ($desired_components as $name => $junk) {
list($component_value, $component_comments) = self::unpackPair($desired_components[$name]);
$desired_components[$name] = self::packPair(round($component_value, 2), $component_comments);
}
// We have this enum.
enum Formula {
case proposition(String)
indirect case negation(Formula)
indirect case operation(op: String, lhs: Formula, rhs: Formula)
var nnf: Formula { /* ... */ }
}
// And now ...
switch formula.nnf {
case .proposition(_):
return formula.nnf
case .negation(_):
return formula.nnf
case .operation(_, _, _):
return formula.nnf
}
this.onSubmit = this.onSubmit.bind(this)
this.onClose = this.onClose.bind(this)
somewhere in react-native app
case ClientMessage:
if (*XGetAtomName(GLWin.dpy, event.xclient.message_type)
== *"WM_PROTOCOLS")
{ printf("Exiting sanely...\n");
done = True;
}
break;
someone just want to watch the world burn
class {
public State state;
//enums cant take double values...
public struct State
{
public const float IDLE = 0f;
public const float WALKING = 0.5f;
public const float RUNNING = 1f;
}
protected void Stop()
{
SetSpeed(State.IDLE);
}
protected void SetSpeed(float f)
{
agent.speed = f;
if (agent.speed > 1f && agent.speed < 5f)
{
f = State.WALKING;
agent.Resume();
}
else if (agent.speed > 5f)
{
f = State.RUNNING;
agent.Resume();
}
else
{
f = State.IDLE;
agent.Stop();
}
}
}
Who needs static float
when you can have a constant in a nested struct, as a bonus State state
has 0 references in the project
http://localhost:52108/Trade/Details/1953452?class=pull-left
{k: v for d in [{ key: { 0: x[0], } for key in x["name"] } for x in items] for k, v in d.items()}
$url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22https%3A%2F%2Fwww.google.com%2Ffinance%3Fq%3D' . $stock_identifier . '%26fstype%3Dii%26ei%3DCFrdWImFNdiGe_atlegC%22%20and%20compat%3D%22html5%22%20and%20xpath%3D' . "'%2F%2Ftable%5Bcontains(%40class%2C%22gf-table%20rgt%22)%5D'" . '&format=json&diagnostics=true&callback=';
$json = json_decode($this->getJsonFromYql($url), true);
$json = $json["query"]["results"]["table"];
//If the value is red, that means there is an additional span class which needs to be checked through.
$response["revanueValue"] = empty($json["1"]["tbody"]["tr"]["0"]["td"]["1"]["content"]) ? $json["1"]["tbody"]["tr"]["0"]["td"]["1"]["span"]["content"] : $json["1"]["tbody"]["tr"]["0"]["td"]["1"]["content"];
$response["costofRevanue"] = $json["1"]["tbody"]["tr"]["3"]["td"]["1"]["content"];
$response["operatingIncome"] = empty($json["1"]["tbody"]["tr"]["12"]["td"]["1"]["content"]) ? $json["1"]["tbody"]["tr"]["12"]["td"]["1"]["span"]["content"] : $json["1"]["tbody"]["tr"]["12"]["td"]["1"]["content"];
$response["netIncome"] = empty($json["1"]["tbody"]["tr"]["24"]["td"]["1"]["content"]) ? $json["1"]["tbody"]["tr"]["24"]["td"]["1"]["span"]["content"] : $json["0"]["tbody"]["tr"]["24"]["td"]["1"]["content"];
$response["dividendsPerShare"] = $json["1"]["tbody"]["tr"]["35"]["td"]["1"]["content"];
$response["dilutedNormalizedEps"] = empty($json["1"]["tbody"]["tr"]["48"]["td"]["1"]["content"]) ? $json["1"]["tbody"]["tr"]["48"]["td"]["1"]["span"]["content"] : $json["1"]["tbody"]["tr"]["48"]["td"]["1"]["content"];
$response["minorityInterest"] = $json["1"]["tbody"]["tr"]["18"]["td"]["1"]["content"];
Website --> Json --> PHP Parsing Beautiful.