repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
daibinhua888/Spheniscidae
Codes/Framework/Storage.cs
2030
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.Serialization.Formatters.Binary; using System.Text; using System.Threading.Tasks; namespace Spheniscidae.Framework { public class Storage { private const string filePath = "e:\\wf.txt"; public static void Persistence(List<Bookmark> bookmarks) { var bytes = Serialize2Bytes(bookmarks); File.WriteAllText(filePath, BitConverter.ToString(bytes)); } public static bool IsPersisted() { if (File.Exists(filePath)) return true; return false; } public static List<Bookmark> Load() { List<byte> bytes = new List<byte>(); var strs = File.ReadAllText(filePath).Split("-".ToCharArray()); if (strs == null) return new List<Bookmark>(); foreach(var s in strs) { byte b = Byte.Parse(s, System.Globalization.NumberStyles.HexNumber); bytes.Add(b); } List<Bookmark> bmks = (List<Bookmark>)DeserializeFromBytes(bytes.ToArray()); return bmks; } private static byte[] Serialize2Bytes(object obj) { var memory = new MemoryStream(); var formatter = new BinaryFormatter(); formatter.Serialize(memory, obj); memory.Position = 0; var read = new byte[memory.Length]; memory.Read(read, 0, read.Length); memory.Close(); return read; } private static object DeserializeFromBytes(byte[] pBytes) { if (pBytes == null) return null; var memory = new MemoryStream(pBytes) { Position = 0 }; var formatter = new BinaryFormatter(); object newOjb = formatter.Deserialize(memory); memory.Close(); return newOjb; } } }
mit
Lignum/CCEmuX
src/main/java/net/clgd/ccemux/plugins/builtin/CCEmuXAPI.java
7468
package net.clgd.ccemux.plugins.builtin; import java.awt.Desktop; import java.awt.Toolkit; import java.awt.datatransfer.StringSelection; import java.io.IOException; import java.util.*; import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.auto.service.AutoService; import com.google.common.io.ByteStreams; import dan200.computercraft.api.lua.ILuaContext; import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.core.apis.ArgumentHelper; import dan200.computercraft.core.apis.ILuaAPI; import dan200.computercraft.core.computer.Computer; import dan200.computercraft.core.computer.ComputerThread; import net.clgd.ccemux.api.config.Group; import net.clgd.ccemux.api.emulation.EmulatedComputer; import net.clgd.ccemux.api.emulation.Emulator; import net.clgd.ccemux.api.emulation.filesystem.VirtualFile; import net.clgd.ccemux.api.peripheral.Peripheral; import net.clgd.ccemux.api.peripheral.PeripheralFactory; import net.clgd.ccemux.api.plugins.Plugin; import net.clgd.ccemux.api.plugins.PluginManager; import net.clgd.ccemux.api.plugins.hooks.ComputerCreated; import net.clgd.ccemux.api.plugins.hooks.CreatingROM; import net.clgd.ccemux.config.LuaAdapter; @AutoService(Plugin.class) public class CCEmuXAPI extends Plugin { private static final Logger log = LoggerFactory.getLogger(CCEmuXAPI.class); @FunctionalInterface private interface APIMethod { Object[] accept(ILuaContext c, Object[] o) throws LuaException, InterruptedException; } private static class API implements ILuaAPI { private static final List<String> sideNames = Arrays.asList(Computer.s_sideNames); private final String name; private final Map<String, APIMethod> methods = new LinkedHashMap<>(); public API(Emulator emu, EmulatedComputer computer, String name) { this.name = name; methods.put("getVersion", (c, o) -> new Object[] { emu.getEmulatorVersion() }); methods.put("closeEmu", (c, o) -> { computer.shutdown(); emu.removeComputer(computer); return new Object[] {}; }); methods.put("openEmu", (c, o) -> { int id = ArgumentHelper.optInt(o, 0, -1); EmulatedComputer ec = emu.createComputer(b -> b.id(id)); return new Object[] { ec.getID() }; }); methods.put("openDataDir", (c, o) -> { try { Desktop.getDesktop().browse(emu.getConfig().getDataDir().toUri()); return new Object[] { true }; } catch (Exception e) { return new Object[] { false, e.toString() }; } }); methods.put("milliTime", (c, o) -> new Object[] { System.currentTimeMillis() }); methods.put("nanoTime", (c, o) -> new Object[] { System.nanoTime() }); methods.put("echo", (c, o) -> { String message = ArgumentHelper.getString(o, 0); log.info("[Computer {}] {}", computer.getID(), message); return new Object[] {}; }); methods.put("setClipboard", (c, o) -> { String contents = ArgumentHelper.getString(o, 0); StringSelection sel = new StringSelection(contents); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, sel); return new Object[] {}; }); methods.put("openConfig", (c, o) -> { if (emu.getRendererFactory().createConfigEditor(emu.getConfig())) { return new Object[] { true }; } else { return new Object[] { false, "Not supported with this renderer" }; } }); methods.put("attach", (c, o) -> { String side = ArgumentHelper.getString(o, 0); String peripheral = ArgumentHelper.getString(o, 1); Object configuration = o.length > 2 ? o[2] : null; int sideId = sideNames.indexOf(side); if (sideId == -1) throw new LuaException("Invalid side"); PeripheralFactory<?> factory = emu.getPeripheralFactory(peripheral); if (factory == null) throw new LuaException("Invalid peripheral"); Peripheral built = factory.create(computer, emu.getConfig()); // Setup the config for this peripheral. In the future this could be // persisted to disk. Group group = new Group("peripheral"); built.configSetup(group); if (configuration != null) LuaAdapter.fromLua(group, configuration); computer.setPeripheral(sideId, built); awaitPeripheralChange(computer, c); return null; }); methods.put("detach", (c, o) -> { String side = ArgumentHelper.getString(o, 0); int sideId = sideNames.indexOf(side); if (sideId == -1) throw new LuaException("Invalid side"); computer.setPeripheral(sideId, null); awaitPeripheralChange(computer, c); return null; }); } @Nonnull @Override public String[] getMethodNames() { return methods.keySet().toArray(new String[] {}); } @Override public Object[] callMethod(@Nonnull ILuaContext context, int method, @Nonnull Object[] arguments) throws LuaException, InterruptedException { return new ArrayList<>(methods.values()).get(method).accept(context, arguments); } @Override public void advance(double dt) {} @Override public String[] getNames() { return new String[] { name }; } @Override public void shutdown() {} @Override public void startup() {} /** * Waits for peripherals to finish attaching/detaching. * * Peripherals are attached/detached on the {@link ComputerThread}, which means they won't have been properly * changed after {@code ccemux.attach}/{@code ccemux.detach} has been called. Instead, we queue an event on the * computer thread, so we are resumed after peripherals have actually been attached. * * @param computer The computer to queue an event on * @param context The context to pull an event from * @throws InterruptedException If pulling an event failed */ static void awaitPeripheralChange(EmulatedComputer computer, ILuaContext context) throws InterruptedException { computer.queueEvent("ccemux_peripheral_update", null); context.pullEventRaw("ccemux_peripheral_update"); } } @Nonnull @Override public String getName() { return "CCEmuX API"; } @Nonnull @Override public String getDescription() { return "Adds the 'ccemux' Lua API, which adds methods for interacting with the emulator and real computer.\n" + "Also adds the `emu` program and help ROM files, which use the API."; } @Nonnull @Override public Optional<String> getVersion() { return Optional.empty(); } @Nonnull @Override public Collection<String> getAuthors() { return Collections.emptyList(); } @Nonnull @Override public Optional<String> getWebsite() { return Optional.empty(); } @Override public void setup(@Nonnull PluginManager manager) { registerHook((ComputerCreated) (emu, computer) -> computer.addAPI(new API(emu, computer, "ccemux"))); registerHook((CreatingROM) (emu, romBuilder) -> { try { romBuilder.addEntry("programs/emu.lua", new VirtualFile( ByteStreams.toByteArray(CCEmuXAPI.class.getResourceAsStream("/rom/emu_program.lua")))); romBuilder.addEntry("help/emu.txt", new VirtualFile( ByteStreams.toByteArray(CCEmuXAPI.class.getResourceAsStream("/rom/emu_help.txt")))); romBuilder.addEntry("help/credits-emu.txt", new VirtualFile( ByteStreams.toByteArray(CCEmuXAPI.class.getResourceAsStream("/rom/credits_help.txt")))); romBuilder.addEntry("autorun/emu.lua", new VirtualFile( ByteStreams.toByteArray(CCEmuXAPI.class.getResourceAsStream("/rom/emu_completion.lua")))); } catch (IOException e) { log.error("Failed to register ROM entries", e); } }); } }
mit
xuanye/dotbpe
src/DotBPE.Rpc/Client/IRpcClient.cs
298
using Peach.Messaging; using System.Threading; using System.Threading.Tasks; namespace DotBPE.Rpc.Client { public interface IRpcClient<in TMessage> where TMessage : IMessage { Task SendAsync(TMessage message); Task CloseAsync(CancellationToken cancellationToken); } }
mit
Catorpilor/LeetCode
22_generate_parentheses/gp_test.go
572
package gp import ( "reflect" "testing" ) func TestGenerateParenthesis(t *testing.T) { st := []struct { name string n int exp []string }{ {"n=0", 0, []string{}}, {"n=1", 1, []string{"()"}}, {"n=2", 2, []string{"()()", "(())"}}, {"n=3", 3, []string{"()()()", "((()))", "(())()", "()(())", "(()())"}}, } for _, tt := range st { t.Run(tt.name, func(t *testing.T) { out := generateParenthesis(tt.n) if !reflect.DeepEqual(tt.exp, out) { t.Fatalf("with input n: %d wanted %v but got %v", tt.n, tt.exp, out) } t.Log("pass") }) } }
mit
VladimirRadojcic/Master
BusinessProcessModelingTool/src/bp/details/ConditionalStartEventDetails.java
2268
package bp.details; import javax.swing.JLabel; import javax.swing.JScrollPane; import javax.swing.JTextArea; import bp.event.BPFocusListener; import bp.model.data.ConditionalStartEvent; import bp.model.util.BPKeyWords; import bp.model.util.Controller; public class ConditionalStartEventDetails extends StartEventDetails{ /** * */ private static final long serialVersionUID = -3830283509661106420L; public static final String CONDITION = "Condition:"; private ConditionalStartEvent event = (ConditionalStartEvent) getElement(); private JLabel conditionLb; private JTextArea conditionTa; private JScrollPane conditionScroll; public ConditionalStartEventDetails(ConditionalStartEvent element) { super(element); } @Override protected void initComponents() { super.initComponents(); this.conditionLb = new JLabel(CONDITION); this.conditionTa = new JTextArea(5, 20); this.conditionScroll = new JScrollPane(this.conditionTa); // Set the texts if available event = (ConditionalStartEvent) getElement(); if (event.getComponent() != null) conditionTa.setText(event.getCondition()); } @Override protected void layoutComponents() { super.layoutComponents(); createAdvanced(); getAdvanced().add(this.conditionLb); getAdvanced().add(this.conditionScroll); } @Override protected void addActions() { super.addActions(); this.conditionTa.addFocusListener(new BPFocusListener() { @Override public void updateValue() { ConditionalStartEventDetails.this.event.updateCondition((String) getValue(), Controller.DETAILS); } @Override public Object getValue() { return ConditionalStartEventDetails.this.conditionTa.getText(); } }); } @Override protected void dataAttributeChanged(final BPKeyWords keyWord, final Object value) { super.dataAttributeChanged(keyWord, value); if (value != null) { if (keyWord == BPKeyWords.CONDITION) { this.conditionTa.setText((String) value); } } } }
mit
jacklam718/react-native-popup-dialog
example/src/DemoScreen.js
9757
import React, { Component } from 'react'; import { Button, View, Text, StyleSheet } from 'react-native'; import Modal, { ModalTitle, ModalContent, ModalFooter, ModalButton, SlideAnimation, ScaleAnimation, BottomModal, ModalPortal, } from 'react-native-modals'; const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', justifyContent: 'center', }, dialogContentView: { paddingLeft: 18, paddingRight: 18, }, navigationBar: { borderBottomColor: '#b5b5b5', borderBottomWidth: 0.5, backgroundColor: '#ffffff', }, navigationTitle: { padding: 10, }, navigationButton: { padding: 10, }, navigationLeftButton: { paddingLeft: 20, paddingRight: 40, }, navigator: { flex: 1, // backgroundColor: '#000000', }, customBackgroundModal: { opacity: 0.5, backgroundColor: '#000', }, }); export default class App extends Component { state = { customBackgroundModal: false, defaultAnimationModal: false, swipeableModal: false, scaleAnimationModal: false, slideAnimationModal: false, bottomModalAndTitle: false, bottomModal: false, }; render() { return ( <View style={{ flex: 1 }}> <View style={styles.container}> <Button title="Show Modal - Default Animation" onPress={() => { this.setState({ defaultAnimationModal: true, }); }} /> <Button title="Show Modal - Swipeable Modal Animation" onPress={() => { this.setState({ swipeableModal: true, }); }} /> <Button title="Show Modal - Scale Animation" onPress={() => { this.setState({ scaleAnimationModal: true, }); }} /> <Button title="Show Modal - Slide Animation" onPress={() => { this.setState({ slideAnimationModal: true, }); }} /> <Button title="Show Modal - Custom Background Style" onPress={() => { this.setState({ customBackgroundModal: true, }); }} /> <Button title="Bottom Modal with Title" onPress={() => { this.setState({ bottomModalAndTitle: true, }); }} /> <Button title="Bottom Modal without Title" onPress={() => { this.setState({ bottomModal: true, }); }} /> </View> <Modal width={0.9} visible={this.state.defaultAnimationModal} rounded actionsBordered style={{ zIndex: 1000 }} onTouchOutside={() => { this.setState({ defaultAnimationModal: false }); }} modalTitle={ <ModalTitle title="Popup Modal - Default Animation" align="left" /> } footer={ <ModalFooter> <ModalButton text="CANCEL" bordered onPress={() => { this.setState({ defaultAnimationModal: false }); }} key="button-1" /> <ModalButton text="OK" bordered onPress={() => { this.setState({ defaultAnimationModal: false }); }} key="button-2" /> </ModalFooter> } > <ModalContent style={{ backgroundColor: '#fff' }} > <Text>Default Animation</Text> <Text>No onTouchOutside handler. will not dismiss when touch overlay.</Text> <Button title="To Empty Screen" onPress={() => { this.setState({ defaultAnimationModal: false, scaleAnimationModal: false, }); this.props.navigation.navigate('Empty'); }} /> </ModalContent> </Modal> <Modal onDismiss={() => { this.setState({ swipeableModal: false }); }} width={0.9} overlayOpacity={1} visible={this.state.swipeableModal} rounded actionsBordered onSwipeOut={() => { this.setState({ swipeableModal: false }); }} onTouchOutside={() => { this.setState({ swipeableModal: false }); }} swipeDirection={['down', 'up']} modalAnimation={new SlideAnimation({ slideFrom: 'bottom' })} modalTitle={ <ModalTitle title="Swipeable Modal" /> } footer={ <ModalFooter> <ModalButton text="CANCEL" bordered onPress={() => { this.setState({ swipeableModal: false }); }} key="button-1" /> <ModalButton text="OK" bordered onPress={() => { this.setState({ swipeableModal: false }); }} key="button-2" /> </ModalFooter> } > <ModalContent style={{ backgroundColor: '#fff', paddingTop: 24 }} > <Text>Swipeable</Text> <Text>Swipe Up/Down</Text> </ModalContent> </Modal> <Modal onTouchOutside={() => { this.setState({ scaleAnimationModal: false }); }} width={0.9} visible={this.state.scaleAnimationModal} onSwipeOut={() => this.setState({ scaleAnimationModal: false })} modalAnimation={new ScaleAnimation()} onHardwareBackPress={() => { console.log('onHardwareBackPress'); this.setState({ scaleAnimationModal: false }); return true; }} modalTitle={ <ModalTitle title="Modal - Scale Animation" hasTitleBar={false} /> } actions={[ <ModalButton text="DISMISS" onPress={() => { this.setState({ scaleAnimationModal: false }); }} key="button-1" />, ]} > <ModalContent> <Button title="Show Modal - Default Animation" onPress={() => { this.setState({ defaultAnimationModal: true }); }} /> </ModalContent> </Modal> <Modal onDismiss={() => { this.setState({ slideAnimationModal: false }); }} onTouchOutside={() => { this.setState({ slideAnimationModal: false }); }} swipeDirection="down" onSwipeOut={() => this.setState({ slideAnimationModal: false })} visible={this.state.slideAnimationModal} modalTitle={ <ModalTitle title="Modal - Slide Animation" hasTitleBar={false} /> } modalAnimation={new SlideAnimation({ slideFrom: 'bottom' })} > <ModalContent> <Text>Slide Animation</Text> </ModalContent> </Modal> <Modal onDismiss={() => { this.setState({ customBackgroundModal: false }); }} onTouchOutside={() => { this.setState({ customBackgroundModal: false }); }} zIndex={1000} backgroundStyle={styles.customBackgroundModal} modalStyle={{ backgroundColor: 'rgba(0,0,0,0.5)', }} modalTitle={ <ModalTitle title="Modal - Custom Background Style" hasTitleBar={false} textStyle={{ color: '#fff' }} /> } visible={this.state.customBackgroundModal} > <View style={styles.dialogContentView}> <Text style={{ color: '#fff' }}>Custom backgroundStyle</Text> </View> </Modal> <BottomModal visible={this.state.bottomModalAndTitle} onTouchOutside={() => this.setState({ bottomModalAndTitle: false })} height={0.5} width={1} onSwipeOut={() => this.setState({ bottomModalAndTitle: false })} modalTitle={ <ModalTitle title="Bottom Modal" hasTitleBar /> } > <ModalContent style={{ flex: 1, backgroundColor: 'fff', }} > <Text> Bottom Modal with Title </Text> </ModalContent> </BottomModal> <BottomModal visible={this.state.bottomModal} onTouchOutside={() => this.setState({ bottomModal: false })} // modalStyle={{ }} > <ModalContent style={{ backgroundColor: 'fff', // height: '40%', }} > <Text> Bottom Modal without Title </Text> </ModalContent> </BottomModal> </View> ); } }
mit
djsegal/julia_observer
db/migrate/20161219001906_create_readmes.rb
228
class CreateReadmes < ActiveRecord::Migration[5.0] def change create_table :readmes do |t| t.string :file_name t.text :cargo t.references :package, foreign_key: true t.timestamps end end end
mit
JornWildt/Elfisk.ECS
Elfisk.ECS.Core/Properties/AssemblyInfo.cs
1442
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Elfisk.ECS.Core")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Elfisk.ECS.Core")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("e5ada543-2feb-404e-8f03-e66146c357c4")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
jasnow/show-me-the-food5
db/schema.rb
1568
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20141027235356) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "locations", force: :cascade do |t| t.float "latitude" t.float "longitude" t.string "name" t.string "address" t.string "land_use_description" t.string "neighborhood_name" t.boolean "sidewalks" t.string "violations" t.string "lot_condition" t.string "structure_condition" t.string "digest_year" t.string "owner" t.string "tax_district" t.string "objectid_1" t.string "objectid" t.string "val_acres" t.string "structure_year" t.string "source" t.datetime "created_at" t.datetime "updated_at" t.boolean "ebt" t.string "county" end end
mit
rdunlop/codeclimate_circle_ci_coverage
lib/codeclimate_circle_ci_coverage/coverage_reporter.rb
3656
# frozen_string_literal: true # from https://github.com/codeclimate/ruby-test-reporter/issues/10 # https://gist.github.com/evanwhalen/f74879e0549b67eb17bb # Possibly look at: # http://technology.indiegogo.com/2015/08/how-we-get-coverage-on-parallelized-test-builds/ # # Questions: # - Why aren't artifacts stored in the $CIRCLE_ARTIFACTS directory when doing SSH login? require "codeclimate-test-reporter" require "simplecov" # This packages up the code coverage metrics from multiple servers and # sends them to CodeClimate via the CodeClimate Test Reporter Gem class CoverageReporter attr_reader :target_branch def initialize(target_branch) @target_branch = target_branch end def current_branch ENV['CIRCLE_BRANCH'] end def current_node ENV['CIRCLE_NODE_INDEX'].to_i end # Returns false if unsuccessful # Returns true if successful def run # Only submit coverage to codeclimate on target branch if current_branch != target_branch puts "Current branch #{current_branch} is not the target branch #{target_branch}" puts "No Coverage will be reported" return true end # Only run on node0 return true unless current_node.zero? json_result_files = download_files merged_result = merge_files(json_result_files) output_result_html(merged_result) upload_result_file(merged_result) store_code_climate_payload(merged_result) puts "Reporting Complete." true end def download_files if ENV["CIRCLE_JOB"].nil? CircleCi1.new.download_files else CircleCi2.new.download_files end end def merge_files(json_files) SimpleCov.coverage_dir('/tmp/coverage') # Merge coverage results from all nodes json_files.each_with_index do |resultset, i| resultset.each do |_command_name, data| result = SimpleCov::Result.from_hash(['command', i].join => data) check_and_fix_result_time(result, i) SimpleCov::ResultMerger.store_result(result) end end merged_result = SimpleCov::ResultMerger.merged_result merged_result.command_name = 'RSpec' merged_result end def check_and_fix_result_time(result, index) if Time.now - result.created_at >= SimpleCov.merge_timeout puts "result #{index} has a created_at from #{result.created_at} (current time #{Time.now})" puts "This will prevent coverage from being combined. Please check your tests for Stub-Time-related issues" puts "Setting result created_at to current time to avoid this issue" # If the result is timestamped old, it is ignored by SimpleCov # So we always set the created_at to Time.now so that the ResultMerger # doesn't discard any results result.created_at = Time.now end end def output_result_html(merged_result) # Format merged result with html html_formatter = SimpleCov::Formatter::HTMLFormatter.new html_formatter.format(merged_result) end def upload_result_file(merged_result) # Post merged coverage result to codeclimate codeclimate_formatter = CodeClimate::TestReporter::Formatter.new formatted_results = codeclimate_formatter.format(merged_result.to_hash) CodeClimate::TestReporter::PostResults.new(formatted_results).post end # Internal: Debug function, in use to log the exact file which is sent to codeclimate # for use when troubleshooting. def store_code_climate_payload(merged_result) ENV["CODECLIMATE_TO_FILE"] = "true" codeclimate_formatter = CodeClimate::TestReporter::Formatter.new codeclimate_formatter.format(merged_result.to_hash) ensure ENV["CODECLIMATE_TO_FILE"] = nil end end
mit
Jmsg0003/practica
src/app/components/detail/view-detail.js
474
(function(angular) { angular.module('app').component('viewDetail', { templateUrl: 'app/components/detail/view-detail-template.html', controller: ['$stateParams', 'cardsFactory', viewDetail], controllerAs: 'viewDetail' }); function viewDetail($stateParams, cardsFactory) { var vm = this; vm.$onInit = function() { //var idAnimal = $stateParams.idAnimal; vm.cardDetail = cardsFactory.getAllCard(); }; } })(angular);
mit
SusieBonte/studyProjects
application/views/pages/about.php
61
this is the about page <p> This is Quiz Tool version 2.0 <p>
mit
ljzhong/react-native-hiapp
App/Views/WebView/index.js
1125
import React, { Component, PropTypes } from 'react' import { WebView, StyleSheet, View } from 'react-native' import styleUtils from '../../Styles' import NavbarComp from '../../Components/NavBar' export default class WebViewView extends Component{ constructor(props) { super(props) this.state = {} } render() { return ( <View style={styles.container}> <NavbarComp route={this.props.route} navigator={this.props.navigator}/> <WebView automaticallyAdjustContentInsets={false} source={{uri: this.props.url}} javaScriptEnabled={true} domStorageEnabled={true} decelerationRate='normal' startInLoadingState={true} scalesPageToFit={true} /> </View> ) } } WebViewView.propTypes = { url: PropTypes.string.isRequired } const styles = StyleSheet.create({ container: { ...styleUtils.containerBg, flex: 1 } })
mit
lessthanthree/wheaton
dist/Randomize.js
2353
var Randomize, slice = [].slice; require('es5-shim'); require('es6-shim'); Randomize = (function() { var _pickFromArray, _pickFromObject, _weightedFromArray, _weightedFromObject; function Randomize() {} Randomize.between = function(min, max) { var rndm; rndm = Math.random(); return rndm * (max - min) + min; }; _pickFromArray = function(list) { var rndm; rndm = Math.random(); return list[list.length * rndm << 0]; }; _pickFromObject = function(list) { return list[_pickFromArray(Object.keys(list))]; }; Randomize.pick = function(list) { var isArray; isArray = Array.isArray(list); if (typeof list === 'object' && isArray === false) { return _pickFromObject(list); } else if (isArray === true) { return _pickFromArray(list); } return null; }; _weightedFromArray = function() { var index, key, list, ref, rndm, totalWeight, val, weight, weightSum, weights; list = arguments[0], weights = 2 <= arguments.length ? slice.call(arguments, 1) : []; index = 0; weight = []; weightSum = 0; for (key in list) { val = list[key]; weight[key] = (ref = weights[key]) != null ? ref : .5; } totalWeight = weight.reduce(function(prev, current, index, list) { return prev + current; }); rndm = this.between(0, totalWeight); while (index < list.length) { weightSum += weight[index]; weightSum = +weightSum.toFixed(2); if (rndm <= weightSum) { return list[index]; } index++; } }; _weightedFromObject = function() { var list, weights; list = arguments[0], weights = 2 <= arguments.length ? slice.call(arguments, 1) : []; return list[_weightedFromObject.apply(null, [Object.keys(list)].concat(slice.call(weights)))]; }; Randomize.weighted = function() { var isArray, list, weights; list = arguments[0], weights = 2 <= arguments.length ? slice.call(arguments, 1) : []; isArray = Array.isArray(list); if (typeof list === 'object' && isArray === false) { return _weightedFromObject.apply(this, [list].concat(slice.call(weights))); } else if (isArray === true) { return _weightedFromArray.apply(this, [list].concat(slice.call(weights))); } return null; }; return Randomize; })(); module.exports = Randomize;
mit
ark120202/aabs
game/scripts/vscripts/heroes/hero_cherub/flower_garden.lua
7222
LinkLuaModifier("modifier_cherub_flower_garden_barrier", "heroes/hero_cherub/modifiers/modifier_cherub_flower_garden_barrier", LUA_MODIFIER_MOTION_NONE) LinkLuaModifier("modifier_cherub_flower_garden_tracker", "heroes/hero_cherub/modifiers/modifier_cherub_flower_garden_tracker", LUA_MODIFIER_MOTION_NONE) function CreatePlot(keys) local caster = keys.caster local ability = keys.ability local point = caster:GetCursorPosition() local level = ability:GetLevel() - 1 if not PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden then PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden = {} end if PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity and not PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity:IsNull() and PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity:entindex() and PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity:IsAlive() then PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity:ForceKill(false) UTIL_Remove(PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity) end local plot = CreateUnitByName("npc_cherub_flower_garden_plot", point, true, caster, caster, caster:GetTeam()) plot:SetControllableByPlayer(caster:GetPlayerID(), true) plot:SetOwner(caster) plot:AddNewModifier(caster, ability, "modifier_kill", {duration = ability:GetLevelSpecialValueFor("life_time", ability:GetLevel() - 1)}) plot:AddNewModifier(caster, ability, "modifier_cherub_flower_garden_tracker", {}) local health = ability:GetLevelSpecialValueFor("flower_health", level) if caster:HasScepter() then plot:AddNewModifier(caster, ability, "modifier_cherub_flower_garden_barrier", {}) health = ability:GetLevelSpecialValueFor("flower_health_scepter", level) end plot:SetBaseMaxHealth(health) plot:SetMaxHealth(health) plot:SetHealth(health) plot.level = level PLAYER_DATA[caster:GetPlayerID()].Cherub_Flower_Garden.LatestPlotEntity = plot for i = 0, plot:GetAbilityCount() - 1 do local skill = plot:GetAbilityByIndex(i) if skill then skill:SetLevel(level + 1) end end end function ChooseFlower(keys) local caster = keys.caster local ability = keys.ability for i = 0, caster:GetAbilityCount() - 1 do local skill = caster:GetAbilityByIndex(i) if skill and skill ~= ability then caster:RemoveAbility(skill:GetAbilityName()) end end local ability_name = ability:GetAbilityName() caster.ability_name = ability_name local max_plants = ability:GetLevelSpecialValueFor("max_plants", ability:GetLevel() - 1) local attack_rate = ability:GetLevelSpecialValueFor("attack_rate", ability:GetLevel() - 1) local hp = caster:GetMaxHealth() ReplaceAbilities(caster, ability_name, ability_name .. "_enabled", true, false) caster:SetBaseMaxHealth(hp) caster:SetMaxHealth(hp) caster:SetHealth(hp) if caster == PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden.LatestPlotEntity then PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden.LatestPlotEntity = nil end if not PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden[ability_name] then PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden[ability_name] = {} end table.insert(PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden[ability_name], caster) if #PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden[ability_name] > max_plants then local unit = table.remove(PLAYER_DATA[caster:GetPlayerOwnerID()].Cherub_Flower_Garden[ability_name], 1) if unit and not unit:IsNull() then if unit:IsAlive() then unit:ForceKill(false) end Timers:NextTick(function() UTIL_Remove(unit) end) end end caster:SetModelScale(1) if ability_name == "cherub_flower_white_rose" then caster:SetModel("models/props_debris/lotus_flower001.vmdl") caster:SetOriginalModel("models/props_debris/lotus_flower001.vmdl") caster:SetModelScale(0.5) --caster:SetRenderColor(255, 255, 255) caster:SetAttackCapability(DOTA_UNIT_CAP_RANGED_ATTACK) caster:SetRangedProjectileName("particles/base_attacks/fountain_attack.vpcf") caster:SetBaseAttackTime(attack_rate) elseif ability_name == "cherub_flower_red_rose" then caster:SetModel("models/items/furion/treant_flower_1.vmdl") caster:SetOriginalModel("models/items/furion/treant_flower_1.vmdl") caster:SetRenderColor(255, 0, 0) caster:SetAttackCapability(DOTA_UNIT_CAP_RANGED_ATTACK) caster:SetRangedProjectileName("particles/units/heroes/hero_batrider/batrider_base_attack.vpcf") caster:SetBaseAttackTime(attack_rate) elseif ability_name == "cherub_flower_pink_blossom" then caster:SetModel("models/items/furion/treant_flower_1.vmdl") caster:SetOriginalModel("models/items/furion/treant_flower_1.vmdl") caster:SetRenderColor(220, 0, 255) elseif ability_name == "cherub_flower_blue_blossom" then caster:SetModel("models/items/furion/flowerstaff.vmdl") caster:SetOriginalModel("models/items/furion/flowerstaff.vmdl") caster:SetModelScale(0.7) elseif ability_name == "cherub_flower_yellow_daisy" then caster:SetModel("models/heroes/enchantress/enchantress_flower.vmdl") caster:SetOriginalModel("models/heroes/enchantress/enchantress_flower.vmdl") caster:SetModelScale(4) elseif ability_name == "cherub_flower_purple_lotus" then caster:SetModel("models/props_debris/lotus_flower003.vmdl") caster:SetOriginalModel("models/props_debris/lotus_flower003.vmdl") caster:SetModelScale(0.75) caster:SetRenderColor(220, 0, 255) end end function PinkBlossomThink(keys) local caster = keys.caster local ability = keys.ability local allies = FindUnitsInRadius(caster:GetTeam(), caster:GetAbsOrigin(), nil, ability:GetLevelSpecialValueFor("heal_range", ability:GetLevel() - 1), DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_CREEP, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_ANY_ORDER, false) table.shuffle(allies) for i = 1, ability:GetLevelSpecialValueFor("max_targets", ability:GetLevel() - 1) do if allies[i] then local amount = ability:GetLevelSpecialValueFor("heal_amount", ability:GetLevel() - 1) SafeHeal(allies[i], amount, caster) ParticleManager:CreateParticle("particles/neutral_fx/troll_heal.vpcf", PATTACH_ABSORIGIN_FOLLOW, allies[i]) SendOverheadEventMessage(allies[i]:GetPlayerOwner(), OVERHEAD_ALERT_HEAL, allies[i], amount, caster:GetPlayerOwner()) end end end function BlueBlossomThink(keys) local caster = keys.caster local ability = keys.ability local allies = FindUnitsInRadius(caster:GetTeam(), caster:GetAbsOrigin(), nil, ability:GetLevelSpecialValueFor("restore_range", ability:GetLevel() - 1), DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC + DOTA_UNIT_TARGET_CREEP, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, FIND_ANY_ORDER, false) table.shuffle(allies) for _,v in ipairs(allies) do local amount = ability:GetLevelSpecialValueFor("restore_amount", ability:GetLevel() - 1) v:GiveMana(amount) ParticleManager:CreateParticle("particles/items_fx/arcane_boots_recipient.vpcf", PATTACH_ABSORIGIN_FOLLOW, v) SendOverheadEventMessage(v:GetPlayerOwner(), OVERHEAD_ALERT_MANA_ADD, v, amount, caster:GetPlayerOwner()) end end
mit
mprinc/KnAllEdge
src/frontend/dev_puzzles/knalledge/view_enginee/code/knalledge/mapVisualizationTree.js
47725
(function() { // This prevents problems when concatenating scripts that aren't strict. 'use strict'; /** @classdesc Deals with visualization of the KnAllEdge map. It is a specialization of the `knalledge.MapVisualization` class @class MapVisualizationTree @memberof knalledge */ var MapVisualizationTree = knalledge.MapVisualizationTree = function(dom, mapStructure, collaboPluginsService, configTransitions, configTree, configNodes, configEdges, rimaService, notifyService, mapPlugins, knalledgeMapViewService, upperAPI) { this.construct(dom, mapStructure, collaboPluginsService, configTransitions, configTree, configNodes, configEdges, rimaService, notifyService, mapPlugins, knalledgeMapViewService, upperAPI); }; // TODO: the quickest solution until find the best and the most performance optimal solution // Set up MapVisualizationTree to inherit from MapVisualization MapVisualizationTree.prototype = Object.create(knalledge.MapVisualization.prototype); MapVisualizationTree.prototype._super = function() { var thisP = Object.getPrototypeOf(this); var parentP = Object.getPrototypeOf(thisP); return parentP; }; /** * Updates map visualization * First tries few ways to resolve the starting node of the map. Then it generates visualization structure calling `knalledge.MapLayout.generateTree()` and then visualizas it. * * @function update * @memberof knalledge.MapVisualizationTree * @param {vkNode} source - node that will be used as a source of animation * (for example nodes will expand from the source node) * @param {Function} callback - called when map visualization finished updating * */ MapVisualizationTree.prototype.update = function(source, callback) { if (this.updateInProgress) { return; } // currently updates can be in the parallel // this.updateInProgress = true; if (!source) source = this.getSourceAlternative(); // filter out invisible nodes (hideIBIS, limit range, ...) this.mapStructure.setVisibility(); this.mapLayout.generateTree(this.mapStructure.rootNode); // this.mapLayout.printTree(this.mapLayout.nodes); // we need to update html nodes to calculate node heights in order to center them verticaly var nodeHtmlDatasets = this.updateHtml(source); var that = this; window.setTimeout(function() { if (!source) source = that.getSourceAlternative(); that.updateNodeDimensions(); that.updateHtmlTransitions(source, nodeHtmlDatasets); // all transitions are put here to be in the same time-slot as links, labels, etc // we do it "second time" to react to width/height changes after adding/removing elemetns (like images, ...) that.updateNodeDimensions(); that.updateHtmlAfterTransitions(source, nodeHtmlDatasets); that.updateSvgNodes(source); that.updateLinks(source); that.updateLinkLabels(source); if (typeof callback === 'function') { callback(); } that.updateInProgress = false; }, 25); }; function isShowingFullSizeImage(d) { // !this.knalledgeMapViewService => showImagesAsThumbnails == true return (this.knalledgeMapViewService && !this.knalledgeMapViewService.provider.config.nodes.showImagesAsThumbnails) && d.kNode.dataContent && d.kNode.dataContent.image && d.kNode.dataContent.image.width; } /** * calculates width of a node * @function getNodeWidth * @param {vkNode} d node that we are calculating width for * */ function getNodeWidth(d) { // .style("min-width", function(d){ var width = null; // !this.knalledgeMapViewService => show images if (!this.knalledgeMapViewService || this.knalledgeMapViewService.provider.config.nodes.showImages) { var width = isShowingFullSizeImage.bind(this)(d) ? d.kNode.dataContent.image.width : (this.knalledgeMapViewService ? this.knalledgeMapViewService.provider.config.nodes.imagesThumbnailsWidth : 100); } // if width is not set or if it is narrower than // this.configNodes.html.dimensions.sizes.width if (this.configNodes.html.dimensions && this.configNodes.html.dimensions.sizes && this.configNodes.html.dimensions.sizes.width && (width === null || width < this.configNodes.html.dimensions.sizes.width)) { width = this.configNodes.html.dimensions.sizes.width; } return this.scales.width(width) + "px"; } /** * Calculates left margin of a node * @function getNodeMarginLeft * @param {vkNode} d node that we are calculating * the left margin for * */ function getNodeMarginLeft(d) { // centering the node (set margin to half the width of the node) var width = null; // !this.knalledgeMapViewService => show images if (!this.knalledgeMapViewService || this.knalledgeMapViewService.provider.config.nodes.showImages) { // !this.knalledgeMapViewService => showImagesAsThumbnails == true var width = (this.knalledgeMapViewService && !this.knalledgeMapViewService.provider.config.nodes.showImagesAsThumbnails && d.kNode.dataContent && d.kNode.dataContent.image && d.kNode.dataContent.image.width) ? d.kNode.dataContent.image.width : (this.knalledgeMapViewService ? this.knalledgeMapViewService.provider.config.nodes.imagesThumbnailsWidth : 100); } // if width is not set or if it is narrower than // this.configNodes.html.dimensions.sizes.width if (this.configNodes.html.dimensions && this.configNodes.html.dimensions.sizes && this.configNodes.html.dimensions.sizes.width && (width === null || width < this.configNodes.html.dimensions.sizes.width)) { width = this.configNodes.html.dimensions.sizes.width; } var margin = null; // set margin only if width is set if (width !== null) { margin = this.scales.width(-width / 2) + "px"; } return margin; } /** * Calculates the width of the image inside the node * if user has chosen to show only thumbnail, * the fixed width of thumbnail will be returned * @function getImageWidthForNode * @param {vkNode} d node that we are calculating * the image width for * */ function getImageWidthForNode(d) { // !this.knalledgeMapViewService => showImagesAsThumbnails == true var width = (!this.knalledgeMapViewService || this.knalledgeMapViewService.provider.config.nodes.showImagesAsThumbnails) ? (this.knalledgeMapViewService ? this.knalledgeMapViewService.provider.config.nodes.imagesThumbnailsWidth : 100) : d.kNode.dataContent.image.width; return this.scales.width(width) + "px"; } /** * Calculates the height of the image inside the node * if user has chosen to show only thumbnail, * the fixed height of thumbnail will be returned * @function getImageHeightForNode * @param {vkNode} d node that we are calculating * the image height for * */ function getImageHeightForNode(d) { // !this.knalledgeMapViewService => showImagesAsThumbnails == true var height = (!this.knalledgeMapViewService || this.knalledgeMapViewService.provider.config.nodes.showImagesAsThumbnails) ? (this.knalledgeMapViewService ? this.knalledgeMapViewService.provider.config.nodes.imagesThumbnailsHeight : 100) : d.kNode.dataContent.image.height; return this.scales.height(height) + "px"; } /** @function updateHtml * @param {vkNode} source - root node * joins data and view * stylize nodes and set their event listeners * Adds all visual plugins * */ MapVisualizationTree.prototype.updateHtml = function(source) { var that = this; if (!this.configNodes.html.show) return; var nodeHtml = this.dom.divMapHtml.selectAll("div.node_html") .data(this.mapLayout.nodes, function(d) { return d.id; }); nodeHtml.classed({ "node_unselectable": function(d) { return (!d.kNode.visual || !d.kNode.visual.selectable) ? true : false; }, "node_selectable": function(d) { return (d.kNode.visual && d.kNode.visual.selectable) ? true : false; } }); // Enter the nodes // we create a div that will contain both visual representation of a node var nodeHtmlEnter = nodeHtml.enter().append("div") .attr("class", function(d) { var classes = "node_html node_unselected draggable " + d.kNode.type; // find if the node is relevant for the user var userHows = null; if (that.rimaService) { that.rimaService.howAmIs; var nodeWhats = (d.kNode.dataContent && d.kNode.dataContent.rima && d.kNode.dataContent.rima.whats) ? d.kNode.dataContent.rima.whats : []; var relevant = false; for (var i in nodeWhats) { var nodeWhat = nodeWhats[i]; for (var j in userHows) { var userHow = userHows[j]; if (userHow && userHow.whatAmI && (userHow.whatAmI.name == nodeWhat.name)) { relevant = true; break; } } } if (relevant) classes += " rima_relevant" } return classes; }) // .on("dblclick", function(d){ // that.upperAPI.nodeDblClicked(d); // }) .on("click", function(d) { that.upperAPI.nodeClicked(d); // that.mapLayout.clickNode(d, this); }); // position node on enter at the source position // (it is either parent or another precessor) nodeHtmlEnter .style("left", function(d) { var y = null; if (that.configTransitions.enter.animate.position) { if (that.configTransitions.enter.referToToggling) { y = source.y0; } else { y = d.parent ? d.parent.y0 : d.y0; } } else { y = d.y; } return that.scales.y(y) + "px"; }) .style("top", function(d) { var x = null; if (that.configTransitions.enter.animate.position) { if (that.configTransitions.enter.referToToggling) { x = source.x0; } else { x = d.parent ? d.parent.x0 : d.x0; } } else { x = d.x; } // console.log("[nodeHtmlEnter] d: %s, x: %s", d.kNode.name, x); return that.scales.x(x) + "px"; }) .classed({ "node_html_fixed": function(d) { return (!isShowingFullSizeImage.bind(that)(d)) ? true : false; } }) /* TODO Fixing expandable nodes */ .style("width", getNodeWidth.bind(this)) .style("margin-left", getNodeMarginLeft.bind(this)); nodeHtmlEnter.filter(function(d) { // !that.knalledgeMapViewService => showImages == true return (!that.knalledgeMapViewService || that.knalledgeMapViewService.provider.config.nodes.showImages) && d.kNode.dataContent && d.kNode.dataContent.image; }) .append("img") .attr("src", function(d) { return d.kNode.dataContent.image.url; }) .attr("width", getImageWidthForNode.bind(this)) .attr("height", getImageHeightForNode.bind(this)) .attr("alt", function(d) { return d.kNode.name; }) .on("click", function(d) { d3.event.stopPropagation(); // alert("Image clicked"); that.upperAPI.nodeMediaClicked(d); }); nodeHtmlEnter .append("div") .attr("class", "open_close_status"); // TODO: we cannot optimize // if(this.rimaService && this.rimaService.config.showUsers){ nodeHtmlEnter .append("div") .attr("class", "rima_user"); // } // nodeHtmlEnter // .append("div") // .attr("class", "node_status") // .html(function(){ // return "&nbsp;"; //d._id; // d.kNode._id; // }); nodeHtmlEnter .append("div") .attr("class", "vote_up"); nodeHtmlEnter .append("div") .attr("class", "vote_down"); nodeHtmlEnter .append("div") .attr("class", "node_inner_html") .append("span") .html(function(d) { let humanID = d.kNode.dataContent.humanID ? ('' + d.kNode.dataContent.humanID + ':') : ''; let decorators = ''; let label = humanID + d.kNode.name; label = JSON.stringify(d.kNode.dataContent); return label; }); // .append("span") // .html(function(d) { // return "report: "+d.x+","+d.y; // }) // .append("p") // .html(function(d) { // return "moving: "; // }); if (this.configTransitions.enter.animate.opacity) { nodeHtmlEnter .style("opacity", 1e-6); } if (this.mapPlugins && this.mapPlugins.mapVisualizePlugins) { for (var pluginName in this.mapPlugins.mapVisualizePlugins) { var plugin = this.mapPlugins.mapVisualizePlugins[pluginName]; if (plugin.nodeHtmlEnter) { plugin.nodeHtmlEnter(nodeHtmlEnter); } } } var nodeHtmlDatasets = { elements: nodeHtml, enter: nodeHtmlEnter, exit: null }; return nodeHtmlDatasets; }; /** @function updateHtmlTransitions * @param {vkNode} source - root node * @param {vkNode} nodeHtmlDatasets - root node * joins data and view * stylize nodes and set their event listeners * Adds all visual plugins * Updates/adds/removes node decorations (for example it adds image thumbnail if before this and previous update rendering image is attached to a node) * */ MapVisualizationTree.prototype.updateHtmlTransitions = function(source, nodeHtmlDatasets) { if (!this.configNodes.html.show) return; var that = this; var nodeHtml = nodeHtmlDatasets.elements; // var nodeHtmlEnter = nodeHtmlDatasets.enter; // var nodeHtml = divMapHtml.selectAll("div.node_html") // .data(nodes, function(d) { return d.id; }); // Transition nodes to their new (final) position // it happens also for entering nodes (http://bl.ocks.org/mbostock/3900925) var nodeHtmlUpdate = nodeHtml; var nodeHtmlUpdateTransition = nodeHtmlUpdate; if (this.configTransitions.update.animate.position || this.configTransitions.update.animate.opacity) { nodeHtmlUpdateTransition = nodeHtmlUpdate.transition() .duration(this.configTransitions.update.duration); } // updates representation of nodes // adding/removing/updating image thumbnails, etc, ... nodeHtmlUpdate .classed({ "node_html_fixed": function(d) { return (!isShowingFullSizeImage.bind(that)(d)) ? true : false; } }) /* TODO FIxing expandable nodes */ .style("width", getNodeWidth.bind(this)) .style("margin-left", getNodeMarginLeft.bind(this)); nodeHtmlUpdate.filter(function(d) { var isEditingNode = (that.mapStructure.getEditingNode() == d); return !isEditingNode; }) .select(".node_inner_html span") .html(function(d) { // TODO: FIX let humanID = d.kNode.dataContent.humanID ? (d.kNode.dataContent.humanID + ' : ') : ''; let playerName = ''; if (d.kNode.dataContent && d.kNode.dataContent.dialoGameReponse && d.kNode.dataContent.dialoGameReponse.playerName) { playerName = ' (' + d.kNode.dataContent.dialoGameReponse.playerName + ') '; } if (d.kNode.dataContent && d.kNode.dataContent.userName) { playerName = ' (' + d.kNode.dataContent.userName + ') '; } let label = humanID + playerName + d.kNode.name; return label; }); // updating image state // image exists in data but not in the view nodeHtmlUpdate.filter(function(d) { // !that.knalledgeMapViewService => showImages == true return ((!that.knalledgeMapViewService || that.knalledgeMapViewService.provider.config.nodes.showImages) && d.kNode.dataContent && d.kNode.dataContent.image && (d3.select(this).select("img").size() <= 0)); }) .append("img") .attr("src", function(d) { return d.kNode.dataContent.image.url; }) .attr("width", getImageWidthForNode.bind(this)) .attr("height", getImageHeightForNode.bind(this)) .attr("alt", function(d) { return d.kNode.name; }); // updating images' properties nodeHtmlUpdate.select("img") .attr("src", function(d) { return d.kNode.dataContent.image.url; }) .attr("width", getImageWidthForNode.bind(this)) .attr("height", getImageHeightForNode.bind(this)) .attr("alt", function(d) { return d.kNode.name; }); // image does not exist in data but does exist in the view nodeHtmlUpdate.select("img").filter(function(d) { // !that.knalledgeMapViewService => showImages == true return !( (!that.knalledgeMapViewService || that.knalledgeMapViewService.provider.config.nodes.showImages) && d.kNode.dataContent && d.kNode.dataContent.image); }) .remove(); nodeHtmlUpdate.select(".vote_up") .style("opacity", function(d) { if (that.rimaService) { var iAmId = that.rimaService.getActiveUserId(); return (d.kNode.dataContent && d.kNode.dataContent.ibis && d.kNode.dataContent.ibis.votes && d.kNode.dataContent.ibis.votes[iAmId]) ? 1.0 : 0.5; } else { return 1.0; } }) .on("click", function(d) { d3.event.stopPropagation(); that.upperAPI.nodeVote(1, d); }) .html(function(d) { var noVote = "&nbsp" if (that.rimaService) { var iAmId = that.rimaService.getActiveUserId(); return (d.kNode.dataContent && d.kNode.dataContent.ibis && d.kNode.dataContent.ibis.votes && d.kNode.dataContent.ibis.votes[iAmId]) ? d.kNode.dataContent.ibis.votes[iAmId] : noVote; } else { return noVote; } }); nodeHtmlUpdate.select(".vote_down") .style("opacity", function(d) { var sum = 0; if (d.kNode.dataContent && d.kNode.dataContent.ibis && d.kNode.dataContent.ibis.votes) { for (var vote in d.kNode.dataContent.ibis.votes) { sum += d.kNode.dataContent.ibis.votes[vote]; } } return sum != 0 ? 1.0 : 0.5; // return (d.kNode.dataContent && d.kNode.dataContent.ibis && d.kNode.dataContent.ibis.voteDown) ? // 1.0 : 0.1; }) .on("click", function(d) { d3.event.stopPropagation(); that.upperAPI.nodeVote(-1, d); }) .html(function(d) { var sum = 0; if (d.kNode.dataContent && d.kNode.dataContent.ibis && d.kNode.dataContent.ibis.votes) { for (var vote in d.kNode.dataContent.ibis.votes) { sum += d.kNode.dataContent.ibis.votes[vote]; } return sum; } else { return "&nbsp"; } }); nodeHtmlUpdate.select(".open_close_status") .style("display", function(d) { return that.mapStructure.hasChildren(d) ? "block" : "none"; }) .on("click", function(d) { d3.event.stopPropagation(); that.upperAPI.nodeDblClicked(d); }) .html(function(d) { return ((d.isOpen === false) && that.mapStructure.hasChildren(d)) ? "+" : "-"; }); nodeHtmlUpdate.select(".rima_user") .style("display", function(d) { // TODO: FIX let playerName = ''; if (that.rimaService && that.rimaService.config.showUsers && that.rimaService.getUserById(d.kNode.iAmId)) { playerName = that.rimaService.getUserById(d.kNode.iAmId); } if (d.kNode.dataContent && d.kNode.dataContent.userName) { playerName = d.kNode.dataContent.userName; } return playerName ? "block" : "none"; // return (that.rimaService && that.rimaService.config.showUsers && that.rimaService.getUserById(d.kNode.iAmId)) ? "block" : "none"; //TODO: unefective!! double finding users (also in following '.html(function(d){') }) .html(function(d) { let label = ''; if (that.rimaService) { var user = that.rimaService.getUserById(d.kNode.iAmId); if (user) { label = "@" + user.displayName; } } if (d.kNode.dataContent && d.kNode.dataContent.userName) { label = ' (' + d.kNode.dataContent.userName + ') '; } // if (that.rimaService) { // var user = that.rimaService.getUserById(d.kNode.iAmId); // if (user) { // label = "@" + user.displayName; // } // } return label; }) .on("click", function(d) { console.log('@creator clicked for node ', d.kNode.name); d3.event.stopPropagation(); //this.append("div").html("users list"); that.upperAPI.nodeCreatorClicked(d); }); if (this.mapPlugins && this.mapPlugins.mapVisualizePlugins) { for (var pluginName in this.mapPlugins.mapVisualizePlugins) { var plugin = this.mapPlugins.mapVisualizePlugins[pluginName]; if (plugin.nodeHtmlUpdate) { plugin.nodeHtmlUpdate(nodeHtmlUpdate); } } } // if we are doing animation then we are continuing changing node position, ... through nodeHtmlUpdateTransition, // which will introduce change with delay and transition, // otherwise changes will happen imediatelly through nodeHtmlUpdate (this.configTransitions.update.animate.position ? nodeHtmlUpdateTransition : nodeHtmlUpdate) .style("left", function(d) { return that.scales.y(d.y) + "px"; }) // .each("start", function(d){ // console.log("[nodeHtmlUpdateTransition] STARTED: d: %s, xCurrent: %s", d.kNode.name, d3.select(this).style("top")); // }) .style("top", function(d) { var x = that.mapLayout.getHtmlNodePosition(d); // x = d.x; // console.log("[nodeHtmlUpdateTransition] d: %s, xCurrent: %s, xNew: %s", d.kNode.name, d3.select(this).style("top"), x); return that.scales.x(x) + "px"; }); if (this.configTransitions.update.animate.opacity) { nodeHtmlUpdateTransition .style("opacity", 1.0); nodeHtmlUpdateTransition.select(".node_inner_html") .style("opacity", function(d) { return (d.kNode.visual && d.kNode.visual.selectable) ? 1.0 : 0.95; }); } // TRANSITION EXITING NODES // TODO: move to separate function var nodeHtmlExit = nodeHtml.exit(); var nodeHtmlExitTransition = nodeHtmlExit; nodeHtmlExit.on("click", null); nodeHtmlExit.on("dblclick", null); if (this.configTransitions.exit.animate.position || this.configTransitions.exit.animate.opacity) { nodeHtmlExitTransition = nodeHtmlExit.transition() .duration(this.configTransitions.exit.duration); } if (this.configTransitions.exit.animate.opacity) { nodeHtmlExitTransition .style("opacity", 1e-6); } if (this.configTransitions.exit.animate.position) { nodeHtmlExitTransition .style("left", function(d) { var y = null; // Transition nodes to the toggling node's new position if (that.configTransitions.exit.referToToggling) { y = source.y; } else { // Transition nodes to the parent node's new position y = (d.parent ? d.parent.y : d.y); } return that.scales.y(d.y) + "px"; }) .style("top", function(d) { var x = null; if (that.configTransitions.exit.referToToggling) { x = source.x; } else { x = (d.parent ? d.parent.x : d.x); } return that.scales.x(d.x) + "px"; }); } nodeHtmlExitTransition.remove(); }; MapVisualizationTree.prototype.updateHtmlAfterTransitions = function(source, nodeHtmlDatasets) { if (!this.configNodes.html.show) return; var that = this; var nodeHtml = nodeHtmlDatasets.elements; // var nodeHtmlEnter = nodeHtmlDatasets.enter; // var nodeHtml = divMapHtml.selectAll("div.node_html") // .data(nodes, function(d) { return d.id; }); // Transition nodes to their new (final) position // it happens also for entering nodes (http://bl.ocks.org/mbostock/3900925) var nodeHtmlUpdate = nodeHtml; var nodeHtmlUpdateTransition = nodeHtmlUpdate; if (this.configTransitions.update.animate.position || this.configTransitions.update.animate.opacity) { nodeHtmlUpdateTransition = nodeHtmlUpdate.transition() .duration(this.configTransitions.update.duration); } (this.configTransitions.update.animate.position ? nodeHtmlUpdateTransition : nodeHtmlUpdate) .style("left", function(d) { return that.scales.y(d.y) + "px"; }) // .each("start", function(d){ // console.log("[nodeHtmlUpdateTransition] STARTED: d: %s, xCurrent: %s", d.kNode.name, d3.select(this).style("top")); // }) .style("top", function(d) { var x = that.mapLayout.getHtmlNodePosition(d); // x = d.x; // console.log("[nodeHtmlUpdateTransition] d: %s, xCurrent: %s, xNew: %s", d.kNode.name, d3.select(this).style("top"), x); return that.scales.x(x) + "px"; }) .each('end', function(d) { that.positionNodeRelatedEntities(d); }); if (this.configTransitions.update.animate.opacity) { nodeHtmlUpdateTransition .style("opacity", 1.0); nodeHtmlUpdateTransition.select(".node_inner_html") .style("opacity", function(d) { return (d.kNode.visual && d.kNode.visual.selectable) ? 1.0 : 0.95; }); } }; MapVisualizationTree.prototype.updateSvgNodes = function(source) { if (!this.configNodes.svg.show) return; var that = this; // Declare the nodes, since there is no unique id we are creating one on the fly // not very smart with real data marshaling in/out :) var node = this.dom.svg.selectAll("g.node") .data(this.mapLayout.nodes, function(d) { return d.id; }); // Enter the nodes // we create a group "g" that will contain both visual representation of a node (circle) and text var nodeEnter = node.enter().append("g") .attr("class", "node") .style("opacity", function() { return that.configTransitions.enter.animate.opacity ? 1e-6 : 0.8; }) .on("click", function(d) { that.upperAPI.nodeClicked(d); }) // .on("dblclick", function(d){ // that.upperAPI.nodeDblClicked(d); // }) // Enter any new nodes at the parent's previous position. .attr("transform", function(d) { var x = null, y = null; if (that.configTransitions.enter.animate.position) { if (that.configTransitions.enter.referToToggling) { y = source.y0; x = source.x0; } else { if (d.parent) { y = d.parent.y0; x = d.parent.x0; } else { y = d.y0; x = d.x0; } } } else { y = d.y; x = d.x; } return "translate(" + that.scales.y(source.y0) + "," + that.scales.x(source.x0) + ")"; }); // .attr("transform", function(d) { // // return "translate(0,0)"; // return "translate(" + d.y + "," + d.x + ")"; // }); // add visual representation of node nodeEnter.append("circle") // the center of the circle is positioned at the 0,0 coordinate .attr("r", 10) .style("fill", "#fff"); var nodeEnterTransition; if (this.configTransitions.enter.animate.position || this.configTransitions.enter.animate.opacity) { nodeEnterTransition = nodeEnter.transition() .duration(this.configTransitions.enter.duration); if (this.configTransitions.enter.animate.opacity) { nodeEnterTransition .style("opacity", 1e-6); } } var nodeUpdate = node; var nodeUpdateTransition; if (this.configTransitions.update.animate.position || this.configTransitions.update.animate.opacity) { nodeUpdateTransition = nodeUpdate.transition() .duration(this.configTransitions.update.duration); } // Transition nodes to their new position (this.configTransitions.update.animate.position ? nodeUpdateTransition : nodeUpdate) .attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; }); (this.configTransitions.update.animate.opacity ? nodeUpdateTransition : nodeUpdate) .style("opacity", 0.8); node.select("circle") .style("fill", function(d) { return ((d.isOpen === false) && that.mapStructure.hasChildren(d)) ? "lightsteelblue" : "#ffffff"; }); // Transition exiting nodes var nodeExit = node.exit(); var nodeExitTransition; nodeExit.on("click", null); if (this.configTransitions.exit.animate.position || this.configTransitions.exit.animate.opacity) { nodeExitTransition = nodeExit.transition() .duration(this.configTransitions.exit.duration); if (this.configTransitions.exit.animate.opacity) { nodeExitTransition .style("opacity", 1e-6); } if (this.configTransitions.exit.animate.position) { nodeExitTransition .attr("transform", function(d) { var x = null, y = null; if (that.configTransitions.exit.referToToggling) { x = source.x; y = source.y; } else { if (d.parent) { x = d.parent.x; y = d.parent.y; } else { x = d.x; y = d.y; } } return "translate(" + that.scales.y(y) + "," + that.scales.x(x) + ")"; }); } nodeExitTransition .remove(); } else { nodeExit .remove(); } }; MapVisualizationTree.prototype.updateLinkLabels = function(source) { if (!this.configEdges.labels.show) return; var that = this; /************** * create D3 references to link labels **************/ var linkLabelHtml = this.dom.divMapHtml.selectAll("div.label_html") .data(this.mapLayout.links, function(d) { // there is only one incoming edge return d.vkEdge.id; // d.target.id; }); /************** * creating link label (enter) **************/ // we create a div that will contain both visual representation link label var linkLabelHtmlEnter = linkLabelHtml.enter().append("div") .attr("class", function(d) { return "label_html " + d.vkEdge.kEdge.type; }) // inform on edge clicked .on("click", function(d) { that.upperAPI.edgeClicked(d); }) .style("left", function(d) { var y; // if edges are animated if (that.configTransitions.enter.animate.position) { // if animation is comming from source of action (usually node toggling) if (that.configTransitions.enter.referToToggling) { y = source.y0; } else { y = d.source.y0; } } else { y = (d.source.y + d.target.y) / 2; } return that.scales.y(y) + "px"; }) .style("top", function(d) { var x; if (that.configTransitions.enter.animate.position) { if (that.configTransitions.enter.referToToggling) { x = source.x0; } else { x = d.source.x0; } } else { x = (d.source.x + d.target.x) / 2; } return that.scales.x(x) + "px"; }); // append link label name linkLabelHtmlEnter .append("span") //.text("<span>Hello</span>"); //.html("<span>Hello</span>"); .html(function(d) { var edge = that.mapStructure.getEdge(d.source.id, d.target.id); //TODO: replace with added kEdge // !that.knalledgeMapViewService => showNames == true return (!that.knalledgeMapViewService || that.knalledgeMapViewService.provider.config.edges.showNames) ? edge.kEdge.name : ""; }); // set opacity to 0 at the innitial if (this.configTransitions.enter.animate.opacity) { linkLabelHtmlEnter .style("opacity", 1e-6); } /************** * UPDATING link label **************/ var linkLabelHtmlUpdate = linkLabelHtml; var linkLabelHtmlUpdateTransition = linkLabelHtmlUpdate; // make transition of lonk labels if there is animation of position or opacity if (this.configTransitions.update.animate.position || this.configTransitions.update.animate.opacity) { linkLabelHtmlUpdateTransition = linkLabelHtmlUpdate.transition() .duration(this.configTransitions.update.duration); } // update link label linkLabelHtmlUpdate.select("span") .html(function(d) { var edge = that.mapStructure.getEdge(d.source.id, d.target.id); //TODO: replace with added kEdge // !that.knalledgeMapViewService => showNames == true return (!that.knalledgeMapViewService || that.knalledgeMapViewService.provider.config.edges.showNames) ? edge.kEdge.name : ""; }); // animate position to the middle between source and target position if (this.configTransitions.update.animate.position) { // either transition ... linkLabelHtmlUpdateTransition .style("left", function(d) { return ((d.source.y + d.target.y) / 2) + "px"; }) .style("top", function(d) { return ((d.source.x + d.target.x) / 2) + "px"; }); } else { // ... or non-transition linkLabel linkLabelHtmlUpdate .style("left", function(d) { return ((d.source.y + d.target.y) / 2) + "px"; }) .style("top", function(d) { return ((d.source.x + d.target.x) / 2) + "px"; }); } // if opacity animated increase it to its final value if (this.configTransitions.update.animate.opacity) { linkLabelHtmlUpdateTransition .style("opacity", 1.0); } /************** * LINK REMOVAL (exit) **************/ var linkLabelHtmlExit = linkLabelHtml.exit(); var linkLabelHtmlExitTransition = linkLabelHtmlExit; linkLabelHtmlExit.on("click", null); // if exiting is animated if (this.configTransitions.exit.animate.position || this.configTransitions.exit.animate.opacity) { // introduce transition linkLabelHtmlExitTransition = linkLabelHtmlExit.transition() .duration(this.configTransitions.exit.duration); // position if (this.configTransitions.exit.animate.position) { linkLabelHtmlExitTransition .style("left", function(d) { var y = null; // Transition edge to the source-of-action's new position if (that.configTransitions.exit.referToToggling) { y = source.y; } else { // Transition edge to the parent node's new position y = d.source.y; } return that.scales.y(y) + "px"; }) .style("top", function(d) { var x = null; // Transition edge to the source-of-action's new position if (that.configTransitions.exit.referToToggling) { x = source.x; } else { // Transition edge to the parent node's new position x = d.source.x; } return that.scales.x(x) + "px"; }); } // opacity if (this.configTransitions.exit.animate.opacity) { linkLabelHtmlExitTransition .style("opacity", 1e-6); } // or just remove link label if there is no animation } linkLabelHtmlExitTransition .remove(); }; /* method responsible for dealing with links * + creating (enter) * + updating * + removing (exit) */ MapVisualizationTree.prototype.updateLinks = function(source) { if (!this.configEdges.show) return; var that = this; // Declare the links /************* * LINK CREATION *************/ var link = this.dom.svg.selectAll("path.link") .data(this.mapLayout.links, function(d) { // TODO: this will need to evolve after adding bouquet links return d.vkEdge.id; }); /************* * LINK ENTER *************/ // Enter the links var linkEnter = link.enter().insert("path", "g") .attr("class", "link") // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d // http://www.w3schools.com/svg/svg_path.asp // https://www.dashingd3js.com/svg-paths-and-d3js // link contains source {x, y} and target {x, y} attributes which are used as input for diagonal, // and then each passed to projection to calculate array couple [x,y] for both source and target point .attr("d", function(d) { var diagonal; // animate diagonal appereance if (that.configTransitions.enter.animate.position) { var o; // should link appear from the node we initiated action? if (that.configTransitions.enter.referToToggling) { o = { x: source.x0, y: source.y0 }; } else { o = { x: d.source.x0, y: d.source.y0 }; } diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage.bind(that))({ source: o, target: o }); // if not, position diagonal in its final position determined by parent and child node position } else { diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage.bind(that))(d); } return diagonal; }); var linkEnterTransition = linkEnter; // make link-entrance animation with increasing opacity if (this.configTransitions.enter.animate.opacity) { linkEnterTransition = linkEnter.transition() .duration(this.configTransitions.update.duration); linkEnter .style("opacity", 1e-6); } linkEnterTransition .style("opacity", 1.0); /************* * LINK UPDATING *************/ var linkUpdate = link; var linkUpdateTransition = linkUpdate; // introduce transition if there is animation if (this.configTransitions.update.animate.position || this.configTransitions.update.animate.opacity) { linkUpdateTransition = linkUpdate.transition() .duration(this.configTransitions.update.duration); } if (this.configTransitions.update.animate.position) { //if there is animation, update link with transition linkUpdateTransition .attr("d", function(d) { var diagonal; diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage.bind(that))(d); return diagonal; }); } else { // otherwise update it immediatelly linkUpdate .attr("d", function(d) { var diagonal; diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage.bind(that))(d); return diagonal; }); } // still need to understand why this is necessary and // linkEnterTransition.style("opacity", 1.0); // is not enough linkUpdateTransition .style("opacity", 1.0); /************* * LINK EXITING *************/ var linkExit = link.exit(); var linkExitTransition = linkExit; // if there is animation (of either position or opacity) introduce transition by setting // linkExitTransition to transition if (this.configTransitions.exit.animate.position || this.configTransitions.exit.animate.opacity) { // create transition linkExitTransition = linkExit.transition() .duration(this.configTransitions.exit.duration); // animating position if (this.configTransitions.exit.animate.position) { // provide final position to transition linkExit: linkExitTransition linkExitTransition .attr("d", function(d) { var diagonal; var o; // Transition nodes to the toggling node's new position if (that.configTransitions.exit.referToToggling) { o = { x: source.x, y: source.y }; } else { o = { x: d.source.x, y: d.source.y }; } diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage)({ source: o, target: o }); return diagonal; }); } else { // provide final position to non-transition linkExit linkExit .attr("d", function(d) { var diagonal; diagonal = that.mapLayout.diagonal(that.mapLayout, isShowingFullSizeImage.bind(that))(d); return diagonal; }); } // reduce opacity through transition if (this.configTransitions.exit.animate.opacity) { linkExitTransition .style("opacity", 1e-6); } // or it will stay just regular linkExit (without transition) } linkExitTransition .remove(); }; }()); // end of 'use strict';
mit
pmq20/ruby-compiler
ruby/bootstraptest/test_io.rb
2351
assert_finish 5, %q{ r, w = IO.pipe t1 = Thread.new { r.sysread(1) } t2 = Thread.new { r.sysread(1) } sleep 0.01 until t1.stop? and t2.stop? w.write "a" w.write "a" }, '[ruby-dev:31866]' assert_finish 10, %q{ begin require "io/nonblock" require "timeout" timeout(3) do r, w = IO.pipe w.nonblock? w.nonblock = true w.write_nonblock("a" * 100000) w.nonblock = false t1 = Thread.new { w.write("b" * 4096) } t2 = Thread.new { w.write("c" * 4096) } sleep 0.5 r.sysread(4096).length sleep 0.5 r.sysread(4096).length t1.join t2.join end rescue LoadError, Timeout::Error, NotImplementedError end }, '[ruby-dev:32566]' assert_finish 1, %q{ r, w = IO.pipe Thread.new { w << "ab" sleep 0.01 w << "ab" } r.gets("abab") } assert_equal 'ok', %q{ require 'tmpdir' begin tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}" rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL) rescue Errno::EEXIST retry end save = STDIN.dup STDIN.reopen(rw) STDIN.reopen(save) rw.close File.unlink(tmpname) :ok } assert_equal 'ok', %q{ require 'tmpdir' begin tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}" rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL) rescue Errno::EEXIST retry end save = STDIN.dup STDIN.reopen(rw) STDIN.print "a" STDIN.reopen(save) rw.close File.unlink(tmpname) :ok } assert_equal 'ok', %q{ dup = STDIN.dup dupfd = dup.fileno dupfd == STDIN.dup.fileno ? :ng : :ok }, '[ruby-dev:46834]' assert_normal_exit %q{ ARGF.set_encoding "foo" } 10.times do assert_normal_exit %q{ at_exit { p :foo } megacontent = "abc" * 12345678 #File.open("megasrc", "w") {|f| f << megacontent } t0 = Thread.main Thread.new { sleep 0.001 until t0.stop?; Process.kill(:INT, $$) } r1, w1 = IO.pipe r2, w2 = IO.pipe t1 = Thread.new { w1 << megacontent; w1.close } t2 = Thread.new { r2.read; r2.close } IO.copy_stream(r1, w2) rescue nil w2.close r1.close t1.join t2.join }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break end assert_normal_exit %q{ r, w = IO.pipe STDOUT.reopen(w) STDOUT.reopen(__FILE__, "r") }, '[ruby-dev:38131]'
mit
pauly4it/laraturk
src/Facades/LaraTurk.php
303
<?php namespace Pauly4it\LaraTurk\Facades; use \Illuminate\Support\Facades\Facade; class Laraturk extends Facade { /** * Get the registered name of the component. * * @return string */ protected static function getFacadeAccessor() { return 'laraturk'; } }
mit
pyqg/pyqg
pyqg/qg_model.py
11090
import numpy as np from numpy import pi from . import model try: import mkl np.use_fastnumpy = True except ImportError: pass try: import pyfftw pyfftw.interfaces.cache.enable() except ImportError: pass class QGModel(model.Model): r"""Two layer quasigeostrophic model. This model is meant to representflows driven by baroclinic instabilty of a base-state shear :math:`U_1-U_2`. The upper and lower layer potential vorticity anomalies :math:`q_1` and :math:`q_2` are .. math:: q_1 &= \nabla^2\psi_1 + F_1(\psi_2 - \psi_1) \\ q_2 &= \nabla^2\psi_2 + F_2(\psi_1 - \psi_2) with .. math:: F_1 &\equiv \frac{k_d^2}{1 + \delta^2} \\ F_2 &\equiv \delta F_1 \ . The layer depth ratio is given by :math:`\delta = H_1 / H_2`. The total depth is :math:`H = H_1 + H_2`. The background potential vorticity gradients are .. math:: \beta_1 &= \beta + F_1(U_1 - U_2) \\ \beta_2 &= \beta - F_2( U_1 - U_2) \ . The evolution equations for :math:`q_1` and :math:`q_2` are .. math:: \partial_t\,{q_1} + J(\psi_1\,, q_1) + \beta_1\, {\psi_1}_x &= \text{ssd} \\ \partial_t\,{q_2} + J(\psi_2\,, q_2)+ \beta_2\, {\psi_2}_x &= -r_{ek}\nabla^2 \psi_2 + \text{ssd}\,. where `ssd` represents small-scale dissipation and :math:`r_{ek}` is the Ekman friction parameter. """ def __init__( self, beta=1.5e-11, # gradient of coriolis parameter #rek=5.787e-7, # linear drag in lower layer rd=15000.0, # deformation radius delta=0.25, # layer thickness ratio (H1/H2) H1 = 500, # depth of layer 1 (H1) U1=0.025, # upper layer flow U2=0.0, # lower layer flow **kwargs ): """ Parameters ---------- beta : number Gradient of coriolis parameter. Units: meters :sup:`-1` seconds :sup:`-1` rek : number Linear drag in lower layer. Units: seconds :sup:`-1` rd : number Deformation radius. Units: meters. delta : number Layer thickness ratio (H1/H2) U1 : number Upper layer flow. Units: m/s U2 : number Lower layer flow. Units: m/s """ # physical self.beta = beta #self.rek = rek self.rd = rd self.delta = delta self.Hi = np.array([ H1, H1/delta]) self.U1 = U1 self.U2 = U2 #self.filterfac = filterfac super().__init__(nz=2, **kwargs) # initial conditions: (PV anomalies) self.set_q1q2( 1e-7*np.random.rand(self.ny,self.nx) + 1e-6*( np.ones((self.ny,1)) * np.random.rand(1,self.nx) ), np.zeros_like(self.x) ) ### PRIVATE METHODS - not meant to be called by user ### def _initialize_background(self): """Set up background state (zonal flow and PV gradients).""" # Background zonal flow (m/s): self.H = self.Hi.sum() self.set_U1U2(self.U1, self.U2) self.U = self.U1 - self.U2 # the F parameters self.F1 = self.rd**-2 / (1.+self.delta) self.F2 = self.delta*self.F1 # the meridional PV gradients in each layer self.Qy1 = self.beta + self.F1*(self.U1 - self.U2) self.Qy2 = self.beta - self.F2*(self.U1 - self.U2) self.Qy = np.array([self.Qy1, self.Qy2]) # complex versions, multiplied by k, speeds up computations to precompute self.ikQy1 = self.Qy1 * 1j * self.k self.ikQy2 = self.Qy2 * 1j * self.k # vector version self.ikQy = np.vstack([self.ikQy1[np.newaxis,...], self.ikQy2[np.newaxis,...]]) self.ilQx = 0. # layer spacing self.del1 = self.delta/(self.delta+1.) self.del2 = (self.delta+1.)**-1 def _initialize_inversion_matrix(self): # The matrix multiplication will look like this # ph[0] = a[0,0] * self.qh[0] + a[0,1] * self.qh[1] # ph[1] = a[1,0] * self.qh[0] + a[1,1] * self.qh[1] a = np.ma.zeros((self.nz, self.nz, self.nl, self.nk), np.dtype('float64')) # inverse determinant det_inv = np.ma.masked_equal( self.wv2 * (self.wv2 + self.F1 + self.F2), 0.)**-1 a[0,0] = -(self.wv2 + self.F2)*det_inv a[0,1] = -self.F1*det_inv a[1,0] = -self.F2*det_inv a[1,1] = -(self.wv2 + self.F1)*det_inv self.a = np.ma.masked_invalid(a).filled(0.) def _initialize_forcing(self): pass #"""Set up frictional filter.""" # this defines the spectral filter (following Arbic and Flierl, 2003) # cphi=0.65*pi # wvx=np.sqrt((self.k*self.dx)**2.+(self.l*self.dy)**2.) # self.filtr = np.exp(-self.filterfac*(wvx-cphi)**4.) # self.filtr[wvx<=cphi] = 1. def set_q1q2(self, q1, q2, check=False): """Set upper and lower layer PV anomalies. Parameters ---------- q1 : array-like Upper layer PV anomaly in spatial coordinates. q1 : array-like Lower layer PV anomaly in spatial coordinates. """ self.set_q(np.vstack([q1[np.newaxis,:,:], q2[np.newaxis,:,:]])) #self.q[0] = q1 #self.q[1] = q2 # initialize spectral PV #self.qh = self.fft2(self.q) # check that it works if check: np.testing.assert_allclose(self.q1, q1) np.testing.assert_allclose(self.q1, self.ifft2(self.qh1)) def set_U1U2(self, U1, U2): """Set background zonal flow. Parameters ---------- U1 : number Upper layer flow. Units: meters seconds :sup:`-1` U2 : number Lower layer flow. Units: meters seconds :sup:`-1` """ self.U1 = U1 self.U2 = U2 #self.Ubg = np.array([U1,U2])[:,np.newaxis,np.newaxis] self.Ubg = np.array([U1,U2]) ### All the diagnostic stuff follows. ### def _calc_cfl(self): return np.abs( np.hstack([self.u + self.Ubg[:,np.newaxis,np.newaxis], self.v]) ).max()*self.dt/self.dx # calculate KE: this has units of m^2 s^{-2} # (should also multiply by H1 and H2...) def _calc_ke(self): ke1 = .5*self.Hi[0]*self.spec_var(self.wv*self.ph[0]) ke2 = .5*self.Hi[1]*self.spec_var(self.wv*self.ph[1]) return ( ke1.sum() + ke2.sum() ) / self.H # calculate eddy turn over time # (perhaps should change to fraction of year...) def _calc_eddy_time(self): """ estimate the eddy turn-over time in days """ ens = .5*self.Hi[0] * self.spec_var(self.wv2*self.ph1) + \ .5*self.Hi[1] * self.spec_var(self.wv2*self.ph2) return 2.*pi*np.sqrt( self.H / ens ) / 86400 def _calc_derived_fields(self): self.p = self.ifft(self.ph) self.xi =self.ifft(-self.wv2*self.ph) self.Jptpc = -self._advect( (self.p[0] - self.p[1]), (self.del1*self.u[0] + self.del2*self.u[1]), (self.del1*self.v[0] + self.del2*self.v[1])) # fix for delta.neq.1 self.Jpxi = self._advect(self.xi, self.u, self.v) def _initialize_model_diagnostics(self): """Extra diagnostics for two-layer model""" self.add_diagnostic('entspec', description='barotropic enstrophy spectrum', function= (lambda self: np.abs(self.del1*self.qh[0] + self.del2*self.qh[1])**2.), units='', dims=('l','k') ) self.add_diagnostic('APEflux', description='spectral flux of available potential energy', function= (lambda self: self.rd**-2 * self.del1*self.del2 * np.real((self.ph[0]-self.ph[1])*np.conj(self.Jptpc)) ), units='', dims=('l','k') ) self.add_diagnostic('KEflux', description='spectral flux of kinetic energy', function= (lambda self: np.real(self.del1*self.ph[0]*np.conj(self.Jpxi[0])) + np.real(self.del2*self.ph[1]*np.conj(self.Jpxi[1])) ), units='', dims=('l','k') ) self.add_diagnostic('APEgenspec', description='spectrum of available potential energy generation', function= (lambda self: self.U * self.rd**-2 * self.del1 * self.del2 * np.real(1j*self.k*(self.del1*self.ph[0] + self.del2*self.ph[1]) * np.conj(self.ph[0] - self.ph[1])) ), units='', dims=('l','k') ) self.add_diagnostic('APEgen', description='total available potential energy generation', function= (lambda self: self.U * self.rd**-2 * self.del1 * self.del2 * np.real((1j*self.k* (self.del1*self.ph[0] + self.del2*self.ph[1]) * np.conj(self.ph[0] - self.ph[1])).sum() +(1j*self.k[:,1:-2]* (self.del1*self.ph[0,:,1:-2] + self.del2*self.ph[1,:,1:-2]) * np.conj(self.ph[0,:,1:-2] - self.ph[1,:,1:-2])).sum()) / (self.M**2) ), units='', dims=('time',) ) ### These generic diagnostics are now calculated in model.py ### # self.add_diagnostic('KE1spec', # description='upper layer kinetic energy spectrum', # function=(lambda self: 0.5*self.wv2*np.abs(self.ph[0])**2) # ) # # self.add_diagnostic('KE2spec', # description='lower layer kinetic energy spectrum', # function=(lambda self: 0.5*self.wv2*np.abs(self.ph[1])**2) # ) # # self.add_diagnostic('q1', # description='upper layer QGPV', # function= (lambda self: self.q[0]) # ) # # self.add_diagnostic('q2', # description='lower layer QGPV', # function= (lambda self: self.q[1]) # ) # # self.add_diagnostic('EKE1', # description='mean upper layer eddy kinetic energy', # function= (lambda self: 0.5*(self.v[0]**2 + self.u[0]**2).mean()) # ) # # self.add_diagnostic('EKE2', # description='mean lower layer eddy kinetic energy', # function= (lambda self: 0.5*(self.v[1]**2 + self.u[1]**2).mean()) # ) # # self.add_diagnostic('EKEdiss', # description='total energy dissipation by bottom drag', # function= (lambda self: # (self.del2*self.rek*self.wv2* # np.abs(self.ph[1])**2./(self.nx*self.ny)).sum()) # )
mit
raphaelrubino/nid
nn/bi/run.py
1619
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import import numpy as np np.random.seed( 1337 ) import data_utils from binid import Bilingual_neural_information_density import sys if __name__ == '__main__': if len( sys.argv ) != 12: print( "\nUsage: ", sys.argv[ 0 ], "<src sentence> <src vocabulary> <src embedding size> <tgr context> <trg target> <trg vocabulary> <trg embedding size> <dropout> <batch size> <epochs> <output model>\n" ) exit() src_sentences, src_vocab, src_embedding, trg_context, trg_target, trg_vocab, trg_embedding, dropout, batch, epoch, out_model = sys.argv[ 1: ] src_embedding = np.int( src_embedding ) trg_embedding = np.int( trg_embedding ) dropout = np.float( dropout ) batch = np.int( batch ) epoch = np.int( epoch ) print( "Loading vocabulary" ) src_vocab, src_max_features = data_utils.load_vocab( src_vocab ) trg_vocab, trg_max_features = data_utils.load_vocab( trg_vocab ) print( "Loading source sentences" ) src_sentences, src_max_length = data_utils.load_corpus( src_sentences ) print( "Loading contexts" ) trg_context = data_utils.load_context( trg_context ) print( "Loading targets" ) trg_target = data_utils.load_target( trg_target ) trg_max_length = trg_context.shape[ 1 ] validation_size = 0.25 print( "Data loaded" ) nid = Bilingual_neural_information_density( src_sentences, src_max_features, src_max_length, trg_context, trg_target, trg_max_features, trg_max_length, batch, validation_size ) print( "Data prepared" ) print( "Training" ) nid.train( src_embedding, trg_embedding, dropout, epoch, out_model )
mit
iamfreee/laracasts-downloader
App/Exceptions/SubscriptionNotActiveException.php
228
<?php /** * Subscription Not Active Exception */ namespace App\Exceptions; use Exception; /** * Class SubscriptionNotActiveException * @package App\Exceptions */ class SubscriptionNotActiveException extends Exception { }
mit
radiant-persimmons/mockr
src/client/app/core/directives/nav-bar.directive.spec.js
3660
/*jshint -W079 */ /*jshint expr:true */ describe('UNIT: navbar directive', function() { var element; var scope; var $httpBackend; describe('before login', function() { /** * Because it's not clear how to do otherwise, different controller stubs * are provided to represent different states in the navbar. */ var NavbarControllerStub = function() { var vm = this; vm.loggedIn = false; }; /** * Since `run.config.js` uses `auth` and `user` services, we need to stub * them here so the app can finish loading. */ beforeEach(module(function($provide) { $provide.value('auth', {}); $provide.value('user', {}); })); // Load directive template provided by ng-html2js beforeEach(module('/html/core/directives/nav-bar.directive.html')); /** * Provide stubbed version of directive controller in lieu of real * one. */ beforeEach(function() { module('app.core', function($provide, $controllerProvider) { $controllerProvider.register('NavbarController', NavbarControllerStub); }); }); /** * Handle other templates that should be stubbed, create a new scope, * compile the directive into an element, and run a digest cycle. */ beforeEach(inject(function($compile, $rootScope, _$httpBackend_) { /** * Because the directive is part of app.core, the whole page will be * loaded. Anticipate template requests for the landing page. */ $httpBackend = _$httpBackend_; $httpBackend .expectGET('/html/modules/landing/landing.html') .respond(200); scope = $rootScope.$new(); element = $compile('<navbar></navbar>')(scope); scope.$digest(); // Flush $httpBackend to clear out template requests $httpBackend.flush(); })); it('should show login button, and logo links to root', function() { expect(element.find('a[href="/"]').hasClass('ng-hide')).to.be.false; expect(element.find('a[href="/home"]').hasClass('ng-hide')).to.be.true; }); }); describe('after login', function() { var NavbarControllerStub = function() { var vm = this; vm.loggedIn = true; }; beforeEach(module(function($provide) { $provide.value('auth', {}); $provide.value('user', {}); })); // Load directive template provided by ng-html2js beforeEach(module('/html/core/directives/nav-bar.directive.html')); beforeEach(function() { module('app.core', function($provide, $controllerProvider) { $controllerProvider.register('NavbarController', NavbarControllerStub); }); }); beforeEach(inject(function($compile, $rootScope, _$httpBackend_) { /** * Because the directive is part of app.core, the whole page will be * loaded. Anticipate template requests for the landing page. */ $httpBackend = _$httpBackend_; $httpBackend .expectGET('/html/modules/landing/landing.html') .respond(200); scope = $rootScope.$new(); element = $compile('<navbar></navbar>')(scope); scope.$digest(); $httpBackend.flush(); })); it('should show username, avatar, logout, and logo links to home', function() { expect(element.find('a[href="/"]').hasClass('ng-hide')).to.be.true; expect(element.find('a[href="/home"]').hasClass('ng-hide')).to.be.false; expect(element.find('ul li a[ng-click="vm.login()"]').parent().hasClass('ng-hide')).to.be.true; expect(element.find('ul li a[ng-click="vm.logout()"]').parent().hasClass('ng-hide')).to.be.false; }); }); });
mit
smathieu/prosperity
lib/prosperity/engine.rb
625
module Prosperity class Engine < ::Rails::Engine isolate_namespace Prosperity config.autoload_paths << File.expand_path("../../", __FILE__) config.after_initialize do require "prosperity/exception" end config.generators do |g| g.test_framework :rspec, :fixtures => false g.view_specs false g.fixture_replacement nil end initializer :append_migrations do |app| unless app.root.to_s.match root.to_s config.paths["db/migrate"].expanded.each do |expanded_path| app.config.paths["db/migrate"] << expanded_path end end end end end
mit
foolcage/fooltrader
fooltrader/datasource/eos_account.py
2544
# -*- coding: utf-8 -*- import logging from datetime import datetime import elasticsearch.helpers from pymongo import MongoClient from fooltrader import fill_doc_type, es_client from fooltrader.domain.data.es_quote import EosAccount from fooltrader.settings import EOS_MONGODB_URL from fooltrader.utils.es_utils import es_index_mapping from fooltrader.utils.utils import to_time_str logger = logging.getLogger(__name__) client = MongoClient(EOS_MONGODB_URL) db = client['eosMain'] db_rs = client['local'] es_index_mapping("eos_account", EosAccount) def eos_acount_update_to_es(): pass def eos_account_to_es(): account = db.accounts count = account.count() logger.info("current account size:{}".format(count)) actions = [] # { # "_id": ObjectId("5b6651aa30cafb28be710275"), # "name": "eosio.ram", # "create_time": ISODate("2018-06-09T11:57:39.000Z"), # "liquid_eos": NumberLong(26757051448), # "stacked_eos": NumberLong(0), # "total_eos": NumberLong(26757051448), # "unstacking_eos": NumberLong(0) # } start = 0 size = 1000 while True: for item in account.find().skip(start).limit(size): liquidEos = item.get('liquid_eos', 0) stackedEos = item.get('stacked_eos', 0) unstackingEos = item.get('unstacking_eos', 0) totalEos = item.get('total_eos', 0) createTime = item.get('create_time', datetime.now()) json_item = { "id": str(item["_id"]), "userId": item["name"], "liquidEos": liquidEos, "stackedEos": stackedEos, "totalEos": totalEos, "unstackingEos": unstackingEos, "timestamp": to_time_str(createTime), "updateTimestamp": to_time_str(datetime.now()) } eos_account = EosAccount(meta={'id': json_item['id'], 'index': "eos_account"}) fill_doc_type(eos_account, json_item) actions.append(eos_account.to_dict(include_meta=True)) if actions: resp = elasticsearch.helpers.bulk(es_client, actions) logger.info("index to {} success:{} failed:{}".format("eos_account", resp[0], len(resp[1]))) if resp[1]: logger.error("index to {} error:{}".format("eos_account", resp[1])) if len(actions) < size: break actions = [] start += (size - 1) if __name__ == '__main__': eos_account_to_es()
mit
fle-internal/content-curation
contentcuration/contentcuration/static/js/edit_channel/constants/Licenses.js
4313
module.exports = [ { is_custom: false, exists: true, license_name: 'CC BY', license_url: 'https://creativecommons.org/licenses/by/4.0/', copyright_holder_required: true, license_description: 'The Attribution License lets others distribute, remix, tweak, and build upon your work, even commercially, as long as they credit you for the original creation. This is the most accommodating of licenses offered. Recommended for maximum dissemination and use of licensed materials.', id: 1, }, { is_custom: false, exists: true, license_name: 'CC BY-ND', license_url: 'https://creativecommons.org/licenses/by-nd/4.0/', copyright_holder_required: true, license_description: 'The Attribution-NoDerivs License allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to you.', id: 3, }, { is_custom: false, exists: true, license_name: 'CC BY-SA', license_url: 'https://creativecommons.org/licenses/by-sa/4.0/', copyright_holder_required: true, license_description: 'The Attribution-ShareAlike License lets others remix, tweak, and build upon your work even for commercial purposes, as long as they credit you and license their new creations under the identical terms. This license is often compared to "copyleft" free and open source software licenses. All new works based on yours will carry the same license, so any derivatives will also allow commercial use. This is the license used by Wikipedia, and is recommended for materials that would benefit from incorporating content from Wikipedia and similarly licensed projects.', id: 2, }, { is_custom: false, exists: true, license_name: 'CC BY-NC-SA', license_url: 'https://creativecommons.org/licenses/by-nc-sa/4.0/', copyright_holder_required: true, license_description: 'The Attribution-NonCommercial-ShareAlike License lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms.', id: 5, }, { is_custom: false, exists: true, license_name: 'CC BY-NC', license_url: 'https://creativecommons.org/licenses/by-nc/4.0/', copyright_holder_required: true, license_description: "The Attribution-NonCommercial License lets others remix, tweak, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don't have to license their derivative works on the same terms.", id: 4, }, { is_custom: false, exists: true, license_name: 'All Rights Reserved', license_url: 'http://www.allrights-reserved.com/', copyright_holder_required: true, license_description: 'The All Rights Reserved License indicates that the copyright holder reserves, or holds for their own use, all the rights provided by copyright law under one specific copyright treaty.', id: 7, }, { is_custom: false, exists: true, license_name: 'CC BY-NC-ND', license_url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/', copyright_holder_required: true, license_description: "The Attribution-NonCommercial-NoDerivs License is the most restrictive of our six main licenses, only allowing others to download your works and share them with others as long as they credit you, but they can't change them in any way or use them commercially.", id: 6, }, { is_custom: true, exists: false, license_name: 'Special Permissions', license_url: '', copyright_holder_required: true, license_description: 'Special Permissions is a custom license to use when the current licenses do not apply to the content. The owner of this license is responsible for creating a description of what this license entails.', id: 9, }, { is_custom: false, exists: true, license_name: 'Public Domain', license_url: 'https://creativecommons.org/publicdomain/mark/1.0/', copyright_holder_required: false, license_description: 'Public Domain work has been identified as being free of known restrictions under copyright law, including all related and neighboring rights.', id: 8, }, ];
mit
salimfadhley/scalamoo
src/test/scala/model/PokemonSpec.scala
1042
package model import model.battle.Status import model.pokedex.Pokedex import org.scalatest.FlatSpec /** * Created by salim on 16/09/2016. */ class PokemonSpec extends FlatSpec { "Pokemon" should "be creatable by id" in { val pokedex: Pokedex = Pokedex.boot val p: Pokemon = Pokemon.spawn(pokedex, 25).named("Foofoo") assert(p.name.get == "Foofoo") assert(p.pokedexEntry.name == "pikachu") } "it" can "be knocked out" in { val pokedex: Pokedex = Pokedex.boot val p: Pokemon = Pokemon.spawn(pokedex, 25) assert(p.hitPoints == p.maxHitPoints) assert(p.canBattle) p.doDamage(p.maxHitPoints) assert(p.hitPoints == 0) assert(p.battleStatus == Status.Unconcious) assert(!p.canBattle) } "it" can "never go below zero hit points" in { val pokedex: Pokedex = Pokedex.boot val p: Pokemon = Pokemon.spawn(pokedex, 25) assert(p.hitPoints == p.maxHitPoints) p.doDamage(p.maxHitPoints + 1) assert(p.hitPoints == 0) assert(p.battleStatus == Status.Unconcious) } }
mit
Snayki/in100gram
src/main/webapp/scripts/app/main/main.js
585
'use strict'; angular.module('in100gramApp') .config(function ($stateProvider) { $stateProvider .state('home', { parent: 'site', url: '/', data: { authorities: [] }, views: { 'content@': { templateUrl: 'scripts/app/main/main.html', controller: 'MainController' } }, resolve: { } }); });
mit
lindexi/lindexi_gd
ScrimpNet.Library.Suite Solution/ScrimpNet.Core Project/Configuration/IWcfConfigurationService.cs
1552
/** /// ScrimpNet.Core Library /// Copyright © 2005-2011 /// /// This module is Copyright © 2005-2011 Steve Powell /// All rights reserved. /// /// This library is free software; you can redistribute it and/or /// modify it under the terms of the Microsoft Public License (Ms-PL) /// /// This library is distributed in the hope that it will be /// useful, but WITHOUT ANY WARRANTY; without even the implied /// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR /// PURPOSE. See theMicrosoft Public License (Ms-PL) License for more /// details. /// /// You should have received a copy of the Microsoft Public License (Ms-PL) /// License along with this library; if not you may /// find it here: http://www.opensource.org/licenses/ms-pl.html /// /// Steve Powell, spowell@scrimpnet.com **/ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace ScrimpNet.Configuration { /// <summary> /// Contract for WCF configuration sub-system /// </summary> [ServiceContract] public interface IWcfConfigurationService:IDisposable { /// <summary> /// Retrieve all settings and variants for a specific application key /// </summary> /// <param name="applicationKey">Name/key of application of setting group</param> /// <returns>List of settings or empty list if not found</returns> [OperationContract] List<ConfigSetting> GetAllSettings(string applicationKey); } }
mit
bitrise-io/bitrise-webhooks
vendor/gopkg.in/DataDog/dd-trace-go.v1/contrib/globalsign/mgo/pipe.go
1277
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-2019 Datadog, Inc. package mgo import ( "github.com/globalsign/mgo" "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) // Pipe is an mgo.Pipe instance along with the data necessary for tracing. type Pipe struct { *mgo.Pipe cfg *mongoConfig tags map[string]string } // Iter invokes and traces Pipe.Iter func (p *Pipe) Iter() *Iter { span := newChildSpanFromContext(p.cfg, p.tags) iter := p.Pipe.Iter() span.Finish() return &Iter{ Iter: iter, cfg: p.cfg, tags: p.tags, } } // All invokes and traces Pipe.All func (p *Pipe) All(result interface{}) error { return p.Iter().All(result) } // One invokes and traces Pipe.One func (p *Pipe) One(result interface{}) (err error) { span := newChildSpanFromContext(p.cfg, p.tags) defer span.Finish(tracer.WithError(err)) err = p.Pipe.One(result) return } // Explain invokes and traces Pipe.Explain func (p *Pipe) Explain(result interface{}) (err error) { span := newChildSpanFromContext(p.cfg, p.tags) defer span.Finish(tracer.WithError(err)) err = p.Pipe.Explain(result) return }
mit
enlight/blender-bind-armatures
bind_armatures.py
12449
#------------------------------------------------------------------------------- # The MIT License (MIT) # # Copyright (c) 2014 Vadim Macagon # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. #------------------------------------------------------------------------------- # <pep8 compliant> import bpy bl_info = { "name": "Bind Armatures", "author": "Vadim Macagon", "version": (0, 1), "blender": (2, 6, 9), "category": "Rigging", "description": "Hooks up a simple game-ready armature to a Rigify or advanced MakeHuman armature." } # mapping of game rig deform bones to Rigify deform bones, the game rig layout is similar # to the standard Unity3d Mecanim layout (minus the mouth/eye bones since I don't have any # use for them yet) rigify_bone_map = { "hips": "DEF-hips", "spine": "DEF-spine", "chest": "DEF-chest", "chest-1": "DEF-chest-1", "neck": "DEF-neck", "head": "DEF-head", "shoulder.L": "DEF-shoulder.L", "upper_arm.L": "DEF-upper_arm.01.L", "forearm.L": "DEF-forearm.01.L", "hand.L": "DEF-hand.L", "thumb.01.L": "DEF-thumb.01.L.02", "thumb.02.L": "DEF-thumb.02.L", "thumb.03.L" : "DEF-thumb.03.L", "f_index.01.L": "DEF-f_index.01.L.02", "f_index.02.L": "DEF-f_index.02.L", "f_index.03.L" : "DEF-f_index.03.L", "f_middle.01.L": "DEF-f_middle.01.L.02", "f_middle.02.L": "DEF-f_middle.02.L", "f_middle.03.L": "DEF-f_middle.03.L", "f_ring.01.L": "DEF-f_ring.01.L.02", "f_ring.02.L": "DEF-f_ring.02.L", "f_ring.03.L": "DEF-f_ring.03.L", "f_pinky.01.L": "DEF-f_pinky.01.L.02", "f_pinky.02.L": "DEF-f_pinky.02.L", "f_pinky.03.L": "DEF-f_pinky.03.L", "shoulder.R": "DEF-shoulder.R", "upper_arm.R": "DEF-upper_arm.01.R", "forearm.R": "DEF-forearm.01.R", "hand.R": "DEF-hand.R", "thumb.01.R": "DEF-thumb.01.R.02", "thumb.02.R": "DEF-thumb.02.R", "thumb.03.R" : "DEF-thumb.03.R", "f_index.01.R": "DEF-f_index.01.R.02", "f_index.02.R": "DEF-f_index.02.R", "f_index.03.R" : "DEF-f_index.03.R", "f_middle.01.R": "DEF-f_middle.01.R.02", "f_middle.02.R": "DEF-f_middle.02.R", "f_middle.03.R": "DEF-f_middle.03.R", "f_ring.01.R": "DEF-f_ring.01.R.02", "f_ring.02.R": "DEF-f_ring.02.R", "f_ring.03.R": "DEF-f_ring.03.R", "f_pinky.01.R": "DEF-f_pinky.01.R.02", "f_pinky.02.R": "DEF-f_pinky.02.R", "f_pinky.03.R": "DEF-f_pinky.03.R", "thigh.L": "DEF-thigh.01.L", "shin.L": "DEF-shin.01.L", "foot.L": "DEF-foot.L", "toe.L": "DEF-toe.L", "thigh.R": "DEF-thigh.01.R", "shin.R": "DEF-shin.01.R", "foot.R": "DEF-foot.R", "toe.R": "DEF-toe.R" } # mapping of game rig deform bones to the deform bones in an advanced MakeHuman generated rig, # unfortunately this doesn't work properly because the hips bone of the MakeHuman rig is inverted # (i.e. hips bone points in the opposite direction to the spine bone), also unsure about the # shoulders mhx_bone_map = { "hips": "DEF-hips", "spine": "DEF-spine", "chest": "DEF-chest", "chest-1": "DEF-chest-1", "neck": "DEF-neck", "head": "DEF-head", "shoulder.L": "DEF-clavicle.L", "upper_arm.L": "DEF-upper_arm.L", "forearm.L": "DEF-forearm.01.L", "hand.L": "DEF-hand.L", "thumb.01.L": "DEF-thumb.01.L", "thumb.02.L": "DEF-thumb.02.L", "thumb.03.L" : "DEF-thumb.03.L", "f_index.01.L": "DEF-f_index.01.L", "f_index.02.L": "DEF-f_index.02.L", "f_index.03.L" : "DEF-f_index.03.L", "f_middle.01.L": "DEF-f_middle.01.L", "f_middle.02.L": "DEF-f_middle.02.L", "f_middle.03.L": "DEF-f_middle.03.L", "f_ring.01.L": "DEF-f_ring.01.L", "f_ring.02.L": "DEF-f_ring.02.L", "f_ring.03.L": "DEF-f_ring.03.L", "f_pinky.01.L": "DEF-f_pinky.01.L", "f_pinky.02.L": "DEF-f_pinky.02.L", "f_pinky.03.L": "DEF-f_pinky.03.L", "shoulder.R": "DEF-clavicle.R", "upper_arm.R": "DEF-upper_arm.R", "forearm.R": "DEF-forearm.01.R", "hand.R": "DEF-hand.R", "thumb.01.R": "DEF-thumb.01.R", "thumb.02.R": "DEF-thumb.02.R", "thumb.03.R" : "DEF-thumb.03.R", "f_index.01.R": "DEF-f_index.01.R", "f_index.02.R": "DEF-f_index.02.R", "f_index.03.R" : "DEF-f_index.03.R", "f_middle.01.R": "DEF-f_middle.01.R", "f_middle.02.R": "DEF-f_middle.02.R", "f_middle.03.R": "DEF-f_middle.03.R", "f_ring.01.R": "DEF-f_ring.01.R", "f_ring.02.R": "DEF-f_ring.02.R", "f_ring.03.R": "DEF-f_ring.03.R", "f_pinky.01.R": "DEF-f_pinky.01.R", "f_pinky.02.R": "DEF-f_pinky.02.R", "f_pinky.03.R": "DEF-f_pinky.03.R", "thigh.L": "DEF-thigh.L", "shin.L": "DEF-shin.01.L", "foot.L": "DEF-foot.L", "toe.L": "DEF-toe.L", "thigh.R": "DEF-thigh.R", "shin.R": "DEF-shin.01.R", "foot.R": "DEF-foot.R", "toe.R": "DEF-toe.R" } class BindArmaturesOperator(bpy.types.Operator): """ Hooks up the currently selected game-ready armature (generated by MakeHuman) to a more complex armature (also generated by MakeHuman) which is either a Rigify armature or an advanced MakeHuman armature. Once the armatures are hooked up the game-ready armature can be indirectly animated via the Rigify or MakeHuman controls. """ bl_idname = "armature.bind_armatures" bl_label = "Bind Armatures" bl_options = {'REGISTER', 'UNDO'} target_armature_name = bpy.props.StringProperty( name = "Target Armature", description = "The armature that the currently selected armature should be bound to." ) target_armature_type = bpy.props.EnumProperty( name = "Target Armature Type", description = "The type of the target armature.", items = [ ("rigify", "Rigify", "Humanoid Rigify armature"), ("mhx", "MakeHuman", "Advanced MakeHuman armature") ], default = "rigify" ) # collection of armatures from which the target armature must be chosen available_armatures = bpy.props.CollectionProperty(type = bpy.types.PropertyGroup) bone_maps = { "rigify": rigify_bone_map, "mhx": mhx_bone_map } @classmethod def poll(cls, context): # for this operator to work an armature must be currently selected return ( (context.active_object is not None) and (context.mode == 'OBJECT') and (context.active_object.type == 'ARMATURE') ) def execute(self, context): if self.target_armature_name in bpy.data.armatures: self.bind_rigs( context.active_object, # the simple armature bpy.data.objects[self.target_armature_name], # the complex armature self.bone_maps[self.target_armature_type] ) else: self.report({'ERROR'}, "Target armature not found!") return {'FINISHED'} # initialize the operator from the context def invoke(self, context, event): # collect all the armatures that can be used as targets for the operator self.available_armatures.clear() for obj in bpy.data.objects: if (obj.type == 'ARMATURE') and (context.active_object.name != obj.name): self.available_armatures.add().name = obj.name # display a dialog to let the user set operator properties return context.window_manager.invoke_props_dialog(self, width = 400) # layout the operator properties dialog def draw(self, context): layout = self.layout layout.prop_search(self, "target_armature_name", self, "available_armatures") layout.prop(self, "target_armature_type") def bind_rigs(self, source_rig, target_rig, bone_map): # pose bones should be edited in POSE mode bpy.ops.object.mode_set(mode = 'POSE') for (source_bone_name, target_bone_name) in bone_map.items(): # TODO: check if this constraint already exists (ignore the name), and if so don't # create it again source_bone = source_rig.pose.bones[source_bone_name] constraint = source_bone.constraints.new(type = 'COPY_TRANSFORMS') constraint.name = "Copy Target Bone Transforms" constraint.target = target_rig constraint.subtarget = target_bone_name constraint.owner_space = 'WORLD' constraint.target_space = 'WORLD' bpy.ops.object.mode_set(mode = 'OBJECT') def register(): bpy.utils.register_class(BindArmaturesOperator) def unregister(): bpy.utils.unregister_class(BindArmaturesOperator) # for debugging if __name__ == "__main__": register()
mit
SpongePowered/SpongeAPI
src/main/java/org/spongepowered/api/block/entity/carrier/furnace/Smoker.java
1368
/* * This file is part of SpongeAPI, licensed under the MIT License (MIT). * * Copyright (c) SpongePowered <https://www.spongepowered.org> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.spongepowered.api.block.entity.carrier.furnace; public interface Smoker extends FurnaceBlockEntity { }
mit
LWIRC/LWIRC
src/lwirc/github/io/Main.java
2000
package lwirc.github.io; import java.awt.EventQueue; import java.util.Arrays; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.border.EmptyBorder; public class Main extends JFrame { private JPanel contentPane; private JTextField textField; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Main frame = new Main(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); if (Config.showDebug == true) { System.out.println("Debug info: "); System.out.println("Nick: " + Config.Nick); System.out.println("NickServ Username: " + Config.nickServUser); System.out.println("NickServ Pass: " + Config.nickServPass); System.out.println("Server+Port: " + Config.Server + ":" + Config.Port); System.out.println("Autojoin Channels: " + Arrays.toString(Config.autoJoinChans)); } else { System.out.println("Debug not enabled, not showing."); } } public Main() { // Main Window setTitle("LWIRC: " + Config.Server); setResizable(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 800, 800); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); // Message Textfield textField = new JTextField(); textField.setToolTipText("Message."); textField.setBounds(141, 734, 577, 27); contentPane.add(textField); textField.setColumns(10); // Thing that has your nick. JLabel lblNickHere = new JLabel(Config.Nick); lblNickHere.setBounds(10, 740, 121, 14); contentPane.add(lblNickHere); final JButton btnSend = new JButton("Send"); btnSend.setToolTipText("Sends message in the textbox."); btnSend.setBounds(718, 736, 76, 23); contentPane.add(btnSend); } }
mit
Drixmux/siic
src/SIICBundle/Entity/Categoriabien.php
1567
<?php namespace SIICBundle\Entity; /** * Categoriabien */ class Categoriabien { /** * @var integer */ private $id; /** * @var string */ private $categoria; /** * @var boolean */ private $status; /** * @var \DateTime */ private $createdAt; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set categoria * * @param string $categoria * * @return Categoriabien */ public function setCategoria($categoria) { $this->categoria = $categoria; return $this; } /** * Get categoria * * @return string */ public function getCategoria() { return $this->categoria; } /** * Set status * * @param boolean $status * * @return Categoriabien */ public function setStatus($status) { $this->status = $status; return $this; } /** * Get status * * @return boolean */ public function getStatus() { return $this->status; } /** * Set createdAt * * @param \DateTime $createdAt * * @return Categoriabien */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } }
mit
vladimir-trifonov/hackbg-nodejs
week0/2-Chirper/test-client.js
396
var argv = require('minimist')(process.argv.slice(2)), clientApi = require("./client-api"); var handler = null; Object.keys(argv).some(function(key) { if(argv.hasOwnProperty(key) && key !== "_") { if(clientApi.hasOwnProperty(key)) { handler = clientApi[key]; return true; } } }); if(handler) { handler(argv, function(err) { if(err) { console.log("Err: " + err); } }); }
mit
hsabiti/ziki
src/xabx/ZikiBundle/Entity/PlaylistTracks.php
1450
<?php namespace xabx\ZikiBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * xabx\ZikiBundle\Entity\PlaylistTracks */ class PlaylistTracks { /** * @var integer $playlistId */ private $playlistId; /** * @var integer $trackId */ private $trackId; /** * @var integer $order */ private $order; /** * Set playlistId * * @param integer $playlistId * @return PlaylistTracks */ public function setPlaylistId($playlistId) { $this->playlistId = $playlistId; return $this; } /** * Get playlistId * * @return integer */ public function getPlaylistId() { return $this->playlistId; } /** * Set trackId * * @param integer $trackId * @return PlaylistTracks */ public function setTrackId($trackId) { $this->trackId = $trackId; return $this; } /** * Get trackId * * @return integer */ public function getTrackId() { return $this->trackId; } /** * Set order * * @param integer $order * @return PlaylistTracks */ public function setOrder($order) { $this->order = $order; return $this; } /** * Get order * * @return integer */ public function getOrder() { return $this->order; } }
mit
jquast/blessed
bin/editor.py
8561
#!/usr/bin/env python """ A Dumb full-screen editor. This example program makes use of many context manager methods: :meth:`~.Terminal.hidden_cursor`, :meth:`~.Terminal.raw`, :meth:`~.Terminal.location`, :meth:`~.Terminal.fullscreen`, and :meth:`~.Terminal.keypad`. Early curses work focused namely around writing screen editors, naturally any serious editor would make liberal use of special modes. ``Ctrl - L`` refresh ``Ctrl - C`` quit ``Ctrl - S`` save """ from __future__ import division, print_function # std imports import functools import collections # local from blessed import Terminal # python 2/3 compatibility, provide 'echo' function as an # alias for "print without newline and flush" try: # pylint: disable=invalid-name # Invalid constant name "echo" echo = functools.partial(print, end='', flush=True) echo(u'') except TypeError: # TypeError: 'flush' is an invalid keyword argument for this function import sys def echo(text): """Display ``text`` and flush output.""" sys.stdout.write(u'{}'.format(text)) sys.stdout.flush() def input_filter(keystroke): """ For given keystroke, return whether it should be allowed as input. This somewhat requires that the interface use special application keys to perform functions, as alphanumeric input intended for persisting could otherwise be interpreted as a command sequence. """ if keystroke.is_sequence: # Namely, deny multi-byte sequences (such as '\x1b[A'), return False if ord(keystroke) < ord(u' '): # or control characters (such as ^L), return False return True def echo_yx(cursor, text): """Move to ``cursor`` and display ``text``.""" echo(cursor.term.move_yx(cursor.y, cursor.x) + text) Cursor = collections.namedtuple('Cursor', ('y', 'x', 'term')) def readline(term, width=20): """A rudimentary readline implementation.""" text = u'' while True: inp = term.inkey() if inp.code == term.KEY_ENTER: break elif inp.code == term.KEY_ESCAPE or inp == chr(3): text = None break elif not inp.is_sequence and len(text) < width: text += inp echo(inp) elif inp.code in (term.KEY_BACKSPACE, term.KEY_DELETE): text = text[:-1] # https://utcc.utoronto.ca/~cks/space/blog/unix/HowUnixBackspaces # # "When you hit backspace, the kernel tty line discipline rubs out # your previous character by printing (in the simple case) # Ctrl-H, a space, and then another Ctrl-H." echo(u'\b \b') return text def save(screen, fname): """Save screen contents to file.""" if not fname: return with open(fname, 'w') as fout: cur_row = cur_col = 0 for (row, col) in sorted(screen): char = screen[(row, col)] while row != cur_row: cur_row += 1 cur_col = 0 fout.write(u'\n') while col > cur_col: cur_col += 1 fout.write(u' ') fout.write(char) cur_col += 1 fout.write(u'\n') def redraw(term, screen, start=None, end=None): """Redraw the screen.""" if start is None and end is None: echo(term.clear) start, end = (Cursor(y=min([y for (y, x) in screen or [(0, 0)]]), x=min([x for (y, x) in screen or [(0, 0)]]), term=term), Cursor(y=max([y for (y, x) in screen or [(0, 0)]]), x=max([x for (y, x) in screen or [(0, 0)]]), term=term)) lastcol, lastrow = -1, -1 for row, col in sorted(screen): if start.y <= row <= end.y and start.x <= col <= end.x: if col >= term.width or row >= term.height: # out of bounds continue if row != lastrow or col != lastcol + 1: # use cursor movement echo_yx(Cursor(row, col, term), screen[row, col]) else: # just write past last one echo(screen[row, col]) def main(): """Program entry point.""" def above(csr, offset): return Cursor(y=max(0, csr.y - offset), x=csr.x, term=csr.term) def below(csr, offset): return Cursor(y=min(csr.term.height - 1, csr.y + offset), x=csr.x, term=csr.term) def right_of(csr, offset): return Cursor(y=csr.y, x=min(csr.term.width - 1, csr.x + offset), term=csr.term) def left_of(csr, offset): return Cursor(y=csr.y, x=max(0, csr.x - offset), term=csr.term) def home(csr): return Cursor(y=csr.y, x=0, term=csr.term) def end(csr): return Cursor(y=csr.y, x=csr.term.width - 1, term=csr.term) def bottom(csr): return Cursor(y=csr.term.height - 1, x=csr.x, term=csr.term) def center(csr): return Cursor(csr.term.height // 2, csr.term.width // 2, csr.term) def lookup_move(inp_code, csr): return { # arrows, including angled directionals csr.term.KEY_END: below(left_of(csr, 1), 1), csr.term.KEY_KP_1: below(left_of(csr, 1), 1), csr.term.KEY_DOWN: below(csr, 1), csr.term.KEY_KP_2: below(csr, 1), csr.term.KEY_PGDOWN: below(right_of(csr, 1), 1), csr.term.KEY_LR: below(right_of(csr, 1), 1), csr.term.KEY_KP_3: below(right_of(csr, 1), 1), csr.term.KEY_LEFT: left_of(csr, 1), csr.term.KEY_KP_4: left_of(csr, 1), csr.term.KEY_CENTER: center(csr), csr.term.KEY_KP_5: center(csr), csr.term.KEY_RIGHT: right_of(csr, 1), csr.term.KEY_KP_6: right_of(csr, 1), csr.term.KEY_HOME: above(left_of(csr, 1), 1), csr.term.KEY_KP_7: above(left_of(csr, 1), 1), csr.term.KEY_UP: above(csr, 1), csr.term.KEY_KP_8: above(csr, 1), csr.term.KEY_PGUP: above(right_of(csr, 1), 1), csr.term.KEY_KP_9: above(right_of(csr, 1), 1), # shift + arrows csr.term.KEY_SLEFT: left_of(csr, 10), csr.term.KEY_SRIGHT: right_of(csr, 10), csr.term.KEY_SDOWN: below(csr, 10), csr.term.KEY_SUP: above(csr, 10), # carriage return csr.term.KEY_ENTER: home(below(csr, 1)), }.get(inp_code, csr) term = Terminal() csr = Cursor(0, 0, term) screen = {} with term.hidden_cursor(), \ term.raw(), \ term.location(), \ term.fullscreen(), \ term.keypad(): inp = None while True: echo_yx(csr, term.reverse(screen.get((csr.y, csr.x), u' '))) inp = term.inkey() if inp == chr(3): # ^c exits break elif inp == chr(19): # ^s saves echo_yx(home(bottom(csr)), term.ljust(term.bold_white(u'Filename: '))) echo_yx(right_of(home(bottom(csr)), len(u'Filename: ')), u'') save(screen, readline(term)) echo_yx(home(bottom(csr)), term.clear_eol) redraw(term=term, screen=screen, start=home(bottom(csr)), end=end(bottom(csr))) continue elif inp == chr(12): # ^l refreshes redraw(term=term, screen=screen) else: n_csr = lookup_move(inp.code, csr) if n_csr != csr: # erase old cursor, echo_yx(csr, screen.get((csr.y, csr.x), u' ')) csr = n_csr elif input_filter(inp): echo_yx(csr, inp) screen[(csr.y, csr.x)] = inp.__str__() n_csr = right_of(csr, 1) if n_csr == csr: # wrap around margin n_csr = home(below(csr, 1)) csr = n_csr if __name__ == '__main__': main()
mit
mikeek/FIT
IIS/proj_1/intra/user/reservation.php
3281
<?php include_once("session_check.php"); include("new_rezervation.php"); ?> <html lang="en"> <?php include_once("head.php"); ?> <link href="../../css/jquery-ui-1.10.1.min.css" rel="stylesheet" /> <body class="reservation"> <?php include_once("top_navbar.php"); ?> <div class="container-fluid"> <div class="row"> <?php include_once("left_navbar.php") ?> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <h1 class="page-header">Rezervace pokoje</h1> <?php include_once("../status.php"); ?> <!-- Reservation form --> <form class="form-horizontal" role="form" method="post" action="reservation.php"> <fieldset> <!-- FROM --> <div class="form-group"> <label class="col-md-4 control-label" for="from">od - do</label> <div class="col-md-2"> <input id="from" name="from" placeholder="dd.mm.yyyy" type="date" class="form-control input-md" required> </div> <div class="col-md-2"> <input id="to" name="to" placeholder="dd.mm.yyyy" type="date" class="form-control input-md" required> </div> </div> <!-- Room type --> <div class="form-group"> <label class="col-md-4 control-label" for="room">Pokoj</label> <div class="col-md-4"> <?php require("../connectDB.php"); $result = mysql_query("SELECT DISTINCT(typ) FROM Izba") or die(mysql_error()); ?> <select id="room" name="room" class="form-control" required> <option>Vyberte typ pokoje</option> <?php $counter = 1; while($row = mysql_fetch_array($result)) { echo ' <option value="' . $counter .'">' . $row['typ'] . '</option>'; $counter++; } ?> </select> </div> </div> <!-- Note --> <div class="form-group"> <label class="col-md-4 control-label" for="note">Poznámka</label> <div class="col-md-4"> <textarea class="form-control" id="note" name="note"></textarea> </div> </div> <!-- Submit --> <div class="form-group"> <label class="col-md-4 control-label" for="submit"></label> <div class="col-md-4"> <button id="submit" name="submit" class="btn btn-success">Potvrdit rezervaci</button> </div> </div> </fieldset> </form> </div> </div> </div> <!-- Bootstrap core JavaScript ================================================== --> <!-- Placed at the end of the document so the pages load faster --> <?php include_once("scripts.php"); ?> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> <script src="../../js/jquery-1.9.1.min.js"></script> <script src="../../js/jquery-ui-1.10.1.min.js"></script> <script src="../../js/modernizr-2.6.2.min.js"></script> <script> if (!Modernizr.inputtypes.date) { $('input[type=date]').datepicker({ dateFormat: 'dd.mm.yy' }); } </script> </body> </html>
mit
stof/manager
tests/Api/Php/ClazzTest.php
18153
<?php /* * This file is part of the puli/manager package. * * (c) Bernhard Schussek <bschussek@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Puli\Manager\Tests\Api\Php; use PHPUnit_Framework_TestCase; use Puli\Manager\Api\Php\Clazz; use Puli\Manager\Api\Php\Import; use Puli\Manager\Api\Php\Method; use Webmozart\PathUtil\Path; /** * @since 1.0 * @author Bernhard Schussek <bschussek@gmail.com> */ class ClazzTest extends PHPUnit_Framework_TestCase { /** * @var Clazz */ private $class; protected function setUp() { $this->class = new Clazz('Puli\MyClass'); } public function testGetClassName() { $this->assertSame('Puli\MyClass', $this->class->getClassName()); } public function testSetClassNameWithNamespace() { $this->class->setClassName('Puli\MyClass'); $this->assertSame('Puli\MyClass', $this->class->getClassName()); $this->assertSame('MyClass', $this->class->getShortClassName()); $this->assertSame('Puli', $this->class->getNamespaceName()); } public function testSetClassNameWithoutNamespace() { $this->class->setClassName('MyClass'); $this->assertSame('MyClass', $this->class->getClassName()); $this->assertSame('MyClass', $this->class->getShortClassName()); $this->assertSame('', $this->class->getNamespaceName()); } public function testSetClassNameWithRootNamespace() { $this->class->setClassName('\MyClass'); $this->assertSame('MyClass', $this->class->getClassName()); $this->assertSame('MyClass', $this->class->getShortClassName()); $this->assertSame('', $this->class->getNamespaceName()); } /** * @expectedException \InvalidArgumentException */ public function testSetClassNameFailsIfNull() { $this->class->setClassName(null); } /** * @expectedException \InvalidArgumentException */ public function testSetClassNameFailsIfEmpty() { $this->class->setClassName(''); } /** * @expectedException \InvalidArgumentException */ public function testSetClassNameFailsIfNoString() { $this->class->setClassName(1234); } public function testSetDirectory() { $this->class->setDirectory(__DIR__.'/..'); $this->assertSame(Path::canonicalize(__DIR__.'/..'), $this->class->getDirectory()); } /** * @expectedException \InvalidArgumentException */ public function testSetDirectoryFailsIfNull() { $this->class->setDirectory(null); } /** * @expectedException \InvalidArgumentException */ public function testSetDirectoryFailsIfEmpty() { $this->class->setDirectory(''); } /** * @expectedException \InvalidArgumentException */ public function testSetDirectoryFailsIfNoString() { $this->class->setDirectory(1234); } public function testSetFileName() { $this->class->setFileName('MyFile.php'); $this->assertSame('MyFile.php', $this->class->getFileName()); } /** * @expectedException \InvalidArgumentException */ public function testSetFileNameFailsIfNull() { $this->class->setFileName(null); } /** * @expectedException \InvalidArgumentException */ public function testSetFileNameFailsIfEmpty() { $this->class->setFileName(''); } /** * @expectedException \InvalidArgumentException */ public function testSetFileNameFailsIfNoString() { $this->class->setFileName(1234); } public function testGetDefaultFileName() { $this->assertSame('MyClass.php', $this->class->getFileName()); } public function testResetFileName() { $this->class->setFileName('MyFile.php'); $this->class->resetFileName(); $this->assertSame('MyClass.php', $this->class->getFileName()); } public function testGetFilePath() { $this->class->setDirectory(__DIR__); $this->class->setFileName('MyFile.php'); $this->assertSame(__DIR__.'/MyFile.php', $this->class->getFilePath()); } public function testSetFilePath() { $this->class->setFilePath(__DIR__.'/../MyFile.php'); $this->assertSame(Path::canonicalize(__DIR__.'/..'), $this->class->getDirectory()); $this->assertSame('MyFile.php', $this->class->getFileName()); } /** * @expectedException \InvalidArgumentException */ public function testSetFilePathFailsIfNull() { $this->class->setFilePath(null); } /** * @expectedException \InvalidArgumentException */ public function testSetFilePathFailsIfEmpty() { $this->class->setFilePath(''); } /** * @expectedException \InvalidArgumentException */ public function testSetFilePathFailsIfNoString() { $this->class->setFilePath(1234); } public function testSetParentClass() { $this->class->setParentClass('stdClass'); $this->assertSame('stdClass', $this->class->getParentClass()); } /** * @expectedException \InvalidArgumentException */ public function testSetParentClassFailsIfNull() { $this->class->setParentClass(null); } /** * @expectedException \InvalidArgumentException */ public function testSetParentClassFailsIfEmpty() { $this->class->setParentClass(''); } /** * @expectedException \InvalidArgumentException */ public function testSetParentClassFailsIfNoString() { $this->class->setParentClass(1234); } public function testRemoveParentClass() { $this->class->setParentClass('stdClass'); $this->class->removeParentClass(); $this->assertNull($this->class->getParentClass()); } public function testHasParentClass() { $this->assertFalse($this->class->hasParentClass()); $this->class->setParentClass('stdClass'); $this->assertTrue($this->class->hasParentClass()); $this->class->removeParentClass(); $this->assertFalse($this->class->hasParentClass()); } public function testAddImplementedInterface() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->addImplementedInterface('Countable'); $this->assertSame(array( 'IteratorAggregate', 'Countable', ), $this->class->getImplementedInterfaces()); } /** * @expectedException \InvalidArgumentException */ public function testAddImplementedInterfaceFailsIfNull() { $this->class->addImplementedInterface(null); } /** * @expectedException \InvalidArgumentException */ public function testAddImplementedInterfaceFailsIfEmpty() { $this->class->addImplementedInterface(''); } /** * @expectedException \InvalidArgumentException */ public function testAddImplementedInterfaceFailsIfNoString() { $this->class->addImplementedInterface(1234); } public function testAddImplementedInterfaces() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->addImplementedInterfaces(array('Countable', 'ArrayAccess')); $this->assertSame(array( 'IteratorAggregate', 'Countable', 'ArrayAccess', ), $this->class->getImplementedInterfaces()); } public function testSetImplementedInterfaces() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->setImplementedInterfaces(array('Countable', 'ArrayAccess')); $this->assertSame(array( 'Countable', 'ArrayAccess', ), $this->class->getImplementedInterfaces()); } public function testRemoveImplementedInterface() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->addImplementedInterface('Countable'); $this->class->removeImplementedInterface('IteratorAggregate'); $this->assertSame(array('Countable'), $this->class->getImplementedInterfaces()); } public function testRemoveImplementedInterfaceIgnoresUnknownInterface() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->addImplementedInterface('Countable'); $this->class->removeImplementedInterface('Foobar'); $this->assertSame(array( 'IteratorAggregate', 'Countable', ), $this->class->getImplementedInterfaces()); } public function testClearImplementedInterfaces() { $this->class->addImplementedInterface('IteratorAggregate'); $this->class->addImplementedInterface('Countable'); $this->class->clearImplementedInterfaces(); $this->assertSame(array(), $this->class->getImplementedInterfaces()); } public function testHasImplementedInterfaces() { $this->assertFalse($this->class->hasImplementedInterfaces()); $this->class->addImplementedInterface('IteratorAggregate'); $this->assertTrue($this->class->hasImplementedInterfaces()); $this->class->removeImplementedInterface('IteratorAggregate'); $this->assertFalse($this->class->hasImplementedInterfaces()); } public function testAddImport() { $this->class->addImport($iterator = new Import('IteratorAggregate')); $this->class->addImport($countable = new Import('Countable')); // Result is sorted $this->assertSame(array( 'Countable' => $countable, 'IteratorAggregate' => $iterator, ), $this->class->getImports()); } public function testAddImportIgnoresDuplicateImports() { $this->class->addImport($iterator = new Import('IteratorAggregate')); $this->class->addImport(new Import('IteratorAggregate')); $this->assertSame(array( 'IteratorAggregate' => $iterator, ), $this->class->getImports()); } public function testAddImportSucceedsIfDuplicatedSymbolHasAlias() { $this->class->addImport($countable1 = new Import('Countable')); $this->class->addImport($countable2 = new Import('Acme\Countable', 'Alias')); $this->assertSame(array( 'Acme\Countable' => $countable2, 'Countable' => $countable1, ), $this->class->getImports()); } /** * @expectedException \RuntimeException */ public function testAddImportFailsIfShortClassClashesWithExistingClass() { $this->class->addImport(new Import('Countable')); $this->class->addImport(new Import('Acme\Countable')); } /** * @expectedException \RuntimeException */ public function testAddImportFailsIfShortClassClashesWithExistingAlias() { $this->class->addImport(new Import('MyClass', 'Countable')); $this->class->addImport(new Import('Acme\Countable')); } /** * @expectedException \RuntimeException */ public function testAddImportFailsIfAliasClashesWithExistingClass() { $this->class->addImport(new Import('Countable')); $this->class->addImport(new Import('Acme\MyClass', 'Countable')); } public function testAddImports() { $this->class->addImport($iterator = new Import('IteratorAggregate')); $this->class->addImports(array( $countable = new Import('Countable'), $arrayAccess = new Import('ArrayAccess'), )); $this->assertSame(array( 'ArrayAccess' => $arrayAccess, 'Countable' => $countable, 'IteratorAggregate' => $iterator, ), $this->class->getImports()); } public function testSetImports() { $this->class->addImport($iterator = new Import('IteratorAggregate')); $this->class->setImports(array( $countable = new Import('Countable'), $arrayAccess = new Import('ArrayAccess'), )); $this->assertSame(array( 'ArrayAccess' => $arrayAccess, 'Countable' => $countable, ), $this->class->getImports()); } public function testRemoveImport() { $this->class->addImport(new Import('IteratorAggregate')); $this->class->addImport($countable = new Import('Countable')); $this->class->removeImport('IteratorAggregate'); $this->assertSame(array( 'Countable' => $countable, ), $this->class->getImports()); } public function testClearImports() { $this->class->addImport(new Import('IteratorAggregate')); $this->class->addImport(new Import('Countable')); $this->class->clearImports(); $this->assertSame(array(), $this->class->getImports()); } public function testHasImports() { $this->assertFalse($this->class->hasImports()); $this->class->addImport(new Import('IteratorAggregate')); $this->assertTrue($this->class->hasImports()); $this->class->removeImport('IteratorAggregate'); $this->assertFalse($this->class->hasImports()); } public function testAddMethod() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $this->class->addMethod($method1); $this->class->addMethod($method2); $this->assertSame(array( 'doSomething' => $method1, 'doSomethingElse' => $method2, ), $this->class->getMethods()); $this->assertSame($this->class, $method1->getClass()); $this->assertSame($this->class, $method2->getClass()); } /** * @expectedException \RuntimeException */ public function testAddMethodFailsIfDuplicate() { $this->class->addMethod(new Method('doSomething')); $this->class->addMethod(new Method('doSomething')); } public function testAddMethods() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $method3 = new Method('doAnotherThing'); $this->class->addMethod($method1); $this->class->addMethods(array($method2, $method3)); $this->assertSame(array( 'doSomething' => $method1, 'doSomethingElse' => $method2, 'doAnotherThing' => $method3, ), $this->class->getMethods()); } public function testSetMethods() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $method3 = new Method('doAnotherThing'); $this->class->addMethod($method1); $this->class->setMethods(array($method2, $method3)); $this->assertSame(array( 'doSomethingElse' => $method2, 'doAnotherThing' => $method3, ), $this->class->getMethods()); } public function testRemoveMethod() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $this->class->addMethod($method1); $this->class->addMethod($method2); $this->class->removeMethod('doSomething'); $this->assertSame(array( 'doSomethingElse' => $method2, ), $this->class->getMethods()); } public function testRemoveMethodIgnoresUnknownMethod() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $this->class->addMethod($method1); $this->class->addMethod($method2); $this->class->removeMethod('foobar'); $this->assertSame(array( 'doSomething' => $method1, 'doSomethingElse' => $method2, ), $this->class->getMethods()); } public function testClearMethods() { $method1 = new Method('doSomething'); $method2 = new Method('doSomethingElse'); $this->class->addMethod($method1); $this->class->addMethod($method2); $this->class->clearMethods(); $this->assertSame(array(), $this->class->getMethods()); } public function testGetMethod() { $this->class->addMethod($method = new Method('doSomething')); $this->assertSame($method, $this->class->getMethod('doSomething')); } /** * @expectedException \OutOfBoundsException * @expectedExceptionMessage foobar */ public function testGetMethodFailsIfNotFound() { $this->class->getMethod('foobar'); } public function testHasMethod() { $this->assertFalse($this->class->hasMethod('doSomething')); $this->class->addMethod(new Method('doSomething')); $this->assertTrue($this->class->hasMethod('doSomething')); $this->class->removeMethod('doSomething'); $this->assertFalse($this->class->hasMethod('doSomething')); } public function testHasMethods() { $this->assertFalse($this->class->hasMethods()); $this->class->addMethod(new Method('doSomething')); $this->assertTrue($this->class->hasMethods()); $this->class->removeMethod('doSomething'); $this->assertFalse($this->class->hasMethods()); } public function testSetDescription() { $this->class->setDescription('The description'); $this->assertSame('The description', $this->class->getDescription()); } /** * @expectedException \InvalidArgumentException */ public function testSetDescriptionFailsIfNull() { $this->class->setDescription(null); } /** * @expectedException \InvalidArgumentException */ public function testSetDescriptionFailsIfEmpty() { $this->class->setDescription(''); } /** * @expectedException \InvalidArgumentException */ public function testSetDescriptionFailsIfNoString() { $this->class->setDescription(1234); } }
mit
chrisenytc/liv-api
api/__init__.py
2673
# -*- coding: utf-8 -*- """" ProjectName: liv-api Repo: https://github.com/chrisenytc/liv-api Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ # version __version__ = '0.2.0' # Dependencies import os from api.config.development import Development from api.config.production import Production from api.config.test import Test from api.errors.invalid_request import InvalidRequest from flask import Flask from flask import jsonify as JSON from flask_mail import Mail from mongoengine import connect # Start Flesk app = Flask('liv') # Configs env = os.environ.get('PY_ENV', 'development') if env == 'development': app.config.from_object(Development) elif env == 'production': app.config.from_object(Production) elif env == 'test': app.config.from_object(Test) else: print 'Environment not found' # Debug mode app.debug = app.config['API']['debug'] app.config.update( # EMAIL SETTINGS MAIL_SERVER='smtp.gmail.com', MAIL_PORT=465, MAIL_USE_SSL=True, MAIL_USERNAME=app.config['MAIL']['email'], MAIL_PASSWORD=app.config['MAIL']['password'], MAIL_DEFAULT_SENDER='Liv <%s>' % app.config['MAIL']['email'] ) # Start MailApp mail = Mail(app) # Connect on mongodb connect('pydemi', host=os.environ.get('MONGOLAB_URI') or os.environ.get('MONGOHQ_URL') or app.config['DATABASE']['uri']) @app.errorhandler(Exception) def handle_all_errors(error): try: response = JSON(error=error.to_dict().get('__all__')) except Exception: response = JSON(error=str(error)) response.status_code = 500 return response @app.errorhandler(InvalidRequest) def handle_invalid_request(error): response = JSON(error.to_dict()) response.status_code = error.status_code return response @app.errorhandler(500) def internal_server_error(error): response = JSON(error=str(app.config['ERRORS']['500'])) response.status_code = 500 return response @app.errorhandler(503) def service_unavailable_error(error): response = JSON(error=str(app.config['ERRORS']['503'])) response.status_code = 503 return response @app.errorhandler(400) def bad_request(error): response = JSON(error=str(app.config['ERRORS']['400'])) response.status_code = 400 return response @app.errorhandler(401) def unauthorized(error): response = JSON(error=str(app.config['ERRORS']['401'])) response.status_code = 401 return response @app.errorhandler(404) def page_not_found(error): response = JSON(error=str(app.config['ERRORS']['404'])) response.status_code = 404 return response # Import from api.models import * from api.controllers import *
mit
fieldenms/tg
platform-dao/src/main/java/ua/com/fielden/platform/attachment/AttachmentDao.java
12165
package ua.com.fielden.platform.attachment; import static java.lang.String.format; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Optional.empty; import static java.util.Optional.of; import static ua.com.fielden.platform.attachment.Attachment.HYPERLINK; import static ua.com.fielden.platform.attachment.Attachment.pn_IS_LATEST_REV; import static ua.com.fielden.platform.attachment.Attachment.pn_LAST_MODIFIED; import static ua.com.fielden.platform.attachment.Attachment.pn_LAST_REVISION; import static ua.com.fielden.platform.attachment.Attachment.pn_MIME; import static ua.com.fielden.platform.attachment.Attachment.pn_ORIG_FILE_NAME; import static ua.com.fielden.platform.attachment.Attachment.pn_PREV_REVISION; import static ua.com.fielden.platform.attachment.Attachment.pn_REV_NO; import static ua.com.fielden.platform.attachment.Attachment.pn_SHA1; import static ua.com.fielden.platform.attachment.Attachment.pn_TITLE; import static ua.com.fielden.platform.entity.AbstractEntity.DESC; import static ua.com.fielden.platform.entity.query.fluent.EntityQueryUtils.select; import static ua.com.fielden.platform.error.Result.failure; import static ua.com.fielden.platform.error.Result.successful; import static ua.com.fielden.platform.utils.CollectionUtil.setOf; import static ua.com.fielden.platform.utils.EntityUtils.equalsEx; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Collection; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.io.IOUtils; import org.apache.log4j.Logger; import com.google.inject.Inject; import com.google.inject.name.Named; import ua.com.fielden.platform.attachment.validators.CanBeUsedAsPrevAttachmentRev; import ua.com.fielden.platform.cypher.HexString; import ua.com.fielden.platform.dao.CommonEntityDao; import ua.com.fielden.platform.dao.annotations.SessionRequired; import ua.com.fielden.platform.entity.annotation.EntityType; import ua.com.fielden.platform.entity.fetch.IFetchProvider; import ua.com.fielden.platform.entity.query.IFilter; import ua.com.fielden.platform.entity.query.fluent.fetch; import ua.com.fielden.platform.error.Result; import ua.com.fielden.platform.reflection.Reflector; import ua.com.fielden.platform.security.Authorise; import ua.com.fielden.platform.security.tokens.attachment.AttachmentDownload_CanExecute_Token; import ua.com.fielden.platform.security.tokens.attachment.Attachment_CanDelete_Token; import ua.com.fielden.platform.security.tokens.attachment.Attachment_CanSave_Token; import ua.com.fielden.platform.types.Hyperlink; @EntityType(Attachment.class) public class AttachmentDao extends CommonEntityDao<Attachment> implements IAttachment { private static final Logger LOGGER = Logger.getLogger(AttachmentDao.class); private static final String KEY_MEMBER_SEPARATOR = Reflector.getKeyMemberSeparator(Attachment.class); private final String attachmentsLocation; @Inject protected AttachmentDao( final IFilter filter, final @Named("attachments.location") String attachmentsLocation) { super(filter); this.attachmentsLocation = attachmentsLocation; } @Override @Authorise(AttachmentDownload_CanExecute_Token.class) public Optional<File> asFile(final Attachment attachment) { final File file = new File(attachmentsLocation + File.separatorChar + attachment.getSha1()); return file.canRead() ? of(file) : empty(); } @Override @SessionRequired @Authorise(Attachment_CanSave_Token.class) public Attachment save(final Attachment attachment) { attachment.isValid().ifFailure(Result::throwRuntime); // check if prev. revision was specified // this would indicate that document revision process is at play... final boolean revisionHistoryModified = attachment.getPrevRevision() != null && attachment.getProperty(pn_PREV_REVISION).isDirty(); final Attachment savedAttachment = super.save(attachment); if (revisionHistoryModified) { updateAttachmentRevisionHistory(savedAttachment).ifFailure(Result::throwRuntime); return findByEntityAndFetch(getFetchProvider().fetchModel(), savedAttachment); } else { return savedAttachment; } } /** * Overridden to provide special handling of partial searches, which is especially important for ad hoc created hyperlink-attachments. */ @Override @SessionRequired public Attachment findByKeyAndFetch(final boolean filtered, final fetch<Attachment> fetchModel, final Object... keyValues) { // is this a special case of partial match by title? if (keyValues != null && keyValues.length == 1 && keyValues[0] instanceof String) { final String[] keys = ((String) keyValues[0]).split(KEY_MEMBER_SEPARATOR); final String potentialUri = keys[0].trim(); return newAsHyperlink(potentialUri).orElse(null); } // otherwise, proceed as usual return super.findByKeyAndFetch(filtered, fetchModel, keyValues); } @Override public Attachment new_() { return super.new_().setRevNo(0); } @Override @SessionRequired public Optional<Attachment> newAsHyperlink(final String potentialUri) { final Result result = Hyperlink.validate(potentialUri); if (result.isSuccessful()) { try { // create SHA1 from URI final MessageDigest md = MessageDigest.getInstance("SHA1"); md.update(potentialUri.getBytes(UTF_8)); final byte[] digest = md.digest(); final String sha1 = HexString.bufferToHex(digest, 0, digest.length); return Optional.of(new_() .setTitle(potentialUri) .setSha1(sha1) .setOrigFileName(HYPERLINK)); } catch (final NoSuchAlgorithmException e) { return Optional.empty(); } } return Optional.empty(); } /** * Ensures correct revision history, including revision numbering and references. * * @param savedAttachment * @param revNoIncBy * @return */ private Result updateAttachmentRevisionHistory(final Attachment savedAttachment) { if (savedAttachment.isDirty()) { return failure("Attachment revision history can only be updated for persisted attachments."); } // if last revision is not populated or references itself then the saved attachment represents the latest revision // this means that prev. revision needs to have its last revision updated if (savedAttachment.getLastRevision() == null || equalsEx(savedAttachment, savedAttachment.getLastRevision())) { final Attachment prevRev = findByEntityAndFetch(getFetchProvider().fetchModel(), savedAttachment.getPrevRevision()); super.save(prevRev.setLastRevision(savedAttachment)); super.save(savedAttachment.setLastRevision(savedAttachment)); return Result.successful(savedAttachment); } else { // otherwise, this is the case of joining two revision histories or the case of updating the history from the tail-end -- both are handled identically final Attachment lastRev = co(Attachment.class).findByEntityAndFetch(getFetchProvider().fetchModel(), savedAttachment.getLastRevision()); return traverseAndUpdateHistory(lastRev, lastRev, /* sha1Checksums = */ setOf()); } } private Result traverseAndUpdateHistory(final Attachment lastRev, final Attachment tracedRevision, final Set<String> sha1Checksums) { if (tracedRevision == null) { return successful(tracedRevision); } else { if (sha1Checksums.contains(tracedRevision.getSha1())) { return failure(format(CanBeUsedAsPrevAttachmentRev.ERR_DUPLICATE_SHA1, tracedRevision.getSha1())); } sha1Checksums.add(tracedRevision.getSha1()); final Result res = traverseAndUpdateHistory(lastRev, tracedRevision.getPrevRevision() != null ? co(Attachment.class).findByEntityAndFetch(getFetchProvider().fetchModel(), tracedRevision.getPrevRevision()) : null, sha1Checksums); if (!res.isSuccessful()) { return res; } try { final Attachment attachmentToUpdate = findByEntityAndFetch(getFetchProvider().fetchModel(), tracedRevision); if (attachmentToUpdate.getPrevRevision() != null) { attachmentToUpdate.setRevNo(attachmentToUpdate.getPrevRevision().getRevNo() + 1); } attachmentToUpdate.beginLastRevisionUpdate().setLastRevision(lastRev).endLastRevisionUpdate(); return successful(super.save(attachmentToUpdate)); } catch (final Result ex) { return ex; } catch (final Exception ex) { return failure(ex); } } } @Override protected IFetchProvider<Attachment> createFetchProvider() { return super.createFetchProvider().with( DESC, pn_TITLE, pn_SHA1, pn_ORIG_FILE_NAME, pn_REV_NO, pn_PREV_REVISION, pn_PREV_REVISION + "." + pn_REV_NO, pn_PREV_REVISION + "." + pn_LAST_REVISION, pn_LAST_REVISION, pn_LAST_MODIFIED, pn_MIME, pn_IS_LATEST_REV); } public byte[] download(final Attachment attachment) { final File file = asFile(attachment).orElseThrow(() -> failure(format("Could not access file for attachment [%s].", attachment))); try (FileInputStream is = new FileInputStream(file)) { return IOUtils.toByteArray(is); } catch (final IOException e) { throw failure(e); } } /** * Deletes attachments and associated with them files one by one. * In case of an exception, all attachments and associated files that were deleted during this call before it occurred are not rolled back. * <p> * This method should not be annotated with {@link SessionRequired} to ensure consistency of deleted attachments and associated with them files. */ @Override @Authorise(Attachment_CanDelete_Token.class) public int batchDelete(final Collection<Long> ids) { final AtomicInteger count = new AtomicInteger(0); try { ids.stream() .map(id -> findById(id, createFetchProvider().fetchModel())) .filter(Objects::nonNull) .forEach(att -> { delete(att); count.incrementAndGet(); }); } catch (final Exception ex) { final String msg = format("Deleted %s of %s attachments. Error occurred. <p>Cause: %s", count.get(), ids.size(), ex.getMessage()); LOGGER.error(msg, ex); throw failure(msg); } return count.get(); } @Override @SessionRequired @Authorise(Attachment_CanDelete_Token.class) public void delete(final Attachment attachment) { // first delete the attachment record defaultDelete(attachment); // and then try deleting the associated file if there are no other attachments referencing it if (0 == count(select(Attachment.class).where().prop(Attachment.pn_SHA1).eq().val(attachment.getSha1()).model())) { asFile(attachment).ifPresent(file -> { final Path path = Paths.get(file.toURI()); try { Files.deleteIfExists(path); } catch (final IOException ex) { throw failure(ex); } }); } } }
mit
viking/collect-js
test/js/models/test_forms.js
1294
define([ 'lib/test', 'lib/sinon', 'lib/maria', 'model', 'models/forms', 'models/form' ], function(test, sinon, maria, Model, FormsModel, FormModel) { return new test.Suite('FormsModel', { 'validates form name uniqueness': sinon.test(function() { var form = new FormModel(); var forms = new FormsModel(); forms.add(form); this.stub(form, 'validatesUnique'); form.isValid(); this.assertCalledWith(form.validatesUnique, 'name', forms); }), 'validates form id uniqueness': sinon.test(function() { var form = new FormModel(); var forms = new FormsModel(); forms.add(form); this.stub(form, 'validatesUnique'); form.isValid(); this.assertCalledWith(form.validatesUnique, 'id', forms); }), 'validating invalid object': sinon.test(function() { var forms = new FormsModel(); var model = new Model(); maria.on(model, 'validate', forms, 'onValidateForm'); this.stub(model, 'addError'); this.assertException(function() { model.isValid(); }); }), 'adding invalid object': function() { var forms = new FormsModel(); var model = new Model(); this.assertException(function() { forms.add(model); }); } }); });
mit
jirutka/gitlabhq
spec/javascripts/vue_shared/components/callout_spec.js
1184
import Vue from 'vue'; import callout from '~/vue_shared/components/callout.vue'; import createComponent from 'spec/helpers/vue_mount_component_helper'; describe('Callout Component', () => { let CalloutComponent; let vm; const exampleMessage = 'This is a callout message!'; beforeEach(() => { CalloutComponent = Vue.extend(callout); }); afterEach(() => { vm.$destroy(); }); it('should render the appropriate variant of callout', () => { vm = createComponent(CalloutComponent, { category: 'info', message: exampleMessage, }); expect(vm.$el.getAttribute('class')).toEqual('bs-callout bs-callout-info'); expect(vm.$el.tagName).toEqual('DIV'); }); it('should render accessibility attributes', () => { vm = createComponent(CalloutComponent, { message: exampleMessage, }); expect(vm.$el.getAttribute('role')).toEqual('alert'); expect(vm.$el.getAttribute('aria-live')).toEqual('assertive'); }); it('should render the provided message', () => { vm = createComponent(CalloutComponent, { message: exampleMessage, }); expect(vm.$el.innerHTML.trim()).toEqual(exampleMessage); }); });
mit
almin/almin
packages/almin/src/index.ts
1394
// MIT © 2016-present azu "use strict"; export { Dispatcher } from "./Dispatcher"; export { Store } from "./Store"; export { StoreGroup } from "./UILayer/StoreGroup"; export { UseCase } from "./UseCase"; export { Context } from "./Context"; export { FunctionalUseCaseContext } from "./FunctionalUseCaseContext"; // payload export { Payload } from "./payload/Payload"; export { StoreChangedPayload } from "./payload/StoreChangedPayload"; export { ErrorPayload } from "./payload/ErrorPayload"; export { TransactionBeganPayload } from "./payload/TransactionBeganPayload"; export { TransactionEndedPayload } from "./payload/TransactionEndedPayload"; export { WillNotExecutedPayload } from "./payload/WillNotExecutedPayload"; export { WillExecutedPayload } from "./payload/WillExecutedPayload"; export { DidExecutedPayload } from "./payload/DidExecutedPayload"; export { CompletedPayload } from "./payload/CompletedPayload"; export { DispatcherPayloadMeta } from "./DispatcherPayloadMeta"; export { ChangedPayload } from "./payload/ChangedPayload"; // For TypeScript import * as StoreGroupTypes from "./UILayer/StoreGroupTypes"; export { StoreGroupTypes }; export { UseCaseExecutor } from "./UseCaseExecutor"; export { StoreLike } from "./StoreLike"; export { UseCaseLike } from "./UseCaseLike"; export { AnyPayload } from "./payload/AnyPayload"; export { DispatchedPayload } from "./Dispatcher";
mit
RhoInc/Webcharts
src/table/draw/applyFilters.js
1172
export default function applyFilters() { //If there are filters, return a filtered data array of the raw data. //Otherwise return the raw data. if ( this.filters && this.filters.some( filter => (typeof filter.val === 'string' && !(filter.all === true && filter.index === 0)) || (Array.isArray(filter.val) && filter.val.length < filter.choices.length) ) ) { this.data.filtered = this.data.raw; this.filters .filter( filter => (typeof filter.val === 'string' && !(filter.all === true && filter.index === 0)) || (Array.isArray(filter.val) && filter.val.length < filter.choices.length) ) .forEach(filter => { this.data.filtered = this.data.filtered.filter( d => Array.isArray(filter.val) ? filter.val.indexOf(d[filter.col]) > -1 : filter.val === d[filter.col] ); }); } else this.data.filtered = this.data.raw; }
mit
xieziyu/ngx-amap
src/app/app.component.ts
235
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], }) export class AppComponent { isCollapsed = false; constructor() {} }
mit
Willianvdv/layers
layer_pusher/test/layer_pusher_test.rb
138
require 'test_helper' class LayerPusherTest < ActiveSupport::TestCase test "truth" do assert_kind_of Module, LayerPusher end end
mit
madewithlove/laravel-cqrs-es
src/EventHandling/SimpleReplayingEventBus.php
197
<?php namespace Madewithlove\LaravelCqrsEs\EventHandling; use Broadway\EventHandling\SimpleEventBus; class SimpleReplayingEventBus extends SimpleEventBus implements ReplayingEventBusInterface { }
mit
Stonelinks/js-iksolvers
solvers/pr2_rightarm.cpp
308976
/// autogenerated analytical inverse kinematics code from ikfast program part of OpenRAVE /// \author Rosen Diankov /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// ikfast version 0x10000048 generated on 2015-05-22 19:30:49.293566 /// To compile with gcc: /// gcc -lstdc++ ik.cpp /// To compile without any main function as a shared object (might need -llapack): /// gcc -fPIC -lstdc++ -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -shared -Wl,-soname,libik.so -o libik.so ik.cpp #define IKFAST_HAS_LIBRARY #include "ikfast.h" // found inside share/openrave-X.Y/python/ikfast.h using namespace ikfast; // check if the included ikfast version matches what this file was compiled with #define IKFAST_COMPILE_ASSERT(x) extern int __dummy[(int)x] IKFAST_COMPILE_ASSERT(IKFAST_VERSION==0x10000048); #include <cmath> #include <vector> #include <limits> #include <algorithm> #include <complex> #ifndef IKFAST_ASSERT #include <stdexcept> #include <sstream> #include <iostream> #ifdef _MSC_VER #ifndef __PRETTY_FUNCTION__ #define __PRETTY_FUNCTION__ __FUNCDNAME__ #endif #endif #ifndef __PRETTY_FUNCTION__ #define __PRETTY_FUNCTION__ __func__ #endif #define IKFAST_ASSERT(b) { if( !(b) ) { std::stringstream ss; ss << "ikfast exception: " << __FILE__ << ":" << __LINE__ << ": " <<__PRETTY_FUNCTION__ << ": Assertion '" << #b << "' failed"; throw std::runtime_error(ss.str()); } } #endif #if defined(_MSC_VER) #define IKFAST_ALIGNED16(x) __declspec(align(16)) x #else #define IKFAST_ALIGNED16(x) x __attribute((aligned(16))) #endif #define IK2PI ((IkReal)6.28318530717959) #define IKPI ((IkReal)3.14159265358979) #define IKPI_2 ((IkReal)1.57079632679490) #ifdef _MSC_VER #ifndef isnan #define isnan _isnan #endif #ifndef isinf #define isinf _isinf #endif //#ifndef isfinite //#define isfinite _isfinite //#endif #endif // _MSC_VER // lapack routines extern "C" { void dgetrf_ (const int* m, const int* n, double* a, const int* lda, int* ipiv, int* info); void zgetrf_ (const int* m, const int* n, std::complex<double>* a, const int* lda, int* ipiv, int* info); void dgetri_(const int* n, const double* a, const int* lda, int* ipiv, double* work, const int* lwork, int* info); void dgesv_ (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info); void dgetrs_(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info); void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi,double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info); } using namespace std; // necessary to get std math routines #ifdef IKFAST_NAMESPACE namespace IKFAST_NAMESPACE { #endif inline float IKabs(float f) { return fabsf(f); } inline double IKabs(double f) { return fabs(f); } inline float IKsqr(float f) { return f*f; } inline double IKsqr(double f) { return f*f; } inline float IKlog(float f) { return logf(f); } inline double IKlog(double f) { return log(f); } // allows asin and acos to exceed 1 #ifndef IKFAST_SINCOS_THRESH #define IKFAST_SINCOS_THRESH ((IkReal)2e-6) #endif // used to check input to atan2 for degenerate cases #ifndef IKFAST_ATAN2_MAGTHRESH #define IKFAST_ATAN2_MAGTHRESH ((IkReal)2e-6) #endif // minimum distance of separate solutions #ifndef IKFAST_SOLUTION_THRESH #define IKFAST_SOLUTION_THRESH ((IkReal)1e-6) #endif // there are checkpoints in ikfast that are evaluated to make sure they are 0. This threshold speicfies by how much they can deviate #ifndef IKFAST_EVALCOND_THRESH #define IKFAST_EVALCOND_THRESH ((IkReal)0.000005) #endif inline float IKasin(float f) { IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver if( f <= -1 ) return float(-IKPI_2); else if( f >= 1 ) return float(IKPI_2); return asinf(f); } inline double IKasin(double f) { IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver if( f <= -1 ) return -IKPI_2; else if( f >= 1 ) return IKPI_2; return asin(f); } // return positive value in [0,y) inline float IKfmod(float x, float y) { while(x < 0) { x += y; } return fmodf(x,y); } // return positive value in [0,y) inline double IKfmod(double x, double y) { while(x < 0) { x += y; } return fmod(x,y); } inline float IKacos(float f) { IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver if( f <= -1 ) return float(IKPI); else if( f >= 1 ) return float(0); return acosf(f); } inline double IKacos(double f) { IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver if( f <= -1 ) return IKPI; else if( f >= 1 ) return 0; return acos(f); } inline float IKsin(float f) { return sinf(f); } inline double IKsin(double f) { return sin(f); } inline float IKcos(float f) { return cosf(f); } inline double IKcos(double f) { return cos(f); } inline float IKtan(float f) { return tanf(f); } inline double IKtan(double f) { return tan(f); } inline float IKsqrt(float f) { if( f <= 0.0f ) return 0.0f; return sqrtf(f); } inline double IKsqrt(double f) { if( f <= 0.0 ) return 0.0; return sqrt(f); } inline float IKatan2Simple(float fy, float fx) { return atan2f(fy,fx); } inline float IKatan2(float fy, float fx) { if( isnan(fy) ) { IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned return float(IKPI_2); } else if( isnan(fx) ) { return 0; } return atan2f(fy,fx); } inline double IKatan2Simple(double fy, double fx) { return atan2(fy,fx); } inline double IKatan2(double fy, double fx) { if( isnan(fy) ) { IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned return IKPI_2; } else if( isnan(fx) ) { return 0; } return atan2(fy,fx); } template <typename T> struct CheckValue { T value; bool valid; }; template <typename T> inline CheckValue<T> IKatan2WithCheck(T fy, T fx, T epsilon) { CheckValue<T> ret; ret.valid = false; ret.value = 0; if( !isnan(fy) && !isnan(fx) ) { if( IKabs(fy) >= IKFAST_ATAN2_MAGTHRESH || IKabs(fx) > IKFAST_ATAN2_MAGTHRESH ) { ret.value = IKatan2Simple(fy,fx); ret.valid = true; } } return ret; } inline float IKsign(float f) { if( f > 0 ) { return float(1); } else if( f < 0 ) { return float(-1); } return 0; } inline double IKsign(double f) { if( f > 0 ) { return 1.0; } else if( f < 0 ) { return -1.0; } return 0; } template <typename T> inline CheckValue<T> IKPowWithIntegerCheck(T f, int n) { CheckValue<T> ret; ret.valid = true; if( n == 0 ) { ret.value = 1.0; return ret; } else if( n == 1 ) { ret.value = f; return ret; } else if( n < 0 ) { if( f == 0 ) { ret.valid = false; ret.value = (T)1.0e30; return ret; } if( n == -1 ) { ret.value = T(1.0)/f; return ret; } } int num = n > 0 ? n : -n; if( num == 2 ) { ret.value = f*f; } else if( num == 3 ) { ret.value = f*f*f; } else { ret.value = 1.0; while(num>0) { if( num & 1 ) { ret.value *= f; } num >>= 1; f *= f; } } if( n < 0 ) { ret.value = T(1.0)/ret.value; } return ret; } /// solves the forward kinematics equations. /// \param pfree is an array specifying the free joints of the chain. IKFAST_API void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) { IkReal x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36,x37,x38,x39,x40,x41,x42,x43,x44,x45,x46,x47,x48,x49,x50,x51,x52,x53,x54,x55,x56; x0=IKcos(j[0]); x1=IKcos(j[1]); x2=IKsin(j[3]); x3=IKcos(j[3]); x4=IKsin(j[1]); x5=IKsin(j[2]); x6=IKcos(j[2]); x7=IKsin(j[0]); x8=IKcos(j[4]); x9=IKsin(j[4]); x10=IKsin(j[5]); x11=IKcos(j[5]); x12=IKcos(j[6]); x13=IKsin(j[6]); x14=((1.0)*x10); x15=((1.0)*x9); x16=((0.321)*x6); x17=((1.0)*x7); x18=((1.0)*x11); x19=((1.0)*x6); x20=((0.4)*x1); x21=(x1*x2); x22=(x0*x6); x23=(x2*x4); x24=(x0*x5); x25=((-1.0)*x0); x26=(x3*x4); x27=((-1.0)*x3); x28=(x4*x7); x29=((-1.0)*x2); x30=(x1*x3); x31=(x30*x7); x32=(x1*x5*x8); x33=((1.0)*x0*x21); x34=(x17*x21); x35=(x19*x30); x36=((((-1.0)*x17*x6))+((x24*x4))); x37=((((-1.0)*x17*x4*x6))+x24); x38=(x22+((x28*x5))); x39=((((-1.0)*x23))+x35); x40=((1.0)*x37); x41=((((-1.0)*x17*x5))+(((-1.0)*x0*x19*x4))); x42=(x36*x9); x43=(x38*x9); x44=(x3*x37); x45=(((x19*x21))+(((1.0)*x26))); x46=(x36*x8); x47=(x2*x37); x48=(x38*x8); x49=(x3*x41); x50=((-1.0)*x41); x51=(((x1*x5*x9))+((x8*(((((-1.0)*x35))+x23))))); x52=(((x27*x41))+x33); x53=(x52*x9); x54=(x43+((x8*(((((-1.0)*x21*x7))+x44))))); x55=((((-1.0)*x18*x51))+(((-1.0)*x14*x45))); x56=((((-1.0)*x18*(((((1.0)*x8*(((((-1.0)*x33))+x49))))+(((1.0)*x42))))))+((x14*(((((-1.0)*x25*x30))+(((-1.0)*x29*x41))))))); eerot[0]=(((x11*((((x2*x41))+((x0*x30))))))+((x10*((((x8*((((x21*x25))+x49))))+x42))))); eerot[1]=(((x13*x56))+((x12*((x46+x53))))); eerot[2]=(((x12*x56))+((x13*(((((-1.0)*x46))+(((-1.0)*x53))))))); eetrans[0]=(((x0*x20))+(((0.1)*x0))+(((0.321)*x0*x30))+((x2*(((((-0.321)*x5*x7))+(((-1.0)*x0*x16*x4))))))); eerot[3]=(((x11*((x31+x47))))+((x10*((((x8*(((((-1.0)*x34))+x44))))+x43))))); eerot[4]=((((-1.0)*x13*((((x14*(((((-1.0)*x17*x30))+(((-1.0)*x2*x40))))))+((x18*x54))))))+((x12*((((x9*((((x27*x37))+x34))))+x48))))); eerot[5]=(((x12*(((((-1.0)*x11*x54))+(((-1.0)*x10*((((x29*x37))+((x1*x27*x7))))))))))+(((-1.0)*x13*((((x15*(((((-1.0)*x3*x40))+x34))))+(((1.0)*x48))))))); eetrans[1]=((-0.188)+(((0.1)*x7))+(((0.321)*x31))+((x2*(((((-1.0)*x16*x28))+(((0.321)*x24))))))+((x20*x7))); eerot[6]=(((x10*x51))+(((-1.0)*x11*x45))); eerot[7]=(((x13*x55))+((x12*((x32+((x39*x9))))))); eerot[8]=(((x12*x55))+((x13*(((((-1.0)*x32))+(((-1.0)*x15*x39))))))); eetrans[2]=((((-1.0)*x16*x21))+(((-0.4)*x4))+(((-0.321)*x26))); } IKFAST_API int GetNumFreeParameters() { return 1; } IKFAST_API int* GetFreeParameters() { static int freeparams[] = {2}; return freeparams; } IKFAST_API int GetNumJoints() { return 7; } IKFAST_API int GetIkRealSize() { return sizeof(IkReal); } IKFAST_API int GetIkType() { return 0x67000001; } class IKSolver { public: IkReal j27,cj27,sj27,htj27,j27mul,j28,cj28,sj28,htj28,j28mul,j30,cj30,sj30,htj30,j30mul,j31,cj31,sj31,htj31,j31mul,j32,cj32,sj32,htj32,j32mul,j33,cj33,sj33,htj33,j33mul,j29,cj29,sj29,htj29,new_r00,r00,rxp0_0,new_r01,r01,rxp0_1,new_r02,r02,rxp0_2,new_r10,r10,rxp1_0,new_r11,r11,rxp1_1,new_r12,r12,rxp1_2,new_r20,r20,rxp2_0,new_r21,r21,rxp2_1,new_r22,r22,rxp2_2,new_px,px,npx,new_py,py,npy,new_pz,pz,npz,pp; unsigned char _ij27[2], _nj27,_ij28[2], _nj28,_ij30[2], _nj30,_ij31[2], _nj31,_ij32[2], _nj32,_ij33[2], _nj33,_ij29[2], _nj29; IkReal j100, cj100, sj100; unsigned char _ij100[2], _nj100; bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) { j27=numeric_limits<IkReal>::quiet_NaN(); _ij27[0] = -1; _ij27[1] = -1; _nj27 = -1; j28=numeric_limits<IkReal>::quiet_NaN(); _ij28[0] = -1; _ij28[1] = -1; _nj28 = -1; j30=numeric_limits<IkReal>::quiet_NaN(); _ij30[0] = -1; _ij30[1] = -1; _nj30 = -1; j31=numeric_limits<IkReal>::quiet_NaN(); _ij31[0] = -1; _ij31[1] = -1; _nj31 = -1; j32=numeric_limits<IkReal>::quiet_NaN(); _ij32[0] = -1; _ij32[1] = -1; _nj32 = -1; j33=numeric_limits<IkReal>::quiet_NaN(); _ij33[0] = -1; _ij33[1] = -1; _nj33 = -1; _ij29[0] = -1; _ij29[1] = -1; _nj29 = 0; for(int dummyiter = 0; dummyiter < 1; ++dummyiter) { solutions.Clear(); j29=pfree[0]; cj29=cos(pfree[0]); sj29=sin(pfree[0]), htj29=tan(pfree[0]*0.5); r00 = eerot[0*3+0]; r01 = eerot[0*3+1]; r02 = eerot[0*3+2]; r10 = eerot[1*3+0]; r11 = eerot[1*3+1]; r12 = eerot[1*3+2]; r20 = eerot[2*3+0]; r21 = eerot[2*3+1]; r22 = eerot[2*3+2]; px = eetrans[0]; py = eetrans[1]; pz = eetrans[2]; new_r00=((-1.0)*r02); new_r01=r01; new_r02=r00; new_px=px; new_r10=((-1.0)*r12); new_r11=r11; new_r12=r10; new_py=((0.188)+py); new_r20=((-1.0)*r22); new_r21=r21; new_r22=r20; new_pz=pz; r00 = new_r00; r01 = new_r01; r02 = new_r02; r10 = new_r10; r11 = new_r11; r12 = new_r12; r20 = new_r20; r21 = new_r21; r22 = new_r22; px = new_px; py = new_py; pz = new_pz; IkReal x57=((1.0)*px); IkReal x58=((1.0)*pz); IkReal x59=((1.0)*py); pp=((px*px)+(py*py)+(pz*pz)); npx=(((px*r00))+((py*r10))+((pz*r20))); npy=(((px*r01))+((py*r11))+((pz*r21))); npz=(((px*r02))+((py*r12))+((pz*r22))); rxp0_0=((((-1.0)*r20*x59))+((pz*r10))); rxp0_1=(((px*r20))+(((-1.0)*r00*x58))); rxp0_2=((((-1.0)*r10*x57))+((py*r00))); rxp1_0=((((-1.0)*r21*x59))+((pz*r11))); rxp1_1=(((px*r21))+(((-1.0)*r01*x58))); rxp1_2=((((-1.0)*r11*x57))+((py*r01))); rxp2_0=(((pz*r12))+(((-1.0)*r22*x59))); rxp2_1=(((px*r22))+(((-1.0)*r02*x58))); rxp2_2=((((-1.0)*r12*x57))+((py*r02))); IkReal op[8+1], zeror[8]; int numroots; IkReal x60=((0.2)*px); IkReal x61=((1.0)*pp); IkReal x62=((0.509841)+x60+(((-1.0)*x61))); IkReal x63=((-0.003759)+x60+(((-1.0)*x61))); IkReal x64=(x60+x61); IkReal x65=((0.509841)+(((-1.0)*x64))); IkReal x66=((-0.003759)+(((-1.0)*x64))); IkReal gconst0=x62; IkReal gconst1=x63; IkReal gconst2=x62; IkReal gconst3=x63; IkReal gconst4=x65; IkReal gconst5=x66; IkReal gconst6=x65; IkReal gconst7=x66; IkReal x67=py*py; IkReal x68=sj29*sj29; IkReal x69=px*px; IkReal x70=((1.0)*gconst4); IkReal x71=(gconst5*gconst7); IkReal x72=(gconst0*gconst3); IkReal x73=(gconst1*gconst2); IkReal x74=((2.0)*gconst5); IkReal x75=((1.0)*gconst0); IkReal x76=(gconst1*gconst7); IkReal x77=(gconst0*gconst6); IkReal x78=(gconst1*gconst3); IkReal x79=(gconst4*gconst7); IkReal x80=((2.0)*gconst0); IkReal x81=(gconst1*gconst6); IkReal x82=(gconst0*gconst7); IkReal x83=((2.0)*gconst4); IkReal x84=(gconst3*gconst5); IkReal x85=(gconst2*gconst5); IkReal x86=(gconst3*gconst4); IkReal x87=(gconst2*gconst4); IkReal x88=(gconst4*gconst6); IkReal x89=(gconst5*gconst6); IkReal x90=(gconst0*gconst2); IkReal x91=((1.05513984)*px*py); IkReal x92=(gconst6*x67); IkReal x93=((4.0)*px*py); IkReal x94=((4.0)*x69); IkReal x95=(gconst2*x67); IkReal x96=(py*x68); IkReal x97=((2.0)*x67); IkReal x98=((1.0)*x67); IkReal x99=((0.824328)*x68); IkReal x100=((0.412164)*x68); IkReal x101=(x67*x79); IkReal x102=(x67*x89); IkReal x103=(x67*x85); IkReal x104=(x67*x86); IkReal x105=(x67*x82); IkReal x106=(x67*x81); IkReal x107=((0.0834355125792)*x96); IkReal x108=(x67*x73); IkReal x109=(x67*x72); IkReal x110=(x68*x85); IkReal x111=(x67*x68); IkReal x112=(x71*x98); IkReal x113=(x70*x92); IkReal x114=(x100*x89); IkReal x115=(x87*x93); IkReal x116=(x76*x93); IkReal x117=(x84*x93); IkReal x118=(x77*x93); IkReal x119=(x86*x93); IkReal x120=(x82*x93); IkReal x121=(x85*x93); IkReal x122=(x81*x93); IkReal x123=(x100*x85); IkReal x124=((0.06594624)*x111); IkReal x125=(x76*x98); IkReal x126=(x70*x95); IkReal x127=(x75*x92); IkReal x128=(x100*x81); IkReal x129=(x84*x98); IkReal x130=((0.3297312)*pp*x96); IkReal x131=((0.06594624)*px*x96); IkReal x132=(x75*x95); IkReal x133=(x100*x73); IkReal x134=(x78*x98); IkReal x135=(x108+x109); IkReal x136=(x101+x102); IkReal x137=(x134+x133+x132); IkReal x138=(x113+x112+x114); IkReal x139=(x104+x105+x106+x103); IkReal x140=(x122+x120+x121+x119); IkReal x141=(x117+x116+x115+x118); IkReal x142=(x126+x127+x124+x125+x123+x128+x129); op[0]=(x136+(((-1.0)*x138))); op[1]=((((-1.0)*x107))+x131+x130+(((-1.0)*x91))); op[2]=((((-1.0)*x142))+((x71*x97))+(((-1.0)*x71*x94))+((x79*x94))+((x89*x94))+x139+(((-1.0)*x74*x92))+(((-1.0)*x79*x97))+((x83*x92))+(((-1.0)*x88*x94))+(((-1.0)*x89*x99))); op[3]=((((-1.0)*x141))+((x71*x93))+(((-0.3297312)*gconst5*x96))+x140+(((-1.0)*x79*x93))+((x88*x93))+(((-0.1648656)*gconst2*x96))+(((-0.3297312)*gconst6*x96))+(((-0.1648656)*gconst1*x96))+(((-1.0)*x89*x93))); op[4]=(((x82*x94))+((x81*x94))+(((-1.0)*x77*x94))+(((-0.13189248)*x111))+((x86*x94))+((x85*x94))+x135+x136+((gconst3*x67*x74))+(((-1.0)*x87*x94))+(((-1.0)*x137))+(((-1.0)*x138))+(((-1.0)*x74*x95))+((x76*x97))+(((-1.0)*x76*x94))+(((-1.0)*x84*x94))+(((-1.0)*gconst3*x67*x83))+((x83*x95))+(((-1.0)*x81*x97))+(((-1.0)*x81*x99))+((x77*x97))+(((-1.0)*gconst7*x67*x80))+(((-1.0)*x85*x99))); op[5]=((((-1.0)*x140))+(((-0.1648656)*gconst5*x96))+(((-1.0)*x90*x93))+((x72*x93))+((x73*x93))+x141+(((-1.0)*x78*x93))+(((-0.1648656)*gconst6*x96))+(((-0.3297312)*gconst1*x96))+(((-0.3297312)*gconst2*x96))); op[6]=((((-1.0)*x142))+(((-1.0)*x73*x99))+(((-1.0)*x73*x97))+(((-1.0)*x72*x97))+(((-1.0)*x90*x94))+((x78*x97))+((x72*x94))+((x73*x94))+x139+(((-1.0)*x78*x94))+((x80*x95))); op[7]=((((-1.0)*x107))+x130+(((-1.0)*x131))+x91); op[8]=(x135+(((-1.0)*x137))); polyroots8(op,zeror,numroots); IkReal j27array[8], cj27array[8], sj27array[8], tempj27array[1]; int numsolutions = 0; for(int ij27 = 0; ij27 < numroots; ++ij27) { IkReal htj27 = zeror[ij27]; tempj27array[0]=((2.0)*(atan(htj27))); for(int kj27 = 0; kj27 < 1; ++kj27) { j27array[numsolutions] = tempj27array[kj27]; if( j27array[numsolutions] > IKPI ) { j27array[numsolutions]-=IK2PI; } else if( j27array[numsolutions] < -IKPI ) { j27array[numsolutions]+=IK2PI; } sj27array[numsolutions] = IKsin(j27array[numsolutions]); cj27array[numsolutions] = IKcos(j27array[numsolutions]); numsolutions++; } } bool j27valid[8]={true,true,true,true,true,true,true,true}; _nj27 = 8; for(int ij27 = 0; ij27 < numsolutions; ++ij27) { if( !j27valid[ij27] ) { continue; } j27 = j27array[ij27]; cj27 = cj27array[ij27]; sj27 = sj27array[ij27]; htj27 = IKtan(j27/2); _ij27[0] = ij27; _ij27[1] = -1; for(int iij27 = ij27+1; iij27 < numsolutions; ++iij27) { if( j27valid[iij27] && IKabs(cj27array[ij27]-cj27array[iij27]) < IKFAST_SOLUTION_THRESH && IKabs(sj27array[ij27]-sj27array[iij27]) < IKFAST_SOLUTION_THRESH ) { j27valid[iij27]=false; _ij27[1] = iij27; break; } } { IkReal j28eval[2]; IkReal x143=cj27*cj27; IkReal x144=py*py; IkReal x145=px*px; IkReal x146=pz*pz; IkReal x147=((100.0)*sj29); IkReal x148=(py*sj27); IkReal x149=((4.0)*sj29); IkReal x150=(cj27*px*sj29); IkReal x151=(x143*x145); IkReal x152=(x144*x149); j28eval[0]=((((20.0)*x150))+((x143*x144*x147))+(((-200.0)*x148*x150))+(((-1.0)*x144*x147))+(((-1.0)*sj29))+(((-1.0)*x147*x151))+(((-1.0)*x146*x147))+(((20.0)*sj29*x148))); j28eval[1]=IKsign(((((-1.0)*x152))+(((0.8)*sj29*x148))+(((-0.04)*sj29))+(((-1.0)*x146*x149))+(((0.8)*x150))+(((-1.0)*x149*x151))+(((-8.0)*x148*x150))+((x143*x152)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 ) { { IkReal j30eval[1]; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[3]; bool bgotonextstatement = true; do { IkReal x153=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x153; evalcond[2]=x153; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[2], cj30array[2], sj30array[2]; bool j30valid[2]={false}; _nj30 = 2; cj30array[0]=((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))); if( cj30array[0] >= -1-IKFAST_SINCOS_THRESH && cj30array[0] <= 1+IKFAST_SINCOS_THRESH ) { j30valid[0] = j30valid[1] = true; j30array[0] = IKacos(cj30array[0]); sj30array[0] = IKsin(j30array[0]); cj30array[1] = cj30array[0]; j30array[1] = -j30array[0]; sj30array[1] = -sj30array[0]; } else if( isnan(cj30array[0]) ) { // probably any value will work j30valid[0] = true; cj30array[0] = 1; sj30array[0] = 0; j30array[0] = 0; } for(int ij30 = 0; ij30 < 2; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 2; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal j28eval[3]; sj29=0; cj29=1.0; j29=0; IkReal x154=((321000.0)*cj30); IkReal x155=(py*sj27); IkReal x156=((321000.0)*sj30); IkReal x157=(cj27*px); j28eval[0]=((1.02430295950156)+cj30); j28eval[1]=((IKabs(((((-1.0)*pz*x154))+(((32100.0)*sj30))+(((-400000.0)*pz))+(((-1.0)*x156*x157))+(((-1.0)*x155*x156)))))+(IKabs(((-40000.0)+(((-1.0)*pz*x156))+(((400000.0)*x155))+(((400000.0)*x157))+(((-32100.0)*cj30))+((x154*x157))+((x154*x155)))))); j28eval[2]=IKsign(((263041.0)+(((256800.0)*cj30)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[3]; sj29=0; cj29=1.0; j29=0; IkReal x158=(pz*sj30); IkReal x159=(cj27*px); IkReal x160=(py*sj27); IkReal x161=((10.0)*cj30); IkReal x162=((321.0)*cj30); IkReal x163=((1000.0)*pz); j28eval[0]=((1.24610591900312)+(((-1.0)*x159*x161))+(((-1.0)*x160*x161))+cj30+(((-10.0)*x158))+(((-12.4610591900312)*x160))+(((-12.4610591900312)*x159))); j28eval[1]=((IKabs(((((-100.0)*pz))+(((128.4)*sj30))+((x159*x163))+((x160*x163))+(((103.041)*cj30*sj30)))))+(IKabs(((-160.0)+((pz*x163))+(((-103.041)*(cj30*cj30)))+(((-256.8)*cj30)))))); j28eval[2]=IKsign(((40.0)+(((-400.0)*x160))+(((-1.0)*x159*x162))+(((-1.0)*x160*x162))+(((-400.0)*x159))+(((32.1)*cj30))+(((-321.0)*x158)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[3]; sj29=0; cj29=1.0; j29=0; IkReal x164=cj27*cj27; IkReal x165=py*py; IkReal x166=pz*pz; IkReal x167=px*px; IkReal x168=(cj27*px); IkReal x169=((321.0)*sj30); IkReal x170=(py*sj27); IkReal x171=((321.0)*cj30); IkReal x172=((321.0)*x170); IkReal x173=((200.0)*x170); IkReal x174=(x164*x165); IkReal x175=(x164*x167); j28eval[0]=((-1.0)+(((-100.0)*x166))+(((-100.0)*x165))+(((-100.0)*x175))+(((20.0)*x170))+(((20.0)*x168))+(((-1.0)*x168*x173))+(((100.0)*x174))); j28eval[1]=((IKabs((((pz*x171))+((x168*x169))+((x169*x170))+(((400.0)*pz))+(((-32.1)*sj30)))))+(IKabs(((40.0)+((pz*x169))+(((-400.0)*x168))+(((-400.0)*x170))+(((-1.0)*x170*x171))+(((-1.0)*x168*x171))+(((32.1)*cj30)))))); j28eval[2]=IKsign(((-10.0)+x173+(((-2000.0)*x168*x170))+(((-1000.0)*x166))+(((-1000.0)*x165))+(((-1000.0)*x175))+(((200.0)*x168))+(((1000.0)*x174)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { continue; // no branches [j28] } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x176=py*py; IkReal x177=cj27*cj27; IkReal x178=(cj27*px); IkReal x179=(py*sj27); IkReal x180=((321.0)*cj30); IkReal x181=((321.0)*sj30); IkReal x182=((1000.0)*x177); CheckValue<IkReal> x183=IKPowWithIntegerCheck(IKsign(((-10.0)+((x176*x182))+(((-1.0)*x182*(px*px)))+(((-1000.0)*(pz*pz)))+(((-2000.0)*x178*x179))+(((-1000.0)*x176))+(((200.0)*x179))+(((200.0)*x178)))),-1); if(!x183.valid){ continue; } CheckValue<IkReal> x184 = IKatan2WithCheck(IkReal((((pz*x180))+((x178*x181))+((x179*x181))+(((400.0)*pz))+(((-32.1)*sj30)))),((40.0)+((pz*x181))+(((-1.0)*x178*x180))+(((-400.0)*x178))+(((-400.0)*x179))+(((-1.0)*x179*x180))+(((32.1)*cj30))),IKFAST_ATAN2_MAGTHRESH); if(!x184.valid){ continue; } j28array[0]=((-1.5707963267949)+(((1.5707963267949)*(x183.value)))+(x184.value)); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x185=IKsin(j28); IkReal x186=IKcos(j28); IkReal x187=((0.321)*cj30); IkReal x188=((0.321)*sj30); IkReal x189=(cj27*px); IkReal x190=(py*sj27); IkReal x191=((1.0)*x190); IkReal x192=(pz*x185); IkReal x193=((0.8)*x186); evalcond[0]=(((x186*x188))+(((0.4)*x185))+((x185*x187))+pz); evalcond[1]=(((pz*x186))+((x185*x189))+x188+((x185*x190))+(((-0.1)*x185))); evalcond[2]=((0.1)+((x186*x187))+(((0.4)*x186))+(((-1.0)*x191))+(((-1.0)*x189))+(((-1.0)*x185*x188))); evalcond[3]=((0.4)+(((0.1)*x186))+(((-1.0)*x186*x191))+x192+x187+(((-1.0)*x186*x189))); evalcond[4]=((-0.066959)+(((0.2)*x189))+(((0.2)*x190))+((x189*x193))+(((-1.0)*pp))+((x190*x193))+(((-0.08)*x186))+(((-0.8)*x192))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x645=((321.0)*cj30); IkReal x646=(py*sj27); IkReal x647=(cj27*px); IkReal x648=((1000.0)*pz); CheckValue<IkReal> x649=IKPowWithIntegerCheck(IKsign(((40.0)+(((-321.0)*pz*sj30))+(((-400.0)*x646))+(((-400.0)*x647))+(((-1.0)*x645*x646))+(((-1.0)*x645*x647))+(((32.1)*cj30)))),-1); if(!x649.valid){ continue; } CheckValue<IkReal> x650 = IKatan2WithCheck(IkReal(((((-100.0)*pz))+(((128.4)*sj30))+((x646*x648))+(((103.041)*cj30*sj30))+((x647*x648)))),((-160.0)+((pz*x648))+(((-103.041)*(cj30*cj30)))+(((-256.8)*cj30))),IKFAST_ATAN2_MAGTHRESH); if(!x650.valid){ continue; } j28array[0]=((-1.5707963267949)+(((1.5707963267949)*(x649.value)))+(x650.value)); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x651=IKsin(j28); IkReal x652=IKcos(j28); IkReal x653=((0.321)*cj30); IkReal x654=((0.321)*sj30); IkReal x655=(cj27*px); IkReal x656=(py*sj27); IkReal x657=((1.0)*x656); IkReal x658=(pz*x651); IkReal x659=((0.8)*x652); evalcond[0]=(((x652*x654))+((x651*x653))+(((0.4)*x651))+pz); evalcond[1]=((((-0.1)*x651))+((pz*x652))+((x651*x656))+((x651*x655))+x654); evalcond[2]=((0.1)+(((-1.0)*x651*x654))+(((-1.0)*x655))+((x652*x653))+(((-1.0)*x657))+(((0.4)*x652))); evalcond[3]=((0.4)+x653+x658+(((0.1)*x652))+(((-1.0)*x652*x657))+(((-1.0)*x652*x655))); evalcond[4]=((-0.066959)+(((-0.8)*x658))+(((-1.0)*pp))+((x656*x659))+((x655*x659))+(((-0.08)*x652))+(((0.2)*x656))+(((0.2)*x655))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x660=((321000.0)*cj30); IkReal x661=(py*sj27); IkReal x662=(cj27*px); IkReal x663=((321000.0)*sj30); CheckValue<IkReal> x664=IKPowWithIntegerCheck(IKsign(((263041.0)+(((256800.0)*cj30)))),-1); if(!x664.valid){ continue; } CheckValue<IkReal> x665 = IKatan2WithCheck(IkReal(((((-1.0)*x662*x663))+(((32100.0)*sj30))+(((-1.0)*x661*x663))+(((-400000.0)*pz))+(((-1.0)*pz*x660)))),((-40000.0)+(((-32100.0)*cj30))+(((400000.0)*x661))+(((400000.0)*x662))+((x660*x661))+((x660*x662))+(((-1.0)*pz*x663))),IKFAST_ATAN2_MAGTHRESH); if(!x665.valid){ continue; } j28array[0]=((-1.5707963267949)+(((1.5707963267949)*(x664.value)))+(x665.value)); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x666=IKsin(j28); IkReal x667=IKcos(j28); IkReal x668=((0.321)*cj30); IkReal x669=((0.321)*sj30); IkReal x670=(cj27*px); IkReal x671=(py*sj27); IkReal x672=((1.0)*x671); IkReal x673=(pz*x666); IkReal x674=((0.8)*x667); evalcond[0]=(((x666*x668))+((x667*x669))+(((0.4)*x666))+pz); evalcond[1]=(((x666*x671))+((x666*x670))+((pz*x667))+x669+(((-0.1)*x666))); evalcond[2]=((0.1)+((x667*x668))+(((0.4)*x667))+(((-1.0)*x670))+(((-1.0)*x666*x669))+(((-1.0)*x672))); evalcond[3]=((0.4)+(((-1.0)*x667*x670))+(((0.1)*x667))+(((-1.0)*x667*x672))+x668+x673); evalcond[4]=((-0.066959)+(((-0.08)*x667))+((x671*x674))+(((0.2)*x671))+(((0.2)*x670))+((x670*x674))+(((-1.0)*pp))+(((-0.8)*x673))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x675=(px*sj27); IkReal x676=(cj27*py); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x675+(((-1.0)*x676))); evalcond[2]=(x676+(((-1.0)*x675))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[2], cj30array[2], sj30array[2]; bool j30valid[2]={false}; _nj30 = 2; cj30array[0]=((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))); if( cj30array[0] >= -1-IKFAST_SINCOS_THRESH && cj30array[0] <= 1+IKFAST_SINCOS_THRESH ) { j30valid[0] = j30valid[1] = true; j30array[0] = IKacos(cj30array[0]); sj30array[0] = IKsin(j30array[0]); cj30array[1] = cj30array[0]; j30array[1] = -j30array[0]; sj30array[1] = -sj30array[0]; } else if( isnan(cj30array[0]) ) { // probably any value will work j30valid[0] = true; cj30array[0] = 1; sj30array[0] = 0; j30array[0] = 0; } for(int ij30 = 0; ij30 < 2; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 2; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal j28eval[3]; sj29=0; cj29=-1.0; j29=3.14159265358979; IkReal x677=((321000.0)*cj30); IkReal x678=(py*sj27); IkReal x679=((321000.0)*sj30); IkReal x680=(cj27*px); j28eval[0]=((-1.02430295950156)+(((-1.0)*cj30))); j28eval[1]=IKsign(((-263041.0)+(((-256800.0)*cj30)))); j28eval[2]=((IKabs((((pz*x677))+(((-1.0)*x678*x679))+(((32100.0)*sj30))+(((400000.0)*pz))+(((-1.0)*x679*x680)))))+(IKabs(((40000.0)+(((-400000.0)*x680))+(((-400000.0)*x678))+(((-1.0)*pz*x679))+(((32100.0)*cj30))+(((-1.0)*x677*x680))+(((-1.0)*x677*x678)))))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[3]; sj29=0; cj29=-1.0; j29=3.14159265358979; IkReal x681=(pz*sj30); IkReal x682=(cj27*px); IkReal x683=(py*sj27); IkReal x684=((10.0)*cj30); IkReal x685=((1000.0)*pz); IkReal x686=((321.0)*cj30); j28eval[0]=((-1.24610591900312)+((x682*x684))+((x683*x684))+(((-1.0)*cj30))+(((-10.0)*x681))+(((12.4610591900312)*x683))+(((12.4610591900312)*x682))); j28eval[1]=((IKabs(((((100.0)*pz))+(((128.4)*sj30))+(((-1.0)*x682*x685))+(((-1.0)*x683*x685))+(((103.041)*cj30*sj30)))))+(IKabs(((160.0)+(((103.041)*(cj30*cj30)))+(((256.8)*cj30))+(((-1.0)*pz*x685)))))); j28eval[2]=IKsign(((-40.0)+((x682*x686))+((x683*x686))+(((400.0)*x682))+(((400.0)*x683))+(((-321.0)*x681))+(((-32.1)*cj30)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[3]; sj29=0; cj29=-1.0; j29=3.14159265358979; IkReal x687=cj27*cj27; IkReal x688=py*py; IkReal x689=pz*pz; IkReal x690=px*px; IkReal x691=(cj27*px); IkReal x692=((321.0)*sj30); IkReal x693=(py*sj27); IkReal x694=((321.0)*cj30); IkReal x695=((321.0)*x693); IkReal x696=((200.0)*x693); IkReal x697=(x687*x688); IkReal x698=(x687*x690); j28eval[0]=((-1.0)+(((20.0)*x691))+(((20.0)*x693))+(((-100.0)*x689))+(((-100.0)*x688))+(((-100.0)*x698))+(((100.0)*x697))+(((-1.0)*x691*x696))); j28eval[1]=((IKabs(((40.0)+(((-1.0)*x693*x694))+(((-400.0)*x693))+(((-400.0)*x691))+(((-1.0)*pz*x692))+(((-1.0)*x691*x694))+(((32.1)*cj30)))))+(IKabs((((pz*x694))+(((400.0)*pz))+(((-1.0)*x692*x693))+(((32.1)*sj30))+(((-1.0)*x691*x692)))))); j28eval[2]=IKsign(((-10.0)+(((-2000.0)*x691*x693))+(((-1000.0)*x698))+(((-1000.0)*x689))+(((-1000.0)*x688))+(((200.0)*x691))+x696+(((1000.0)*x697)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { continue; // no branches [j28] } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x699=py*py; IkReal x700=cj27*cj27; IkReal x701=(cj27*px); IkReal x702=(py*sj27); IkReal x703=((321.0)*cj30); IkReal x704=((321.0)*sj30); IkReal x705=((1000.0)*x700); CheckValue<IkReal> x706=IKPowWithIntegerCheck(IKsign(((-10.0)+(((-1000.0)*x699))+(((-2000.0)*x701*x702))+(((-1000.0)*(pz*pz)))+(((-1.0)*x705*(px*px)))+(((200.0)*x701))+(((200.0)*x702))+((x699*x705)))),-1); if(!x706.valid){ continue; } CheckValue<IkReal> x707 = IKatan2WithCheck(IkReal(((((-1.0)*x702*x704))+(((400.0)*pz))+(((32.1)*sj30))+(((-1.0)*x701*x704))+((pz*x703)))),((40.0)+(((-1.0)*pz*x704))+(((-1.0)*x702*x703))+(((-400.0)*x702))+(((-400.0)*x701))+(((32.1)*cj30))+(((-1.0)*x701*x703))),IKFAST_ATAN2_MAGTHRESH); if(!x707.valid){ continue; } j28array[0]=((-1.5707963267949)+(((1.5707963267949)*(x706.value)))+(x707.value)); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x708=IKsin(j28); IkReal x709=IKcos(j28); IkReal x710=((0.321)*cj30); IkReal x711=((0.321)*sj30); IkReal x712=(py*sj27); IkReal x713=(cj27*px); IkReal x714=((1.0)*x712); IkReal x715=(pz*x708); IkReal x716=((1.0)*x709); IkReal x717=((0.8)*x709); evalcond[0]=((((0.4)*x708))+(((-1.0)*x709*x711))+pz+((x708*x710))); evalcond[1]=((0.1)+(((0.4)*x709))+(((-1.0)*x713))+((x709*x710))+(((-1.0)*x714))+((x708*x711))); evalcond[2]=((0.4)+(((-1.0)*x709*x714))+(((0.1)*x709))+x710+x715+(((-1.0)*x713*x716))); evalcond[3]=((((-1.0)*pz*x716))+(((-1.0)*x708*x713))+(((0.1)*x708))+(((-1.0)*x708*x714))+x711); evalcond[4]=((-0.066959)+(((-1.0)*pp))+(((-0.8)*x715))+(((0.2)*x712))+(((0.2)*x713))+((x712*x717))+((x713*x717))+(((-0.08)*x709))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x718=((321.0)*cj30); IkReal x719=(py*sj27); IkReal x720=(cj27*px); IkReal x721=((1000.0)*pz); CheckValue<IkReal> x722 = IKatan2WithCheck(IkReal(((((100.0)*pz))+(((128.4)*sj30))+(((-1.0)*x720*x721))+(((-1.0)*x719*x721))+(((103.041)*cj30*sj30)))),((160.0)+(((103.041)*(cj30*cj30)))+(((256.8)*cj30))+(((-1.0)*pz*x721))),IKFAST_ATAN2_MAGTHRESH); if(!x722.valid){ continue; } CheckValue<IkReal> x723=IKPowWithIntegerCheck(IKsign(((-40.0)+(((400.0)*x720))+(((400.0)*x719))+(((-321.0)*pz*sj30))+((x718*x720))+((x718*x719))+(((-32.1)*cj30)))),-1); if(!x723.valid){ continue; } j28array[0]=((-1.5707963267949)+(x722.value)+(((1.5707963267949)*(x723.value)))); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x724=IKsin(j28); IkReal x725=IKcos(j28); IkReal x726=((0.321)*cj30); IkReal x727=((0.321)*sj30); IkReal x728=(py*sj27); IkReal x729=(cj27*px); IkReal x730=((1.0)*x728); IkReal x731=(pz*x724); IkReal x732=((1.0)*x725); IkReal x733=((0.8)*x725); evalcond[0]=((((-1.0)*x725*x727))+pz+((x724*x726))+(((0.4)*x724))); evalcond[1]=((0.1)+(((-1.0)*x729))+(((-1.0)*x730))+((x725*x726))+((x724*x727))+(((0.4)*x725))); evalcond[2]=((0.4)+(((-1.0)*x725*x730))+(((0.1)*x725))+x731+x726+(((-1.0)*x729*x732))); evalcond[3]=((((-1.0)*x724*x730))+(((-1.0)*x724*x729))+(((0.1)*x724))+x727+(((-1.0)*pz*x732))); evalcond[4]=((-0.066959)+(((-0.08)*x725))+((x728*x733))+((x729*x733))+(((-1.0)*pp))+(((-0.8)*x731))+(((0.2)*x729))+(((0.2)*x728))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x734=(cj27*px); IkReal x735=((321000.0)*cj30); IkReal x736=((321000.0)*sj30); IkReal x737=((321000.0)*py*sj27); CheckValue<IkReal> x738 = IKatan2WithCheck(IkReal(((((32100.0)*sj30))+(((-1.0)*py*sj27*x736))+(((-1.0)*x734*x736))+(((400000.0)*pz))+((pz*x735)))),((40000.0)+(((-400000.0)*py*sj27))+(((-1.0)*py*sj27*x735))+(((-1.0)*x734*x735))+(((-400000.0)*x734))+(((32100.0)*cj30))+(((-1.0)*pz*x736))),IKFAST_ATAN2_MAGTHRESH); if(!x738.valid){ continue; } CheckValue<IkReal> x739=IKPowWithIntegerCheck(IKsign(((-263041.0)+(((-256800.0)*cj30)))),-1); if(!x739.valid){ continue; } j28array[0]=((-1.5707963267949)+(x738.value)+(((1.5707963267949)*(x739.value)))); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x740=IKsin(j28); IkReal x741=IKcos(j28); IkReal x742=((0.321)*cj30); IkReal x743=((0.321)*sj30); IkReal x744=(py*sj27); IkReal x745=(cj27*px); IkReal x746=((1.0)*x744); IkReal x747=(pz*x740); IkReal x748=((1.0)*x741); IkReal x749=((0.8)*x741); evalcond[0]=(((x740*x742))+pz+(((0.4)*x740))+(((-1.0)*x741*x743))); evalcond[1]=((0.1)+((x740*x743))+((x741*x742))+(((-1.0)*x745))+(((0.4)*x741))+(((-1.0)*x746))); evalcond[2]=((0.4)+(((-1.0)*x745*x748))+(((0.1)*x741))+(((-1.0)*x741*x746))+x747+x742); evalcond[3]=((((0.1)*x740))+(((-1.0)*pz*x748))+(((-1.0)*x740*x746))+x743+(((-1.0)*x740*x745))); evalcond[4]=((-0.066959)+((x745*x749))+((x744*x749))+(((-0.08)*x741))+(((-1.0)*pp))+(((0.2)*x744))+(((0.2)*x745))+(((-0.8)*x747))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j28, j30] } } while(0); if( bgotonextstatement ) { } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x750=IKPowWithIntegerCheck(sj29,-1); if(!x750.valid){ continue; } if( IKabs(((0.00311526479750779)*(x750.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x750.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x750.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[2]; evalcond[0]=((((-1.0)*cj27*py))+((px*sj27))+(((0.321)*sj29*(IKsin(j30))))); evalcond[1]=((0.253041)+(((0.2568)*(IKcos(j30))))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j28eval[3]; IkReal x751=(py*sj27); IkReal x752=(cj29*sj30); IkReal x753=(cj27*px); IkReal x754=((10.0)*cj30); IkReal x755=((1000.0)*pz); IkReal x756=((321.0)*cj30); j28eval[0]=((-1.24610591900312)+((x751*x754))+(((10.0)*pz*x752))+(((-1.0)*cj30))+(((12.4610591900312)*x753))+(((12.4610591900312)*x751))+((x753*x754))); j28eval[1]=IKsign(((-40.0)+((x751*x756))+(((400.0)*x753))+(((400.0)*x751))+(((321.0)*pz*x752))+((x753*x756))+(((-32.1)*cj30)))); j28eval[2]=((IKabs(((160.0)+(((-1.0)*pz*x755))+(((103.041)*(cj30*cj30)))+(((256.8)*cj30)))))+(IKabs(((((100.0)*pz))+(((-1.0)*x753*x755))+(((-1.0)*x751*x755))+(((-128.4)*x752))+(((-103.041)*cj30*x752)))))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[3]; IkReal x757=cj29*cj29; IkReal x758=cj30*cj30; IkReal x759=(cj27*px); IkReal x760=((321000.0)*cj30); IkReal x761=(py*sj27); IkReal x762=((321000.0)*cj29*sj30); IkReal x763=((103041.0)*x758); j28eval[0]=((1.5527799613746)+(((-1.0)*x757*x758))+x757+x758+(((2.49221183800623)*cj30))); j28eval[1]=IKsign(((160000.0)+(((256800.0)*cj30))+(((-1.0)*x757*x763))+(((103041.0)*x757))+x763)); j28eval[2]=((IKabs(((-40000.0)+(((-32100.0)*cj30))+((x760*x761))+((x759*x760))+(((400000.0)*x761))+(((400000.0)*x759))+(((-1.0)*pz*x762)))))+(IKabs(((((32100.0)*cj29*sj30))+(((-400000.0)*pz))+(((-1.0)*x761*x762))+(((-1.0)*x759*x762))+(((-1.0)*pz*x760)))))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 || IKabs(j28eval[2]) < 0.0000010000000000 ) { { IkReal j28eval[2]; IkReal x764=(cj29*sj30); IkReal x765=(py*sj27); IkReal x766=(cj30*pz); IkReal x767=(cj27*px); j28eval[0]=((((-10.0)*x764*x765))+(((-10.0)*x764*x767))+x764+(((10.0)*x766))+(((12.4610591900312)*pz))); j28eval[1]=IKsign(((((400.0)*pz))+(((321.0)*x766))+(((-321.0)*x764*x765))+(((-321.0)*x764*x767))+(((32.1)*x764)))); if( IKabs(j28eval[0]) < 0.0000010000000000 || IKabs(j28eval[1]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x768=((((0.321)*sj30))+(((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((IKabs(pz))+(IKabs(((-3.14159265358979)+(IKfmod(((1.5707963267949)+j29), 6.28318530717959)))))); evalcond[1]=x768; evalcond[2]=((0.253041)+(((0.2568)*cj30))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=x768; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28eval[1]; IkReal x769=((-1.0)*py); pz=0; j29=1.5707963267949; sj29=1.0; cj29=0; pp=((px*px)+(py*py)); npx=(((px*r00))+((py*r10))); npy=(((px*r01))+((py*r11))); npz=(((px*r02))+((py*r12))); rxp0_0=(r20*x769); rxp0_1=(px*r20); rxp1_0=(r21*x769); rxp1_1=(px*r21); rxp2_0=(r22*x769); rxp2_1=(px*r22); j28eval[0]=((1.0)+(((-10.0)*cj27*px))+(((-10.0)*py*sj27))); if( IKabs(j28eval[0]) < 0.0000010000000000 ) { { IkReal j28eval[1]; IkReal x770=((-1.0)*py); pz=0; j29=1.5707963267949; sj29=1.0; cj29=0; pp=((px*px)+(py*py)); npx=(((px*r00))+((py*r10))); npy=(((px*r01))+((py*r11))); npz=(((px*r02))+((py*r12))); rxp0_0=(r20*x770); rxp0_1=(px*r20); rxp1_0=(r21*x770); rxp1_1=(px*r21); rxp2_0=(r22*x770); rxp2_1=(px*r22); j28eval[0]=((1.24610591900312)+cj30); if( IKabs(j28eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x771=((((100.0)*(px*px)))+(((100.0)*(py*py)))); if((x771) < -0.00001) continue; IkReal x772=IKabs(IKsqrt(x771)); IkReal x778 = x771; if(IKabs(x778)==0){ continue; } IkReal x773=pow(x778,-0.5); CheckValue<IkReal> x779=IKPowWithIntegerCheck(x772,-1); if(!x779.valid){ continue; } IkReal x774=x779.value; IkReal x775=((10.0)*px*x773); IkReal x776=((10.0)*py*x773); if((((1.0)+(((-1.0)*(x774*x774))))) < -0.00001) continue; IkReal x777=IKsqrt(((1.0)+(((-1.0)*(x774*x774))))); if( (x774) < -1-IKFAST_SINCOS_THRESH || (x774) > 1+IKFAST_SINCOS_THRESH ) continue; CheckValue<IkReal> x780 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x780.valid){ continue; } IkReal gconst24=((((-1.0)*(IKasin(x774))))+(((-1.0)*(x780.value)))); IkReal gconst25=(((x774*x776))+((x775*x777))); IkReal gconst26=(((x774*x775))+(((-1.0)*x776*x777))); IkReal x781=px*px; IkReal x782=py*py; IkReal x783=(((gconst25*px))+(((0.321)*sj30))+(((-1.0)*gconst26*py))); CheckValue<IkReal> x784 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x784.valid){ continue; } if((((((100.0)*x782))+(((100.0)*x781)))) < -0.00001) continue; CheckValue<IkReal> x785=IKPowWithIntegerCheck(IKabs(IKsqrt(((((100.0)*x782))+(((100.0)*x781))))),-1); if(!x785.valid){ continue; } if( (x785.value) < -1-IKFAST_SINCOS_THRESH || (x785.value) > 1+IKFAST_SINCOS_THRESH ) continue; evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs((j27+(x784.value)+(IKasin(x785.value)))))), 6.28318530717959))); evalcond[1]=x783; evalcond[2]=((0.253041)+(((0.2568)*cj30))+(((0.2)*gconst25*py))+(((0.2)*gconst26*px))+(((-1.0)*x781))+(((-1.0)*x782))); evalcond[3]=x783; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x787=IKPowWithIntegerCheck(((0.1)+(((-1.0)*gconst25*py))+(((-1.0)*gconst26*px))),-1); if(!x787.valid){ continue; } IkReal x786=x787.value; cj28array[0]=((((-0.321)*cj30*x786))+(((-0.4)*x786))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x788=IKsin(j28); IkReal x789=IKcos(j28); IkReal x790=(gconst25*py); IkReal x791=(gconst26*px); IkReal x792=((0.321)*cj30); IkReal x793=((1.0)*x788); IkReal x794=((0.8)*x789); evalcond[0]=(((x788*x792))+(((0.4)*x788))); evalcond[1]=((((-1.0)*x791*x793))+(((0.1)*x788))+(((-1.0)*x790*x793))); evalcond[2]=((0.1)+(((-1.0)*x791))+(((-1.0)*x790))+(((0.4)*x789))+((x789*x792))); evalcond[3]=((-0.32)+((x790*x794))+(((-0.08)*x789))+(((-0.2568)*cj30))+((x791*x794))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x795=((((100.0)*(px*px)))+(((100.0)*(py*py)))); IkReal x802 = x795; if(IKabs(x802)==0){ continue; } IkReal x796=pow(x802,-0.5); if((x795) < -0.00001) continue; IkReal x797=IKabs(IKsqrt(x795)); CheckValue<IkReal> x803=IKPowWithIntegerCheck(x797,-1); if(!x803.valid){ continue; } IkReal x798=x803.value; IkReal x799=((10.0)*px*x796); IkReal x800=((10.0)*py*x796); if((((1.0)+(((-1.0)*(x798*x798))))) < -0.00001) continue; IkReal x801=IKsqrt(((1.0)+(((-1.0)*(x798*x798))))); CheckValue<IkReal> x804 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x804.valid){ continue; } if( (x798) < -1-IKFAST_SINCOS_THRESH || (x798) > 1+IKFAST_SINCOS_THRESH ) continue; IkReal gconst27=((3.14159265358979)+(((-1.0)*(x804.value)))+(IKasin(x798))); IkReal gconst28=((((-1.0)*x799*x801))+((x798*x800))); IkReal gconst29=(((x800*x801))+((x798*x799))); IkReal x805=px*px; IkReal x806=py*py; IkReal x807=((((0.321)*sj30))+(((-1.0)*gconst29*py))+((gconst28*px))); CheckValue<IkReal> x808 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x808.valid){ continue; } if((((((100.0)*x806))+(((100.0)*x805)))) < -0.00001) continue; CheckValue<IkReal> x809=IKPowWithIntegerCheck(IKabs(IKsqrt(((((100.0)*x806))+(((100.0)*x805))))),-1); if(!x809.valid){ continue; } if( (x809.value) < -1-IKFAST_SINCOS_THRESH || (x809.value) > 1+IKFAST_SINCOS_THRESH ) continue; evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j27+(x808.value)+(((-1.0)*(IKasin(x809.value)))))))), 6.28318530717959))); evalcond[1]=x807; evalcond[2]=((0.253041)+(((-1.0)*x805))+(((-1.0)*x806))+(((0.2568)*cj30))+(((0.2)*gconst29*px))+(((0.2)*gconst28*py))); evalcond[3]=x807; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x811=IKPowWithIntegerCheck(((0.1)+(((-1.0)*gconst29*px))+(((-1.0)*gconst28*py))),-1); if(!x811.valid){ continue; } IkReal x810=x811.value; cj28array[0]=((((-0.4)*x810))+(((-0.321)*cj30*x810))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x812=IKsin(j28); IkReal x813=IKcos(j28); IkReal x814=(gconst28*py); IkReal x815=((0.321)*cj30); IkReal x816=((0.8)*x813); IkReal x817=((1.0)*gconst29*px); evalcond[0]=(((x812*x815))+(((0.4)*x812))); evalcond[1]=((((-1.0)*x812*x817))+(((-1.0)*x812*x814))+(((0.1)*x812))); evalcond[2]=((0.1)+(((-1.0)*x817))+((x813*x815))+(((0.4)*x813))+(((-1.0)*x814))); evalcond[3]=((-0.32)+((x814*x816))+((gconst29*px*x816))+(((-0.2568)*cj30))+(((-0.08)*x813))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j28] } } while(0); if( bgotonextstatement ) { } } } } } else { { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x819=IKPowWithIntegerCheck(((0.4)+(((0.321)*cj30))),-1); if(!x819.valid){ continue; } IkReal x818=x819.value; cj28array[0]=(((py*sj27*x818))+((cj27*px*x818))+(((-0.1)*x818))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x820=IKsin(j28); IkReal x821=IKcos(j28); IkReal x822=((0.321)*cj30); IkReal x823=(cj27*px); IkReal x824=((1.0)*x820); IkReal x825=(py*sj27*x821); evalcond[0]=(((x820*x822))+(((0.4)*x820))); evalcond[1]=((((0.1)*x820))+(((-1.0)*x823*x824))+(((-1.0)*py*sj27*x824))); evalcond[2]=((0.4)+(((0.1)*x821))+(((-1.0)*x825))+(((-1.0)*x821*x823))+x822); evalcond[3]=((-0.32)+(((0.8)*x825))+(((-0.08)*x821))+(((0.8)*x821*x823))+(((-0.2568)*cj30))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x827=IKPowWithIntegerCheck(((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))),-1); if(!x827.valid){ continue; } IkReal x826=x827.value; cj28array[0]=((((-0.4)*x826))+(((-0.321)*cj30*x826))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x828=IKsin(j28); IkReal x829=IKcos(j28); IkReal x830=(py*sj27); IkReal x831=(cj27*px); IkReal x832=((0.321)*cj30); IkReal x833=((0.8)*x829); IkReal x834=((1.0)*x828); evalcond[0]=((((0.4)*x828))+((x828*x832))); evalcond[1]=((((0.1)*x828))+(((-1.0)*x830*x834))+(((-1.0)*x831*x834))); evalcond[2]=((0.1)+(((0.4)*x829))+((x829*x832))+(((-1.0)*x831))+(((-1.0)*x830))); evalcond[3]=((-0.32)+((x831*x833))+(((-0.08)*x829))+(((-0.2568)*cj30))+((x830*x833))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x835=((0.321)*sj30); IkReal x836=(cj27*py); IkReal x837=(px*sj27); evalcond[0]=((IKabs(pz))+(IKabs(((-3.14159265358979)+(IKfmod(((4.71238898038469)+j29), 6.28318530717959)))))); evalcond[1]=((((-1.0)*x835))+(((-1.0)*x836))+x837); evalcond[2]=((0.253041)+(((0.2568)*cj30))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=((((-1.0)*x837))+x835+x836); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28eval[1]; IkReal x838=((-1.0)*py); pz=0; j29=-1.5707963267949; sj29=-1.0; cj29=0; pp=((px*px)+(py*py)); npx=(((px*r00))+((py*r10))); npy=(((px*r01))+((py*r11))); npz=(((px*r02))+((py*r12))); rxp0_0=(r20*x838); rxp0_1=(px*r20); rxp1_0=(r21*x838); rxp1_1=(px*r21); rxp2_0=(r22*x838); rxp2_1=(px*r22); j28eval[0]=((1.0)+(((-10.0)*cj27*px))+(((-10.0)*py*sj27))); if( IKabs(j28eval[0]) < 0.0000010000000000 ) { { IkReal j28eval[1]; IkReal x839=((-1.0)*py); pz=0; j29=-1.5707963267949; sj29=-1.0; cj29=0; pp=((px*px)+(py*py)); npx=(((px*r00))+((py*r10))); npy=(((px*r01))+((py*r11))); npz=(((px*r02))+((py*r12))); rxp0_0=(r20*x839); rxp0_1=(px*r20); rxp1_0=(r21*x839); rxp1_1=(px*r21); rxp2_0=(r22*x839); rxp2_1=(px*r22); j28eval[0]=((1.24610591900312)+cj30); if( IKabs(j28eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x840=((((100.0)*(px*px)))+(((100.0)*(py*py)))); if((x840) < -0.00001) continue; IkReal x841=IKabs(IKsqrt(x840)); IkReal x847 = x840; if(IKabs(x847)==0){ continue; } IkReal x842=pow(x847,-0.5); CheckValue<IkReal> x848=IKPowWithIntegerCheck(x841,-1); if(!x848.valid){ continue; } IkReal x843=x848.value; IkReal x844=((10.0)*px*x842); IkReal x845=((10.0)*py*x842); if((((1.0)+(((-1.0)*(x843*x843))))) < -0.00001) continue; IkReal x846=IKsqrt(((1.0)+(((-1.0)*(x843*x843))))); CheckValue<IkReal> x849 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x849.valid){ continue; } if( (x843) < -1-IKFAST_SINCOS_THRESH || (x843) > 1+IKFAST_SINCOS_THRESH ) continue; IkReal gconst30=((((-1.0)*(x849.value)))+(((-1.0)*(IKasin(x843))))); IkReal gconst31=(((x843*x845))+((x844*x846))); IkReal gconst32=(((x843*x844))+(((-1.0)*x845*x846))); IkReal x850=px*px; IkReal x851=py*py; IkReal x852=((0.321)*sj30); IkReal x853=(gconst32*py); IkReal x854=(gconst31*px); if((((((100.0)*x851))+(((100.0)*x850)))) < -0.00001) continue; CheckValue<IkReal> x855=IKPowWithIntegerCheck(IKabs(IKsqrt(((((100.0)*x851))+(((100.0)*x850))))),-1); if(!x855.valid){ continue; } if( (x855.value) < -1-IKFAST_SINCOS_THRESH || (x855.value) > 1+IKFAST_SINCOS_THRESH ) continue; CheckValue<IkReal> x856 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x856.valid){ continue; } evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((IKasin(x855.value))+j27+(x856.value))))), 6.28318530717959))); evalcond[1]=((((-1.0)*x852))+(((-1.0)*x853))+x854); evalcond[2]=((0.253041)+(((0.2568)*cj30))+(((-1.0)*x851))+(((-1.0)*x850))+(((0.2)*gconst32*px))+(((0.2)*gconst31*py))); evalcond[3]=((((-1.0)*x854))+x852+x853); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x858=IKPowWithIntegerCheck(((0.1)+(((-1.0)*gconst32*px))+(((-1.0)*gconst31*py))),-1); if(!x858.valid){ continue; } IkReal x857=x858.value; cj28array[0]=((((-0.4)*x857))+(((-0.321)*cj30*x857))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x859=IKsin(j28); IkReal x860=IKcos(j28); IkReal x861=(gconst31*py); IkReal x862=(gconst32*px); IkReal x863=((0.321)*cj30); IkReal x864=((0.8)*x860); evalcond[0]=(((x859*x863))+(((0.4)*x859))); evalcond[1]=((((-0.1)*x859))+((x859*x862))+((x859*x861))); evalcond[2]=((0.1)+(((-1.0)*x862))+(((-1.0)*x861))+(((0.4)*x860))+((x860*x863))); evalcond[3]=((-0.32)+(((-0.2568)*cj30))+((x862*x864))+((x861*x864))+(((-0.08)*x860))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x865=((((100.0)*(px*px)))+(((100.0)*(py*py)))); IkReal x872 = x865; if(IKabs(x872)==0){ continue; } IkReal x866=pow(x872,-0.5); if((x865) < -0.00001) continue; IkReal x867=IKabs(IKsqrt(x865)); CheckValue<IkReal> x873=IKPowWithIntegerCheck(x867,-1); if(!x873.valid){ continue; } IkReal x868=x873.value; IkReal x869=((10.0)*px*x866); IkReal x870=((10.0)*py*x866); if((((1.0)+(((-1.0)*(x868*x868))))) < -0.00001) continue; IkReal x871=IKsqrt(((1.0)+(((-1.0)*(x868*x868))))); if( (x868) < -1-IKFAST_SINCOS_THRESH || (x868) > 1+IKFAST_SINCOS_THRESH ) continue; CheckValue<IkReal> x874 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x874.valid){ continue; } IkReal gconst33=((3.14159265358979)+(IKasin(x868))+(((-1.0)*(x874.value)))); IkReal gconst34=(((x868*x870))+(((-1.0)*x869*x871))); IkReal gconst35=(((x868*x869))+((x870*x871))); IkReal x875=px*px; IkReal x876=py*py; IkReal x877=((0.321)*sj30); IkReal x878=(gconst35*py); IkReal x879=(gconst34*px); if((((((100.0)*x875))+(((100.0)*x876)))) < -0.00001) continue; CheckValue<IkReal> x880=IKPowWithIntegerCheck(IKabs(IKsqrt(((((100.0)*x875))+(((100.0)*x876))))),-1); if(!x880.valid){ continue; } if( (x880.value) < -1-IKFAST_SINCOS_THRESH || (x880.value) > 1+IKFAST_SINCOS_THRESH ) continue; CheckValue<IkReal> x881 = IKatan2WithCheck(IkReal(((-10.0)*px)),((-10.0)*py),IKFAST_ATAN2_MAGTHRESH); if(!x881.valid){ continue; } evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j27+(((-1.0)*(IKasin(x880.value))))+(x881.value))))), 6.28318530717959))); evalcond[1]=((((-1.0)*x878))+x879+(((-1.0)*x877))); evalcond[2]=((0.253041)+(((0.2568)*cj30))+(((-1.0)*x876))+(((-1.0)*x875))+(((0.2)*gconst35*px))+(((0.2)*gconst34*py))); evalcond[3]=((((-1.0)*x879))+x878+x877); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x883=IKPowWithIntegerCheck(((0.1)+(((-1.0)*gconst34*py))+(((-1.0)*gconst35*px))),-1); if(!x883.valid){ continue; } IkReal x882=x883.value; cj28array[0]=((((-0.4)*x882))+(((-0.321)*cj30*x882))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x884=IKsin(j28); IkReal x885=IKcos(j28); IkReal x886=(gconst34*py); IkReal x887=(gconst35*px); IkReal x888=((0.321)*cj30); IkReal x889=((0.8)*x885); evalcond[0]=((((0.4)*x884))+((x884*x888))); evalcond[1]=((((-0.1)*x884))+((x884*x887))+((x884*x886))); evalcond[2]=((0.1)+(((-1.0)*x887))+(((-1.0)*x886))+(((0.4)*x885))+((x885*x888))); evalcond[3]=((-0.32)+((x887*x889))+((x886*x889))+(((-0.2568)*cj30))+(((-0.08)*x885))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j28] } } while(0); if( bgotonextstatement ) { } } } } } else { { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x891=IKPowWithIntegerCheck(((0.4)+(((0.321)*cj30))),-1); if(!x891.valid){ continue; } IkReal x890=x891.value; cj28array[0]=((((-0.1)*x890))+((cj27*px*x890))+((py*sj27*x890))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x892=IKsin(j28); IkReal x893=IKcos(j28); IkReal x894=((0.321)*cj30); IkReal x895=(py*sj27*x893); IkReal x896=(cj27*px*x893); evalcond[0]=((((0.4)*x892))+((x892*x894))); evalcond[1]=((((-0.1)*x892))+((cj27*px*x892))+((py*sj27*x892))); evalcond[2]=((0.4)+(((-1.0)*x895))+(((-1.0)*x896))+x894+(((0.1)*x893))); evalcond[3]=((-0.32)+(((0.8)*x896))+(((0.8)*x895))+(((-0.2568)*cj30))+(((-0.08)*x893))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; CheckValue<IkReal> x898=IKPowWithIntegerCheck(((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))),-1); if(!x898.valid){ continue; } IkReal x897=x898.value; cj28array[0]=((((-0.4)*x897))+(((-0.321)*cj30*x897))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[4]; IkReal x899=IKsin(j28); IkReal x900=IKcos(j28); IkReal x901=(py*sj27); IkReal x902=(cj27*px); IkReal x903=((0.321)*cj30); IkReal x904=((0.8)*x900); evalcond[0]=((((0.4)*x899))+((x899*x903))); evalcond[1]=((((-0.1)*x899))+((x899*x901))+((x899*x902))); evalcond[2]=((0.1)+((x900*x903))+(((0.4)*x900))+(((-1.0)*x902))+(((-1.0)*x901))); evalcond[3]=((-0.32)+((x901*x904))+((x902*x904))+(((-0.08)*x900))+(((-0.2568)*cj30))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((IKabs(pz))+(IKabs(((-3.14159265358979)+(IKfmod(((3.14159265358979)+j30), 6.28318530717959)))))); evalcond[1]=((((-1.0)*cj27*py))+((px*sj27))); evalcond[2]=((0.509841)+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; cj28array[0]=((-0.13869625520111)+(((1.3869625520111)*py*sj27))+(((1.3869625520111)*cj27*px))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x905=IKcos(j28); IkReal x906=px*px; CheckValue<IkReal> x915=IKPowWithIntegerCheck(py,-1); if(!x915.valid){ continue; } IkReal x907=x915.value; IkReal x908=IKsin(j28); IkReal x909=(py*sj27); IkReal x910=(x906*x907); IkReal x911=((1.0)*x905); IkReal x912=(sj29*x908); IkReal x913=(cj29*x908); IkReal x914=((0.8)*sj27*x905); evalcond[0]=((0.721)*x908); evalcond[1]=((0.721)+(((-1.0)*cj27*px*x911))+(((0.1)*x905))+(((-1.0)*x909*x911))); evalcond[2]=((-0.5768)+((x910*x914))+(((-0.08)*x905))+(((0.8)*x905*x909))); evalcond[3]=(((x909*x913))+(((-0.1)*x913))+((sj27*x910*x913))); evalcond[4]=((((-1.0)*x909*x912))+(((0.1)*x912))+(((-1.0)*sj27*x910*x912))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((IKabs(pz))+(IKabs(((-3.14159265358979)+(IKfmod(j30, 6.28318530717959)))))); evalcond[1]=((((-1.0)*cj27*py))+((px*sj27))); evalcond[2]=((-0.003759)+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j28array[2], cj28array[2], sj28array[2]; bool j28valid[2]={false}; _nj28 = 2; cj28array[0]=((-1.26582278481013)+(((12.6582278481013)*py*sj27))+(((12.6582278481013)*cj27*px))); if( cj28array[0] >= -1-IKFAST_SINCOS_THRESH && cj28array[0] <= 1+IKFAST_SINCOS_THRESH ) { j28valid[0] = j28valid[1] = true; j28array[0] = IKacos(cj28array[0]); sj28array[0] = IKsin(j28array[0]); cj28array[1] = cj28array[0]; j28array[1] = -j28array[0]; sj28array[1] = -sj28array[0]; } else if( isnan(cj28array[0]) ) { // probably any value will work j28valid[0] = true; cj28array[0] = 1; sj28array[0] = 0; j28array[0] = 0; } for(int ij28 = 0; ij28 < 2; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 2; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[5]; IkReal x916=IKcos(j28); IkReal x917=px*px; CheckValue<IkReal> x926=IKPowWithIntegerCheck(py,-1); if(!x926.valid){ continue; } IkReal x918=x926.value; IkReal x919=IKsin(j28); IkReal x920=(py*sj27); IkReal x921=(x917*x918); IkReal x922=((1.0)*x916); IkReal x923=(sj29*x919); IkReal x924=(cj29*x919); IkReal x925=((0.8)*sj27*x916); evalcond[0]=((0.079)*x919); evalcond[1]=((0.079)+(((-1.0)*x920*x922))+(((0.1)*x916))+(((-1.0)*cj27*px*x922))); evalcond[2]=((-0.0632)+(((-0.08)*x916))+((x921*x925))+(((0.8)*x916*x920))); evalcond[3]=((((-0.1)*x924))+((x920*x924))+((sj27*x921*x924))); evalcond[4]=((((0.1)*x923))+(((-1.0)*x920*x923))+(((-1.0)*sj27*x921*x923))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j28] } } while(0); if( bgotonextstatement ) { } } } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x927=cj27*cj27; IkReal x928=py*py; IkReal x929=(cj27*px); IkReal x930=(cj29*sj30); IkReal x931=(py*sj27); IkReal x932=((1000.0)*pz); IkReal x933=((1000.0)*x927); CheckValue<IkReal> x934=IKPowWithIntegerCheck(IKsign(((((32.1)*x930))+(((321.0)*cj30*pz))+(((-321.0)*x929*x930))+(((400.0)*pz))+(((-321.0)*x930*x931)))),-1); if(!x934.valid){ continue; } CheckValue<IkReal> x935 = IKatan2WithCheck(IkReal(((-150.0)+(((-200.0)*x931))+(((-200.0)*x929))+(((-1.0)*x928*x933))+((x933*(px*px)))+(((1000.0)*x928))+(((2000.0)*x929*x931))+(((-103.041)*(cj30*cj30)))+(((-256.8)*cj30)))),((((-100.0)*pz))+(((-103.041)*cj30*x930))+(((-128.4)*x930))+((x931*x932))+((x929*x932))),IKFAST_ATAN2_MAGTHRESH); if(!x935.valid){ continue; } j28array[0]=((-1.5707963267949)+(((1.5707963267949)*(x934.value)))+(x935.value)); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[6]; IkReal x936=IKsin(j28); IkReal x937=IKcos(j28); IkReal x938=((0.321)*cj30); IkReal x939=(py*sj27); IkReal x940=((0.321)*sj30); IkReal x941=((1.0)*sj29); IkReal x942=(px*sj27); IkReal x943=(cj27*px); IkReal x944=(cj27*py); IkReal x945=((1.0)*x939); IkReal x946=(pz*x936); IkReal x947=(cj29*x936); IkReal x948=(pz*x937); IkReal x949=((0.8)*x937); IkReal x950=(sj29*x936); evalcond[0]=(((x936*x938))+((cj29*x937*x940))+pz+(((0.4)*x936))); evalcond[1]=((0.1)+(((-1.0)*x945))+((x937*x938))+(((-1.0)*x943))+(((0.4)*x937))+(((-1.0)*x940*x947))); evalcond[2]=((0.4)+(((0.1)*x937))+(((-1.0)*x937*x943))+(((-1.0)*x937*x945))+x938+x946); evalcond[3]=((-0.066959)+(((-0.08)*x937))+(((-0.8)*x946))+(((0.2)*x939))+((x939*x949))+(((0.2)*x943))+((x943*x949))+(((-1.0)*pp))); evalcond[4]=((((-1.0)*x936*x941*x943))+(((0.1)*x950))+(((-1.0)*cj29*x944))+(((-1.0)*x941*x948))+((cj29*x942))+(((-1.0)*x936*x939*x941))); evalcond[5]=(((sj29*x942))+((x939*x947))+((x943*x947))+(((-1.0)*x941*x944))+((cj29*x948))+(((-0.1)*x947))+x940); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x951=cj29*cj29; IkReal x952=cj30*cj30; IkReal x953=(cj27*px); IkReal x954=((321000.0)*cj30); IkReal x955=(py*sj27); IkReal x956=((321000.0)*cj29*sj30); IkReal x957=((103041.0)*x951); CheckValue<IkReal> x958 = IKatan2WithCheck(IkReal(((((-1.0)*pz*x954))+(((32100.0)*cj29*sj30))+(((-400000.0)*pz))+(((-1.0)*x953*x956))+(((-1.0)*x955*x956)))),((-40000.0)+(((-1.0)*pz*x956))+(((-32100.0)*cj30))+(((400000.0)*x953))+(((400000.0)*x955))+((x953*x954))+((x954*x955))),IKFAST_ATAN2_MAGTHRESH); if(!x958.valid){ continue; } CheckValue<IkReal> x959=IKPowWithIntegerCheck(IKsign(((160000.0)+(((256800.0)*cj30))+(((-1.0)*x952*x957))+(((103041.0)*x952))+x957)),-1); if(!x959.valid){ continue; } j28array[0]=((-1.5707963267949)+(x958.value)+(((1.5707963267949)*(x959.value)))); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[6]; IkReal x960=IKsin(j28); IkReal x961=IKcos(j28); IkReal x962=((0.321)*cj30); IkReal x963=(py*sj27); IkReal x964=((0.321)*sj30); IkReal x965=((1.0)*sj29); IkReal x966=(px*sj27); IkReal x967=(cj27*px); IkReal x968=(cj27*py); IkReal x969=((1.0)*x963); IkReal x970=(pz*x960); IkReal x971=(cj29*x960); IkReal x972=(pz*x961); IkReal x973=((0.8)*x961); IkReal x974=(sj29*x960); evalcond[0]=(((x960*x962))+((cj29*x961*x964))+pz+(((0.4)*x960))); evalcond[1]=((0.1)+((x961*x962))+(((-1.0)*x967))+(((-1.0)*x964*x971))+(((-1.0)*x969))+(((0.4)*x961))); evalcond[2]=((0.4)+(((-1.0)*x961*x969))+(((-1.0)*x961*x967))+(((0.1)*x961))+x970+x962); evalcond[3]=((-0.066959)+(((-0.8)*x970))+((x963*x973))+(((-1.0)*pp))+(((0.2)*x967))+(((0.2)*x963))+((x967*x973))+(((-0.08)*x961))); evalcond[4]=((((-1.0)*x965*x972))+(((0.1)*x974))+(((-1.0)*x960*x965*x967))+(((-1.0)*cj29*x968))+(((-1.0)*x960*x963*x965))+((cj29*x966))); evalcond[5]=(((sj29*x966))+(((-0.1)*x971))+(((-1.0)*x965*x968))+((x963*x971))+((cj29*x972))+((x967*x971))+x964); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x975=(py*sj27); IkReal x976=(cj29*sj30); IkReal x977=((321.0)*cj30); IkReal x978=(cj27*px); IkReal x979=((1000.0)*pz); CheckValue<IkReal> x980 = IKatan2WithCheck(IkReal(((((100.0)*pz))+(((-1.0)*x978*x979))+(((-128.4)*x976))+(((-1.0)*x975*x979))+(((-103.041)*cj30*x976)))),((160.0)+(((-1.0)*pz*x979))+(((103.041)*(cj30*cj30)))+(((256.8)*cj30))),IKFAST_ATAN2_MAGTHRESH); if(!x980.valid){ continue; } CheckValue<IkReal> x981=IKPowWithIntegerCheck(IKsign(((-40.0)+((x975*x977))+(((321.0)*pz*x976))+((x977*x978))+(((400.0)*x975))+(((400.0)*x978))+(((-32.1)*cj30)))),-1); if(!x981.valid){ continue; } j28array[0]=((-1.5707963267949)+(x980.value)+(((1.5707963267949)*(x981.value)))); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[6]; IkReal x982=IKsin(j28); IkReal x983=IKcos(j28); IkReal x984=((0.321)*cj30); IkReal x985=(py*sj27); IkReal x986=((0.321)*sj30); IkReal x987=((1.0)*sj29); IkReal x988=(px*sj27); IkReal x989=(cj27*px); IkReal x990=(cj27*py); IkReal x991=((1.0)*x985); IkReal x992=(pz*x982); IkReal x993=(cj29*x982); IkReal x994=(pz*x983); IkReal x995=((0.8)*x983); IkReal x996=(sj29*x982); evalcond[0]=((((0.4)*x982))+((x982*x984))+pz+((cj29*x983*x986))); evalcond[1]=((0.1)+((x983*x984))+(((0.4)*x983))+(((-1.0)*x989))+(((-1.0)*x991))+(((-1.0)*x986*x993))); evalcond[2]=((0.4)+(((0.1)*x983))+(((-1.0)*x983*x989))+(((-1.0)*x983*x991))+x992+x984); evalcond[3]=((-0.066959)+(((-0.8)*x992))+((x989*x995))+(((-1.0)*pp))+(((0.2)*x985))+(((0.2)*x989))+(((-0.08)*x983))+((x985*x995))); evalcond[4]=((((-1.0)*x982*x987*x989))+(((-1.0)*x982*x985*x987))+(((0.1)*x996))+((cj29*x988))+(((-1.0)*x987*x994))+(((-1.0)*cj29*x990))); evalcond[5]=(((x989*x993))+((cj29*x994))+((sj29*x988))+(((-0.1)*x993))+x986+((x985*x993))+(((-1.0)*x987*x990))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } } } } else { { IkReal j28array[1], cj28array[1], sj28array[1]; bool j28valid[1]={false}; _nj28 = 1; IkReal x997=cj27*cj27; IkReal x998=px*px; IkReal x999=py*py; IkReal x1000=((1.0)*pz); IkReal x1001=(cj27*px); IkReal x1002=((5.0)*pp); IkReal x1003=(cj29*py); IkReal x1004=((4.0)*cj27); IkReal x1005=(pz*sj29); IkReal x1006=(cj29*sj27); IkReal x1007=(py*sj27*sj29); IkReal x1008=((4.0)*cj29*px); IkReal x1009=(sj29*x997); IkReal x1010=((4.0)*x999); CheckValue<IkReal> x1011 = IKatan2WithCheck(IkReal(((((-1.0)*sj29*x1000*x1001))+(((8.0)*px*x1003*x997))+(((-0.4)*cj27*x1003))+(((-1.0)*x1004*x1006*x998))+((x1004*x1006*x999))+((x1002*x1005))+(((-1.0)*x1000*x1007))+(((-4.0)*px*x1003))+(((0.334795)*x1005))+(((0.4)*px*x1006)))),((((-1.0)*x1009*x999))+(((0.5)*pp*sj29))+((pz*x1003*x1004))+(((2.0)*x1001*x1007))+(((-4.0)*px*pz*x1006))+((x1009*x998))+(((0.0334795)*sj29))+((sj29*x999))+(((-1.0)*sj29*x1001*x1002))+(((-1.0)*x1002*x1007))+(((-0.434795)*x1007))+(((-0.434795)*sj29*x1001))),IKFAST_ATAN2_MAGTHRESH); if(!x1011.valid){ continue; } CheckValue<IkReal> x1012=IKPowWithIntegerCheck(IKsign(((((0.8)*sj29*x1001))+((x1009*x1010))+(((-4.0)*x1009*x998))+(((-0.04)*sj29))+(((-8.0)*x1001*x1007))+(((-1.0)*sj29*x1010))+(((0.8)*x1007))+(((-4.0)*pz*x1005)))),-1); if(!x1012.valid){ continue; } j28array[0]=((-1.5707963267949)+(x1011.value)+(((1.5707963267949)*(x1012.value)))); sj28array[0]=IKsin(j28array[0]); cj28array[0]=IKcos(j28array[0]); if( j28array[0] > IKPI ) { j28array[0]-=IK2PI; } else if( j28array[0] < -IKPI ) { j28array[0]+=IK2PI; } j28valid[0] = true; for(int ij28 = 0; ij28 < 1; ++ij28) { if( !j28valid[ij28] ) { continue; } _ij28[0] = ij28; _ij28[1] = -1; for(int iij28 = ij28+1; iij28 < 1; ++iij28) { if( j28valid[iij28] && IKabs(cj28array[ij28]-cj28array[iij28]) < IKFAST_SOLUTION_THRESH && IKabs(sj28array[ij28]-sj28array[iij28]) < IKFAST_SOLUTION_THRESH ) { j28valid[iij28]=false; _ij28[1] = iij28; break; } } j28 = j28array[ij28]; cj28 = cj28array[ij28]; sj28 = sj28array[ij28]; { IkReal evalcond[2]; IkReal x1013=IKcos(j28); IkReal x1014=IKsin(j28); IkReal x1015=(py*sj27); IkReal x1016=((1.0)*cj27); IkReal x1017=(cj27*px); IkReal x1018=((0.8)*x1013); IkReal x1019=(sj29*x1014); evalcond[0]=((-0.066959)+(((-0.8)*pz*x1014))+((x1017*x1018))+(((-0.08)*x1013))+(((-1.0)*pp))+((x1015*x1018))+(((0.2)*x1017))+(((0.2)*x1015))); evalcond[1]=(((cj29*px*sj27))+(((-1.0)*pz*sj29*x1013))+(((-1.0)*cj29*py*x1016))+(((-1.0)*x1015*x1019))+(((-1.0)*px*x1016*x1019))+(((0.1)*x1019))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j30eval[1]; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal j30eval[2]; j30eval[0]=cj28; j30eval[1]=cj29; if( IKabs(j30eval[0]) < 0.0000010000000000 || IKabs(j30eval[1]) < 0.0000010000000000 ) { { IkReal j30eval[2]; j30eval[0]=sj29; j30eval[1]=sj28; if( IKabs(j30eval[0]) < 0.0000010000000000 || IKabs(j30eval[1]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x1020=(cj27*px); IkReal x1021=((0.8)*cj28); IkReal x1022=(py*sj27); IkReal x1023=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x1023; evalcond[2]=((-0.066959)+(((-0.08)*cj28))+(((-1.0)*pp))+((x1021*x1022))+((x1020*x1021))+(((0.2)*x1022))+(((0.2)*x1020))+(((-0.8)*pz*sj28))); evalcond[3]=x1023; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; IkReal x1024=((3.11526479750779)*cj28); IkReal x1025=(py*sj27); IkReal x1026=((3.11526479750779)*sj28); IkReal x1027=(cj27*px); if( IKabs(((((-1.0)*pz*x1024))+(((-1.0)*x1026*x1027))+(((-1.0)*x1025*x1026))+(((0.311526479750779)*sj28)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-0.311526479750779)*cj28))+(((-1.0)*pz*x1026))+((x1024*x1027))+((x1024*x1025)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*pz*x1024))+(((-1.0)*x1026*x1027))+(((-1.0)*x1025*x1026))+(((0.311526479750779)*sj28))))+IKsqr(((-1.24610591900312)+(((-0.311526479750779)*cj28))+(((-1.0)*pz*x1026))+((x1024*x1027))+((x1024*x1025))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-1.0)*pz*x1024))+(((-1.0)*x1026*x1027))+(((-1.0)*x1025*x1026))+(((0.311526479750779)*sj28))), ((-1.24610591900312)+(((-0.311526479750779)*cj28))+(((-1.0)*pz*x1026))+((x1024*x1027))+((x1024*x1025)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1028=IKcos(j30); IkReal x1029=IKsin(j30); IkReal x1030=(py*sj27); IkReal x1031=(cj27*px); IkReal x1032=((0.321)*x1028); IkReal x1033=((0.321)*x1029); evalcond[0]=((((0.4)*sj28))+((cj28*x1033))+pz+((sj28*x1032))); evalcond[1]=((0.253041)+(((0.2568)*x1028))+(((-1.0)*pp))+(((0.2)*x1030))+(((0.2)*x1031))); evalcond[2]=(x1033+((cj28*pz))+((sj28*x1030))+((sj28*x1031))+(((-0.1)*sj28))); CheckValue<IkReal> x1034=IKPowWithIntegerCheck(py,-1); if(!x1034.valid){ continue; } evalcond[3]=((0.31630125)+x1032+(((-1.25)*pp))+(((0.25)*x1030))+(((0.25)*sj27*(px*px)*(x1034.value)))); evalcond[4]=((0.1)+((cj28*x1032))+(((-1.0)*x1030))+(((-1.0)*x1031))+(((0.4)*cj28))+(((-1.0)*sj28*x1033))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1035=(cj27*px); IkReal x1036=((0.8)*cj28); IkReal x1037=(cj27*py); IkReal x1038=(px*sj27); IkReal x1039=(py*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x1038+(((-1.0)*x1037))); evalcond[2]=((-0.066959)+((x1036*x1039))+(((-0.08)*cj28))+(((-1.0)*pp))+((x1035*x1036))+(((-0.8)*pz*sj28))+(((0.2)*x1039))+(((0.2)*x1035))); evalcond[3]=(x1037+(((-1.0)*x1038))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; IkReal x1040=((3.11526479750779)*cj28); IkReal x1041=(py*sj27); IkReal x1042=((3.11526479750779)*sj28); IkReal x1043=(cj27*px); if( IKabs((((x1042*x1043))+((x1041*x1042))+((pz*x1040))+(((-0.311526479750779)*sj28)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-0.311526479750779)*cj28))+((x1040*x1043))+((x1040*x1041))+(((-1.0)*pz*x1042)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x1042*x1043))+((x1041*x1042))+((pz*x1040))+(((-0.311526479750779)*sj28))))+IKsqr(((-1.24610591900312)+(((-0.311526479750779)*cj28))+((x1040*x1043))+((x1040*x1041))+(((-1.0)*pz*x1042))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2((((x1042*x1043))+((x1041*x1042))+((pz*x1040))+(((-0.311526479750779)*sj28))), ((-1.24610591900312)+(((-0.311526479750779)*cj28))+((x1040*x1043))+((x1040*x1041))+(((-1.0)*pz*x1042)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1044=IKcos(j30); IkReal x1045=IKsin(j30); IkReal x1046=(cj27*px); IkReal x1047=((1.0)*sj28); IkReal x1048=((0.25)*sj27); IkReal x1049=(py*sj27); IkReal x1050=((0.321)*x1044); IkReal x1051=((0.321)*x1045); evalcond[0]=((((0.4)*sj28))+pz+(((-1.0)*cj28*x1051))+((sj28*x1050))); evalcond[1]=((0.253041)+(((0.2)*x1046))+(((0.2)*x1049))+(((-1.0)*pp))+(((0.2568)*x1044))); CheckValue<IkReal> x1052=IKPowWithIntegerCheck(py,-1); if(!x1052.valid){ continue; } evalcond[2]=((0.31630125)+x1050+(((-1.25)*pp))+((py*x1048))+((x1048*(px*px)*(x1052.value)))); evalcond[3]=((((-1.0)*x1046*x1047))+x1051+(((0.1)*sj28))+(((-1.0)*cj28*pz))+(((-1.0)*x1047*x1049))); evalcond[4]=((0.1)+(((0.4)*cj28))+(((-1.0)*x1049))+(((-1.0)*x1046))+((cj28*x1050))+((sj28*x1051))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j28))), 6.28318530717959))); evalcond[1]=((-0.146959)+((cj27*px))+(((-1.0)*pp))+((py*sj27))); evalcond[2]=(((cj29*px*sj27))+(((-1.0)*cj27*cj29*py))+(((-1.0)*pz*sj29))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30eval[1]; sj28=0; cj28=1.0; j28=0; j30eval[0]=cj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal j30eval[1]; sj28=0; cj28=1.0; j28=0; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x1053=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x1053; evalcond[2]=((-0.146959)+((cj27*px))+(((-1.0)*pp))+((py*sj27))); evalcond[3]=x1053; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((-3.11526479750779)*pz)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-3.11526479750779)*pz))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((-3.11526479750779)*pz), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1054=IKcos(j30); evalcond[0]=(pz+(((0.321)*(IKsin(j30))))); evalcond[1]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1054))); evalcond[2]=((0.353041)+(((0.321)*x1054))+(((-1.0)*pp))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1055=(cj27*py); IkReal x1056=(px*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x1056+(((-1.0)*x1055))); evalcond[2]=((-0.146959)+((cj27*px))+(((-1.0)*pp))+((py*sj27))); evalcond[3]=(x1055+(((-1.0)*x1056))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((3.11526479750779)*pz)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((3.11526479750779)*pz))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((3.11526479750779)*pz), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1057=IKcos(j30); evalcond[0]=((((-0.321)*(IKsin(j30))))+pz); evalcond[1]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1057))); evalcond[2]=((0.353041)+(((0.321)*x1057))+(((-1.0)*pp))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=pz; evalcond[2]=((-0.146959)+((cj27*px))+(((-1.0)*pp))+((py*sj27))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1058=IKcos(j30); evalcond[0]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1058))); evalcond[1]=((0.353041)+(((0.321)*x1058))+(((-1.0)*pp))); evalcond[2]=((((-1.0)*cj27*py))+((px*sj27))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=pz; evalcond[2]=((-0.146959)+((cj27*px))+(((-1.0)*pp))+((py*sj27))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1059=IKcos(j30); evalcond[0]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1059))); evalcond[1]=((0.353041)+(((0.321)*x1059))+(((-1.0)*pp))); evalcond[2]=((((-1.0)*cj27*py))+(((-0.321)*(IKsin(j30))))+((px*sj27))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j30] } } while(0); if( bgotonextstatement ) { } } } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1060=IKPowWithIntegerCheck(sj29,-1); if(!x1060.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1060.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1060.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1060.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1061=IKcos(j30); IkReal x1062=IKsin(j30); IkReal x1063=(px*sj27); IkReal x1064=((1.0)*cj27*py); IkReal x1065=((0.321)*x1062); evalcond[0]=(pz+((cj29*x1065))); evalcond[1]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1061))); evalcond[2]=((0.353041)+(((0.321)*x1061))+(((-1.0)*pp))); evalcond[3]=(x1063+(((-1.0)*x1064))+((sj29*x1065))); evalcond[4]=(x1065+(((-1.0)*sj29*x1064))+((cj29*pz))+((sj29*x1063))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1066=IKPowWithIntegerCheck(cj29,-1); if(!x1066.valid){ continue; } if( IKabs(((-3.11526479750779)*pz*(x1066.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.09981619937695)+(((3.11526479750779)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-3.11526479750779)*pz*(x1066.value)))+IKsqr(((-1.09981619937695)+(((3.11526479750779)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((-3.11526479750779)*pz*(x1066.value)), ((-1.09981619937695)+(((3.11526479750779)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1067=IKcos(j30); IkReal x1068=IKsin(j30); IkReal x1069=(px*sj27); IkReal x1070=((1.0)*cj27*py); IkReal x1071=((0.321)*x1068); evalcond[0]=(pz+((cj29*x1071))); evalcond[1]=((0.2824328)+(((-0.8)*pp))+(((0.2568)*x1067))); evalcond[2]=((0.353041)+(((0.321)*x1067))+(((-1.0)*pp))); evalcond[3]=(x1069+((sj29*x1071))+(((-1.0)*x1070))); evalcond[4]=((((-1.0)*sj29*x1070))+x1071+((cj29*pz))+((sj29*x1069))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j28)))), 6.28318530717959))); evalcond[1]=((0.013041)+(((-0.6)*cj27*px))+(((-1.0)*pp))+(((-0.6)*py*sj27))); evalcond[2]=(((cj29*px*sj27))+(((-1.0)*cj27*cj29*py))+((pz*sj29))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30eval[1]; sj28=0; cj28=-1.0; j28=3.14159265358979; j30eval[0]=cj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal j30eval[1]; sj28=0; cj28=-1.0; j28=3.14159265358979; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x1072=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x1072; evalcond[2]=((0.013041)+(((-0.6)*cj27*px))+(((-1.0)*pp))+(((-0.6)*py*sj27))); evalcond[3]=x1072; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((3.11526479750779)*pz)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((3.11526479750779)*pz))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((3.11526479750779)*pz), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1073=IKcos(j30); evalcond[0]=((((-0.321)*(IKsin(j30))))+pz); evalcond[1]=((0.257388)+(((0.2568)*x1073))+(((-1.33333333333333)*pp))); evalcond[2]=((0.321735)+(((0.321)*x1073))+(((-1.66666666666667)*pp))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1074=(cj27*py); IkReal x1075=(px*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x1075+(((-1.0)*x1074))); evalcond[2]=((0.013041)+(((-0.6)*cj27*px))+(((-1.0)*pp))+(((-0.6)*py*sj27))); evalcond[3]=(x1074+(((-1.0)*x1075))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((-3.11526479750779)*pz)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-3.11526479750779)*pz))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((-3.11526479750779)*pz), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1076=IKcos(j30); evalcond[0]=(pz+(((0.321)*(IKsin(j30))))); evalcond[1]=((0.257388)+(((0.2568)*x1076))+(((-1.33333333333333)*pp))); evalcond[2]=((0.321735)+(((0.321)*x1076))+(((-1.66666666666667)*pp))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=pz; evalcond[2]=((0.013041)+(((-0.6)*cj27*px))+(((-1.0)*pp))+(((-0.6)*py*sj27))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1077=IKcos(j30); evalcond[0]=((0.257388)+(((0.2568)*x1077))+(((-1.33333333333333)*pp))); evalcond[1]=((0.321735)+(((0.321)*x1077))+(((-1.66666666666667)*pp))); evalcond[2]=((((-1.0)*cj27*py))+((px*sj27))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=pz; evalcond[2]=((0.013041)+(((-0.6)*cj27*px))+(((-1.0)*pp))+(((-0.6)*py*sj27))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1078=IKcos(j30); evalcond[0]=((0.257388)+(((0.2568)*x1078))+(((-1.33333333333333)*pp))); evalcond[1]=((0.321735)+(((0.321)*x1078))+(((-1.66666666666667)*pp))); evalcond[2]=((((-1.0)*cj27*py))+(((-0.321)*(IKsin(j30))))+((px*sj27))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j30] } } while(0); if( bgotonextstatement ) { } } } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1079=IKPowWithIntegerCheck(sj29,-1); if(!x1079.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1079.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1079.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1079.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1080=IKcos(j30); IkReal x1081=IKsin(j30); IkReal x1082=(px*sj27); IkReal x1083=((1.0)*cj27*py); IkReal x1084=((0.321)*x1081); evalcond[0]=(pz+(((-1.0)*cj29*x1084))); evalcond[1]=((0.257388)+(((0.2568)*x1080))+(((-1.33333333333333)*pp))); evalcond[2]=((0.321735)+(((0.321)*x1080))+(((-1.66666666666667)*pp))); evalcond[3]=(x1082+((sj29*x1084))+(((-1.0)*x1083))); evalcond[4]=(x1084+((sj29*x1082))+(((-1.0)*cj29*pz))+(((-1.0)*sj29*x1083))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1085=IKPowWithIntegerCheck(cj29,-1); if(!x1085.valid){ continue; } if( IKabs(((3.11526479750779)*pz*(x1085.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.00228971962617)+(((5.19210799584631)*pp)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((3.11526479750779)*pz*(x1085.value)))+IKsqr(((-1.00228971962617)+(((5.19210799584631)*pp))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((3.11526479750779)*pz*(x1085.value)), ((-1.00228971962617)+(((5.19210799584631)*pp)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1086=IKcos(j30); IkReal x1087=IKsin(j30); IkReal x1088=(px*sj27); IkReal x1089=((1.0)*cj27*py); IkReal x1090=((0.321)*x1087); evalcond[0]=(pz+(((-1.0)*cj29*x1090))); evalcond[1]=((0.257388)+(((0.2568)*x1086))+(((-1.33333333333333)*pp))); evalcond[2]=((0.321735)+(((0.321)*x1086))+(((-1.66666666666667)*pp))); evalcond[3]=(x1088+((sj29*x1090))+(((-1.0)*x1089))); evalcond[4]=(x1090+((sj29*x1088))+(((-1.0)*cj29*pz))+(((-1.0)*sj29*x1089))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1091=(cj27*px); IkReal x1092=((1.0)*py); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j28)))), 6.28318530717959))); evalcond[1]=((-0.066959)+(((-0.8)*pz))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*x1091))); evalcond[2]=(((cj29*px*sj27))+(((-1.0)*sj29*x1091))+(((0.1)*sj29))+(((-1.0)*cj27*cj29*x1092))+(((-1.0)*sj27*sj29*x1092))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30eval[1]; sj28=1.0; cj28=0; j28=1.5707963267949; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal j30eval[1]; sj28=1.0; cj28=0; j28=1.5707963267949; j30eval[0]=cj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x1093=(py*sj27); IkReal x1094=(cj27*px); IkReal x1095=((0.1)+(((-1.0)*x1093))+(((-1.0)*x1094))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=x1095; evalcond[2]=((-0.066959)+(((-0.8)*pz))+(((-1.0)*pp))+(((0.2)*x1094))+(((0.2)*x1093))); evalcond[3]=x1095; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1096=IKcos(j30); evalcond[0]=((0.4)+pz+(((0.321)*x1096))); evalcond[1]=((0.32)+(((0.2568)*x1096))+(((0.8)*pz))); evalcond[2]=((((-1.0)*cj27*py))+((px*sj27))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1097=(py*sj27); IkReal x1098=(cj27*px); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=((0.1)+(((-1.0)*x1098))+(((-1.0)*x1097))); evalcond[2]=((-0.066959)+(((-0.8)*pz))+(((-1.0)*pp))+(((0.2)*x1097))+(((0.2)*x1098))); evalcond[3]=((-0.1)+x1097+x1098); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1099=IKcos(j30); evalcond[0]=((0.4)+pz+(((0.321)*x1099))); evalcond[1]=((0.32)+(((0.2568)*x1099))+(((0.8)*pz))); evalcond[2]=((((-1.0)*cj27*py))+(((-0.321)*(IKsin(j30))))+((px*sj27))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1100=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x1100; evalcond[2]=((-0.066959)+(((-0.8)*pz))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=x1100; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1101=IKcos(j30); evalcond[0]=((0.4)+(((0.321)*x1101))+pz); evalcond[1]=((0.32)+(((0.8)*pz))+(((0.2568)*x1101))); evalcond[2]=((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))+(((-0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1102=(cj27*py); IkReal x1103=(px*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x1103+(((-1.0)*x1102))); evalcond[2]=((-0.066959)+(((-0.8)*pz))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=(x1102+(((-1.0)*x1103))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1104=IKcos(j30); evalcond[0]=((0.4)+(((0.321)*x1104))+pz); evalcond[1]=((0.32)+(((0.8)*pz))+(((0.2568)*x1104))); evalcond[2]=((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j30] } } while(0); if( bgotonextstatement ) { } } } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1105=IKPowWithIntegerCheck(cj29,-1); if(!x1105.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1105.value)*(((100.0)+(((-1000.0)*cj27*px))+(((-1000.0)*py*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1105.value)*(((100.0)+(((-1000.0)*cj27*px))+(((-1000.0)*py*sj27))))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1105.value)*(((100.0)+(((-1000.0)*cj27*px))+(((-1000.0)*py*sj27))))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1106=IKcos(j30); IkReal x1107=IKsin(j30); IkReal x1108=((1.0)*py); IkReal x1109=(cj27*px); IkReal x1110=(px*sj27); IkReal x1111=((0.321)*x1107); evalcond[0]=((0.4)+(((0.321)*x1106))+pz); evalcond[1]=((0.32)+(((0.8)*pz))+(((0.2568)*x1106))); evalcond[2]=(x1110+(((-1.0)*cj27*x1108))+((sj29*x1111))); evalcond[3]=((0.1)+(((-1.0)*sj27*x1108))+(((-1.0)*x1109))+(((-1.0)*cj29*x1111))); evalcond[4]=(((cj29*x1109))+((cj29*py*sj27))+x1111+(((-1.0)*cj27*sj29*x1108))+((sj29*x1110))+(((-0.1)*cj29))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1112=IKPowWithIntegerCheck(sj29,-1); if(!x1112.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1112.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((-3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1112.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-1.24610591900312)+(((-3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1112.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-1.24610591900312)+(((-3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1113=IKcos(j30); IkReal x1114=IKsin(j30); IkReal x1115=((1.0)*py); IkReal x1116=(cj27*px); IkReal x1117=(px*sj27); IkReal x1118=((0.321)*x1114); evalcond[0]=((0.4)+(((0.321)*x1113))+pz); evalcond[1]=((0.32)+(((0.8)*pz))+(((0.2568)*x1113))); evalcond[2]=(x1117+(((-1.0)*cj27*x1115))+((sj29*x1118))); evalcond[3]=((0.1)+(((-1.0)*sj27*x1115))+(((-1.0)*x1116))+(((-1.0)*cj29*x1118))); evalcond[4]=(((cj29*py*sj27))+x1118+(((-1.0)*cj27*sj29*x1115))+((sj29*x1117))+(((-0.1)*cj29))+((cj29*x1116))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1119=(py*sj27); IkReal x1120=(cj27*px); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j28)))), 6.28318530717959))); evalcond[1]=((-0.066959)+(((0.8)*pz))+(((-1.0)*pp))+(((0.2)*x1120))+(((0.2)*x1119))); evalcond[2]=(((sj29*x1120))+((cj29*px*sj27))+(((-1.0)*cj27*cj29*py))+((sj29*x1119))+(((-0.1)*sj29))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30eval[1]; sj28=-1.0; cj28=0; j28=-1.5707963267949; j30eval[0]=sj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal j30eval[1]; sj28=-1.0; cj28=0; j28=-1.5707963267949; j30eval[0]=cj29; if( IKabs(j30eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[4]; bool bgotonextstatement = true; do { IkReal x1121=(py*sj27); IkReal x1122=(cj27*px); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=((0.1)+(((-1.0)*x1121))+(((-1.0)*x1122))); evalcond[2]=((-0.066959)+(((0.8)*pz))+(((-1.0)*pp))+(((0.2)*x1121))+(((0.2)*x1122))); evalcond[3]=((-0.1)+x1121+x1122); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1123=IKcos(j30); evalcond[0]=((-0.4)+(((-0.321)*x1123))+pz); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1123))); evalcond[2]=((((-1.0)*cj27*py))+((px*sj27))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1124=(py*sj27); IkReal x1125=(cj27*px); IkReal x1126=((0.1)+(((-1.0)*x1124))+(((-1.0)*x1125))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=x1126; evalcond[2]=((-0.066959)+(((0.8)*pz))+(((-1.0)*pp))+(((0.2)*x1125))+(((0.2)*x1124))); evalcond[3]=x1126; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1127=IKcos(j30); evalcond[0]=((-0.4)+(((-0.321)*x1127))+pz); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1127))); evalcond[2]=((((-1.0)*cj27*py))+(((-0.321)*(IKsin(j30))))+((px*sj27))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1128=((((-1.0)*cj27*py))+((px*sj27))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j29))), 6.28318530717959))); evalcond[1]=x1128; evalcond[2]=((-0.066959)+(((0.8)*pz))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=x1128; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((-0.311526479750779)+(((3.11526479750779)*cj27*px))+(((3.11526479750779)*py*sj27))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1129=IKcos(j30); evalcond[0]=((-0.4)+(((-0.321)*x1129))+pz); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1129))); evalcond[2]=((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))+(((0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1130=(cj27*py); IkReal x1131=(px*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j29)))), 6.28318530717959))); evalcond[1]=(x1131+(((-1.0)*x1130))); evalcond[2]=((-0.066959)+(((0.8)*pz))+(((-1.0)*pp))+(((0.2)*py*sj27))+(((0.2)*cj27*px))); evalcond[3]=(x1130+(((-1.0)*x1131))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.311526479750779)+(((-3.11526479750779)*cj27*px))+(((-3.11526479750779)*py*sj27))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[3]; IkReal x1132=IKcos(j30); evalcond[0]=((-0.4)+(((-0.321)*x1132))+pz); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1132))); evalcond[2]=((0.1)+(((-1.0)*py*sj27))+(((-1.0)*cj27*px))+(((-0.321)*(IKsin(j30))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j30] } } while(0); if( bgotonextstatement ) { } } } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1133=IKPowWithIntegerCheck(cj29,-1); if(!x1133.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1133.value)*(((-100.0)+(((1000.0)*cj27*px))+(((1000.0)*py*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1133.value)*(((-100.0)+(((1000.0)*cj27*px))+(((1000.0)*py*sj27))))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1133.value)*(((-100.0)+(((1000.0)*cj27*px))+(((1000.0)*py*sj27))))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1134=IKcos(j30); IkReal x1135=IKsin(j30); IkReal x1136=((1.0)*py); IkReal x1137=(px*sj27); IkReal x1138=((1.0)*cj27*px); IkReal x1139=((0.321)*x1135); evalcond[0]=((-0.4)+(((-0.321)*x1134))+pz); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1134))); evalcond[2]=(x1137+((sj29*x1139))+(((-1.0)*cj27*x1136))); evalcond[3]=((0.1)+(((-1.0)*x1138))+(((-1.0)*sj27*x1136))+((cj29*x1139))); evalcond[4]=(x1139+((sj29*x1137))+(((0.1)*cj29))+(((-1.0)*cj29*sj27*x1136))+(((-1.0)*cj27*sj29*x1136))+(((-1.0)*cj29*x1138))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1140=IKPowWithIntegerCheck(sj29,-1); if(!x1140.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1140.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.24610591900312)+(((3.11526479750779)*pz)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1140.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-1.24610591900312)+(((3.11526479750779)*pz))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1140.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-1.24610591900312)+(((3.11526479750779)*pz)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1141=IKcos(j30); IkReal x1142=IKsin(j30); IkReal x1143=((1.0)*py); IkReal x1144=(px*sj27); IkReal x1145=((1.0)*cj27*px); IkReal x1146=((0.321)*x1142); evalcond[0]=((-0.4)+pz+(((-0.321)*x1141))); evalcond[1]=((0.32)+(((-0.8)*pz))+(((0.2568)*x1141))); evalcond[2]=(x1144+(((-1.0)*cj27*x1143))+((sj29*x1146))); evalcond[3]=((0.1)+(((-1.0)*x1145))+((cj29*x1146))+(((-1.0)*sj27*x1143))); evalcond[4]=((((-1.0)*cj29*sj27*x1143))+x1146+(((-1.0)*cj27*sj29*x1143))+((sj29*x1144))+(((-1.0)*cj29*x1145))+(((0.1)*cj29))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1147=(cj27*px); IkReal x1148=((0.8)*cj28); IkReal x1149=(py*sj27); IkReal x1150=((1.0)*sj28); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=((-0.066959)+(((-0.08)*cj28))+(((-1.0)*pp))+((x1147*x1148))+((x1148*x1149))+(((0.2)*x1147))+(((0.2)*x1149))+(((-0.8)*pz*sj28))); evalcond[2]=((((-1.0)*x1149*x1150))+(((-1.0)*x1147*x1150))+(((0.1)*sj28))+(((-1.0)*cj28*pz))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))))+IKsqr(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((3.11526479750779)*cj27*py))+(((-3.11526479750779)*px*sj27))), ((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1151=IKcos(j30); IkReal x1152=((1.0)*py); IkReal x1153=(cj27*px); IkReal x1154=((0.321)*x1151); evalcond[0]=((((0.4)*sj28))+((sj28*x1154))+pz); evalcond[1]=((((-1.0)*cj27*x1152))+((px*sj27))+(((0.321)*(IKsin(j30))))); evalcond[2]=((0.253041)+(((0.2)*x1153))+(((0.2568)*x1151))+(((-1.0)*pp))+(((0.2)*py*sj27))); evalcond[3]=((0.1)+(((-1.0)*sj27*x1152))+(((0.4)*cj28))+((cj28*x1154))+(((-1.0)*x1153))); evalcond[4]=((0.4)+x1154+(((-1.0)*cj28*sj27*x1152))+(((-1.0)*cj28*x1153))+(((0.1)*cj28))+((pz*sj28))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x1155=(cj27*px); IkReal x1156=((0.8)*cj28); IkReal x1157=(py*sj27); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j29)))), 6.28318530717959))); evalcond[1]=((-0.066959)+(((0.2)*x1155))+(((0.2)*x1157))+(((-0.08)*cj28))+(((-1.0)*pp))+((x1156*x1157))+(((-0.8)*pz*sj28))+((x1155*x1156))); evalcond[2]=(((sj28*x1155))+((sj28*x1157))+((cj28*pz))+(((-0.1)*sj28))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; if( IKabs(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))))+IKsqr(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((((-3.11526479750779)*cj27*py))+(((3.11526479750779)*px*sj27))), ((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[5]; IkReal x1158=IKcos(j30); IkReal x1159=((1.0)*py); IkReal x1160=(cj27*px); IkReal x1161=((0.321)*x1158); evalcond[0]=((((0.4)*sj28))+pz+((sj28*x1161))); evalcond[1]=((((-1.0)*cj27*x1159))+(((-0.321)*(IKsin(j30))))+((px*sj27))); evalcond[2]=((0.253041)+(((0.2568)*x1158))+(((-1.0)*pp))+(((0.2)*x1160))+(((0.2)*py*sj27))); evalcond[3]=((0.1)+(((-1.0)*sj27*x1159))+(((0.4)*cj28))+(((-1.0)*x1160))+((cj28*x1161))); evalcond[4]=((0.4)+x1161+(((-1.0)*cj28*sj27*x1159))+(((-1.0)*cj28*x1160))+(((0.1)*cj28))+((pz*sj28))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j30] } } while(0); if( bgotonextstatement ) { } } } } } } } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1167=IKPowWithIntegerCheck(sj29,-1); if(!x1167.valid){ continue; } IkReal x1162=x1167.value; IkReal x1163=((0.00311526479750779)*x1162); IkReal x1164=(cj28*cj29); IkReal x1165=((1000.0)*cj27*py); IkReal x1166=((1000.0)*px*sj27); CheckValue<IkReal> x1168=IKPowWithIntegerCheck(sj28,-1); if(!x1168.valid){ continue; } if( IKabs((x1163*((x1165+(((-1.0)*x1166)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1163*(x1168.value)*((((x1164*x1166))+(((-400.0)*sj28*sj29))+(((-1000.0)*pz*sj29))+(((-1.0)*x1164*x1165)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1163*((x1165+(((-1.0)*x1166))))))+IKsqr((x1163*(x1168.value)*((((x1164*x1166))+(((-400.0)*sj28*sj29))+(((-1000.0)*pz*sj29))+(((-1.0)*x1164*x1165))))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2((x1163*((x1165+(((-1.0)*x1166))))), (x1163*(x1168.value)*((((x1164*x1166))+(((-400.0)*sj28*sj29))+(((-1000.0)*pz*sj29))+(((-1.0)*x1164*x1165)))))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[6]; IkReal x1169=IKsin(j30); IkReal x1170=IKcos(j30); IkReal x1171=((1.0)*py); IkReal x1172=(cj29*sj28); IkReal x1173=(cj27*px); IkReal x1174=(cj28*cj29); IkReal x1175=(py*sj27); IkReal x1176=(px*sj27); IkReal x1177=((0.321)*x1169); IkReal x1178=((0.321)*x1170); evalcond[0]=(x1176+(((-1.0)*cj27*x1171))+((sj29*x1177))); evalcond[1]=((0.253041)+(((0.2568)*x1170))+(((0.2)*x1175))+(((0.2)*x1173))+(((-1.0)*pp))); evalcond[2]=((((0.4)*sj28))+((x1174*x1177))+pz+((sj28*x1178))); evalcond[3]=((0.4)+x1178+(((-1.0)*cj28*sj27*x1171))+(((0.1)*cj28))+(((-1.0)*cj28*x1173))+((pz*sj28))); evalcond[4]=((0.1)+((cj28*x1178))+(((0.4)*cj28))+(((-1.0)*x1172*x1177))+(((-1.0)*sj27*x1171))+(((-1.0)*x1173))); evalcond[5]=((((-1.0)*cj27*sj29*x1171))+x1177+((x1172*x1175))+((x1172*x1173))+((pz*x1174))+(((-0.1)*x1172))+((sj29*x1176))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; IkReal x1179=((250.0)*sj28); IkReal x1180=(py*sj27); IkReal x1181=(cj27*px); CheckValue<IkReal> x1182=IKPowWithIntegerCheck(cj28,-1); if(!x1182.valid){ continue; } CheckValue<IkReal> x1183=IKPowWithIntegerCheck(cj29,-1); if(!x1183.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1182.value)*(x1183.value)*(((((-1000.0)*pz))+(((-83.69875)*sj28))+((x1179*x1181))+((x1179*x1180))+(((-1250.0)*pp*sj28)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*x1180))+(((-0.778816199376947)*x1181)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1182.value)*(x1183.value)*(((((-1000.0)*pz))+(((-83.69875)*sj28))+((x1179*x1181))+((x1179*x1180))+(((-1250.0)*pp*sj28))))))+IKsqr(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*x1180))+(((-0.778816199376947)*x1181))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1182.value)*(x1183.value)*(((((-1000.0)*pz))+(((-83.69875)*sj28))+((x1179*x1181))+((x1179*x1180))+(((-1250.0)*pp*sj28))))), ((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*x1180))+(((-0.778816199376947)*x1181)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[6]; IkReal x1184=IKsin(j30); IkReal x1185=IKcos(j30); IkReal x1186=((1.0)*py); IkReal x1187=(cj29*sj28); IkReal x1188=(cj27*px); IkReal x1189=(cj28*cj29); IkReal x1190=(py*sj27); IkReal x1191=(px*sj27); IkReal x1192=((0.321)*x1184); IkReal x1193=((0.321)*x1185); evalcond[0]=(((sj29*x1192))+x1191+(((-1.0)*cj27*x1186))); evalcond[1]=((0.253041)+(((-1.0)*pp))+(((0.2)*x1190))+(((0.2)*x1188))+(((0.2568)*x1185))); evalcond[2]=((((0.4)*sj28))+((sj28*x1193))+((x1189*x1192))+pz); evalcond[3]=((0.4)+x1193+(((0.1)*cj28))+(((-1.0)*cj28*x1188))+(((-1.0)*cj28*sj27*x1186))+((pz*sj28))); evalcond[4]=((0.1)+(((0.4)*cj28))+(((-1.0)*x1187*x1192))+((cj28*x1193))+(((-1.0)*sj27*x1186))+(((-1.0)*x1188))); evalcond[5]=(((sj29*x1191))+((x1187*x1188))+x1192+((x1187*x1190))+((pz*x1189))+(((-0.1)*x1187))+(((-1.0)*cj27*sj29*x1186))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } else { { IkReal j30array[1], cj30array[1], sj30array[1]; bool j30valid[1]={false}; _nj30 = 1; CheckValue<IkReal> x1194=IKPowWithIntegerCheck(sj29,-1); if(!x1194.valid){ continue; } if( IKabs(((0.00311526479750779)*(x1194.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.00311526479750779)*(x1194.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))))+IKsqr(((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px))))-1) <= IKFAST_SINCOS_THRESH ) continue; j30array[0]=IKatan2(((0.00311526479750779)*(x1194.value)*(((((1000.0)*cj27*py))+(((-1000.0)*px*sj27))))), ((-0.98536214953271)+(((3.89408099688474)*pp))+(((-0.778816199376947)*py*sj27))+(((-0.778816199376947)*cj27*px)))); sj30array[0]=IKsin(j30array[0]); cj30array[0]=IKcos(j30array[0]); if( j30array[0] > IKPI ) { j30array[0]-=IK2PI; } else if( j30array[0] < -IKPI ) { j30array[0]+=IK2PI; } j30valid[0] = true; for(int ij30 = 0; ij30 < 1; ++ij30) { if( !j30valid[ij30] ) { continue; } _ij30[0] = ij30; _ij30[1] = -1; for(int iij30 = ij30+1; iij30 < 1; ++iij30) { if( j30valid[iij30] && IKabs(cj30array[ij30]-cj30array[iij30]) < IKFAST_SOLUTION_THRESH && IKabs(sj30array[ij30]-sj30array[iij30]) < IKFAST_SOLUTION_THRESH ) { j30valid[iij30]=false; _ij30[1] = iij30; break; } } j30 = j30array[ij30]; cj30 = cj30array[ij30]; sj30 = sj30array[ij30]; { IkReal evalcond[6]; IkReal x1195=IKsin(j30); IkReal x1196=IKcos(j30); IkReal x1197=((1.0)*py); IkReal x1198=(cj29*sj28); IkReal x1199=(cj27*px); IkReal x1200=(cj28*cj29); IkReal x1201=(py*sj27); IkReal x1202=(px*sj27); IkReal x1203=((0.321)*x1195); IkReal x1204=((0.321)*x1196); evalcond[0]=(x1202+((sj29*x1203))+(((-1.0)*cj27*x1197))); evalcond[1]=((0.253041)+(((-1.0)*pp))+(((0.2)*x1199))+(((0.2568)*x1196))+(((0.2)*x1201))); evalcond[2]=((((0.4)*sj28))+((sj28*x1204))+((x1200*x1203))+pz); evalcond[3]=((0.4)+x1204+(((0.1)*cj28))+(((-1.0)*cj28*x1199))+(((-1.0)*cj28*sj27*x1197))+((pz*sj28))); evalcond[4]=((0.1)+(((0.4)*cj28))+((cj28*x1204))+(((-1.0)*sj27*x1197))+(((-1.0)*x1199))+(((-1.0)*x1198*x1203))); evalcond[5]=(x1203+(((-0.1)*x1198))+((x1198*x1199))+((sj29*x1202))+(((-1.0)*cj27*sj29*x1197))+((pz*x1200))+((x1198*x1201))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH ) { continue; } } rotationfunction0(solutions); } } } } } } } } } } return solutions.GetNumSolutions()>0; } inline void rotationfunction0(IkSolutionListBase<IkReal>& solutions) { for(int rotationiter = 0; rotationiter < 1; ++rotationiter) { IkReal x194=(sj27*sj29); IkReal x195=(cj27*sj29); IkReal x196=(cj28*sj29); IkReal x197=(cj28*cj30); IkReal x198=((1.0)*sj30); IkReal x199=((1.0)*cj29); IkReal x200=(cj29*x198); IkReal x201=((1.0)*cj30*sj28); IkReal x202=((((-1.0)*x197*x199))+((sj28*sj30))); IkReal x203=((((-1.0)*sj27*x199))+((sj28*x195))); IkReal x204=(((sj28*x194))+((cj27*cj29))); IkReal x205=(x197+(((-1.0)*sj28*x200))); IkReal x206=(cj27*x205); IkReal x207=((((-1.0)*cj30*sj28*x199))+(((-1.0)*cj28*x198))); IkReal x208=((((-1.0)*x201))+(((-1.0)*cj28*x200))); IkReal x209=(cj27*x207); IkReal x210=(((sj30*x195))+((sj27*x205))); IkReal x211=((((-1.0)*sj30*x194))+x206); IkReal x212=(((cj30*x195))+((sj27*x207))); IkReal x213=((((-1.0)*cj30*x194))+x209); new_r00=(((r20*x202))+((r00*(((((-1.0)*cj30*x194))+x209))))+((r10*x212))); new_r01=(((r11*x212))+((r21*x202))+((r01*x213))); new_r02=(((r22*x202))+((r12*x212))+((r02*x213))); new_r10=(((r20*x196))+((r00*x203))+((r10*x204))); new_r11=(((r11*x204))+((r01*x203))+((r21*x196))); new_r12=(((r22*x196))+((r12*x204))+((r02*x203))); new_r20=(((r20*x208))+((r00*x211))+((r10*x210))); new_r21=(((r11*x210))+((r21*x208))+((r01*x211))); new_r22=(((r22*x208))+((r02*(((((-1.0)*x194*x198))+x206))))+((r12*x210))); { IkReal j32array[2], cj32array[2], sj32array[2]; bool j32valid[2]={false}; _nj32 = 2; cj32array[0]=new_r22; if( cj32array[0] >= -1-IKFAST_SINCOS_THRESH && cj32array[0] <= 1+IKFAST_SINCOS_THRESH ) { j32valid[0] = j32valid[1] = true; j32array[0] = IKacos(cj32array[0]); sj32array[0] = IKsin(j32array[0]); cj32array[1] = cj32array[0]; j32array[1] = -j32array[0]; sj32array[1] = -sj32array[0]; } else if( isnan(cj32array[0]) ) { // probably any value will work j32valid[0] = true; cj32array[0] = 1; sj32array[0] = 0; j32array[0] = 0; } for(int ij32 = 0; ij32 < 2; ++ij32) { if( !j32valid[ij32] ) { continue; } _ij32[0] = ij32; _ij32[1] = -1; for(int iij32 = ij32+1; iij32 < 2; ++iij32) { if( j32valid[iij32] && IKabs(cj32array[ij32]-cj32array[iij32]) < IKFAST_SOLUTION_THRESH && IKabs(sj32array[ij32]-sj32array[iij32]) < IKFAST_SOLUTION_THRESH ) { j32valid[iij32]=false; _ij32[1] = iij32; break; } } j32 = j32array[ij32]; cj32 = cj32array[ij32]; sj32 = sj32array[ij32]; { IkReal j31eval[2]; IkReal x214=(sj27*sj29); IkReal x215=(cj27*sj29); IkReal x216=(cj28*sj29); IkReal x217=(cj28*cj30); IkReal x218=((1.0)*sj30); IkReal x219=((1.0)*cj29); IkReal x220=(cj29*x218); IkReal x221=((1.0)*cj30*sj28); IkReal x222=x202; IkReal x223=x203; IkReal x224=x204; IkReal x225=((((-1.0)*sj28*x220))+x217); IkReal x226=(cj27*x225); IkReal x227=x207; IkReal x228=((((-1.0)*cj28*x220))+(((-1.0)*x221))); IkReal x229=(cj27*x227); IkReal x230=(((sj30*x215))+((sj27*x225))); IkReal x231=(x226+(((-1.0)*sj30*x214))); IkReal x232=(((cj30*x215))+((sj27*x227))); IkReal x233=(x229+(((-1.0)*cj30*x214))); new_r00=(((r20*x222))+((r10*x232))+((r00*((x229+(((-1.0)*cj30*x214))))))); new_r01=(((r11*x232))+((r01*x233))+((r21*x222))); new_r02=(((r02*x233))+((r22*x222))+((r12*x232))); new_r10=(((r00*x223))+((r10*x224))+((r20*x216))); new_r11=(((r21*x216))+((r01*x223))+((r11*x224))); new_r12=(((r12*x224))+((r22*x216))+((r02*x223))); new_r20=(((r20*x228))+((r10*x230))+((r00*x231))); new_r21=(((r11*x230))+((r01*x231))+((r21*x228))); new_r22=(((r22*x228))+((r02*((x226+(((-1.0)*x214*x218))))))+((r12*x230))); j31eval[0]=sj32; j31eval[1]=IKsign(sj32); if( IKabs(j31eval[0]) < 0.0000010000000000 || IKabs(j31eval[1]) < 0.0000010000000000 ) { { IkReal j31eval[1]; IkReal x234=(sj27*sj29); IkReal x235=(cj27*sj29); IkReal x236=(cj28*sj29); IkReal x237=(cj28*cj30); IkReal x238=((1.0)*sj30); IkReal x239=((1.0)*cj29); IkReal x240=(cj29*x238); IkReal x241=((1.0)*cj30*sj28); IkReal x242=x202; IkReal x243=x203; IkReal x244=x204; IkReal x245=(x237+(((-1.0)*sj28*x240))); IkReal x246=(cj27*x245); IkReal x247=x207; IkReal x248=((((-1.0)*x241))+(((-1.0)*cj28*x240))); IkReal x249=(cj27*x247); IkReal x250=(((sj27*x245))+((sj30*x235))); IkReal x251=(x246+(((-1.0)*sj30*x234))); IkReal x252=(((sj27*x247))+((cj30*x235))); IkReal x253=(x249+(((-1.0)*cj30*x234))); new_r00=(((r00*((x249+(((-1.0)*cj30*x234))))))+((r10*x252))+((r20*x242))); new_r01=(((r11*x252))+((r01*x253))+((r21*x242))); new_r02=(((r22*x242))+((r12*x252))+((r02*x253))); new_r10=(((r20*x236))+((r00*x243))+((r10*x244))); new_r11=(((r01*x243))+((r11*x244))+((r21*x236))); new_r12=(((r02*x243))+((r12*x244))+((r22*x236))); new_r20=(((r00*x251))+((r10*x250))+((r20*x248))); new_r21=(((r11*x250))+((r01*x251))+((r21*x248))); new_r22=(((r22*x248))+((r12*x250))+((r02*((x246+(((-1.0)*x234*x238))))))); j31eval[0]=sj32; if( IKabs(j31eval[0]) < 0.0000010000000000 ) { { IkReal evalcond[6]; bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j32))), 6.28318530717959))); evalcond[1]=((-1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j31array[2], cj31array[2], sj31array[2]; bool j31valid[2]={false}; _nj31 = 2; CheckValue<IkReal> x255 = IKatan2WithCheck(IkReal(new_r02),new_r12,IKFAST_ATAN2_MAGTHRESH); if(!x255.valid){ continue; } IkReal x254=x255.value; j31array[0]=((-1.0)*x254); sj31array[0]=IKsin(j31array[0]); cj31array[0]=IKcos(j31array[0]); j31array[1]=((3.14159265358979)+(((-1.0)*x254))); sj31array[1]=IKsin(j31array[1]); cj31array[1]=IKcos(j31array[1]); if( j31array[0] > IKPI ) { j31array[0]-=IK2PI; } else if( j31array[0] < -IKPI ) { j31array[0]+=IK2PI; } j31valid[0] = true; if( j31array[1] > IKPI ) { j31array[1]-=IK2PI; } else if( j31array[1] < -IKPI ) { j31array[1]+=IK2PI; } j31valid[1] = true; for(int ij31 = 0; ij31 < 2; ++ij31) { if( !j31valid[ij31] ) { continue; } _ij31[0] = ij31; _ij31[1] = -1; for(int iij31 = ij31+1; iij31 < 2; ++iij31) { if( j31valid[iij31] && IKabs(cj31array[ij31]-cj31array[iij31]) < IKFAST_SOLUTION_THRESH && IKabs(sj31array[ij31]-sj31array[iij31]) < IKFAST_SOLUTION_THRESH ) { j31valid[iij31]=false; _ij31[1] = iij31; break; } } j31 = j31array[ij31]; cj31 = cj31array[ij31]; sj31 = sj31array[ij31]; { IkReal evalcond[1]; evalcond[0]=(((new_r12*(IKcos(j31))))+(((-1.0)*new_r02*(IKsin(j31))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x256=((1.0)*sj31); if( IKabs(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x256)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x256))+((cj31*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x256))))+IKsqr(((((-1.0)*new_r01*x256))+((cj31*new_r00))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x256))), ((((-1.0)*new_r01*x256))+((cj31*new_r00)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x257=IKsin(j33); IkReal x258=IKcos(j33); IkReal x259=((1.0)*sj31); IkReal x260=((1.0)*x258); IkReal x261=(sj31*x257); IkReal x262=((1.0)*x257); IkReal x263=(cj31*x260); evalcond[0]=(((cj31*new_r01))+((new_r11*sj31))+x257); evalcond[1]=(((cj31*x257))+((sj31*x258))+new_r01); evalcond[2]=(((cj31*new_r00))+((new_r10*sj31))+(((-1.0)*x260))); evalcond[3]=(((cj31*new_r10))+(((-1.0)*x262))+(((-1.0)*new_r00*x259))); evalcond[4]=((((-1.0)*new_r01*x259))+((cj31*new_r11))+(((-1.0)*x260))); evalcond[5]=(x261+new_r00+(((-1.0)*x263))); evalcond[6]=(x261+new_r11+(((-1.0)*x263))); evalcond[7]=((((-1.0)*cj31*x262))+new_r10+(((-1.0)*x258*x259))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j32)))), 6.28318530717959))); evalcond[1]=((1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j31array[2], cj31array[2], sj31array[2]; bool j31valid[2]={false}; _nj31 = 2; CheckValue<IkReal> x265 = IKatan2WithCheck(IkReal(new_r02),new_r12,IKFAST_ATAN2_MAGTHRESH); if(!x265.valid){ continue; } IkReal x264=x265.value; j31array[0]=((-1.0)*x264); sj31array[0]=IKsin(j31array[0]); cj31array[0]=IKcos(j31array[0]); j31array[1]=((3.14159265358979)+(((-1.0)*x264))); sj31array[1]=IKsin(j31array[1]); cj31array[1]=IKcos(j31array[1]); if( j31array[0] > IKPI ) { j31array[0]-=IK2PI; } else if( j31array[0] < -IKPI ) { j31array[0]+=IK2PI; } j31valid[0] = true; if( j31array[1] > IKPI ) { j31array[1]-=IK2PI; } else if( j31array[1] < -IKPI ) { j31array[1]+=IK2PI; } j31valid[1] = true; for(int ij31 = 0; ij31 < 2; ++ij31) { if( !j31valid[ij31] ) { continue; } _ij31[0] = ij31; _ij31[1] = -1; for(int iij31 = ij31+1; iij31 < 2; ++iij31) { if( j31valid[iij31] && IKabs(cj31array[ij31]-cj31array[iij31]) < IKFAST_SOLUTION_THRESH && IKabs(sj31array[ij31]-sj31array[iij31]) < IKFAST_SOLUTION_THRESH ) { j31valid[iij31]=false; _ij31[1] = iij31; break; } } j31 = j31array[ij31]; cj31 = cj31array[ij31]; sj31 = sj31array[ij31]; { IkReal evalcond[1]; evalcond[0]=(((new_r12*(IKcos(j31))))+(((-1.0)*new_r02*(IKsin(j31))))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x266=((1.0)*sj31); if( IKabs(((((-1.0)*new_r00*x266))+((cj31*new_r01)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x266))+(((-1.0)*cj31*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*x266))+((cj31*new_r01))))+IKsqr(((((-1.0)*new_r01*x266))+(((-1.0)*cj31*new_r00))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((((-1.0)*new_r00*x266))+((cj31*new_r01))), ((((-1.0)*new_r01*x266))+(((-1.0)*cj31*new_r00)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x267=IKsin(j33); IkReal x268=IKcos(j33); IkReal x269=((1.0)*sj31); IkReal x270=((1.0)*x267); IkReal x271=(sj31*x268); IkReal x272=((1.0)*x268); IkReal x273=(cj31*x270); evalcond[0]=(((cj31*new_r00))+((new_r10*sj31))+x268); evalcond[1]=(((cj31*new_r01))+((new_r11*sj31))+(((-1.0)*x270))); evalcond[2]=(((sj31*x267))+((cj31*x268))+new_r00); evalcond[3]=(((cj31*new_r10))+(((-1.0)*new_r00*x269))+(((-1.0)*x270))); evalcond[4]=((((-1.0)*new_r01*x269))+((cj31*new_r11))+(((-1.0)*x272))); evalcond[5]=(x271+(((-1.0)*x273))+new_r01); evalcond[6]=(x271+(((-1.0)*x273))+new_r10); evalcond[7]=((((-1.0)*cj31*x272))+(((-1.0)*x267*x269))+new_r11); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j31, j33] } } while(0); if( bgotonextstatement ) { } } } } } else { { IkReal j31array[1], cj31array[1], sj31array[1]; bool j31valid[1]={false}; _nj31 = 1; CheckValue<IkReal> x275=IKPowWithIntegerCheck(sj32,-1); if(!x275.valid){ continue; } IkReal x274=x275.value; CheckValue<IkReal> x276=IKPowWithIntegerCheck(new_r12,-1); if(!x276.valid){ continue; } if( IKabs((x274*(x276.value)*(((1.0)+(((-1.0)*(new_r02*new_r02)))+(((-1.0)*(cj32*cj32))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r02*x274)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x274*(x276.value)*(((1.0)+(((-1.0)*(new_r02*new_r02)))+(((-1.0)*(cj32*cj32)))))))+IKsqr((new_r02*x274))-1) <= IKFAST_SINCOS_THRESH ) continue; j31array[0]=IKatan2((x274*(x276.value)*(((1.0)+(((-1.0)*(new_r02*new_r02)))+(((-1.0)*(cj32*cj32)))))), (new_r02*x274)); sj31array[0]=IKsin(j31array[0]); cj31array[0]=IKcos(j31array[0]); if( j31array[0] > IKPI ) { j31array[0]-=IK2PI; } else if( j31array[0] < -IKPI ) { j31array[0]+=IK2PI; } j31valid[0] = true; for(int ij31 = 0; ij31 < 1; ++ij31) { if( !j31valid[ij31] ) { continue; } _ij31[0] = ij31; _ij31[1] = -1; for(int iij31 = ij31+1; iij31 < 1; ++iij31) { if( j31valid[iij31] && IKabs(cj31array[ij31]-cj31array[iij31]) < IKFAST_SOLUTION_THRESH && IKabs(sj31array[ij31]-sj31array[iij31]) < IKFAST_SOLUTION_THRESH ) { j31valid[iij31]=false; _ij31[1] = iij31; break; } } j31 = j31array[ij31]; cj31 = cj31array[ij31]; sj31 = sj31array[ij31]; { IkReal evalcond[8]; IkReal x277=IKcos(j31); IkReal x278=IKsin(j31); IkReal x279=((1.0)*sj32); IkReal x280=(new_r02*x277); IkReal x281=(new_r12*x278); IkReal x282=(sj32*x277); IkReal x283=(sj32*x278); evalcond[0]=((((-1.0)*x277*x279))+new_r02); evalcond[1]=((((-1.0)*x278*x279))+new_r12); evalcond[2]=((((-1.0)*new_r02*x278))+((new_r12*x277))); evalcond[3]=(x281+x280+(((-1.0)*x279))); evalcond[4]=(((cj32*new_r20))+((new_r00*x282))+((new_r10*x283))); evalcond[5]=(((cj32*new_r21))+((new_r11*x283))+((new_r01*x282))); evalcond[6]=((-1.0)+((cj32*new_r22))+((sj32*x281))+((sj32*x280))); evalcond[7]=((((-1.0)*new_r22*x279))+((cj32*x281))+((cj32*x280))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j33eval[2]; IkReal x284=(sj27*sj29); IkReal x285=(cj27*sj29); IkReal x286=(cj28*sj29); IkReal x287=(cj28*cj30); IkReal x288=((1.0)*sj30); IkReal x289=((1.0)*cj29); IkReal x290=(cj29*x288); IkReal x291=((1.0)*cj30*sj28); IkReal x292=x202; IkReal x293=x203; IkReal x294=x204; IkReal x295=((((-1.0)*sj28*x290))+x287); IkReal x296=(cj27*x295); IkReal x297=x207; IkReal x298=((((-1.0)*x291))+(((-1.0)*cj28*x290))); IkReal x299=(cj27*x297); IkReal x300=(((sj30*x285))+((sj27*x295))); IkReal x301=(x296+(((-1.0)*sj30*x284))); IkReal x302=(((cj30*x285))+((sj27*x297))); IkReal x303=((((-1.0)*cj30*x284))+x299); new_r00=(((r00*(((((-1.0)*cj30*x284))+x299))))+((r20*x292))+((r10*x302))); new_r01=(((r11*x302))+((r01*x303))+((r21*x292))); new_r02=(((r02*x303))+((r22*x292))+((r12*x302))); new_r10=(((r00*x293))+((r10*x294))+((r20*x286))); new_r11=(((r21*x286))+((r01*x293))+((r11*x294))); new_r12=(((r12*x294))+((r22*x286))+((r02*x293))); new_r20=(((r20*x298))+((r10*x300))+((r00*x301))); new_r21=(((r11*x300))+((r01*x301))+((r21*x298))); new_r22=(((r02*((x296+(((-1.0)*x284*x288))))))+((r22*x298))+((r12*x300))); j33eval[0]=sj32; j33eval[1]=IKsign(sj32); if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 ) { { IkReal j33eval[2]; IkReal x304=(sj27*sj29); IkReal x305=(cj27*sj29); IkReal x306=(cj28*sj29); IkReal x307=(cj28*cj30); IkReal x308=((1.0)*sj30); IkReal x309=((1.0)*cj29); IkReal x310=(cj29*x308); IkReal x311=((1.0)*cj30*sj28); IkReal x312=x202; IkReal x313=x203; IkReal x314=x204; IkReal x315=(x307+(((-1.0)*sj28*x310))); IkReal x316=(cj27*x315); IkReal x317=x207; IkReal x318=((((-1.0)*cj28*x310))+(((-1.0)*x311))); IkReal x319=(cj27*x317); IkReal x320=(((sj27*x315))+((sj30*x305))); IkReal x321=(x316+(((-1.0)*sj30*x304))); IkReal x322=(((cj30*x305))+((sj27*x317))); IkReal x323=((((-1.0)*cj30*x304))+x319); new_r00=(((r20*x312))+((r00*(((((-1.0)*cj30*x304))+x319))))+((r10*x322))); new_r01=(((r11*x322))+((r01*x323))+((r21*x312))); new_r02=(((r02*x323))+((r12*x322))+((r22*x312))); new_r10=(((r20*x306))+((r00*x313))+((r10*x314))); new_r11=(((r11*x314))+((r21*x306))+((r01*x313))); new_r12=(((r22*x306))+((r02*x313))+((r12*x314))); new_r20=(((r00*x321))+((r20*x318))+((r10*x320))); new_r21=(((r11*x320))+((r01*x321))+((r21*x318))); new_r22=(((r12*x320))+((r02*((x316+(((-1.0)*x304*x308))))))+((r22*x318))); j33eval[0]=sj31; j33eval[1]=sj32; if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 ) { { IkReal j33eval[3]; IkReal x324=(sj27*sj29); IkReal x325=(cj27*sj29); IkReal x326=(cj28*sj29); IkReal x327=(cj28*cj30); IkReal x328=((1.0)*sj30); IkReal x329=((1.0)*cj29); IkReal x330=(cj29*x328); IkReal x331=((1.0)*cj30*sj28); IkReal x332=x202; IkReal x333=x203; IkReal x334=x204; IkReal x335=((((-1.0)*sj28*x330))+x327); IkReal x336=(cj27*x335); IkReal x337=x207; IkReal x338=((((-1.0)*cj28*x330))+(((-1.0)*x331))); IkReal x339=(cj27*x337); IkReal x340=(((sj30*x325))+((sj27*x335))); IkReal x341=((((-1.0)*sj30*x324))+x336); IkReal x342=(((sj27*x337))+((cj30*x325))); IkReal x343=(x339+(((-1.0)*cj30*x324))); new_r00=(((r00*((x339+(((-1.0)*cj30*x324))))))+((r20*x332))+((r10*x342))); new_r01=(((r01*x343))+((r21*x332))+((r11*x342))); new_r02=(((r22*x332))+((r02*x343))+((r12*x342))); new_r10=(((r00*x333))+((r20*x326))+((r10*x334))); new_r11=(((r01*x333))+((r11*x334))+((r21*x326))); new_r12=(((r12*x334))+((r02*x333))+((r22*x326))); new_r20=(((r00*x341))+((r20*x338))+((r10*x340))); new_r21=(((r01*x341))+((r21*x338))+((r11*x340))); new_r22=(((r22*x338))+((r02*((x336+(((-1.0)*x324*x328))))))+((r12*x340))); j33eval[0]=cj31; j33eval[1]=cj32; j33eval[2]=sj32; if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 || IKabs(j33eval[2]) < 0.0000010000000000 ) { { IkReal evalcond[12]; bool bgotonextstatement = true; do { IkReal x344=((((-1.0)*cj32))+new_r22); IkReal x345=((((-1.0)*sj32))+new_r12); IkReal x346=((1.0)*sj32); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j31)))), 6.28318530717959))); evalcond[1]=x344; evalcond[2]=x344; evalcond[3]=new_r02; evalcond[4]=x345; evalcond[5]=x345; evalcond[6]=(((new_r10*sj32))+((cj32*new_r20))); evalcond[7]=(((new_r11*sj32))+((cj32*new_r21))); evalcond[8]=((-1.0)+((new_r12*sj32))+((cj32*new_r22))); evalcond[9]=(((cj32*new_r12))+(((-1.0)*new_r22*x346))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x347 = IKatan2WithCheck(IkReal(new_r21),((-1.0)*new_r20),IKFAST_ATAN2_MAGTHRESH); if(!x347.valid){ continue; } CheckValue<IkReal> x348=IKPowWithIntegerCheck(IKsign(new_r12),-1); if(!x348.valid){ continue; } j33array[0]=((-1.5707963267949)+(x347.value)+(((1.5707963267949)*(x348.value)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x349=IKsin(j33); IkReal x350=IKcos(j33); IkReal x351=((1.0)*new_r12); IkReal x352=((1.0)*x350); IkReal x353=((1.0)*x349); evalcond[0]=(new_r20+((new_r12*x350))); evalcond[1]=(((new_r22*x349))+new_r11); evalcond[2]=((((-1.0)*x349*x351))+new_r21); evalcond[3]=((((-1.0)*new_r22*x352))+new_r10); evalcond[4]=((((-1.0)*x353))+(((-1.0)*new_r00))); evalcond[5]=((((-1.0)*x352))+(((-1.0)*new_r01))); evalcond[6]=(x349+((new_r11*new_r22))+(((-1.0)*new_r21*x351))); evalcond[7]=((((-1.0)*x352))+((new_r10*new_r22))+(((-1.0)*new_r20*x351))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x354=((((-1.0)*cj32))+new_r22); IkReal x355=((1.0)*sj32); IkReal x356=((1.0)*new_r12); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j31)))), 6.28318530717959))); evalcond[1]=x354; evalcond[2]=x354; evalcond[3]=new_r02; evalcond[4]=(sj32+new_r12); evalcond[5]=((((-1.0)*x356))+(((-1.0)*x355))); evalcond[6]=(((cj32*new_r20))+(((-1.0)*new_r10*x355))); evalcond[7]=((((-1.0)*new_r11*x355))+((cj32*new_r21))); evalcond[8]=((-1.0)+(((-1.0)*new_r12*x355))+((cj32*new_r22))); evalcond[9]=((((-1.0)*new_r22*x355))+(((-1.0)*cj32*x356))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r01)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r00, new_r01); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x357=IKsin(j33); IkReal x358=IKcos(j33); IkReal x359=((1.0)*new_r10); IkReal x360=((1.0)*new_r11); IkReal x361=((1.0)*x358); evalcond[0]=(new_r21+((new_r12*x357))); evalcond[1]=((((-1.0)*x357))+new_r00); evalcond[2]=((((-1.0)*x361))+new_r01); evalcond[3]=((((-1.0)*new_r12*x361))+new_r20); evalcond[4]=(((new_r22*x357))+(((-1.0)*x360))); evalcond[5]=((((-1.0)*x359))+(((-1.0)*new_r22*x361))); evalcond[6]=((((-1.0)*new_r22*x360))+x357+((new_r12*new_r21))); evalcond[7]=((((-1.0)*new_r22*x359))+(((-1.0)*x361))+((new_r12*new_r20))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x362=((1.0)*sj31); IkReal x363=(((cj31*new_r12))+(((-1.0)*new_r02*x362))); IkReal x364=(((cj31*new_r00))+((new_r10*sj31))); IkReal x365=(((cj31*new_r01))+((new_r11*sj31))); IkReal x366=((-1.0)+((cj31*new_r02))+((new_r12*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j32)))), 6.28318530717959))); evalcond[1]=new_r22; evalcond[2]=((((-1.0)*cj31))+new_r02); evalcond[3]=((((-1.0)*x362))+new_r12); evalcond[4]=x363; evalcond[5]=x363; evalcond[6]=x366; evalcond[7]=x365; evalcond[8]=x364; evalcond[9]=x364; evalcond[10]=x365; evalcond[11]=x366; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 && IKabs(evalcond[10]) < 0.0000010000000000 && IKabs(evalcond[11]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r21, ((-1.0)*new_r20)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x367=IKcos(j33); IkReal x368=IKsin(j33); IkReal x369=((1.0)*new_r12); IkReal x370=((1.0)*x368); IkReal x371=((1.0)*x367); evalcond[0]=(x367+new_r20); evalcond[1]=((((-1.0)*x370))+new_r21); evalcond[2]=(new_r01+((new_r12*x367))); evalcond[3]=(new_r00+((new_r12*x368))); evalcond[4]=(new_r11+(((-1.0)*new_r02*x371))); evalcond[5]=(new_r10+(((-1.0)*new_r02*x370))); evalcond[6]=((((-1.0)*new_r00*x369))+(((-1.0)*x370))+((new_r02*new_r10))); evalcond[7]=((((-1.0)*x371))+((new_r02*new_r11))+(((-1.0)*new_r01*x369))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x372=(new_r10*sj31); IkReal x373=(cj31*new_r00); IkReal x374=(cj31*new_r02); IkReal x375=(new_r11*sj31); IkReal x376=(new_r12*sj31); IkReal x377=(cj31*new_r01); IkReal x378=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j32)))), 6.28318530717959))); evalcond[1]=new_r22; evalcond[2]=(cj31+new_r02); evalcond[3]=(sj31+new_r12); evalcond[4]=x378; evalcond[5]=x378; evalcond[6]=((1.0)+x376+x374); evalcond[7]=(x377+x375); evalcond[8]=(x373+x372); evalcond[9]=((((-1.0)*x373))+(((-1.0)*x372))); evalcond[10]=((((-1.0)*x377))+(((-1.0)*x375))); evalcond[11]=((-1.0)+(((-1.0)*x374))+(((-1.0)*x376))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 && IKabs(evalcond[10]) < 0.0000010000000000 && IKabs(evalcond[11]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((-1.0)*new_r21), new_r20); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x379=IKcos(j33); IkReal x380=IKsin(j33); IkReal x381=((1.0)*new_r02); IkReal x382=((1.0)*x379); IkReal x383=((1.0)*x380); evalcond[0]=(x380+new_r21); evalcond[1]=((((-1.0)*x382))+new_r20); evalcond[2]=(new_r11+((new_r02*x379))); evalcond[3]=(((new_r02*x380))+new_r10); evalcond[4]=((((-1.0)*new_r12*x382))+new_r01); evalcond[5]=((((-1.0)*new_r12*x383))+new_r00); evalcond[6]=((((-1.0)*new_r10*x381))+((new_r00*new_r12))+(((-1.0)*x383))); evalcond[7]=((((-1.0)*new_r11*x381))+((new_r01*new_r12))+(((-1.0)*x382))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x384=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); IkReal x385=(((cj31*new_r02))+((new_r12*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j32))), 6.28318530717959))); evalcond[1]=((-1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; evalcond[6]=x384; evalcond[7]=x384; evalcond[8]=x385; evalcond[9]=x385; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x386=((1.0)*sj31); if( IKabs(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x386)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj31*new_r00))+(((-1.0)*new_r01*x386)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x386))))+IKsqr((((cj31*new_r00))+(((-1.0)*new_r01*x386))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x386))), (((cj31*new_r00))+(((-1.0)*new_r01*x386)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x387=IKsin(j33); IkReal x388=IKcos(j33); IkReal x389=((1.0)*sj31); IkReal x390=((1.0)*x388); IkReal x391=(sj31*x387); IkReal x392=((1.0)*x387); IkReal x393=(cj31*x390); evalcond[0]=(((cj31*new_r01))+((new_r11*sj31))+x387); evalcond[1]=(((sj31*x388))+((cj31*x387))+new_r01); evalcond[2]=((((-1.0)*x390))+((cj31*new_r00))+((new_r10*sj31))); evalcond[3]=((((-1.0)*x392))+((cj31*new_r10))+(((-1.0)*new_r00*x389))); evalcond[4]=((((-1.0)*x390))+((cj31*new_r11))+(((-1.0)*new_r01*x389))); evalcond[5]=((((-1.0)*x393))+x391+new_r00); evalcond[6]=((((-1.0)*x393))+x391+new_r11); evalcond[7]=((((-1.0)*cj31*x392))+new_r10+(((-1.0)*x388*x389))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x394=(cj31*new_r02); IkReal x395=(new_r12*sj31); IkReal x396=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j32)))), 6.28318530717959))); evalcond[1]=((1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; evalcond[6]=x396; evalcond[7]=x396; evalcond[8]=(x395+x394); evalcond[9]=((((-1.0)*x395))+(((-1.0)*x394))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x397=((1.0)*sj31); if( IKabs((((cj31*new_r01))+(((-1.0)*new_r00*x397)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x397))+(((-1.0)*cj31*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((cj31*new_r01))+(((-1.0)*new_r00*x397))))+IKsqr(((((-1.0)*new_r01*x397))+(((-1.0)*cj31*new_r00))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((((cj31*new_r01))+(((-1.0)*new_r00*x397))), ((((-1.0)*new_r01*x397))+(((-1.0)*cj31*new_r00)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x398=IKsin(j33); IkReal x399=IKcos(j33); IkReal x400=((1.0)*sj31); IkReal x401=((1.0)*x398); IkReal x402=(sj31*x399); IkReal x403=((1.0)*x399); IkReal x404=(cj31*x401); evalcond[0]=(((cj31*new_r00))+x399+((new_r10*sj31))); evalcond[1]=(((cj31*new_r01))+((new_r11*sj31))+(((-1.0)*x401))); evalcond[2]=(((cj31*x399))+((sj31*x398))+new_r00); evalcond[3]=(((cj31*new_r10))+(((-1.0)*new_r00*x400))+(((-1.0)*x401))); evalcond[4]=(((cj31*new_r11))+(((-1.0)*new_r01*x400))+(((-1.0)*x403))); evalcond[5]=(x402+new_r01+(((-1.0)*x404))); evalcond[6]=(x402+new_r10+(((-1.0)*x404))); evalcond[7]=((((-1.0)*cj31*x403))+(((-1.0)*x398*x400))+new_r11); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x405=((((-1.0)*cj32))+new_r22); IkReal x406=((((-1.0)*sj32))+new_r02); IkReal x407=((1.0)*sj32); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j31))), 6.28318530717959))); evalcond[1]=x405; evalcond[2]=x405; evalcond[3]=x406; evalcond[4]=new_r12; evalcond[5]=x406; evalcond[6]=(((new_r00*sj32))+((cj32*new_r20))); evalcond[7]=(((new_r01*sj32))+((cj32*new_r21))); evalcond[8]=((-1.0)+((new_r02*sj32))+((cj32*new_r22))); evalcond[9]=(((cj32*new_r02))+(((-1.0)*new_r22*x407))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r10)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r10, new_r11); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x408=IKcos(j33); IkReal x409=IKsin(j33); IkReal x410=((1.0)*new_r02); IkReal x411=((1.0)*x408); evalcond[0]=(new_r20+((new_r02*x408))); evalcond[1]=(new_r10+(((-1.0)*x409))); evalcond[2]=(new_r11+(((-1.0)*x411))); evalcond[3]=(((new_r22*x409))+new_r01); evalcond[4]=(new_r21+(((-1.0)*x409*x410))); evalcond[5]=(new_r00+(((-1.0)*new_r22*x411))); evalcond[6]=(((new_r01*new_r22))+x409+(((-1.0)*new_r21*x410))); evalcond[7]=(((new_r00*new_r22))+(((-1.0)*new_r20*x410))+(((-1.0)*x411))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x412=((((-1.0)*cj32))+new_r22); IkReal x413=((1.0)*sj32); IkReal x414=((1.0)*new_r02); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j31)))), 6.28318530717959))); evalcond[1]=x412; evalcond[2]=x412; evalcond[3]=(sj32+new_r02); evalcond[4]=new_r12; evalcond[5]=((((-1.0)*x414))+(((-1.0)*x413))); evalcond[6]=(((cj32*new_r20))+(((-1.0)*new_r00*x413))); evalcond[7]=(((cj32*new_r21))+(((-1.0)*new_r01*x413))); evalcond[8]=((-1.0)+((cj32*new_r22))+(((-1.0)*new_r02*x413))); evalcond[9]=((((-1.0)*cj32*x414))+(((-1.0)*new_r22*x413))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x415 = IKatan2WithCheck(IkReal(((-1.0)*new_r21)),new_r20,IKFAST_ATAN2_MAGTHRESH); if(!x415.valid){ continue; } CheckValue<IkReal> x416=IKPowWithIntegerCheck(IKsign(new_r02),-1); if(!x416.valid){ continue; } j33array[0]=((-1.5707963267949)+(x415.value)+(((1.5707963267949)*(x416.value)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x417=IKsin(j33); IkReal x418=IKcos(j33); IkReal x419=((1.0)*new_r22); IkReal x420=((1.0)*x418); evalcond[0]=(new_r21+((new_r02*x417))); evalcond[1]=((((-1.0)*new_r02*x420))+new_r20); evalcond[2]=((((-1.0)*new_r10))+(((-1.0)*x417))); evalcond[3]=((((-1.0)*x420))+(((-1.0)*new_r11))); evalcond[4]=(((new_r22*x417))+(((-1.0)*new_r01))); evalcond[5]=((((-1.0)*x418*x419))+(((-1.0)*new_r00))); evalcond[6]=(x417+((new_r02*new_r21))+(((-1.0)*new_r01*x419))); evalcond[7]=((((-1.0)*x420))+((new_r02*new_r20))+(((-1.0)*new_r00*x419))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j33] } } while(0); if( bgotonextstatement ) { } } } } } } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x422=IKPowWithIntegerCheck(sj32,-1); if(!x422.valid){ continue; } IkReal x421=x422.value; CheckValue<IkReal> x423=IKPowWithIntegerCheck(cj31,-1); if(!x423.valid){ continue; } CheckValue<IkReal> x424=IKPowWithIntegerCheck(cj32,-1); if(!x424.valid){ continue; } if( IKabs((x421*(x423.value)*(x424.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x421)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x421*(x423.value)*(x424.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32))))))+IKsqr(((-1.0)*new_r20*x421))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((x421*(x423.value)*(x424.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32))))), ((-1.0)*new_r20*x421)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x425=IKsin(j33); IkReal x426=IKcos(j33); IkReal x427=(cj31*cj32); IkReal x428=((1.0)*sj31); IkReal x429=(new_r11*sj31); IkReal x430=(new_r10*sj31); IkReal x431=((1.0)*sj32); IkReal x432=((1.0)*x426); IkReal x433=((1.0)*x425); IkReal x434=(sj31*x425); evalcond[0]=(new_r20+((sj32*x426))); evalcond[1]=((((-1.0)*x425*x431))+new_r21); evalcond[2]=(((cj31*new_r01))+x429+((cj32*x425))); evalcond[3]=((((-1.0)*x433))+((cj31*new_r10))+(((-1.0)*new_r00*x428))); evalcond[4]=((((-1.0)*x432))+((cj31*new_r11))+(((-1.0)*new_r01*x428))); evalcond[5]=(((x425*x427))+((sj31*x426))+new_r01); evalcond[6]=(((cj31*new_r00))+x430+(((-1.0)*cj32*x432))); evalcond[7]=((((-1.0)*x427*x432))+x434+new_r00); evalcond[8]=(((cj32*x434))+(((-1.0)*cj31*x432))+new_r11); evalcond[9]=((((-1.0)*cj32*x426*x428))+(((-1.0)*cj31*x433))+new_r10); evalcond[10]=(x425+((cj32*x429))+((new_r01*x427))+(((-1.0)*new_r21*x431))); evalcond[11]=((((-1.0)*x432))+((cj32*x430))+(((-1.0)*new_r20*x431))+((new_r00*x427))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x436=IKPowWithIntegerCheck(sj32,-1); if(!x436.valid){ continue; } IkReal x435=x436.value; CheckValue<IkReal> x437=IKPowWithIntegerCheck(sj31,-1); if(!x437.valid){ continue; } if( IKabs((x435*(x437.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x435)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x435*(x437.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20))))))+IKsqr(((-1.0)*new_r20*x435))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((x435*(x437.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20))))), ((-1.0)*new_r20*x435)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x438=IKsin(j33); IkReal x439=IKcos(j33); IkReal x440=(cj31*cj32); IkReal x441=((1.0)*sj31); IkReal x442=(new_r11*sj31); IkReal x443=(new_r10*sj31); IkReal x444=((1.0)*sj32); IkReal x445=((1.0)*x439); IkReal x446=((1.0)*x438); IkReal x447=(sj31*x438); evalcond[0]=(((sj32*x439))+new_r20); evalcond[1]=((((-1.0)*x438*x444))+new_r21); evalcond[2]=(((cj31*new_r01))+((cj32*x438))+x442); evalcond[3]=((((-1.0)*x446))+(((-1.0)*new_r00*x441))+((cj31*new_r10))); evalcond[4]=((((-1.0)*x445))+((cj31*new_r11))+(((-1.0)*new_r01*x441))); evalcond[5]=(((sj31*x439))+((x438*x440))+new_r01); evalcond[6]=(((cj31*new_r00))+x443+(((-1.0)*cj32*x445))); evalcond[7]=(x447+new_r00+(((-1.0)*x440*x445))); evalcond[8]=(((cj32*x447))+(((-1.0)*cj31*x445))+new_r11); evalcond[9]=((((-1.0)*cj31*x446))+new_r10+(((-1.0)*cj32*x439*x441))); evalcond[10]=(((new_r01*x440))+((cj32*x442))+x438+(((-1.0)*new_r21*x444))); evalcond[11]=(((new_r00*x440))+(((-1.0)*x445))+((cj32*x443))+(((-1.0)*new_r20*x444))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x448=IKPowWithIntegerCheck(IKsign(sj32),-1); if(!x448.valid){ continue; } CheckValue<IkReal> x449 = IKatan2WithCheck(IkReal(new_r21),((-1.0)*new_r20),IKFAST_ATAN2_MAGTHRESH); if(!x449.valid){ continue; } j33array[0]=((-1.5707963267949)+(((1.5707963267949)*(x448.value)))+(x449.value)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x450=IKsin(j33); IkReal x451=IKcos(j33); IkReal x452=(cj31*cj32); IkReal x453=((1.0)*sj31); IkReal x454=(new_r11*sj31); IkReal x455=(new_r10*sj31); IkReal x456=((1.0)*sj32); IkReal x457=((1.0)*x451); IkReal x458=((1.0)*x450); IkReal x459=(sj31*x450); evalcond[0]=(((sj32*x451))+new_r20); evalcond[1]=((((-1.0)*x450*x456))+new_r21); evalcond[2]=(((cj31*new_r01))+x454+((cj32*x450))); evalcond[3]=(((cj31*new_r10))+(((-1.0)*new_r00*x453))+(((-1.0)*x458))); evalcond[4]=(((cj31*new_r11))+(((-1.0)*new_r01*x453))+(((-1.0)*x457))); evalcond[5]=(((x450*x452))+new_r01+((sj31*x451))); evalcond[6]=((((-1.0)*cj32*x457))+((cj31*new_r00))+x455); evalcond[7]=(x459+(((-1.0)*x452*x457))+new_r00); evalcond[8]=(new_r11+((cj32*x459))+(((-1.0)*cj31*x457))); evalcond[9]=((((-1.0)*cj32*x451*x453))+new_r10+(((-1.0)*cj31*x458))); evalcond[10]=((((-1.0)*new_r21*x456))+((new_r01*x452))+x450+((cj32*x454))); evalcond[11]=((((-1.0)*new_r20*x456))+((new_r00*x452))+(((-1.0)*x457))+((cj32*x455))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } } } } } else { { IkReal j31array[1], cj31array[1], sj31array[1]; bool j31valid[1]={false}; _nj31 = 1; CheckValue<IkReal> x460=IKPowWithIntegerCheck(IKsign(sj32),-1); if(!x460.valid){ continue; } CheckValue<IkReal> x461 = IKatan2WithCheck(IkReal(new_r12),new_r02,IKFAST_ATAN2_MAGTHRESH); if(!x461.valid){ continue; } j31array[0]=((-1.5707963267949)+(((1.5707963267949)*(x460.value)))+(x461.value)); sj31array[0]=IKsin(j31array[0]); cj31array[0]=IKcos(j31array[0]); if( j31array[0] > IKPI ) { j31array[0]-=IK2PI; } else if( j31array[0] < -IKPI ) { j31array[0]+=IK2PI; } j31valid[0] = true; for(int ij31 = 0; ij31 < 1; ++ij31) { if( !j31valid[ij31] ) { continue; } _ij31[0] = ij31; _ij31[1] = -1; for(int iij31 = ij31+1; iij31 < 1; ++iij31) { if( j31valid[iij31] && IKabs(cj31array[ij31]-cj31array[iij31]) < IKFAST_SOLUTION_THRESH && IKabs(sj31array[ij31]-sj31array[iij31]) < IKFAST_SOLUTION_THRESH ) { j31valid[iij31]=false; _ij31[1] = iij31; break; } } j31 = j31array[ij31]; cj31 = cj31array[ij31]; sj31 = sj31array[ij31]; { IkReal evalcond[8]; IkReal x462=IKcos(j31); IkReal x463=IKsin(j31); IkReal x464=((1.0)*sj32); IkReal x465=(new_r02*x462); IkReal x466=(new_r12*x463); IkReal x467=(sj32*x462); IkReal x468=(sj32*x463); evalcond[0]=((((-1.0)*x462*x464))+new_r02); evalcond[1]=((((-1.0)*x463*x464))+new_r12); evalcond[2]=(((new_r12*x462))+(((-1.0)*new_r02*x463))); evalcond[3]=((((-1.0)*x464))+x466+x465); evalcond[4]=(((new_r10*x468))+((new_r00*x467))+((cj32*new_r20))); evalcond[5]=(((new_r11*x468))+((new_r01*x467))+((cj32*new_r21))); evalcond[6]=((-1.0)+((sj32*x466))+((sj32*x465))+((cj32*new_r22))); evalcond[7]=((((-1.0)*new_r22*x464))+((cj32*x465))+((cj32*x466))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { IkReal j33eval[2]; IkReal x469=(sj27*sj29); IkReal x470=(cj27*sj29); IkReal x471=(cj28*sj29); IkReal x472=(cj28*cj30); IkReal x473=((1.0)*sj30); IkReal x474=((1.0)*cj29); IkReal x475=(cj29*x473); IkReal x476=((1.0)*cj30*sj28); IkReal x477=x202; IkReal x478=x203; IkReal x479=x204; IkReal x480=((((-1.0)*sj28*x475))+x472); IkReal x481=(cj27*x480); IkReal x482=x207; IkReal x483=((((-1.0)*cj28*x475))+(((-1.0)*x476))); IkReal x484=(cj27*x482); IkReal x485=(((sj27*x480))+((sj30*x470))); IkReal x486=((((-1.0)*sj30*x469))+x481); IkReal x487=(((sj27*x482))+((cj30*x470))); IkReal x488=(x484+(((-1.0)*cj30*x469))); new_r00=(((r20*x477))+((r10*x487))+((r00*((x484+(((-1.0)*cj30*x469))))))); new_r01=(((r21*x477))+((r11*x487))+((r01*x488))); new_r02=(((r02*x488))+((r12*x487))+((r22*x477))); new_r10=(((r10*x479))+((r20*x471))+((r00*x478))); new_r11=(((r21*x471))+((r11*x479))+((r01*x478))); new_r12=(((r02*x478))+((r12*x479))+((r22*x471))); new_r20=(((r20*x483))+((r10*x485))+((r00*x486))); new_r21=(((r11*x485))+((r21*x483))+((r01*x486))); new_r22=(((r12*x485))+((r22*x483))+((r02*(((((-1.0)*x469*x473))+x481))))); j33eval[0]=sj32; j33eval[1]=IKsign(sj32); if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 ) { { IkReal j33eval[2]; IkReal x489=(sj27*sj29); IkReal x490=(cj27*sj29); IkReal x491=(cj28*sj29); IkReal x492=(cj28*cj30); IkReal x493=((1.0)*sj30); IkReal x494=((1.0)*cj29); IkReal x495=(cj29*x493); IkReal x496=((1.0)*cj30*sj28); IkReal x497=x202; IkReal x498=x203; IkReal x499=x204; IkReal x500=(x492+(((-1.0)*sj28*x495))); IkReal x501=(cj27*x500); IkReal x502=x207; IkReal x503=((((-1.0)*x496))+(((-1.0)*cj28*x495))); IkReal x504=(cj27*x502); IkReal x505=(((sj27*x500))+((sj30*x490))); IkReal x506=((((-1.0)*sj30*x489))+x501); IkReal x507=(((sj27*x502))+((cj30*x490))); IkReal x508=((((-1.0)*cj30*x489))+x504); new_r00=(((r10*x507))+((r00*(((((-1.0)*cj30*x489))+x504))))+((r20*x497))); new_r01=(((r01*x508))+((r11*x507))+((r21*x497))); new_r02=(((r22*x497))+((r12*x507))+((r02*x508))); new_r10=(((r10*x499))+((r00*x498))+((r20*x491))); new_r11=(((r11*x499))+((r21*x491))+((r01*x498))); new_r12=(((r02*x498))+((r22*x491))+((r12*x499))); new_r20=(((r20*x503))+((r10*x505))+((r00*x506))); new_r21=(((r21*x503))+((r01*x506))+((r11*x505))); new_r22=(((r02*(((((-1.0)*x489*x493))+x501))))+((r22*x503))+((r12*x505))); j33eval[0]=sj31; j33eval[1]=sj32; if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 ) { { IkReal j33eval[3]; IkReal x509=(sj27*sj29); IkReal x510=(cj27*sj29); IkReal x511=(cj28*sj29); IkReal x512=(cj28*cj30); IkReal x513=((1.0)*sj30); IkReal x514=((1.0)*cj29); IkReal x515=(cj29*x513); IkReal x516=((1.0)*cj30*sj28); IkReal x517=x202; IkReal x518=x203; IkReal x519=x204; IkReal x520=(x512+(((-1.0)*sj28*x515))); IkReal x521=(cj27*x520); IkReal x522=x207; IkReal x523=((((-1.0)*cj28*x515))+(((-1.0)*x516))); IkReal x524=(cj27*x522); IkReal x525=(((sj27*x520))+((sj30*x510))); IkReal x526=(x521+(((-1.0)*sj30*x509))); IkReal x527=(((cj30*x510))+((sj27*x522))); IkReal x528=(x524+(((-1.0)*cj30*x509))); new_r00=(((r20*x517))+((r10*x527))+((r00*((x524+(((-1.0)*cj30*x509))))))); new_r01=(((r11*x527))+((r21*x517))+((r01*x528))); new_r02=(((r02*x528))+((r12*x527))+((r22*x517))); new_r10=(((r20*x511))+((r10*x519))+((r00*x518))); new_r11=(((r01*x518))+((r11*x519))+((r21*x511))); new_r12=(((r02*x518))+((r22*x511))+((r12*x519))); new_r20=(((r20*x523))+((r10*x525))+((r00*x526))); new_r21=(((r21*x523))+((r11*x525))+((r01*x526))); new_r22=(((r12*x525))+((r22*x523))+((r02*((x521+(((-1.0)*x509*x513))))))); j33eval[0]=cj31; j33eval[1]=cj32; j33eval[2]=sj32; if( IKabs(j33eval[0]) < 0.0000010000000000 || IKabs(j33eval[1]) < 0.0000010000000000 || IKabs(j33eval[2]) < 0.0000010000000000 ) { { IkReal evalcond[12]; bool bgotonextstatement = true; do { IkReal x529=((((-1.0)*cj32))+new_r22); IkReal x530=((((-1.0)*sj32))+new_r12); IkReal x531=((1.0)*sj32); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j31)))), 6.28318530717959))); evalcond[1]=x529; evalcond[2]=x529; evalcond[3]=new_r02; evalcond[4]=x530; evalcond[5]=x530; evalcond[6]=(((new_r10*sj32))+((cj32*new_r20))); evalcond[7]=(((new_r11*sj32))+((cj32*new_r21))); evalcond[8]=((-1.0)+((new_r12*sj32))+((cj32*new_r22))); evalcond[9]=((((-1.0)*new_r22*x531))+((cj32*new_r12))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x532 = IKatan2WithCheck(IkReal(new_r21),((-1.0)*new_r20),IKFAST_ATAN2_MAGTHRESH); if(!x532.valid){ continue; } CheckValue<IkReal> x533=IKPowWithIntegerCheck(IKsign(new_r12),-1); if(!x533.valid){ continue; } j33array[0]=((-1.5707963267949)+(x532.value)+(((1.5707963267949)*(x533.value)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x534=IKsin(j33); IkReal x535=IKcos(j33); IkReal x536=((1.0)*new_r12); IkReal x537=((1.0)*x535); IkReal x538=((1.0)*x534); evalcond[0]=(((new_r12*x535))+new_r20); evalcond[1]=(((new_r22*x534))+new_r11); evalcond[2]=((((-1.0)*x534*x536))+new_r21); evalcond[3]=((((-1.0)*new_r22*x537))+new_r10); evalcond[4]=((((-1.0)*x538))+(((-1.0)*new_r00))); evalcond[5]=((((-1.0)*x537))+(((-1.0)*new_r01))); evalcond[6]=((((-1.0)*new_r21*x536))+x534+((new_r11*new_r22))); evalcond[7]=((((-1.0)*x537))+(((-1.0)*new_r20*x536))+((new_r10*new_r22))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x539=((((-1.0)*cj32))+new_r22); IkReal x540=((1.0)*sj32); IkReal x541=((1.0)*new_r12); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j31)))), 6.28318530717959))); evalcond[1]=x539; evalcond[2]=x539; evalcond[3]=new_r02; evalcond[4]=(sj32+new_r12); evalcond[5]=((((-1.0)*x541))+(((-1.0)*x540))); evalcond[6]=((((-1.0)*new_r10*x540))+((cj32*new_r20))); evalcond[7]=((((-1.0)*new_r11*x540))+((cj32*new_r21))); evalcond[8]=((-1.0)+(((-1.0)*new_r12*x540))+((cj32*new_r22))); evalcond[9]=((((-1.0)*cj32*x541))+(((-1.0)*new_r22*x540))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r01)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r00, new_r01); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x542=IKsin(j33); IkReal x543=IKcos(j33); IkReal x544=((1.0)*new_r10); IkReal x545=((1.0)*new_r11); IkReal x546=((1.0)*x543); evalcond[0]=(((new_r12*x542))+new_r21); evalcond[1]=((((-1.0)*x542))+new_r00); evalcond[2]=((((-1.0)*x546))+new_r01); evalcond[3]=((((-1.0)*new_r12*x546))+new_r20); evalcond[4]=((((-1.0)*x545))+((new_r22*x542))); evalcond[5]=((((-1.0)*new_r22*x546))+(((-1.0)*x544))); evalcond[6]=((((-1.0)*new_r22*x545))+((new_r12*new_r21))+x542); evalcond[7]=((((-1.0)*new_r22*x544))+(((-1.0)*x546))+((new_r12*new_r20))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x547=((1.0)*sj31); IkReal x548=(((cj31*new_r12))+(((-1.0)*new_r02*x547))); IkReal x549=(((cj31*new_r00))+((new_r10*sj31))); IkReal x550=(((cj31*new_r01))+((new_r11*sj31))); IkReal x551=((-1.0)+((cj31*new_r02))+((new_r12*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j32)))), 6.28318530717959))); evalcond[1]=new_r22; evalcond[2]=((((-1.0)*cj31))+new_r02); evalcond[3]=((((-1.0)*x547))+new_r12); evalcond[4]=x548; evalcond[5]=x548; evalcond[6]=x551; evalcond[7]=x550; evalcond[8]=x549; evalcond[9]=x549; evalcond[10]=x550; evalcond[11]=x551; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 && IKabs(evalcond[10]) < 0.0000010000000000 && IKabs(evalcond[11]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r21) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r21)+IKsqr(((-1.0)*new_r20))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r21, ((-1.0)*new_r20)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x552=IKcos(j33); IkReal x553=IKsin(j33); IkReal x554=((1.0)*new_r12); IkReal x555=((1.0)*x553); IkReal x556=((1.0)*x552); evalcond[0]=(x552+new_r20); evalcond[1]=((((-1.0)*x555))+new_r21); evalcond[2]=(((new_r12*x552))+new_r01); evalcond[3]=(((new_r12*x553))+new_r00); evalcond[4]=(new_r11+(((-1.0)*new_r02*x556))); evalcond[5]=(new_r10+(((-1.0)*new_r02*x555))); evalcond[6]=((((-1.0)*new_r00*x554))+(((-1.0)*x555))+((new_r02*new_r10))); evalcond[7]=((((-1.0)*new_r01*x554))+(((-1.0)*x556))+((new_r02*new_r11))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x557=(new_r10*sj31); IkReal x558=(cj31*new_r00); IkReal x559=(cj31*new_r02); IkReal x560=(new_r11*sj31); IkReal x561=(new_r12*sj31); IkReal x562=(cj31*new_r01); IkReal x563=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j32)))), 6.28318530717959))); evalcond[1]=new_r22; evalcond[2]=(cj31+new_r02); evalcond[3]=(sj31+new_r12); evalcond[4]=x563; evalcond[5]=x563; evalcond[6]=((1.0)+x559+x561); evalcond[7]=(x562+x560); evalcond[8]=(x558+x557); evalcond[9]=((((-1.0)*x557))+(((-1.0)*x558))); evalcond[10]=((((-1.0)*x560))+(((-1.0)*x562))); evalcond[11]=((-1.0)+(((-1.0)*x559))+(((-1.0)*x561))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 && IKabs(evalcond[10]) < 0.0000010000000000 && IKabs(evalcond[11]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(((-1.0)*new_r21)) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r20) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21))+IKsqr(new_r20)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((-1.0)*new_r21), new_r20); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x564=IKcos(j33); IkReal x565=IKsin(j33); IkReal x566=((1.0)*new_r02); IkReal x567=((1.0)*x564); IkReal x568=((1.0)*x565); evalcond[0]=(x565+new_r21); evalcond[1]=(new_r20+(((-1.0)*x567))); evalcond[2]=(((new_r02*x564))+new_r11); evalcond[3]=(((new_r02*x565))+new_r10); evalcond[4]=((((-1.0)*new_r12*x567))+new_r01); evalcond[5]=((((-1.0)*new_r12*x568))+new_r00); evalcond[6]=(((new_r00*new_r12))+(((-1.0)*new_r10*x566))+(((-1.0)*x568))); evalcond[7]=(((new_r01*new_r12))+(((-1.0)*new_r11*x566))+(((-1.0)*x567))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x569=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); IkReal x570=(((cj31*new_r02))+((new_r12*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j32))), 6.28318530717959))); evalcond[1]=((-1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; evalcond[6]=x569; evalcond[7]=x569; evalcond[8]=x570; evalcond[9]=x570; if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x571=((1.0)*sj31); if( IKabs(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x571)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj31*new_r00))+(((-1.0)*new_r01*x571)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x571))))+IKsqr((((cj31*new_r00))+(((-1.0)*new_r01*x571))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(((((-1.0)*cj31*new_r01))+(((-1.0)*new_r00*x571))), (((cj31*new_r00))+(((-1.0)*new_r01*x571)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x572=IKsin(j33); IkReal x573=IKcos(j33); IkReal x574=((1.0)*sj31); IkReal x575=((1.0)*x573); IkReal x576=(sj31*x572); IkReal x577=((1.0)*x572); IkReal x578=(cj31*x575); evalcond[0]=(((cj31*new_r01))+((new_r11*sj31))+x572); evalcond[1]=(((cj31*x572))+new_r01+((sj31*x573))); evalcond[2]=(((cj31*new_r00))+((new_r10*sj31))+(((-1.0)*x575))); evalcond[3]=(((cj31*new_r10))+(((-1.0)*x577))+(((-1.0)*new_r00*x574))); evalcond[4]=(((cj31*new_r11))+(((-1.0)*x575))+(((-1.0)*new_r01*x574))); evalcond[5]=((((-1.0)*x578))+x576+new_r00); evalcond[6]=((((-1.0)*x578))+x576+new_r11); evalcond[7]=((((-1.0)*x573*x574))+new_r10+(((-1.0)*cj31*x577))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x579=(cj31*new_r02); IkReal x580=(new_r12*sj31); IkReal x581=(((cj31*new_r12))+(((-1.0)*new_r02*sj31))); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j32)))), 6.28318530717959))); evalcond[1]=((1.0)+new_r22); evalcond[2]=new_r20; evalcond[3]=new_r02; evalcond[4]=new_r12; evalcond[5]=new_r21; evalcond[6]=x581; evalcond[7]=x581; evalcond[8]=(x579+x580); evalcond[9]=((((-1.0)*x580))+(((-1.0)*x579))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; IkReal x582=((1.0)*sj31); if( IKabs((((cj31*new_r01))+(((-1.0)*new_r00*x582)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x582))+(((-1.0)*cj31*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((cj31*new_r01))+(((-1.0)*new_r00*x582))))+IKsqr(((((-1.0)*new_r01*x582))+(((-1.0)*cj31*new_r00))))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((((cj31*new_r01))+(((-1.0)*new_r00*x582))), ((((-1.0)*new_r01*x582))+(((-1.0)*cj31*new_r00)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x583=IKsin(j33); IkReal x584=IKcos(j33); IkReal x585=((1.0)*sj31); IkReal x586=((1.0)*x583); IkReal x587=(sj31*x584); IkReal x588=((1.0)*x584); IkReal x589=(cj31*x586); evalcond[0]=(((cj31*new_r00))+((new_r10*sj31))+x584); evalcond[1]=(((cj31*new_r01))+((new_r11*sj31))+(((-1.0)*x586))); evalcond[2]=(((cj31*x584))+((sj31*x583))+new_r00); evalcond[3]=(((cj31*new_r10))+(((-1.0)*x586))+(((-1.0)*new_r00*x585))); evalcond[4]=((((-1.0)*new_r01*x585))+((cj31*new_r11))+(((-1.0)*x588))); evalcond[5]=(x587+new_r01+(((-1.0)*x589))); evalcond[6]=(x587+new_r10+(((-1.0)*x589))); evalcond[7]=((((-1.0)*cj31*x588))+(((-1.0)*x583*x585))+new_r11); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x590=((((-1.0)*cj32))+new_r22); IkReal x591=((((-1.0)*sj32))+new_r02); IkReal x592=((1.0)*sj32); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j31))), 6.28318530717959))); evalcond[1]=x590; evalcond[2]=x590; evalcond[3]=x591; evalcond[4]=new_r12; evalcond[5]=x591; evalcond[6]=(((new_r00*sj32))+((cj32*new_r20))); evalcond[7]=(((new_r01*sj32))+((cj32*new_r21))); evalcond[8]=((-1.0)+((new_r02*sj32))+((cj32*new_r22))); evalcond[9]=(((cj32*new_r02))+(((-1.0)*new_r22*x592))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; if( IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r10)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2(new_r10, new_r11); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x593=IKcos(j33); IkReal x594=IKsin(j33); IkReal x595=((1.0)*new_r02); IkReal x596=((1.0)*x593); evalcond[0]=(((new_r02*x593))+new_r20); evalcond[1]=((((-1.0)*x594))+new_r10); evalcond[2]=((((-1.0)*x596))+new_r11); evalcond[3]=(new_r01+((new_r22*x594))); evalcond[4]=((((-1.0)*x594*x595))+new_r21); evalcond[5]=((((-1.0)*new_r22*x596))+new_r00); evalcond[6]=((((-1.0)*new_r21*x595))+((new_r01*new_r22))+x594); evalcond[7]=((((-1.0)*new_r20*x595))+((new_r00*new_r22))+(((-1.0)*x596))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { IkReal x597=((((-1.0)*cj32))+new_r22); IkReal x598=((1.0)*sj32); IkReal x599=((1.0)*new_r02); evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j31)))), 6.28318530717959))); evalcond[1]=x597; evalcond[2]=x597; evalcond[3]=(sj32+new_r02); evalcond[4]=new_r12; evalcond[5]=((((-1.0)*x598))+(((-1.0)*x599))); evalcond[6]=((((-1.0)*new_r00*x598))+((cj32*new_r20))); evalcond[7]=((((-1.0)*new_r01*x598))+((cj32*new_r21))); evalcond[8]=((-1.0)+(((-1.0)*new_r02*x598))+((cj32*new_r22))); evalcond[9]=((((-1.0)*cj32*x599))+(((-1.0)*new_r22*x598))); if( IKabs(evalcond[0]) < 0.0000010000000000 && IKabs(evalcond[1]) < 0.0000010000000000 && IKabs(evalcond[2]) < 0.0000010000000000 && IKabs(evalcond[3]) < 0.0000010000000000 && IKabs(evalcond[4]) < 0.0000010000000000 && IKabs(evalcond[5]) < 0.0000010000000000 && IKabs(evalcond[6]) < 0.0000010000000000 && IKabs(evalcond[7]) < 0.0000010000000000 && IKabs(evalcond[8]) < 0.0000010000000000 && IKabs(evalcond[9]) < 0.0000010000000000 ) { bgotonextstatement=false; { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x600 = IKatan2WithCheck(IkReal(((-1.0)*new_r21)),new_r20,IKFAST_ATAN2_MAGTHRESH); if(!x600.valid){ continue; } CheckValue<IkReal> x601=IKPowWithIntegerCheck(IKsign(new_r02),-1); if(!x601.valid){ continue; } j33array[0]=((-1.5707963267949)+(x600.value)+(((1.5707963267949)*(x601.value)))); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[8]; IkReal x602=IKsin(j33); IkReal x603=IKcos(j33); IkReal x604=((1.0)*new_r22); IkReal x605=((1.0)*x603); evalcond[0]=(((new_r02*x602))+new_r21); evalcond[1]=((((-1.0)*new_r02*x605))+new_r20); evalcond[2]=((((-1.0)*x602))+(((-1.0)*new_r10))); evalcond[3]=((((-1.0)*new_r11))+(((-1.0)*x605))); evalcond[4]=(((new_r22*x602))+(((-1.0)*new_r01))); evalcond[5]=((((-1.0)*x603*x604))+(((-1.0)*new_r00))); evalcond[6]=(x602+(((-1.0)*new_r01*x604))+((new_r02*new_r21))); evalcond[7]=((((-1.0)*x605))+((new_r02*new_r20))+(((-1.0)*new_r00*x604))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } while(0); if( bgotonextstatement ) { bool bgotonextstatement = true; do { if( 1 ) { bgotonextstatement=false; continue; // branch miss [j33] } } while(0); if( bgotonextstatement ) { } } } } } } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x607=IKPowWithIntegerCheck(sj32,-1); if(!x607.valid){ continue; } IkReal x606=x607.value; CheckValue<IkReal> x608=IKPowWithIntegerCheck(cj31,-1); if(!x608.valid){ continue; } CheckValue<IkReal> x609=IKPowWithIntegerCheck(cj32,-1); if(!x609.valid){ continue; } if( IKabs((x606*(x608.value)*(x609.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x606)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x606*(x608.value)*(x609.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32))))))+IKsqr(((-1.0)*new_r20*x606))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((x606*(x608.value)*(x609.value)*((((new_r20*sj31))+(((-1.0)*new_r01*sj32))))), ((-1.0)*new_r20*x606)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x610=IKsin(j33); IkReal x611=IKcos(j33); IkReal x612=(cj31*cj32); IkReal x613=((1.0)*sj31); IkReal x614=(new_r11*sj31); IkReal x615=(new_r10*sj31); IkReal x616=((1.0)*sj32); IkReal x617=((1.0)*x611); IkReal x618=((1.0)*x610); IkReal x619=(sj31*x610); evalcond[0]=(((sj32*x611))+new_r20); evalcond[1]=((((-1.0)*x610*x616))+new_r21); evalcond[2]=(((cj31*new_r01))+((cj32*x610))+x614); evalcond[3]=(((cj31*new_r10))+(((-1.0)*x618))+(((-1.0)*new_r00*x613))); evalcond[4]=(((cj31*new_r11))+(((-1.0)*x617))+(((-1.0)*new_r01*x613))); evalcond[5]=(((sj31*x611))+new_r01+((x610*x612))); evalcond[6]=(((cj31*new_r00))+(((-1.0)*cj32*x617))+x615); evalcond[7]=((((-1.0)*x612*x617))+x619+new_r00); evalcond[8]=(((cj32*x619))+new_r11+(((-1.0)*cj31*x617))); evalcond[9]=((((-1.0)*cj32*x611*x613))+new_r10+(((-1.0)*cj31*x618))); evalcond[10]=((((-1.0)*new_r21*x616))+((cj32*x614))+x610+((new_r01*x612))); evalcond[11]=(((cj32*x615))+(((-1.0)*x617))+(((-1.0)*new_r20*x616))+((new_r00*x612))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x621=IKPowWithIntegerCheck(sj32,-1); if(!x621.valid){ continue; } IkReal x620=x621.value; CheckValue<IkReal> x622=IKPowWithIntegerCheck(sj31,-1); if(!x622.valid){ continue; } if( IKabs((x620*(x622.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r20*x620)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x620*(x622.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20))))))+IKsqr(((-1.0)*new_r20*x620))-1) <= IKFAST_SINCOS_THRESH ) continue; j33array[0]=IKatan2((x620*(x622.value)*(((((-1.0)*new_r00*sj32))+(((-1.0)*cj31*cj32*new_r20))))), ((-1.0)*new_r20*x620)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x623=IKsin(j33); IkReal x624=IKcos(j33); IkReal x625=(cj31*cj32); IkReal x626=((1.0)*sj31); IkReal x627=(new_r11*sj31); IkReal x628=(new_r10*sj31); IkReal x629=((1.0)*sj32); IkReal x630=((1.0)*x624); IkReal x631=((1.0)*x623); IkReal x632=(sj31*x623); evalcond[0]=(((sj32*x624))+new_r20); evalcond[1]=((((-1.0)*x623*x629))+new_r21); evalcond[2]=(((cj31*new_r01))+x627+((cj32*x623))); evalcond[3]=((((-1.0)*new_r00*x626))+((cj31*new_r10))+(((-1.0)*x631))); evalcond[4]=((((-1.0)*new_r01*x626))+((cj31*new_r11))+(((-1.0)*x630))); evalcond[5]=(((sj31*x624))+new_r01+((x623*x625))); evalcond[6]=(((cj31*new_r00))+(((-1.0)*cj32*x630))+x628); evalcond[7]=(x632+(((-1.0)*x625*x630))+new_r00); evalcond[8]=((((-1.0)*cj31*x630))+new_r11+((cj32*x632))); evalcond[9]=((((-1.0)*cj32*x624*x626))+(((-1.0)*cj31*x631))+new_r10); evalcond[10]=(((new_r01*x625))+(((-1.0)*new_r21*x629))+x623+((cj32*x627))); evalcond[11]=((((-1.0)*x630))+((new_r00*x625))+(((-1.0)*new_r20*x629))+((cj32*x628))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } else { { IkReal j33array[1], cj33array[1], sj33array[1]; bool j33valid[1]={false}; _nj33 = 1; CheckValue<IkReal> x633=IKPowWithIntegerCheck(IKsign(sj32),-1); if(!x633.valid){ continue; } CheckValue<IkReal> x634 = IKatan2WithCheck(IkReal(new_r21),((-1.0)*new_r20),IKFAST_ATAN2_MAGTHRESH); if(!x634.valid){ continue; } j33array[0]=((-1.5707963267949)+(((1.5707963267949)*(x633.value)))+(x634.value)); sj33array[0]=IKsin(j33array[0]); cj33array[0]=IKcos(j33array[0]); if( j33array[0] > IKPI ) { j33array[0]-=IK2PI; } else if( j33array[0] < -IKPI ) { j33array[0]+=IK2PI; } j33valid[0] = true; for(int ij33 = 0; ij33 < 1; ++ij33) { if( !j33valid[ij33] ) { continue; } _ij33[0] = ij33; _ij33[1] = -1; for(int iij33 = ij33+1; iij33 < 1; ++iij33) { if( j33valid[iij33] && IKabs(cj33array[ij33]-cj33array[iij33]) < IKFAST_SOLUTION_THRESH && IKabs(sj33array[ij33]-sj33array[iij33]) < IKFAST_SOLUTION_THRESH ) { j33valid[iij33]=false; _ij33[1] = iij33; break; } } j33 = j33array[ij33]; cj33 = cj33array[ij33]; sj33 = sj33array[ij33]; { IkReal evalcond[12]; IkReal x635=IKsin(j33); IkReal x636=IKcos(j33); IkReal x637=(cj31*cj32); IkReal x638=((1.0)*sj31); IkReal x639=(new_r11*sj31); IkReal x640=(new_r10*sj31); IkReal x641=((1.0)*sj32); IkReal x642=((1.0)*x636); IkReal x643=((1.0)*x635); IkReal x644=(sj31*x635); evalcond[0]=(((sj32*x636))+new_r20); evalcond[1]=((((-1.0)*x635*x641))+new_r21); evalcond[2]=(((cj31*new_r01))+x639+((cj32*x635))); evalcond[3]=(((cj31*new_r10))+(((-1.0)*new_r00*x638))+(((-1.0)*x643))); evalcond[4]=((((-1.0)*new_r01*x638))+((cj31*new_r11))+(((-1.0)*x642))); evalcond[5]=(((x635*x637))+((sj31*x636))+new_r01); evalcond[6]=(((cj31*new_r00))+(((-1.0)*cj32*x642))+x640); evalcond[7]=(x644+(((-1.0)*x637*x642))+new_r00); evalcond[8]=(((cj32*x644))+new_r11+(((-1.0)*cj31*x642))); evalcond[9]=(new_r10+(((-1.0)*cj32*x636*x638))+(((-1.0)*cj31*x643))); evalcond[10]=(((new_r01*x637))+(((-1.0)*new_r21*x641))+x635+((cj32*x639))); evalcond[11]=(((cj32*x640))+((new_r00*x637))+(((-1.0)*x642))+(((-1.0)*new_r20*x641))); if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH ) { continue; } } { std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(7); vinfos[0].jointtype = 1; vinfos[0].foffset = j27; vinfos[0].indices[0] = _ij27[0]; vinfos[0].indices[1] = _ij27[1]; vinfos[0].maxsolutions = _nj27; vinfos[1].jointtype = 1; vinfos[1].foffset = j28; vinfos[1].indices[0] = _ij28[0]; vinfos[1].indices[1] = _ij28[1]; vinfos[1].maxsolutions = _nj28; vinfos[2].jointtype = 1; vinfos[2].foffset = j29; vinfos[2].indices[0] = _ij29[0]; vinfos[2].indices[1] = _ij29[1]; vinfos[2].maxsolutions = _nj29; vinfos[3].jointtype = 1; vinfos[3].foffset = j30; vinfos[3].indices[0] = _ij30[0]; vinfos[3].indices[1] = _ij30[1]; vinfos[3].maxsolutions = _nj30; vinfos[4].jointtype = 1; vinfos[4].foffset = j31; vinfos[4].indices[0] = _ij31[0]; vinfos[4].indices[1] = _ij31[1]; vinfos[4].maxsolutions = _nj31; vinfos[5].jointtype = 1; vinfos[5].foffset = j32; vinfos[5].indices[0] = _ij32[0]; vinfos[5].indices[1] = _ij32[1]; vinfos[5].maxsolutions = _nj32; vinfos[6].jointtype = 1; vinfos[6].foffset = j33; vinfos[6].indices[0] = _ij33[0]; vinfos[6].indices[1] = _ij33[1]; vinfos[6].maxsolutions = _nj33; std::vector<int> vfree(0); solutions.AddSolution(vinfos,vfree); } } } } } } } } } } } } }static inline void polyroots3(IkReal rawcoeffs[3+1], IkReal rawroots[3], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots2(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[3]; const int maxsteps = 110; for(int i = 0; i < 3; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[3]; IkReal err[3]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 3; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 3; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 3; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 3; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[3] = {false}; for(int i = 0; i < 3; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 3; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } static inline void polyroots2(IkReal rawcoeffs[2+1], IkReal rawroots[2], int& numroots) { IkReal det = rawcoeffs[1]*rawcoeffs[1]-4*rawcoeffs[0]*rawcoeffs[2]; if( det < 0 ) { numroots=0; } else if( det == 0 ) { rawroots[0] = -0.5*rawcoeffs[1]/rawcoeffs[0]; numroots = 1; } else { det = IKsqrt(det); rawroots[0] = (-rawcoeffs[1]+det)/(2*rawcoeffs[0]); rawroots[1] = (-rawcoeffs[1]-det)/(2*rawcoeffs[0]);//rawcoeffs[2]/(rawcoeffs[0]*rawroots[0]); numroots = 2; } } static inline void polyroots5(IkReal rawcoeffs[5+1], IkReal rawroots[5], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots4(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[5]; const int maxsteps = 110; for(int i = 0; i < 5; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[5]; IkReal err[5]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 5; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 5; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 5; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 5; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[5] = {false}; for(int i = 0; i < 5; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 5; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } static inline void polyroots4(IkReal rawcoeffs[4+1], IkReal rawroots[4], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots3(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[4]; const int maxsteps = 110; for(int i = 0; i < 4; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[4]; IkReal err[4]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 4; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 4; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 4; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 4; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[4] = {false}; for(int i = 0; i < 4; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 4; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } static inline void polyroots7(IkReal rawcoeffs[7+1], IkReal rawroots[7], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots6(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[7]; const int maxsteps = 110; for(int i = 0; i < 7; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[7]; IkReal err[7]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 7; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 7; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 7; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 7; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[7] = {false}; for(int i = 0; i < 7; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 7; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } static inline void polyroots6(IkReal rawcoeffs[6+1], IkReal rawroots[6], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots5(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[6]; const int maxsteps = 110; for(int i = 0; i < 6; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[6]; IkReal err[6]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 6; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 6; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 6; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 6; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[6] = {false}; for(int i = 0; i < 6; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 6; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } static inline void polyroots8(IkReal rawcoeffs[8+1], IkReal rawroots[8], int& numroots) { using std::complex; if( rawcoeffs[0] == 0 ) { // solve with one reduced degree polyroots7(&rawcoeffs[1], &rawroots[0], numroots); return; } IKFAST_ASSERT(rawcoeffs[0] != 0); const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); complex<IkReal> coeffs[8]; const int maxsteps = 110; for(int i = 0; i < 8; ++i) { coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); } complex<IkReal> roots[8]; IkReal err[8]; roots[0] = complex<IkReal>(1,0); roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works err[0] = 1.0; err[1] = 1.0; for(int i = 2; i < 8; ++i) { roots[i] = roots[i-1]*roots[1]; err[i] = 1.0; } for(int step = 0; step < maxsteps; ++step) { bool changed = false; for(int i = 0; i < 8; ++i) { if ( err[i] >= tol ) { changed = true; // evaluate complex<IkReal> x = roots[i] + coeffs[0]; for(int j = 1; j < 8; ++j) { x = roots[i] * x + coeffs[j]; } for(int j = 0; j < 8; ++j) { if( i != j ) { if( roots[i] != roots[j] ) { x /= (roots[i] - roots[j]); } } } roots[i] -= x; err[i] = abs(x); } } if( !changed ) { break; } } numroots = 0; bool visited[8] = {false}; for(int i = 0; i < 8; ++i) { if( !visited[i] ) { // might be a multiple root, in which case it will have more error than the other roots // find any neighboring roots, and take the average complex<IkReal> newroot=roots[i]; int n = 1; for(int j = i+1; j < 8; ++j) { // care about error in real much more than imaginary if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { newroot += roots[j]; n += 1; visited[j] = true; } } if( n > 1 ) { newroot /= n; } // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt if( IKabs(imag(newroot)) < tolsqrt ) { rawroots[numroots++] = real(newroot); } } } } }; /// solves the inverse kinematics equations. /// \param pfree is an array specifying the free joints of the chain. IKFAST_API bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) { IKSolver solver; return solver.ComputeIk(eetrans,eerot,pfree,solutions); } IKFAST_API bool ComputeIk2(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions, void* pOpenRAVEManip) { IKSolver solver; return solver.ComputeIk(eetrans,eerot,pfree,solutions); } IKFAST_API const char* GetKinematicsHash() { return "f720334422c04aa0c3fc731126ce5f95"; } IKFAST_API const char* GetIkFastVersion() { return "0x10000048"; } #ifdef IKFAST_NAMESPACE } // end namespace #endif #ifndef IKFAST_NO_MAIN #include <stdio.h> #include <stdlib.h> #ifdef IKFAST_NAMESPACE using namespace IKFAST_NAMESPACE; #endif int main(int argc, char** argv) { if( argc != 12+GetNumFreeParameters()+1 ) { printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n" "Returns the ik solutions given the transformation of the end effector specified by\n" "a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n" "There are %d free parameters that have to be specified.\n\n",GetNumFreeParameters()); return 1; } IkSolutionList<IkReal> solutions; std::vector<IkReal> vfree(GetNumFreeParameters()); IkReal eerot[9],eetrans[3]; eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]); eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]); eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]); for(std::size_t i = 0; i < vfree.size(); ++i) vfree[i] = atof(argv[13+i]); bool bSuccess = ComputeIk(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : NULL, solutions); if( !bSuccess ) { fprintf(stderr,"Failed to get ik solution\n"); return -1; } printf("Found %d ik solutions:\n", (int)solutions.GetNumSolutions()); std::vector<IkReal> solvalues(GetNumJoints()); for(std::size_t i = 0; i < solutions.GetNumSolutions(); ++i) { const IkSolutionBase<IkReal>& sol = solutions.GetSolution(i); printf("sol%d (free=%d): ", (int)i, (int)sol.GetFree().size()); std::vector<IkReal> vsolfree(sol.GetFree().size()); sol.GetSolution(&solvalues[0],vsolfree.size()>0?&vsolfree[0]:NULL); for( std::size_t j = 0; j < solvalues.size(); ++j) printf("%.15f, ", solvalues[j]); printf("\n"); } return 0; } #endif
mit
beyzakokcan/ojs
src/Ojs/ApiBundle/Tests/Controller/JournalArticleRestControllerTest.php
6602
<?php namespace Ojs\ApiBundle\Tests\Controller; use Ojs\CoreBundle\Tests\BaseTestCase; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Exception\IOException; class JournalArticleRestControllerTest extends BaseTestCase { private $sampleArticleHeader = 'http://lorempixel.com/960/200/'; private $sampleArticleHeaderEncoded; public function __construct() { $cacheDir = __DIR__.'/../../../../../app/cache/'; $articleCacheDir = $cacheDir.'api_article/'; if(!is_dir($cacheDir) || !is_dir($articleCacheDir)){ mkdir($articleCacheDir, 0775, true); } if(!file_exists($articleCacheDir.'sampleArticleHeader')){ file_put_contents($articleCacheDir.'sampleArticleHeader', file_get_contents($this->sampleArticleHeader)); } $this->sampleArticleHeaderEncoded = base64_encode(file_get_contents($articleCacheDir.'sampleArticleHeader')); } public function testGetJournalArticlesAction() { $routeParameters = $this->getRouteParams(['journalId' => 1]); $url = $this->router->generate('api_1_get_articles', $routeParameters); $this->client->request('GET', $url); $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); } public function testNewJournalArticleAction() { $content = [ 'translations' => [ 'en' => [ 'title' => 'PHPUnit Test Title Field en - POST', 'subjects' => 'PHPUnit Test Subjects Field en - POST', 'keywords' => 'PHPUnit Test Keywords Field en - POST', 'abstract' => 'PHPUnit Test Abstract Field en - POST' ] ], 'titleTransliterated' => 'PHPUnit Test Title Transliterated Field en - POST', 'status' => 1, 'doi' => 'PHPUnit Test Doi Field en - POST', 'otherId' => 'PHPUnit Test Other ID Field en - POST', 'anonymous' => 1, 'pubdate' => '29-10-2015', 'pubdateSeason' => 8, 'firstPage' => 11, 'lastPage' => 999, 'uri' => 'http://phpunittest.com', 'abstractTransliterated' => 'PHPUnit Test Abstract Transliterated Field en - POST', 'articleType' => 10, 'orderNum' => 2, 'submissionDate' => '22-10-2015', 'header' => [ 'filename' => rand(0,1000).'sampleArticleHeader.jpg', 'encoded_content' => $this->sampleArticleHeaderEncoded, ], ]; $routeParameters = $this->getRouteParams(['journalId' => 1]); $url = $this->router->generate('api_1_post_article', $routeParameters); $this->client->request( 'POST', $url, [], [], ['CONTENT_TYPE' => 'application/json'], json_encode($content) ); $response = $this->client->getResponse(); $this->assertEquals(201, $response->getStatusCode()); } public function testGetJournalArticleAction() { $routeParameters = $this->getRouteParams(['journalId' => 1,'id' => 1]); $url = $this->router->generate('api_1_get_article', $routeParameters); $this->client->request('GET', $url); $response = $this->client->getResponse(); $this->assertEquals(200, $response->getStatusCode()); } public function testPutJournalArticleAction() { $content = [ 'translations' => [ 'en' => [ 'title' => 'PHPUnit Test Title Field en - PUT', 'subjects' => 'PHPUnit Test Subjects Field en - PUT', 'keywords' => 'PHPUnit Test Keywords Field en - PUT', 'abstract' => 'PHPUnit Test Abstract Field en - PUT' ] ], 'titleTransliterated' => 'PHPUnit Test Title Transliterated Field en - PUT', 'status' => 1, 'doi' => 'PHPUnit Test Doi Field en - POST', 'otherId' => 'PHPUnit Test Other ID Field en - PUT', 'anonymous' => 1, 'pubdate' => '29-10-2015', 'pubdateSeason' => 8, 'firstPage' => 11, 'lastPage' => 999, 'uri' => 'http://phpunittest.com', 'abstractTransliterated' => 'PHPUnit Test Abstract Transliterated Field en - PUT', 'articleType' => 10, 'orderNum' => 2, 'submissionDate' => '22-10-2015', 'header' => [ 'filename' => rand(0,1000).'sampleArticleHeader.jpg', 'encoded_content' => $this->sampleArticleHeaderEncoded, ], ]; $routeParameters = $this->getRouteParams(['journalId' => 1,'id' => 550]); $url = $this->router->generate('api_1_put_article', $routeParameters); $this->client->request( 'PUT', $url, [], [], ['CONTENT_TYPE' => 'application/json'], json_encode($content) ); $response = $this->client->getResponse(); $this->assertEquals(201, $response->getStatusCode()); } public function testPatchJournalArticleAction() { $content = [ 'translations' => [ 'en' => [ 'title' => 'PHPUnit Test Title Field en - PATCH', ] ], 'header' => [ 'filename' => rand(0,1000).'sampleArticleHeader.jpg', 'encoded_content' => $this->sampleArticleHeaderEncoded, ], ]; $routeParameters = $this->getRouteParams(['journalId' => 1,'id' => 1]); $url = $this->router->generate('api_1_patch_article', $routeParameters); $this->client->request( 'PATCH', $url, [], [], ['CONTENT_TYPE' => 'application/json'], json_encode($content) ); $response = $this->client->getResponse(); $this->assertEquals(204, $response->getStatusCode()); } public function testDeleteJournalArticleAction() { $routeParameters = $this->getRouteParams(['id' => 1,'journalId' => 1]); $url = $this->router->generate('api_1_delete_article', $routeParameters); $this->client->request( 'DELETE', $url ); $response = $this->client->getResponse(); $this->assertEquals(204, $response->getStatusCode()); } }
mit
behzad888/DefinitelyTyped
aurelia/aurelia-metadata.d.ts
6887
// Type definitions for aurelia-metadata v1.0.0-beta.1.2.0 // Project: https://github.com/aurelia/metadata/ // Definitions by: Behzad abbai <https://github.com/behzad888> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// <reference path="./aurelia-pal.d.ts" /> declare module 'aurelia-metadata' { import { PLATFORM } from 'aurelia-pal'; /** * Helpers for working with metadata on functions. */ export interface MetadataType { /** * The metadata key representing pluggable resources. */ resource: string; /** * The metadata key representing parameter type information. */ paramTypes: string; /** * The metadata key representing property information. */ properties: string; /** * Gets metadata specified by a key on a target, searching up the inheritance hierarchy. * @param metadataKey The key for the metadata to lookup. * @param target The target to lookup the metadata on. * @param targetKey The member on the target to lookup the metadata on. */ get(metadataKey: string, target: Function, targetKey: string): Object; /** * Gets metadata specified by a key on a target, only searching the own instance. * @param metadataKey The key for the metadata to lookup. * @param target The target to lookup the metadata on. * @param targetKey The member on the target to lookup the metadata on. */ getOwn(metadataKey: string, target: Function, targetKey: string): Object; /** * Defines metadata specified by a key on a target. * @param metadataKey The key for the metadata to define. * @param target The target to set the metadata on. * @param targetKey The member on the target to set the metadata on. */ define(metadataKey: string, metadataValue: Object, target: Function, targetKey: string): void; /** * Gets metadata specified by a key on a target, or creates an instance of the specified metadata if not found. * @param metadataKey The key for the metadata to lookup or create. * @param Type The type of metadata to create if existing metadata is not found. * @param target The target to lookup or create the metadata on. * @param targetKey The member on the target to lookup or create the metadata on. */ getOrCreateOwn(metadataKey: string, Type: Function, target: Function, targetKey: string): Object; } /** * An object capable of applying it's captured decorators to a target. */ export interface DecoratorApplicator { /** * Applies the decorators to the target. * @param target The target. * @param key If applying to a method, the member name. * @param key If applying to a method, you may supply an initial descriptor to pass to the decorators. */ on(target: any, key?: string, descriptor?: Object): any; } /** * Options that control how the deprected decorator should function at runtime. */ export interface DeprecatedOptions { /** * Specifies a custom deprecation message. */ message: string; /** * Specifies whether or not the deprecation should throw an error. */ error: boolean; } /** * Options used during protocol creation. */ export interface ProtocolOptions { /** * A function that will be run to validate the decorated class when the protocol is applied. It is also used to validate adhoc instances. * If the validation fails, a message should be returned which directs the developer in how to address the issue. */ validate?: (target: any) => string | boolean; /** * A function which has the opportunity to compose additional behavior into the decorated class when the protocol is applied. */ compose?: (target: any) => void; } /** * Provides helpers for working with metadata. */ /** * Provides helpers for working with metadata. */ export const metadata: MetadataType; /** * A metadata annotation that describes the origin module of the function to which it's attached. */ export class Origin { /** * The id of the module from which the item originated. */ moduleId: string; /** * The member name of the export on the module object from which the item originated. */ moduleMember: string; /** * Creates an instance of Origin metadata. * @param moduleId The id of the module from which the item originated. * @param moduleMember The member name of the export on the module object from which the item originated. */ constructor(moduleId: string, moduleMember: string); /** * Get the Origin metadata for the specified function. * @param fn The function to inspect for Origin metadata. * @return Returns the Origin metadata. */ static get(fn: Function): Origin; /** * Set the Origin metadata for the specified function. * @param fn The function to set the Origin metadata on. * @param fn The Origin metadata to store on the function. * @return Returns the Origin metadata. */ static set(fn: Function, origin: Origin): void; } /** * Enables applying decorators, particularly for use when there is no syntax support in the language, such as with ES5 and ES2016. * @param rest The decorators to apply. */ /** * Enables applying decorators, particularly for use when there is no syntax support in the language, such as with ES5 and ES2016. * @param rest The decorators to apply. */ export function decorators(...rest: Function[]): DecoratorApplicator; /** * Decorator: Enables marking methods as deprecated. * @param optionsOrTarget Options for how the deprected decorator should function at runtime. */ /** * Decorator: Enables marking methods as deprecated. * @param optionsOrTarget Options for how the deprected decorator should function at runtime. */ export function deprecated(optionsOrTarget?: DeprecatedOptions, maybeKey?: string, maybeDescriptor?: Object): any; /** * Decorator: Enables mixing behaior into a class. * @param behavior An object with keys for each method to mix into the target class. */ export function mixin(behavior: Object): any; /** * Decorator: Creates a protocol. * @param name The name of the protocol. * @param options The validation function or options object used in configuring the protocol. */ /** * Decorator: Creates a protocol. * @param name The name of the protocol. * @param options The validation function or options object used in configuring the protocol. */ export function protocol(name: string, options?: ((target: any) => string | boolean) | ProtocolOptions): any; }
mit
HerrLoesch/Trapeze
Code/StackKata/StackKata.Tests/Properties/AssemblyInfo.cs
1406
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("StackKata.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("StackKata.Tests")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ce28552d-ba45-4af9-a18e-fe904c300fef")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
denismaster/dcs
src/Diploms.Dto/Users/UserEditItem.cs
187
namespace Diploms.Dto.Users { public class UserEditDto { public int? Id {get;set;} public string Login {get;set;} public string Password {get;set;} } }
mit
benpickles/js-model
test/tests/plugin_test.js
547
module("Model plugins") test("applied in factory", 3, function() { var obj = {} function Foo(klass, a, b) { klass.foo = "foo" equal(a, "a") ok(b === obj) } var Post = Model("post", function() { this.use(Foo, "a", obj) }) equal(Post.foo, "foo") }) test("applied outside factory", 4, function() { var obj = {} function Foo(klass, a, b) { klass.foo = "foo" equal(a, "a") ok(b === obj) } var Post = Model("post") var rtn = Post.use(Foo, "a", obj) ok(rtn === Post) equal(Post.foo, "foo") })
mit
james-jenkinson/tango-atlas
src/test/components/fom/Button.test.tsx
863
import { should } from "chai"; import { shallow } from "enzyme"; import { noop } from "lodash"; import * as React from "react"; import * as sinon from "sinon"; import Button from "../../../components/form/Button"; describe("Button", () => { should(); it("should render", () => { shallow(<Button click={noop}/>); }); it("calls click function", () => { const func = sinon.spy(); const component = shallow(<Button click={func}/>); func.notCalled.should.be.true; component.find(".Button").simulate("click"); func.calledOnce.should.be.true; }); it("doesn't call function if disabled", () => { const func = sinon.spy(); const component = shallow(<Button disabled={true} click={func}/>); func.notCalled.should.be.true; component.find(".Button").simulate("click"); func.notCalled.should.be.true; }); });
mit
pekkao/opixmanager
application/language/finnish/project_lang.php
2052
<?php /** * Project lang file * * @package CodeIgniter * @category Lang file, translate english * @subpackage Project * @author Antti Aho, Arto Ruonala, Pipsa Korkiakoski */ $lang['title_project'] = "Projektit"; $lang['title_db_error'] = 'Tietokantavirhe'; $lang['title_insert_project'] = "Lisää projekti"; $lang['title_edit_project'] = "Muokkaa projektia"; $lang['title_search_project'] = "Hae projekti"; $lang['link_insert_project'] = "Lisää projekti"; $lang['link_project_staff'] = "Projektin henkilöt"; $lang['link_product_backlog'] = "Tuotejono"; $lang['link_return'] = "Paluu"; $lang['link_all'] = "Kaikki projektit"; $lang['link_edit'] = "Muokkaa"; $lang['link_show_all'] = "Näytä kaikki projektit"; $lang['link_show_active'] = "Näytä aktiiviset projektit"; $lang['link_show_finished'] = "Näytä päättyneet projektit"; $lang['link_project_period'] = "Projektin periodi"; $lang['button_save'] = "Talleta"; $lang['button_reset'] = "Tyhjennä"; $lang['button_search'] = "Hae"; $lang['label_project_name'] = "Projektin nimi"; $lang['label_project_description'] = "Kuvaus"; $lang['label_project_start_date'] = "Alkupvm"; $lang['label_project_end_date'] = "Loppupvm"; $lang['label_project_type'] = "Projektityyppi"; $lang['label_customer_name'] = "Asiakas"; $lang['label_active'] = 'Projektin Tila'; $lang['label_start_date'] = "Alkupvm"; $lang['label_end_date'] = "Loppupvm"; $lang['select_customer'] = "Valitse asiakas"; $lang['select_type'] = "Valitse tyyppi"; $lang['missing_project'] = "Projektia ei löydy tietokannasta."; $lang['missing_dates'] = "Molemmat päivämäärät tarvitaan."; $lang['invalid_dates'] = "Aloituspäivämäärä täytyy olla ennen päättymispäivämäärää."; $lang['text_search_project'] = "Hae projekteja, jotka ovat käynnisssä annettujen päivämäärien välillä."; $lang['cannot_delete']='Projektia ei voi poistaa, koska se sisältää tuotteen kehitysjonoja tai projektin periodeja.'; $lang['search_results'] = 'Haun tulokset: '; $lang['no_results'] = 'Haulla ei löytynyt mitään!' ?>
mit
shawnblakesley/shawnblakesley.github.io
src/js/alphabet_game/sketch.js
2724
var voice = new p5.Speech(); // speech synthesis object var currentLetter = "A"; var current; var data; const letterRegex = /^[a-zA-Z]$/; let img; let visitTracker = new Array(26); function preload() { data = loadJSON("/data/alphabet_game.json"); } function setup() { canvas = createCanvas(windowWidth, windowHeight); noStroke(); img = getImage(currentLetter, data[currentLetter]); } function draw() { colorMode(RGB); background(0); noStroke(); let from = color(218, 165, 32 + 50 * sin(frameCount / 50)); let to = color(172, 61, 139 + 50 * cos(frameCount / 100)); for (let i = 0; i < 200; i++) { let inter = lerpColor(from, to, i / 200); fill(inter); rect(floor(i / 200 * width), 0, ceil(width / 200), height); } fill(255); text(currentLetter, width / 2, height / 2); let screenRatio = width / height; let ratio = img.width / img.height; let w; let h; if (ratio > screenRatio) { w = width - 100; h = img.height * (width - 100) / img.width; } else { w = img.width * (height - 100) / img.height; h = height - 100; } let x = (width - w) / 2, y = (height - h) / 2; image(img, x, y, w, h); stroke(0); strokeWeight(4); textSize(60); fill(128, 128, 255); text(`${currentLetter} is for...`, x + 10, y + 70); text(sanitizeName(current.name), x + w - 200, y + h - 10); } function keyPressed() { if (letterRegex.test(key)) { loadLetter(key); } } function loadLetter(letter) { currentLetter = letter.toUpperCase(); var items = data[currentLetter]; img = getImage(currentLetter, items); } function getImage(letter, items) { let index = letter.charCodeAt(0) - 'A'.charCodeAt(0); if (!visitTracker[index]) { visitTracker[index] = new Array(items.length); visitTracker[index].fill(0); } let minVal = Math.min(...visitTracker[index]); let itemIndex = visitTracker[index].indexOf(minVal); visitTracker[index][itemIndex] += 1; let item = items[itemIndex]; if (!item.type) { item.type = "jpg"; } current = item; voice.cancel(); voice.speak(`${letter}: is for ${sanitizeName(item.name)}`); return loadImage(`/images/alphabet_game/${item.name.toLowerCase()}.${item.type}`); } function sanitizeName(name) { let regex = /_[0-9]$/; return name.replace(regex, "").replace("_", " "); } function windowResized() { canvas = createCanvas(windowWidth, windowHeight); } function mousePressed() { let letter = "A"; if (currentLetter !== 'Z') { letter = String.fromCharCode(currentLetter.charCodeAt(0) + 1); } loadLetter(letter); }
mit
sengsourng/ci_shopingonline.com
application/views/inc/v_footer_home.php
4497
<!-- footer --> <footer id="footer" class="clearfix"> <!-- footer-top --> <section class="footer-top clearfix"> <div class="container"> <div class="row"> <!-- footer-widget --> <div class="col-sm-3"> <div class="footer-widget"> <h3>Quik Links</h3> <ul> <li><a href="#">About Us</a></li> <li><a href="#">Contact Us</a></li> <li><a href="#">Careers</a></li> <li><a href="#">All Cities</a></li> <li><a href="#">Help & Support</a></li> <li><a href="#">Advertise With Us</a></li> <li><a href="#">Blog</a></li> </ul> </div> </div><!-- footer-widget --> <!-- footer-widget --> <div class="col-sm-3"> <div class="footer-widget"> <h3>How to sell fast</h3> <ul> <li><a href="#">How to sell fast</a></li> <li><a href="#">Membership</a></li> <li><a href="#">Banner Advertising</a></li> <li><a href="#">Promote your ad</a></li> <li><a href="#">Trade Delivers</a></li> <li><a href="#">FAQ</a></li> </ul> </div> </div><!-- footer-widget --> <!-- footer-widget --> <div class="col-sm-3"> <div class="footer-widget social-widget"> <h3>Follow us on</h3> <ul> <li><a href="#"><i class="fa fa-facebook-official"></i>Facebook</a></li> <li><a href="#"><i class="fa fa-twitter-square"></i>Twitter</a></li> <li><a href="#"><i class="fa fa-google-plus-square"></i>Google+</a></li> <li><a href="#"><i class="fa fa-youtube-play"></i>youtube</a></li> </ul> </div> </div><!-- footer-widget --> <!-- footer-widget --> <div class="col-sm-3"> <div class="footer-widget news-letter"> <h3>Newsletter</h3> <p>Trade is Worldest leading classifieds platform that brings!</p> <!-- form --> <form action="#"> <input type="email" class="form-control" placeholder="Your email id"> <button type="submit" class="btn btn-primary">Sign Up</button> </form><!-- form --> </div> </div><!-- footer-widget --> </div><!-- row --> </div><!-- container --> </section><!-- footer-top --> <div class="footer-bottom clearfix text-center"> <div class="container"> <p>Copyright &copy; 2016. Developed by <a href="http://themeregion.com/">ThemeRegion</a></p> </div> </div><!-- footer-bottom --> </footer><!-- footer --> <!--/Preset Style Chooser--> <div class="style-chooser"> <div class="style-chooser-inner"> <a href="#" class="toggler"><i class="fa fa-life-ring fa-spin"></i></a> <h4>Presets</h4> <ul class="preset-list clearfix"> <li class="preset1 active" data-preset="1"><a href="#" data-color="preset1"></a></li> <li class="preset2" data-preset="2"><a href="#" data-color="preset2"></a></li> <li class="preset3" data-preset="3"><a href="#" data-color="preset3"></a></li> <li class="preset4" data-preset="4"><a href="#" data-color="preset4"></a></li> </ul> </div> </div> <!--/End:Preset Style Chooser--> <!-- JS --> <script src="<?php echo base_url ();?>public/js/jquery.min.js"></script> <script src="<?php echo base_url ();?>public/js/modernizr.min.js"></script> <script src="<?php echo base_url ();?>public/js/bootstrap.min.js"></script> <script src="http://maps.google.com/maps/api/js?sensor=true"></script> <script src="<?php echo base_url ();?>public/js/gmaps.min.js"></script> <script src="<?php echo base_url ();?>public/js/owl.carousel.min.js"></script> <script src="<?php echo base_url ();?>public/js/smoothscroll.min.js"></script> <script src="<?php echo base_url ();?>public/js/scrollup.min.js"></script> <script src="<?php echo base_url ();?>public/js/price-range.js"></script> <script src="<?php echo base_url ();?>public/js/jquery.countdown.js"></script> <script src="<?php echo base_url ();?>public/js/custom.js"></script> <script src="<?php echo base_url ();?>public/js/switcher.js"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-73239902-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
mit
Kinnay/NintendoClients
nintendo/switch.py
2810
from Crypto.Cipher import AES from Crypto.PublicKey import RSA from anynet import tls import hashlib import struct import base64 import logging logger = logging.getLogger(__name__) def b64encode(data): return base64.b64encode(data, b"-_").decode().rstrip("=") def b64decode(text): length = (len(text) + 3) & ~3 text = text.ljust(length, "=") return base64.b64decode(text.encode(), b"-_") class NDASError(Exception): def __init__(self, status_code, errors=None): self.status_code = status_code self.errors = errors def __str__(self): if self.errors is not None: return self.errors[0]["message"] return "Server returned status code: %i" %self.status_code class KeySet: def __init__(self): self.keys = {} def __getitem__(self, key): return self.keys[key] def __setitem__(self, key, value): self.keys[key] = value @classmethod def load(cls, filename): keyset = cls() with open(filename) as f: lines = f.readlines() for line in lines: line = line.strip() if line: name, key = line.split("=") keyset[name.strip()] = bytes.fromhex(key) return keyset table = [ 0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401, 0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400 ] def crc16(data): hash = 0x55AA for byte in data: r = table[hash & 0xF] hash = (hash >> 4) ^ r ^ table[byte & 0xF] r = table[hash & 0xF] hash = (hash >> 4) ^ r ^ table[byte >> 4] return hash class ProdInfo: def __init__(self, keyset, filename): self.keyset = keyset with open(filename, "rb") as f: self.data = f.read() def check(self, offset, size): end = offset + size - 2 expected = struct.unpack_from("<H", self.data, end)[0] if crc16(self.data[offset : end]) != expected: raise ValueError("CRC16 check failed") def get_tls_cert(self): self.check(0xAD0, 0x10) length = struct.unpack_from("<I", self.data, 0xAD0)[0] if length > 0x800: raise ValueError("TLS certificate is too big") data = self.data[0xAE0 : 0xAE0 + length] hash = hashlib.sha256(data).digest() if hash != self.data[0x12E0 : 0x1300]: raise ValueError("SHA256 check failed") return tls.TLSCertificate.parse(data, tls.TYPE_DER) def get_tls_key(self): self.check(0x3AE0, 0x140) initial = self.data[0x3AE0 : 0x3AF0] cipher = self.data[0x3AF0 : 0x3BF0] kek = self.keyset["ssl_rsa_kek"] aes = AES.new(kek, AES.MODE_CTR, nonce=b"", initial_value=initial) d = int.from_bytes(aes.decrypt(cipher), "big") pubkey = self.get_tls_cert().public_key() rsa = RSA.construct((pubkey.n, pubkey.e, d)) der = rsa.export_key("DER") return tls.TLSPrivateKey.parse(der, tls.TYPE_DER)
mit
nguyen-nhat-mulodo/phptraining
fuel/app/classes/controller/LoginUser.php
2065
<?php use \Model_mUser; use \Model_mToken; class Controller_LoginUser extends Controller_Rest { public function action_Login() { //post parameter $mail = Input::post('mail'); $password = Input::post('password'); //check validation if (($mail == "") || ($password == "")) { $this->Response( array( 'status' => 401, 'message' => "Invalid Argument", ) ); return; } $m = new Model_mUser(); try { $data_user = $m->search_login($mail, $password); if ($data_user == 0) { $this->Response( array( 'status' => 402, 'message' => "Not Exist User", ) ); return; } //Add Date: 09/09/2014 - Name :Tran Quoc Dung Start if($data_user['user_ban'] == 1) { $this->Response( array( 'status' => 408, 'message' => "User was banned", ) ); return; } //Add Date : 09/09/2014 - Name: Tran Quoc Dung End } catch (Exception $e) { $this->Response( array( 'status' => 500, 'message' => "InternalÊServerÊError", ) ); return; } $id = $data_user["id"]; $temp = new DateTime(); $dt = $temp->format('Y-m-d H:i:s'); $token_id = hash_hmac('sha1',$dt,$id,false); //var_dump($token_id);exit; $m2 = new Model_mToken(); $m2->save_token($token_id, $id); $this->Response( array( 'status' => 200, 'message' => "Login Successfull", 'token' => $token_id; ) ); } }
mit
ericmuyser/web2f
src/js/jquery.MultiFile.js
17621
/* ### jQuery Multiple File Upload Plugin v1.27 - 2008-03-29 ### By Diego A., http://www.fyneworks.com, diego@fyneworks.com Project: http://jquery.com/plugins/project/MultiFile/ Website: http://www.fyneworks.com/jquery/multiple-file-upload/ Forums: http://www.nabble.com/jQuery-Multiple-File-Upload-f20931.html */ /* CHANGE LOG: 12-April-2007: v1.1 Added events and file extension validation See website for details. 06-June-2007: v1.2 Now works in Opera. 12-June-2007: v1.21 Preserves name of file input so all current server-side functions don't need to be changed on new installations. 24-June-2007: v1.22 Now works perfectly in Opera, thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com> 10-Jan-2008: v1.24 Fixed bug in event trigger - sending incorrect parameters to event handlers 14-Jan-2008: v1.24 Fixed bug 1251: http://plugins.jquery.com/project/comments/add/1251 25-Jan-2008: v1.24 Implemented feature request: http://plugins.jquery.com/node/1363 The plugin now automatically intercepts ajaxSubmit function (form plugin) and disbales empty file input elements for submission 08-Feb-2008: v1.25 Fixed bug: http://plugins.jquery.com/node/1495 The last change caused the plugin to disabled input files that shouldn't have been ignored Now, every newly created input file (by this plugin) is marked by the MultiFile class. 11-Feb-2008: v1.25 Fixed bug: http://plugins.jquery.com/node/1495 Plugin would override element ID everytime. 11-Feb-2008: v1.26 Modified plugin structure. After selecting and removing a file, the plugin would remove the original element from DOM. Now the plugin works back on its own tracks and removes the last generated element. This will resolve compatibility issues with validation plugins and custom code. 12-Feb-2008: v1.26 Try to clear elements using the browser's native behaviour: .reset() This works around security policies in IE6 and Opera. 17-Mar-2008: v1.27 Added properties/methods for easier form integration $.MultiFile.autoIntercept - array of known jQuery plugins to intercept (default: 'submit', 'ajaxSubmit', 'validate'); $.MultiFile.intercept - intercepts a jQuery plugin / anonymous function $.MultiFile.disableEmpty - disable empty inputs (required for some upload scripts) $.MultiFile.reEnableEmpty - re-enables empty inputs 17-Mar-2008: v1.27 MAJOR FIX - OPERA BUG MASTER.labels was a readyonly property and cause the script to fail. Renamed to MASTER.eLBL. Problem solved! */ /*# AVOID COLLISIONS #*/ ;if(jQuery) (function($){ /*# AVOID COLLISIONS #*/ // Fix for Opera: 6-June-2007 // Stop confusion between null, 'null' and 'undefined' //function IsNull(i){ // return (i==null || i=='null' || i=='' || i=='undefined'); //}; // extend jQuery - $.MultiFile hook $.extend($, { MultiFile: function( o /* Object */ ){ //return $("INPUT[@type='file'].multi").MultiFile(o); return $("input:file.multi").MultiFile(o); } }); // extend $.MultiFile - global methods $.extend($.MultiFile, { disableEmpty: function(){ $('input:file'/*.multi'*/).each(function(){ var $this = $(this); if($this.val()=='') $this.addClass('mfD').each(function(){ this.disabled = true }); }); }, reEnableEmpty: function(){ $('input:file.mfD').removeClass('mfD').each(function(){ this.disabled = false }); }, autoIntercept: [ 'submit', 'ajaxSubmit', 'validate' /* array of methods to intercept */ ], intercepted: {}, intercept: function(methods, context, args){ var method, value; args = args || []; if(args.constructor.toString().indexOf("Array")<0) args = [ args ]; if(typeof(methods)=='function'){ $.MultiFile.disableEmpty(); value = methods.apply(context || window, args); $.MultiFile.reEnableEmpty(); return value; }; if(methods.constructor.toString().indexOf("Array")<0) methods = [methods]; for(var i=0;i<methods.length;i++){ method = methods[i]+''; // make sure that we have a STRING if(method) (function(method){ // make sure that method is ISOLATED for the interception $.MultiFile.intercepted[method] = $.fn[method] || function(){}; $.fn[method] = function(){ $.MultiFile.disableEmpty(); //if(console) console.log(['$.MultiFile.intercepted', method, this, arguments]); value = $.MultiFile.intercepted[method].apply(this, arguments); $.MultiFile.reEnableEmpty(); return value; }; // interception })(method); // MAKE SURE THAT method IS ISOLATED for the interception };// for each method } }); // extend jQuery function library $.extend($.fn, { // Use this function to clear values of file inputs // This doesn't always work: $(element).val('').attr('value', '')[0].value = ''; reset: function(){ return this.each(function(){ try{ this.reset(); }catch(e){} }); }, // MultiFile function MultiFile: function( o /* Object */ ){ // DEBUGGING: disable plugin //return false; //### http://plugins.jquery.com/node/1363 // utility method to integrate this plugin with others... if($.MultiFile.autoIntercept){ $.MultiFile.intercept( $.MultiFile.autoIntercept /* array of methods to intercept */ ); $.MultiFile.autoIntercept = null; /* only run this once */ }; //### // Bind to each element in current jQuery object return $(this).each(function(i){ if(this._MultiFile) return; this._MultiFile = true; // BUG 1251 FIX: http://plugins.jquery.com/project/comments/add/1251 // variable i would repeat itself on multiple calls to the plugin. // this would cause a conflict with multiple elements // changes scope of variable to global so id will be unique over n calls window.MultiFile = (window.MultiFile || 0) + 1; i = window.MultiFile; // Remember our ancestors... var MASTER = this; // Copy parent attributes - Thanks to Jonas Wagner // we will use this one to create new input elements var xCLONE = $(MASTER).clone(); //######################################### // Find basic configuration in class string // debug??? MASTER.debug = (MASTER.className.indexOf('debug')>0); // limit number of files that can be selected? if(!(MASTER.max>0) /*IsNull(MASTER.max)*/){ MASTER.max = $(MASTER).attr('maxlength'); if(!(MASTER.max>0) /*IsNull(MASTER.max)*/){ MASTER.max = (String(MASTER.className.match(/\b(max|limit)\-([0-9]+)\b/gi) || ['']).match(/[0-9]+/gi) || [''])[0]; if(!(MASTER.max>0) /*IsNull(MASTER.max)*/){ MASTER.max = -1; } else{ MASTER.max = MASTER.max.match(/[0-9]+/gi)[0]; } } }; MASTER.max = new Number(MASTER.max); // limit extensions? if(!MASTER.accept){ MASTER.accept = (MASTER.className.match(/\b(accept\-[\w\|]+)\b/gi)) || ''; MASTER.accept = new String(MASTER.accept).replace(/^(accept|ext)\-/i,''); }; //######################################### // DEBUGGING: report status in Firebug console /*DBG*/// MASTER.debug = true; /*DBG*/// if(MASTER.debug && console) console.log('MultipleFile Upload plugin debugging enabled on "'+(MASTER.id?'#':'')+''+(MASTER.id || MASTER.name)+'"'); // Attach a bunch of events, jQuery style ;-) /*DBG*/// $.each("on,after".split(","), function(i,o){ /*DBG*/// $.each("FileSelect,FileRemove,FileAppend".split(","), function(j,event){ /*DBG*/// MASTER[o+event] = function(element, value, master){ // default event handlers just show debugging info... /*DBG*/// if(MASTER.debug && console) console.log('*** '+o+event+' *** DEFAULT HANDLER' +'\nElement:' +element.name+ '\nValue: ' +value+ '\nMaster: ' +master.name+ ''); /*DBG*/// }; /*DBG*/// }); /*DBG*/// }); // Setup a global event handler MASTER.trigger = function(event, element){ var handler = MASTER[event]; var value = $(element).attr('value'); /*DBG*/// if(MASTER.debug && console) console.log('*** TRIGGER EVENT: '+event+' ***' +'\nCustom Handler:' +(handler ? 'Yes':'No') +'\nElement:' +element.name+ '\nValue: ' +value+ '\nMaster: ' +MASTER.name+ ''); if(handler){ var returnValue = handler(element, value, MASTER); if( returnValue!=null ) return returnValue; } return true; }; // Initialize options if( typeof o == 'number' ){ o = {max:o}; }; $.extend( MASTER, ($.metadata ? $(MASTER).metadata()/*NEW metadata plugin*/ : ($.meta ? $(MASTER).data()/*OLD metadata plugin*/ : null/*metadata plugin not available*/)) || {}, o || {} ); // Default properties - INTERNAL USE ONLY $.extend(MASTER, { STRING: MASTER.STRING || {}, // used to hold string constants n: 0, // How many elements are currently selected? instanceKey: MASTER.id || 'MultiFile'+String(i), // Instance Key? generateID: function(z){ return MASTER.instanceKey + (z>0 ?'_F'+String(z):''); } }); // Visible text strings... // $file = file name (with path), $ext = file extension MASTER.STRING = $.extend({ remove:'remove', denied:'You cannot select a $ext file.\nTry again...', selected:'File selected: $file' }, MASTER.STRING); // Setup dynamic regular expression for extension validation // - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/ if(String(MASTER.accept).length>1){ MASTER.rxAccept = new RegExp('\\.('+(MASTER.accept?MASTER.accept:'')+')$','gi'); }; // Create wrapper to hold our file list MASTER.wrapID = MASTER.instanceKey+'_wrap'; // Wrapper ID? $(MASTER).wrap('<div id="'+MASTER.wrapID+'"></div>'); MASTER.eWRP = $('#'+MASTER.wrapID+''); // Create a wrapper for the labels // * OPERA BUG: NO_MODIFICATION_ALLOWED_ERR ('labels' is a read-only property) // this changes allows us to keep the files in the order they were selected MASTER.eWRP.append( '<span id="'+MASTER.wrapID+'_labels"></span>' ); MASTER.eLBL = $('#'+MASTER.wrapID+'_labels'); // Bind a new element MASTER.addSlave = function( slave, ii ){ // Keep track of how many elements have been displayed MASTER.n++; // Add reference to master element slave.MASTER = MASTER; // Count slaves slave.i = ii; // BUG FIX: http://plugins.jquery.com/node/1495 // Clear identifying properties from clones if(slave.i>0) slave.id = slave.name = null; // Define element's ID and name (upload components need this!) slave.id = (slave.id || MASTER.generateID(slave.i)); slave.name = (slave.name || $(MASTER).attr('name') || 'file');// + (slave.i>0?slave.i:''); // same name as master element // Clear value slave.value = ''; // If we've reached maximum number, disable input slave if( (MASTER.max != -1) && ((MASTER.n-1) > (MASTER.max)) ){ // MASTER.n Starts at 1, so subtract 1 to find true count slave.disabled = true; }; // Remember most recent slave MASTER.eCur = slave; /// now let's use jQuery slave = $(slave); // Triggered when a file is selected slave.change(function(){ //# Trigger Event! onFileSelect if(!MASTER.trigger('onFileSelect', this, MASTER)) return false; //# End Event! // check extension if(MASTER.accept){ var v = String(slave[0].value || ''/*.attr('value)*/); if(!v.match(MASTER.rxAccept)){ // Clear element value slave.reset().val('').attr('value', '')[0].value = ''; // OPERA BUG FIX - 2007-06-24 // Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com> // we add new input element and remove present one for browsers that can't clear value of input element //var newEle = $('<input name="'+($(MASTER).attr('name') || '')+'" type="file"/>'); var newEle = xCLONE.clone();// Copy parent attributes - Thanks to Jonas Wagner //# Let's remember which input we've generated so // we can disable the empty ones before submission // See: http://plugins.jquery.com/node/1495 newEle.addClass('MultiFile'); // Remove slave!!! MASTER.n--; MASTER.addSlave(newEle[0], this.i); slave.parent().prepend(newEle); slave.remove(); // Show error message // TO-DO: Some people have suggested alternative methods for displaying this message // such as inline HTML, lightbox, etc... maybe integrate with blockUI plugin? if(v!='') alert(MASTER.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi)))); return false; } }; // Create a new file input element //var newEle = $('<input name="'+($(MASTER).attr('name') || '')+'" type="file"/>'); var newEle = xCLONE.clone();// Copy parent attributes - Thanks to Jonas Wagner // Hide this element (NB: display:none is evil!) $(this).css({ position:'absolute', top: '-3000px' }); // Add new element to the form MASTER.eLBL.before(newEle);//.append(newEle); // Update list MASTER.addToList( this ); // Bind functionality MASTER.addSlave( newEle[0], this.i+1 ); //# Trigger Event! afterFileSelect if(!MASTER.trigger('afterFileSelect', this, MASTER)) return false; //# End Event! }); };// MASTER.addSlave // Bind a new element // Add a new file to the list MASTER.addToList = function( slave ){ //# Trigger Event! onFileAppend if(!MASTER.trigger('onFileAppend', slave, MASTER)) return false; //# End Event! // Create label elements var r = $('<div></div>'), v = String(slave.value || ''/*.attr('value)*/), a = $('<span class="file" title="'+MASTER.STRING.selected.replace('$file', v)+'">'+v.match(/[^\/\\]+$/gi)[0]+'</span>'), b = $('<a href="#'+MASTER.wrapID+'">'+MASTER.STRING.remove+'</a>'); // Insert label MASTER.eLBL.append( r//.prepend(slave.i+': ') .append('[', b, ']&nbsp;', a) ); b.click(function(){ //# Trigger Event! onFileRemove if(!MASTER.trigger('onFileRemove', slave, MASTER)) return false; //# End Event! MASTER.n--; MASTER.eCur.disabled = false; // Remove element, remove label, point to current if(slave.i==0){ $(MASTER.eCur).remove(); MASTER.eCur = slave; } else{ $(slave).remove(); }; $(this).parent().remove(); // Show most current element again (move into view) and clear selection $(MASTER.eCur).css({ position:'', top: '' }).reset().val('').attr('value', '')[0].value = ''; //# Trigger Event! afterFileRemove if(!MASTER.trigger('afterFileRemove', slave, MASTER)) return false; //# End Event! return false; }); //# Trigger Event! afterFileAppend if(!MASTER.trigger('afterFileAppend', slave, MASTER)) return false; //# End Event! }; // MASTER.addToList // Add element to selected files list // Bind functionality to the first element if(!MASTER.MASTER) MASTER.addSlave(MASTER, 0); // Increment control count //MASTER.I++; // using window.MultiFile MASTER.n++; }); // each element } // MultiFile function }); // extend jQuery function library /* ### Default implementation ### The plugin will attach itself to file inputs with the class 'multi' when the page loads Use the jQuery start plugin to */ /* if($.start){ $.start('MultiFile', $.MultiFile) } else $(function(){ $.MultiFile() }); */ if($.start) $.start('MultiFile', function(context){ context = context || this; // attach to start-up $("INPUT[@type='file'].multi", context).MultiFile(); }); // $.start else $(function(){ $.MultiFile() }); // $() /*# AVOID COLLISIONS #*/ })(jQuery); /*# AVOID COLLISIONS #*/
mit
olavoasantos/unite.js
node_modules/jasmine-expect/src/toBeArray.js
60
const is = require('./lib/is'); module.exports = is.Array;
mit
maqen/contentful_model
lib/contentful_model/associations/has_one.rb
1989
module ContentfulModel module Associations module HasOne def self.included(base) base.extend ClassMethods end module ClassMethods #has_one defines a method on the parent which wraps around the superclass's implementation. In most cases this #will end up at ContentfulModel::Base#method_missing and look at the fields on a content object. #We wrap around it like this so we can specify a class_name option to call a different method from the association #name. # class Foo # has_one :special_bar, class_name: "Bar" # end # @param association_name [Symbol] the name of the association. In this case Foo.special_bar. # @param options [Hash] a hash, the only key of which is important is class_name. def has_one(association_name, options = {}) default_options = { class_name: association_name.to_s.classify, inverse_of: self.to_s.underscore.to_sym } options = default_options.merge(options) # Define a method which matches the association name define_method association_name do begin # Start by calling the association name as a method on the superclass. # this will end up in ContentfulModel::Base#method_missing and return the value from Contentful. # We set the singular of the association name on this object to allow easy recursing. super() rescue ContentfulModel::AttributeNotFoundError # If method_missing returns an error, the field doesn't exist. If a class is specified, try that. if options[:class_name].underscore.to_sym != association_name self.send(options[:class_name].underscore.to_sym) else #otherwise give up and return nil nil end end end end end end end end
mit
MerlinDS/UniBindRx
Assets/Plugins/UniBindRx/Base/IBinder.cs
1269
// <copyright file="IBinder.cs" company="Near Fancy"> // Copyright (c) 2017 All Rights Reserved // </copyright> // <author>Andrew Salomatin</author> // <date>08/06/2017 11:36</date> using JetBrains.Annotations; using UniRx; namespace UniBindRx.Base { /// <summary> /// IBinder /// </summary> public interface IBinder { /// <summary> /// Trying to find a bindable reavtive property in context by the specified path /// </summary> /// <param name="value"></param> /// <typeparam name="T">Type of the reactive property</typeparam> /// <returns>The found reactive property. /// If the property was not found will returns empty (fake) property.</returns> [NotNull] IReactiveProperty<T> FindBindableProperty<T>(T value = default(T)); /// <summary> /// Trying to find a bindable reavtive collection in context by the specified path /// </summary> /// <typeparam name="T">Type of the reactive collection</typeparam> /// <returns>The found reactive collection. /// If the collection was not found will returns empty (fake) property.</returns> [NotNull] IReactiveCollection<T> FindBindableCollection<T>(); } }
mit
rodriguesl3/portfolio
app/js/controllers/blogController.js
140
var blogController = function ($rootScope) { $rootScope.bodyImage = "overflow-y:hidden"; }; blogController.$inject = ["$rootScope"];
mit
cego/zfs-cleaner
zfs/Snapshot_test.go
1613
package zfs import ( "testing" "time" ) var ( s0 = Snapshot{"s0", time.Unix(0, 0), false} s1 = Snapshot{"s1", time.Unix(1491918988, 0), false} s2 = Snapshot{"s2", time.Unix(1491918990, 0), false} s3 = Snapshot{"s3", time.Unix(1491919188, 0), false} ) const ( failCommand = "false" ) func TestNewSnapshotFromLine(t *testing.T) { cases := []struct { input string expected *Snapshot err error }{ {"", nil, ErrMalformedLine}, {"a", nil, ErrMalformedLine}, {"s1 1491918988", &s1, nil}, {"s0 0", &s0, nil}, {"s1 -1", nil, ErrMalformedLine}, {"non integer", nil, ErrMalformedLine}, {"too many fields", nil, ErrMalformedLine}, } for i, c := range cases { s, err := NewSnapshotFromLine(c.input) if err != nil && c.err == nil { t.Fatalf("%d NewSnapshotFromLine() returned unexpected error: %s", i, err.Error()) } if c.expected == nil { continue } if s.Name != c.expected.Name { t.Fatalf("%d Got wrong name from '%s', expected '%s', got '%s'", i, c.input, c.expected.Name, s.Name) } if s.Creation != c.expected.Creation { t.Fatalf("%d Got wrong creation from '%s', expected '%s', got '%s'", i, c.input, c.expected.Creation, s.Creation) } } } func TestSnapshotName(t *testing.T) { cases := []struct { input string expected string }{ {"path@s1", "s1"}, {"s1", "s1"}, {"@s1", "s1"}, {"@", ""}, } for i, c := range cases { s := &Snapshot{ Name: c.input, } result := s.SnapshotName() if result != c.expected { t.Fatalf("%d Got wrong name from '%s', expected '%s', got '%s'", i, c.input, c.expected, result) } } }
mit
adelamtuduce/thesisapp
spec/models/student_teacher_event_spec.rb
355
# == Schema Information # # Table name: student_teacher_events # # id :integer not null, primary key # student_id :integer # teacher_id :integer # event_id :integer # created_at :datetime # updated_at :datetime # require 'spec_helper' describe StudentTeacherEvent do pending "add some examples to (or delete) #{__FILE__}" end
mit
MatheusFaria/IJE
engine/src/components/text.cpp
2018
#include "components/text.hpp" #include "game.hpp" #include "log.h" #include "sdl_log.h" using namespace engine; bool TextComponent::init() { INFO("Init TextComponent"); if (m_font_path == "") { WARN("Invalid path for font!"); return false; } m_font = Game::instance.assets_manager().load_font(m_font_path, m_font_size); if(m_font == NULL) return false; SDL_Color color = {m_color.r, m_color.g, m_color.b, m_color.a}; SDL_Color bg_color = {m_background_color.r, m_background_color.g, m_background_color.b, m_background_color.a}; SDL_Surface * surface = NULL; if (m_high_quality && bg_color.a == 0x00) { surface = TTF_RenderText_Blended( m_font, m_text.c_str(), color ); } else if (m_high_quality) { surface = TTF_RenderText_Shaded( m_font, m_text.c_str(), color, bg_color ); } else { surface = TTF_RenderText_Solid( m_font, m_text.c_str(), color ); } if(surface == NULL) { SDL_TTF_ERROR("Could not render text " << m_text << " with font " << m_font_path); return false; } m_texture = SDL_CreateTextureFromSurface(Game::instance.canvas(), surface); if (m_texture == NULL) { SDL_ERROR("Could not create texture from rendered text surface!"); return false; } m_w = surface->w; m_h = surface->h; SDL_FreeSurface(surface); return true; } bool TextComponent::shutdown() { INFO("Shutdown TextComponent"); SDL_DestroyTexture(m_texture); m_texture = NULL; m_font = NULL; return true; } void TextComponent::draw() { auto position = m_game_object->get_position(); SDL_Rect renderQuad = { static_cast<int>(position.first), static_cast<int>(position.second), m_w, m_h }; SDL_RenderCopy(Game::instance.canvas(), m_texture, NULL, &renderQuad); }
mit
Shabananana/hot-nav
src/components/Notification/Notification.js
564
import React, {Component, PropTypes} from 'react'; export default class Notification extends Component { const NEW = 'NEW'; const VIEWED = 'VIEWED'; const accountStatuses = new Map([NEW, NEW], [VIEWED, VIEWED]); const static propTypes = { profile: PropTypes.shape({ name: PropTypes.string.isRequired, copy: PropTypes.string.isRequired, status: PropTypes.oneOf({ accountStatuses.get(NEW), accountStatuses.get(VIEWED) }).isRequired }) } render() { return ( <div> </div> ); } }
mit
TomiTakussaari/spreact
src/main/java/com/github/tomitakussaari/SpreactApplication.java
680
package com.github.tomitakussaari; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication public class SpreactApplication extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpreactApplication.class); } public static void main(String[] args) { SpringApplication.run(SpreactApplication.class, args); } }
mit
nicholviton/ImageUpload
requestHandler.js
1822
var exec = require("child_process").exec; var server = require("./server"); var querystring = require("querystring"); var fs = require("fs"); var formidable = require("formidable"); function upload(response, request) { console.log("uploading..."); var form = new formidable.IncomingForm(); console.log("about to parse"); form.parse(request, function(error, fields, files) { console.log("parsing done"); fs.rename(files.upload.path, "/nv/temp/cat.png", function(error) { if (error) { fs.unlink("/nv/temp/cat.png"); fs.rename(files.upload.path, "/nv/temp/cat.png"); } }); response.writeHead(200, {"Content-Type": "text/html"}); response.write("received image:<br/>"); response.write("<img src='/show' />"); response.end(); }) } function show(response) { console.log("request handler show was called"); response.writeHead(200, {"Content.Type": "image/png"}); fs.createReadStream("/nv/temp/cat.png").pipe(response); } function start(response) { console.log("call the start request handler"); var body = '<html>'+ '<head>'+ '<meta http-equiv="Content-Type" content="text/html; '+ 'charset=UTF-8" />'+ '</head>'+ '<body>'+ '<form action="/upload" enctype="multipart/form-data" method="post">'+ '<input type="file" name="upload"><br>'+ '<input type="submit" value="Upload file">'+ '</form>'+ '</body>'+ '</html>'; server.writehtml(response, body); } function empty(response) { console.log("in the empty function"); server.writetopage(response, "Hello World from Empty"); } exports.start = start; exports.upload = upload; exports.empty = empty; exports.show = show;
mit
j-easy/easy-jobs
easy-jobs-core/src/test/java/org/jeasy/jobs/job/JobRepositoryTest.java
378
package org.jeasy.jobs.job; public class JobRepositoryTest { /* * The core module is database agnostic. Testing a repository here makes no sense. * Each database module contains a data source definition and database schema against which this repository is tested. * See tests in easy-jobs-tests module which are inherited in each database module. */ }
mit
pink-lucifer/preresearch
grpc-playground/grpc-spring-starter-eureka/grpc-spring-consul-server/src/test/java/com/github/lufs/grpc/spring/consul/server/GrpcSpringConsulServerApplicationTests.java
374
package com.github.lufs.grpc.spring.consul.server; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest public class GrpcSpringConsulServerApplicationTests { @Test public void contextLoads() { } }
mit
getfiteats/gothrive-api
common/models/nutrition-tag-reference.js
55
module.exports = function (NutritionTagReference) { };
mit
repli2dev/nature-quizzer
app/presenters/ConceptPresenter.php
6090
<?php namespace NatureQuizzer\Presenters; use NatureQuizzer\Database\Model\Concept; use NatureQuizzer\Database\Model\Group; use NatureQuizzer\Database\Model\Language; use NatureQuizzer\Database\Model\Organism; use Nette\Application\BadRequestException; use Nette\Application\UI\Form; use Nextras\Datagrid\Datagrid; use PDOException; class ConceptPresenter extends BasePresenter { protected $resource = 'content'; /** @var Concept */ private $conceptModel; /** @var Language */ private $languageModel; /** @var Organism */ private $organismModel; /** @var Group */ private $groupModel; public function injectBase(Concept $conceptModel, Language $languageModel, Organism $organismModel, Group $groupModel) { $this->conceptModel = $conceptModel; $this->languageModel = $languageModel; $this->organismModel = $organismModel; $this->groupModel = $groupModel; } public function startup() { $this->perm(); parent::startup(); } public function actionEdit($id) { $data = $this->conceptModel->get($id); if ($data === NULL) { throw new BadRequestException(); } $values = $data->toArray(); $values['infos'] = $this->conceptModel->getInfos($id); /** @var Form $form */ $form = $this->getComponent('editForm'); $form->setDefaults($values); $this->template->data = $data; } public function actionManage($id) { $data = $this->conceptModel->get($id); if ($data === NULL) { throw new BadRequestException(); } $this->template->data = $data; $conceptOrganisms = $this->organismModel->getFromConcept($this->getParameter('id')); $checked = []; foreach ($conceptOrganisms as $row) { $checked[$row->id_organism] = true; } /** @var Form $form */ $form = $this->getComponent('organisms'); $form->setDefaults(['organisms' => $checked]); } public function actionDelete($id) { $data = $this->conceptModel->get($id); if ($data === NULL) { throw new BadRequestException(); } $this->template->data = $data; } protected function createComponentAddForm() { $form = $this->prepareForm(); $form->addSubmit('send', 'Add concept'); $form->onSuccess[] = [$this, 'addFormSucceeded']; return $form; } public function addFormSucceeded(Form $form, $values) { $infos = $values['infos']; unset($values['infos']); $values['quick'] = $values['quick'] ? 'true' : 'false'; $values['warning'] = $values['warning'] ? 'true' : 'false'; try { $this->conceptModel->insert($values, $infos); } catch (PDOException $ex) { if ($ex->errorInfo[0] != 23505) { throw $ex; } else { $form->addError('This code name is already used. Please select different one.'); } return; } $this->flashMessage('Concept has been successfully added.', 'success'); $this->redirect('default'); } protected function createComponentEditForm() { $form = $this->prepareForm(); $form->addSubmit('send', 'Update concept'); $form->onSuccess[] = [$this, 'editFormSucceeded']; return $form; } public function editFormSucceeded(Form $form, $values) { $infos = $values['infos']; unset($values['infos']); $values['quick'] = $values['quick'] ? 'true' : 'false'; $values['warning'] = $values['warning'] ? 'true' : 'false'; try { $this->conceptModel->update($this->getParameter('id'), $values, $infos); } catch (PDOException $ex) { if ($ex->errorInfo[0] != 23505) { throw $ex; } else { $form->addError('This code name is already used. Please select different one.'); } return; } $this->flashMessage('Concept has been successfully updated.', 'success'); $this->redirect('default'); } protected function createComponentDeleteForm() { $form = new Form(); $form->addSubmit('yes', 'Yes'); $form->addSubmit('no', 'No'); $form->onSuccess[] = [$this, 'deleteFormSucceeded']; return $form; } public function deleteFormSucceeded($form, $values) { if ($form['yes']->isSubmittedBy()) { $this->conceptModel->delete($this->getParameter('id')); $this->flashMessage('Concept has been successfully deleted.', 'success'); } $this->redirect('default'); } private function prepareForm() { $form = new Form(); $form->addGroup('General'); $form->addText('code_name', 'Code name:') ->setRequired('Please enter concept code name.'); $form->addSelect('id_group', 'Group', $this->groupModel->getPairs()) ->setPrompt('No group'); $form->addCheckbox('quick', 'Favourite'); $form->addCheckbox('warning', 'Warning'); $form->setCurrentGroup(null); $languagePairs = $this->languageModel->getLanguagePairs(); $infos = $form->addContainer('infos'); foreach ($languagePairs as $langId => $langName) { $inner = $infos->addContainer($langId); $group = $form->addGroup($langName); $inner->setCurrentGroup($group); $inner->addText('name', 'Name'); $inner->addText('description', 'Description'); } $form->setCurrentGroup(null); return $form; } public function createComponentConceptList() { $grid = new Datagrid(); $grid->setRowPrimaryKey('id_concept'); $grid->setDatasourceCallback(function ($filter, $order) { return $this->conceptModel->getAll(); }); $grid->addCellsTemplate(__DIR__ . '/../grids/concepts-list.latte'); $grid->addColumn('id_concept', 'ID'); $grid->addColumn('code_name', 'Code name'); $grid->addColumn('quick', 'Favourite'); $grid->addColumn('warning', 'Warning'); return $grid; } public function createComponentOrganisms() { $form = new Form(); $container = $form->addContainer('organisms'); $organisms = $this->organismModel->getAll(); foreach ($organisms as $row) { $container->addCheckbox($row->id_organism, $row->latin_name); } $form->addSubmit('send', 'Update'); $form->onSuccess[] = [$this, 'organismsSucceeded']; return $form; } public function organismsSucceeded($form, $values) { $organisms = iterator_to_array($values['organisms']); $this->organismModel->syncBelonging($this->getParameter('id'), $organisms); $this->flashMessage('Matching of organisms to concept has been successfully updated.'); //$this->redirect('this'); } }
mit
steamcomputer/aesir
co2cloud/default/Controller/FuelsController.php
4465
<?php App::uses('AppController', 'Controller'); /** * Fuels Controller * * @property Fuel $Fuel */ class FuelsController extends AppController { /** * index method * * @return void */ public function index() { $this->Fuel->recursive = 0; $this->set('fuels', $this->paginate()); } /** * view method * * @throws NotFoundException * @param string $id * @return void */ public function view($id = null) { if (!$this->Fuel->exists($id)) { throw new NotFoundException(__('Combustible inválido.')); } $options = array('conditions' => array('Fuel.' . $this->Fuel->primaryKey => $id)); $this->set('fuel', $this->Fuel->find('first', $options)); } /** * add method * * @return void */ public function add() { if ($this->request->is('post')) { $this->Fuel->create(); if ($this->Fuel->save($this->request->data)) { $this->Session->setFlash(__('El combustible ha sido guardado.'),'flash_success.ace'); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('El combustible no ha podido ser guardado. Inténtelo nuevamente.'),'flash_error.ace'); } } $error = $this->Fuel->invalidFields(); $sourcetypes = $this->Fuel->SourceType->find('list'); $this->set(compact('error','sourcetypes')); } /** * edit method * * @throws NotFoundException * @param string $id * @return void */ public function edit($id = null) { if (!$this->Fuel->exists($id)) { throw new NotFoundException(__('Combustible inválido.')); } if ($this->request->is('post') || $this->request->is('put')) { if ($this->Fuel->save($this->request->data)) { $this->Session->setFlash(__('El combustible ha sido guardado.'),'flash_success.ace'); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('El combustible no ha podido ser guardado. Inténtelo nuevamente.'),'flash_error.ace'); } } else { $options = array('conditions' => array('Fuel.' . $this->Fuel->primaryKey => $id)); $this->request->data = $this->Fuel->find('first', $options); } $error = $this->Fuel->invalidFields(); $sourcetypes = $this->Fuel->SourceType->find('list'); $this->set(compact('error','sourcetypes')); } /** * delete method * * @throws NotFoundException * @param string $id * @return void */ public function delete($id = null) { $this->Fuel->id = $id; if (!$this->Fuel->exists()) { throw new NotFoundException(__('Combustible inválido.')); } $this->request->onlyAllow('post', 'delete'); if ($this->Fuel->delete()) { $this->Session->setFlash(__('El combustible ha sido eliminado.'),'flash_success.ace'); $this->redirect(array('action' => 'index')); } $this->Session->setFlash(__('El combustible no ha podido eliminarse.'),'flash_error.ace'); $this->redirect(array('action' => 'index')); } public function getBySourceType(){ if ($this->request->is('post') and $this->request->is('ajax')) { $data = array(); if(!empty($this->request->data['Source']['source_type_id'])) { $fuels = $this->Fuel->find( 'list', array( 'recursive' => -1, 'conditions' => array( 'Fuel.source_type_id' => $this->request->data['Source']['source_type_id'], ), 'order' => array( 'Fuel.name' => 'asc' ) ) ); foreach($fuels as $fuel_id => $fuel_name) { $data[] = array( 'value' => $fuel_id, 'text' => $fuel_name ); } } $json_data = array( 'response' => 'success', 'content' => array( 'data' => $data, 'message' => null ) ); $this->set(compact('json_data')); $this->render('/Elements/json','ajax'); } else { $this->redirect(array('controller' => 'page', 'action' => 'display', 'home')); } } public function FuelsBySourceTypeList() { if ($this->request->is('ajax')) { $json_data = array(); if (!empty($this->request->query['source_type_id'])) { $fuels = $this->Fuel->find('list', array( 'recursive' => -1, 'conditions' => array('Fuel.source_type_id' => $this->request->query['source_type_id']), 'order' => array('Fuel.name' => 'asc') ) ); foreach ($fuels as $id => $name) { $json_data[] = array( 'value' => $id, 'text' => $name ); } } $this->set(compact('json_data')); $this->render('/Elements/json','ajax'); } else { $this->redirect(array('controller' => 'page', 'action' => 'display', 'home')); } } }
mit
spiderbait90/Step-By-Step-In-Coding
C# Fundamentals/OOP Basic/Inheritance/Person/Child.cs
487
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class Child : Person { public Child(string name, int age) : base(name, age) { } public override int Age { get { return base.Age; } set { if (value > 15) throw new ArgumentException("Child's age must be less than 15!"); base.Age = value; } } }
mit
telemark/roy
lib/send-documents-to-svarut.js
867
'use strict' const miss = require('mississippi') const svarUt = require('svarut') module.exports = miss.through(function (chunck, encoding, callback) { var item = JSON.parse(chunck) if (item.dsfError) { return callback(null, JSON.stringify(item)) } if (!item.gotRestrictedAddress) { var options = JSON.parse(JSON.stringify(item.svarUt.options)) console.log(item._id + ': send documents to svarut') svarUt(options, function (error, id) { if (error) { item.errors.push(JSON.stringify(error)) } else { item.svarUt.response = id console.log(item._id + ': svarut id returned - ' + JSON.stringify(id)) } return callback(null, JSON.stringify(item)) }) } else { console.log(item._id + ': send documents to svarut. restrictedAddress') return callback(null, JSON.stringify(item)) } })
mit
CoralineAda/alice
alice/handlers/unknown.rb
130
module Handlers class Unknown include PoroPlus include Behavior::HandlesCommands def process end end end
mit
nelsonmelecio/laravel_5_4_with_adminlte
resources/views/vendor/adminlte/blank.blade.php
837
@extends('adminlte::layouts.sge_layout') @section('htmlheader_title') {{ trans('adminlte_lang::message.home') }} @endsection @section('content-header-v2') @include('vendor.adminlte.layouts.partials.contentheader_v2', [ 'title' => 'Page Under Construction', 'indexes' => 'Not implemented yet' ]) @endsection @section('main-content') <div class="container-fluid spark-screen"> <div class="row"> <div class="col-md-12 "> <div class="panel panel-primary"> <div class="panel-heading"> <h4>A message from the developer</h4> </div> <div class="panel-body"> <h3>This page is under construction. Please get back on this page very soon. </h3> </div> <div class="panel-footer"> <h3>God Bless Us All</h3> </div> </div> </div> </div> </div> @endsection
mit
snsavage/timer-react
src/containers/RoutineForm.js
3583
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux' import { withRouter } from 'react-router'; import { PropTypes } from 'prop-types'; import { Link } from 'react-router-dom'; import RoutineFormRoutineDetails from '../components/RoutineFormRoutineDetails'; import RoutineFormGroups from '../components/RoutineFormGroups'; import * as actions from '../actions/routineFormActions'; import { Message, Button, Grid, Form, Header } from 'semantic-ui-react'; export class RoutineForm extends Component { onFormChange = () => { const { saved, actions } = this.props; if (saved) { actions.markAsNotSaved(); } } onFormSubmit = (ev) => { const { onSubmit, routine, history } = this.props; ev.preventDefault(); onSubmit(routine, history) } render() { const { actions, error, routine, submitValue, formTitle, loggedIn, } = this.props; return ( <Form onChange={() => this.onFormChange()} onSubmit={(ev) => this.onFormSubmit(ev)}> <Grid columns={2} centered style={{ margin: 0 }}> <Grid.Column width={8}> <Header as='h1'>{formTitle}</Header> { error.length > 1 && <Message error header='Oh no! Something went wrong!' content={error} /> } <RoutineFormRoutineDetails actions={actions} routine={routine} /> { loggedIn ? ( <Button color="blue" type="submit" disabled={this.props.saved} > {submitValue} </Button> ) : ( <p> <Link to={{ pathname: "/register", state: {from: this.props.location}, }}> Register </Link> {" or "} <Link to={{ pathname: "/signin", state: {from: this.props.location}, }}> Sign In </Link> {" "} to save routine. </p> )} </Grid.Column> <Grid.Column width={8}> <Header as='h3'>Routine Actions</Header> <p>Intervals represent the actions to perform. For example, run, sprint, jump, rest, etc. Intervals are contained in groups that can be repeated.</p> <RoutineFormGroups actions={actions} groups={routine.groups} /> </Grid.Column> </Grid> </Form> ); } } RoutineForm.propTypes = { routine: PropTypes.object.isRequired, saved: PropTypes.bool.isRequired, error: PropTypes.string.isRequired, routineId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), onSubmit: PropTypes.func.isRequired, submitValue: PropTypes.string.isRequired, formTitle: PropTypes.string.isRequired, loggedIn: PropTypes.bool.isRequired, } function mapStateToProps(state, ownProps) { return { routine: state.currentRoutine.routine, saved: state.currentRoutine.saved, error: state.currentRoutine.error, loggedIn: state.session.session, } } function mapDispatchToProps(dispatch, ownProps) { return { actions: bindActionCreators(actions, dispatch), onSubmit: bindActionCreators(ownProps.onSubmit, dispatch), }; } export default withRouter( connect(mapStateToProps, mapDispatchToProps)(RoutineForm) );
mit
iootbob/tyto
application/views/login.php
1201
<!doctype html> <html> <head> <meta charset="utf-8"> <title>Tyto | Login</title> <link href="<?php echo base_url()?>assets/css/login.css" rel="stylesheet" type="text/css"> </head> <body> <h1 class="proj-logo">Tyto</h1> <div class="login-container"> <h2 class="login-title">LOGIN</h2> <?php echo form_open('user/login',$attributes = array('class' => 'login-form-design')) ?> <hr> <p class="login-labels">ID Number</p> <input type="text" name="id-num" class="login-inputbox"> <small><center><?php echo form_error('id-num'); ?></center></small> <p class="login-labels">Password</p> <input type="password" name="password" class="login-inputbox"> <small><center><?php echo form_error('password'); ?></center></small> <br> <input type="submit" name="sublogin" value="LOGIN" class="login-inputbutton"> <?php if($this->session->flashdata('login_error')): ?> <br> <?php echo '<p style = "text-align:center;">'.$this->session->flashdata('login_error').'</p>'; ?> <?php endif; ?> </form> </div> <p class="login-footer">TYTO &copy; <span style="font-weight: bold">2017</span></p> </body> </html>
mit
sinfin/folio
db/migrate/20171129121532_make_atoms_polymorphic.rb
589
# frozen_string_literal: true class MakeAtomsPolymorphic < ActiveRecord::Migration[5.1] def up add_reference :folio_atoms, :placement, polymorphic: true Folio::Atom::Base.find_each do |atom| atom.placement_id = atom.node_id atom.placement_type = "Folio::Page" atom.save! end remove_reference :folio_atoms, :node end def down add_reference :folio_atoms, :node Folio::Atom::Base.find_each do |atom| atom.node_id = atom.placement_id atom.save! end remove_reference :folio_atoms, :placement, polymorphic: true end end
mit
samael205/ExcelPHP
PhpSpreadsheet/Writer/Xlsx/Drawing.php
22040
<?php namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Chart; /** * Copyright (c) 2006 - 2016 PhpSpreadsheet * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category PhpSpreadsheet * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL * @version ##VERSION##, ##DATE## */ class Drawing extends WriterPart { /** * Write drawings to XML format * * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet * @param int &$chartRef Chart ID * @param bool $includeCharts Flag indicating if we should include drawing details for charts * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ public function writeDrawings(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet, &$chartRef, $includeCharts = false) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); // xdr:wsDr $objWriter->startElement('xdr:wsDr'); $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing'); $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main'); // Loop through images and write drawings $i = 1; $iterator = $pWorksheet->getDrawingCollection()->getIterator(); while ($iterator->valid()) { $this->writeDrawing($objWriter, $iterator->current(), $i); $iterator->next(); ++$i; } if ($includeCharts) { $chartCount = $pWorksheet->getChartCount(); // Loop through charts and write the chart position if ($chartCount > 0) { for ($c = 0; $c < $chartCount; ++$c) { $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c + $i); } } } $objWriter->endElement(); // Return return $objWriter->getData(); } /** * Write drawings to XML format * * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param Chart $pChart * @param int $pRelationId * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function writeChart(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, Chart $pChart = null, $pRelationId = -1) { $tl = $pChart->getTopLeftPosition(); $tl['colRow'] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($tl['cell']); $br = $pChart->getBottomRightPosition(); $br['colRow'] = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($br['cell']); $objWriter->startElement('xdr:twoCellAnchor'); $objWriter->startElement('xdr:from'); $objWriter->writeElement('xdr:col', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($tl['colRow'][0]) - 1); $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['xOffset'])); $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1); $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:to'); $objWriter->writeElement('xdr:col', \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($br['colRow'][0]) - 1); $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['xOffset'])); $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1); $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['yOffset'])); $objWriter->endElement(); $objWriter->startElement('xdr:graphicFrame'); $objWriter->writeAttribute('macro', ''); $objWriter->startElement('xdr:nvGraphicFramePr'); $objWriter->startElement('xdr:cNvPr'); $objWriter->writeAttribute('name', 'Chart ' . $pRelationId); $objWriter->writeAttribute('id', 1025 * $pRelationId); $objWriter->endElement(); $objWriter->startElement('xdr:cNvGraphicFramePr'); $objWriter->startElement('a:graphicFrameLocks'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->startElement('xdr:xfrm'); $objWriter->startElement('a:off'); $objWriter->writeAttribute('x', '0'); $objWriter->writeAttribute('y', '0'); $objWriter->endElement(); $objWriter->startElement('a:ext'); $objWriter->writeAttribute('cx', '0'); $objWriter->writeAttribute('cy', '0'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->startElement('a:graphic'); $objWriter->startElement('a:graphicData'); $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); $objWriter->startElement('c:chart'); $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart'); $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); $objWriter->writeAttribute('r:id', 'rId' . $pRelationId); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->startElement('xdr:clientData'); $objWriter->endElement(); $objWriter->endElement(); } /** * Write drawings to XML format * * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing * @param int $pRelationId * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ public function writeDrawing(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing $pDrawing = null, $pRelationId = -1) { if ($pRelationId >= 0) { // xdr:oneCellAnchor $objWriter->startElement('xdr:oneCellAnchor'); // Image location $aCoordinates = \PhpOffice\PhpSpreadsheet\Cell::coordinateFromString($pDrawing->getCoordinates()); $aCoordinates[0] = \PhpOffice\PhpSpreadsheet\Cell::columnIndexFromString($aCoordinates[0]); // xdr:from $objWriter->startElement('xdr:from'); $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1); $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX())); $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1); $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY())); $objWriter->endElement(); // xdr:ext $objWriter->startElement('xdr:ext'); $objWriter->writeAttribute('cx', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getWidth())); $objWriter->writeAttribute('cy', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getHeight())); $objWriter->endElement(); // xdr:pic $objWriter->startElement('xdr:pic'); // xdr:nvPicPr $objWriter->startElement('xdr:nvPicPr'); // xdr:cNvPr $objWriter->startElement('xdr:cNvPr'); $objWriter->writeAttribute('id', $pRelationId); $objWriter->writeAttribute('name', $pDrawing->getName()); $objWriter->writeAttribute('descr', $pDrawing->getDescription()); $objWriter->endElement(); // xdr:cNvPicPr $objWriter->startElement('xdr:cNvPicPr'); // a:picLocks $objWriter->startElement('a:picLocks'); $objWriter->writeAttribute('noChangeAspect', '1'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); // xdr:blipFill $objWriter->startElement('xdr:blipFill'); // a:blip $objWriter->startElement('a:blip'); $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'); $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId); $objWriter->endElement(); // a:stretch $objWriter->startElement('a:stretch'); $objWriter->writeElement('a:fillRect', null); $objWriter->endElement(); $objWriter->endElement(); // xdr:spPr $objWriter->startElement('xdr:spPr'); // a:xfrm $objWriter->startElement('a:xfrm'); $objWriter->writeAttribute('rot', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getRotation())); $objWriter->endElement(); // a:prstGeom $objWriter->startElement('a:prstGeom'); $objWriter->writeAttribute('prst', 'rect'); // a:avLst $objWriter->writeElement('a:avLst', null); $objWriter->endElement(); if ($pDrawing->getShadow()->getVisible()) { // a:effectLst $objWriter->startElement('a:effectLst'); // a:outerShdw $objWriter->startElement('a:outerShdw'); $objWriter->writeAttribute('blurRad', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius())); $objWriter->writeAttribute('dist', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance())); $objWriter->writeAttribute('dir', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection())); $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment()); $objWriter->writeAttribute('rotWithShape', '0'); // a:srgbClr $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', $pDrawing->getShadow()->getColor()->getRGB()); // a:alpha $objWriter->startElement('a:alpha'); $objWriter->writeAttribute('val', $pDrawing->getShadow()->getAlpha() * 1000); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); } /* // a:scene3d $objWriter->startElement('a:scene3d'); // a:camera $objWriter->startElement('a:camera'); $objWriter->writeAttribute('prst', 'orthographicFront'); $objWriter->endElement(); // a:lightRig $objWriter->startElement('a:lightRig'); $objWriter->writeAttribute('rig', 'twoPt'); $objWriter->writeAttribute('dir', 't'); // a:rot $objWriter->startElement('a:rot'); $objWriter->writeAttribute('lat', '0'); $objWriter->writeAttribute('lon', '0'); $objWriter->writeAttribute('rev', '0'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); */ /* // a:sp3d $objWriter->startElement('a:sp3d'); // a:bevelT $objWriter->startElement('a:bevelT'); $objWriter->writeAttribute('w', '25400'); $objWriter->writeAttribute('h', '19050'); $objWriter->endElement(); // a:contourClr $objWriter->startElement('a:contourClr'); // a:srgbClr $objWriter->startElement('a:srgbClr'); $objWriter->writeAttribute('val', 'FFFFFF'); $objWriter->endElement(); $objWriter->endElement(); $objWriter->endElement(); */ $objWriter->endElement(); $objWriter->endElement(); // xdr:clientData $objWriter->writeElement('xdr:clientData', null); $objWriter->endElement(); } else { throw new \PhpOffice\PhpSpreadsheet\Writer\Exception('Invalid parameters passed.'); } } /** * Write VML header/footer images to XML format * * @param \PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return string XML Output */ public function writeVMLHeaderFooterImages(\PhpOffice\PhpSpreadsheet\Worksheet $pWorksheet = null) { // Create XML writer $objWriter = null; if ($this->getParentWriter()->getUseDiskCaching()) { $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory()); } else { $objWriter = new \PhpOffice\PhpSpreadsheet\Shared\XMLWriter(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter::STORAGE_MEMORY); } // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); // Header/footer images $images = $pWorksheet->getHeaderFooter()->getImages(); // xml $objWriter->startElement('xml'); $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml'); $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office'); $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel'); // o:shapelayout $objWriter->startElement('o:shapelayout'); $objWriter->writeAttribute('v:ext', 'edit'); // o:idmap $objWriter->startElement('o:idmap'); $objWriter->writeAttribute('v:ext', 'edit'); $objWriter->writeAttribute('data', '1'); $objWriter->endElement(); $objWriter->endElement(); // v:shapetype $objWriter->startElement('v:shapetype'); $objWriter->writeAttribute('id', '_x0000_t75'); $objWriter->writeAttribute('coordsize', '21600,21600'); $objWriter->writeAttribute('o:spt', '75'); $objWriter->writeAttribute('o:preferrelative', 't'); $objWriter->writeAttribute('path', 'm@4@5l@4@11@9@11@9@5xe'); $objWriter->writeAttribute('filled', 'f'); $objWriter->writeAttribute('stroked', 'f'); // v:stroke $objWriter->startElement('v:stroke'); $objWriter->writeAttribute('joinstyle', 'miter'); $objWriter->endElement(); // v:formulas $objWriter->startElement('v:formulas'); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'if lineDrawn pixelLineWidth 0'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'sum @0 1 0'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'sum 0 0 @1'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @2 1 2'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelWidth'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelHeight'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'sum @0 0 1'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @6 1 2'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelWidth'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'sum @8 21600 0'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelHeight'); $objWriter->endElement(); // v:f $objWriter->startElement('v:f'); $objWriter->writeAttribute('eqn', 'sum @10 21600 0'); $objWriter->endElement(); $objWriter->endElement(); // v:path $objWriter->startElement('v:path'); $objWriter->writeAttribute('o:extrusionok', 'f'); $objWriter->writeAttribute('gradientshapeok', 't'); $objWriter->writeAttribute('o:connecttype', 'rect'); $objWriter->endElement(); // o:lock $objWriter->startElement('o:lock'); $objWriter->writeAttribute('v:ext', 'edit'); $objWriter->writeAttribute('aspectratio', 't'); $objWriter->endElement(); $objWriter->endElement(); // Loop through images foreach ($images as $key => $value) { $this->writeVMLHeaderFooterImage($objWriter, $key, $value); } $objWriter->endElement(); // Return return $objWriter->getData(); } /** * Write VML comment to XML format * * @param \PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter XML Writer * @param string $pReference Reference * @param \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage Image * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception */ private function writeVMLHeaderFooterImage(\PhpOffice\PhpSpreadsheet\Shared\XMLWriter $objWriter = null, $pReference = '', \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing $pImage = null) { // Calculate object id preg_match('{(\d+)}', md5($pReference), $m); $id = 1500 + (substr($m[1], 0, 2) * 1); // Calculate offset $width = $pImage->getWidth(); $height = $pImage->getHeight(); $marginLeft = $pImage->getOffsetX(); $marginTop = $pImage->getOffsetY(); // v:shape $objWriter->startElement('v:shape'); $objWriter->writeAttribute('id', $pReference); $objWriter->writeAttribute('o:spid', '_x0000_s' . $id); $objWriter->writeAttribute('type', '#_x0000_t75'); $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1"); // v:imagedata $objWriter->startElement('v:imagedata'); $objWriter->writeAttribute('o:relid', 'rId' . $pReference); $objWriter->writeAttribute('o:title', $pImage->getName()); $objWriter->endElement(); // o:lock $objWriter->startElement('o:lock'); $objWriter->writeAttribute('v:ext', 'edit'); $objWriter->writeAttribute('rotation', 't'); $objWriter->endElement(); $objWriter->endElement(); } /** * Get an array of all drawings * * @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception * @return \PhpOffice\PhpSpreadsheet\Worksheet\Drawing[] All drawings in PhpSpreadsheet */ public function allDrawings(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null) { // Get an array of all drawings $aDrawings = []; // Loop through PhpSpreadsheet $sheetCount = $spreadsheet->getSheetCount(); for ($i = 0; $i < $sheetCount; ++$i) { // Loop through images and add to array $iterator = $spreadsheet->getSheet($i)->getDrawingCollection()->getIterator(); while ($iterator->valid()) { $aDrawings[] = $iterator->current(); $iterator->next(); } } return $aDrawings; } }
mit
darkbasic/angular-meteor
atmosphere-packages/angular-compilers/package.js
753
Package.describe({ name: 'angular-compilers', version: '0.2.9_2', summary: 'Rollup, AOT, SCSS, HTML and TypeScript compilers for Angular Meteor', git: 'https://github.com/Urigo/angular-meteor/tree/master/atmosphere-packages/angular-compilers', documentation: 'README.md' }); Package.registerBuildPlugin({ name: 'Angular Compilers', sources: [ 'plugin/register.js' ], use: [ // Uses an external packages to get the actual compilers 'ecmascript@0.8.3', 'angular-typescript-compiler@0.2.9_5', 'angular-html-compiler@0.2.9', 'angular-scss-compiler@0.2.9' ] }); Package.onUse(function(api) { api.versionsFrom('1.6'); // Required in order to register plugins api.use('isobuild:compiler-plugin@1.0.0'); });
mit
butane/CodeIgniter
system/libraries/Encryption.php
23327
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2019, British Columbia Institute of Technology * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @package CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/) * @license https://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 3.0.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * CodeIgniter Encryption Class * * Provides two-way keyed encryption via PHP's MCrypt and/or OpenSSL extensions. * * @package CodeIgniter * @subpackage Libraries * @category Libraries * @author Andrey Andreev * @link https://codeigniter.com/userguide3/libraries/encryption.html */ class CI_Encryption { /** * Encryption cipher * * @var string */ protected $_cipher = 'aes-128'; /** * Cipher mode * * @var string */ protected $_mode = 'cbc'; /** * Cipher handle * * @var mixed */ protected $_handle; /** * Encryption key * * @var string */ protected $_key; /** * PHP extension to be used * * @var string */ protected $_driver; /** * List of usable drivers (PHP extensions) * * @var array */ protected $_drivers = array(); /** * List of available modes * * @var array */ protected $_modes = array( 'mcrypt' => array( 'cbc' => 'cbc', 'ecb' => 'ecb', 'ofb' => 'nofb', 'ofb8' => 'ofb', 'cfb' => 'ncfb', 'cfb8' => 'cfb', 'ctr' => 'ctr', 'stream' => 'stream' ), 'openssl' => array( 'cbc' => 'cbc', 'ecb' => 'ecb', 'ofb' => 'ofb', 'cfb' => 'cfb', 'cfb8' => 'cfb8', 'ctr' => 'ctr', 'stream' => '', 'xts' => 'xts' ) ); /** * List of supported HMAC algorithms * * name => digest size pairs * * @var array */ protected $_digests = array( 'sha224' => 28, 'sha256' => 32, 'sha384' => 48, 'sha512' => 64 ); /** * mbstring.func_overload flag * * @var bool */ protected static $func_overload; // -------------------------------------------------------------------- /** * Class constructor * * @param array $params Configuration parameters * @return void */ public function __construct(array $params = array()) { $this->_drivers = array( 'mcrypt' => defined('MCRYPT_DEV_URANDOM'), 'openssl' => extension_loaded('openssl') ); if ( ! $this->_drivers['mcrypt'] && ! $this->_drivers['openssl']) { show_error('Encryption: Unable to find an available encryption driver.'); } isset(self::$func_overload) OR self::$func_overload = (extension_loaded('mbstring') && ini_get('mbstring.func_overload')); $this->initialize($params); if ( ! isset($this->_key) && self::strlen($key = config_item('encryption_key')) > 0) { $this->_key = $key; } log_message('info', 'Encryption Class Initialized'); } // -------------------------------------------------------------------- /** * Initialize * * @param array $params Configuration parameters * @return CI_Encryption */ public function initialize(array $params) { if ( ! empty($params['driver'])) { if (isset($this->_drivers[$params['driver']])) { if ($this->_drivers[$params['driver']]) { $this->_driver = $params['driver']; } else { log_message('error', "Encryption: Driver '".$params['driver']."' is not available."); } } else { log_message('error', "Encryption: Unknown driver '".$params['driver']."' cannot be configured."); } } if (empty($this->_driver)) { $this->_driver = ($this->_drivers['openssl'] === TRUE) ? 'openssl' : 'mcrypt'; log_message('debug', "Encryption: Auto-configured driver '".$this->_driver."'."); } empty($params['cipher']) && $params['cipher'] = $this->_cipher; empty($params['key']) OR $this->_key = $params['key']; $this->{'_'.$this->_driver.'_initialize'}($params); return $this; } // -------------------------------------------------------------------- /** * Initialize MCrypt * * @param array $params Configuration parameters * @return void */ protected function _mcrypt_initialize($params) { if ( ! empty($params['cipher'])) { $params['cipher'] = strtolower($params['cipher']); $this->_cipher_alias($params['cipher']); if ( ! in_array($params['cipher'], mcrypt_list_algorithms(), TRUE)) { log_message('error', 'Encryption: MCrypt cipher '.strtoupper($params['cipher']).' is not available.'); } else { $this->_cipher = $params['cipher']; } } if ( ! empty($params['mode'])) { $params['mode'] = strtolower($params['mode']); if ( ! isset($this->_modes['mcrypt'][$params['mode']])) { log_message('error', 'Encryption: MCrypt mode '.strtoupper($params['mode']).' is not available.'); } else { $this->_mode = $this->_modes['mcrypt'][$params['mode']]; } } if (isset($this->_cipher, $this->_mode)) { if (is_resource($this->_handle) && (strtolower(mcrypt_enc_get_algorithms_name($this->_handle)) !== $this->_cipher OR strtolower(mcrypt_enc_get_modes_name($this->_handle)) !== $this->_mode) ) { mcrypt_module_close($this->_handle); } if ($this->_handle = mcrypt_module_open($this->_cipher, '', $this->_mode, '')) { log_message('info', 'Encryption: MCrypt cipher '.strtoupper($this->_cipher).' initialized in '.strtoupper($this->_mode).' mode.'); } else { log_message('error', 'Encryption: Unable to initialize MCrypt with cipher '.strtoupper($this->_cipher).' in '.strtoupper($this->_mode).' mode.'); } } } // -------------------------------------------------------------------- /** * Initialize OpenSSL * * @param array $params Configuration parameters * @return void */ protected function _openssl_initialize($params) { if ( ! empty($params['cipher'])) { $params['cipher'] = strtolower($params['cipher']); $this->_cipher_alias($params['cipher']); $this->_cipher = $params['cipher']; } if ( ! empty($params['mode'])) { $params['mode'] = strtolower($params['mode']); if ( ! isset($this->_modes['openssl'][$params['mode']])) { log_message('error', 'Encryption: OpenSSL mode '.strtoupper($params['mode']).' is not available.'); } else { $this->_mode = $this->_modes['openssl'][$params['mode']]; } } if (isset($this->_cipher, $this->_mode)) { // This is mostly for the stream mode, which doesn't get suffixed in OpenSSL $handle = empty($this->_mode) ? $this->_cipher : $this->_cipher.'-'.$this->_mode; if ( ! in_array($handle, openssl_get_cipher_methods(), TRUE)) { $this->_handle = NULL; log_message('error', 'Encryption: Unable to initialize OpenSSL with method '.strtoupper($handle).'.'); } else { $this->_handle = $handle; log_message('info', 'Encryption: OpenSSL initialized with method '.strtoupper($handle).'.'); } } } // -------------------------------------------------------------------- /** * Create a random key * * @param int $length Output length * @return string */ public function create_key($length) { if (function_exists('random_bytes')) { try { return random_bytes((int) $length); } catch (Exception $e) { log_message('error', $e->getMessage()); return FALSE; } } elseif (defined('MCRYPT_DEV_URANDOM')) { return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); } $is_secure = NULL; $key = openssl_random_pseudo_bytes($length, $is_secure); return ($is_secure === TRUE) ? $key : FALSE; } // -------------------------------------------------------------------- /** * Encrypt * * @param string $data Input data * @param array $params Input parameters * @return string */ public function encrypt($data, array $params = NULL) { if (($params = $this->_get_params($params)) === FALSE) { return FALSE; } isset($params['key']) OR $params['key'] = $this->hkdf($this->_key, 'sha512', NULL, self::strlen($this->_key), 'encryption'); if (($data = $this->{'_'.$this->_driver.'_encrypt'}($data, $params)) === FALSE) { return FALSE; } $params['base64'] && $data = base64_encode($data); if (isset($params['hmac_digest'])) { isset($params['hmac_key']) OR $params['hmac_key'] = $this->hkdf($this->_key, 'sha512', NULL, NULL, 'authentication'); return hash_hmac($params['hmac_digest'], $data, $params['hmac_key'], ! $params['base64']).$data; } return $data; } // -------------------------------------------------------------------- /** * Encrypt via MCrypt * * @param string $data Input data * @param array $params Input parameters * @return string */ protected function _mcrypt_encrypt($data, $params) { if ( ! is_resource($params['handle'])) { return FALSE; } // The greater-than-1 comparison is mostly a work-around for a bug, // where 1 is returned for ARCFour instead of 0. $iv = (($iv_size = mcrypt_enc_get_iv_size($params['handle'])) > 1) ? $this->create_key($iv_size) : NULL; if (mcrypt_generic_init($params['handle'], $params['key'], $iv) < 0) { if ($params['handle'] !== $this->_handle) { mcrypt_module_close($params['handle']); } return FALSE; } // Use PKCS#7 padding in order to ensure compatibility with OpenSSL // and other implementations outside of PHP. if (in_array(strtolower(mcrypt_enc_get_modes_name($params['handle'])), array('cbc', 'ecb'), TRUE)) { $block_size = mcrypt_enc_get_block_size($params['handle']); $pad = $block_size - (self::strlen($data) % $block_size); $data .= str_repeat(chr($pad), $pad); } // Work-around for yet another strange behavior in MCrypt. // // When encrypting in ECB mode, the IV is ignored. Yet // mcrypt_enc_get_iv_size() returns a value larger than 0 // even if ECB is used AND mcrypt_generic_init() complains // if you don't pass an IV with length equal to the said // return value. // // This probably would've been fine (even though still wasteful), // but OpenSSL isn't that dumb and we need to make the process // portable, so ... $data = (mcrypt_enc_get_modes_name($params['handle']) !== 'ECB') ? $iv.mcrypt_generic($params['handle'], $data) : mcrypt_generic($params['handle'], $data); mcrypt_generic_deinit($params['handle']); if ($params['handle'] !== $this->_handle) { mcrypt_module_close($params['handle']); } return $data; } // -------------------------------------------------------------------- /** * Encrypt via OpenSSL * * @param string $data Input data * @param array $params Input parameters * @return string */ protected function _openssl_encrypt($data, $params) { if (empty($params['handle'])) { return FALSE; } $iv = ($iv_size = openssl_cipher_iv_length($params['handle'])) ? $this->create_key($iv_size) : NULL; $data = openssl_encrypt( $data, $params['handle'], $params['key'], OPENSSL_RAW_DATA, $iv ); if ($data === FALSE) { return FALSE; } return $iv.$data; } // -------------------------------------------------------------------- /** * Decrypt * * @param string $data Encrypted data * @param array $params Input parameters * @return string */ public function decrypt($data, array $params = NULL) { if (($params = $this->_get_params($params)) === FALSE) { return FALSE; } if (isset($params['hmac_digest'])) { // This might look illogical, but it is done during encryption as well ... // The 'base64' value is effectively an inverted "raw data" parameter $digest_size = ($params['base64']) ? $this->_digests[$params['hmac_digest']] * 2 : $this->_digests[$params['hmac_digest']]; if (self::strlen($data) <= $digest_size) { return FALSE; } $hmac_input = self::substr($data, 0, $digest_size); $data = self::substr($data, $digest_size); isset($params['hmac_key']) OR $params['hmac_key'] = $this->hkdf($this->_key, 'sha512', NULL, NULL, 'authentication'); $hmac_check = hash_hmac($params['hmac_digest'], $data, $params['hmac_key'], ! $params['base64']); // Time-attack-safe comparison $diff = 0; for ($i = 0; $i < $digest_size; $i++) { $diff |= ord($hmac_input[$i]) ^ ord($hmac_check[$i]); } if ($diff !== 0) { return FALSE; } } if ($params['base64']) { $data = base64_decode($data); } isset($params['key']) OR $params['key'] = $this->hkdf($this->_key, 'sha512', NULL, self::strlen($this->_key), 'encryption'); return $this->{'_'.$this->_driver.'_decrypt'}($data, $params); } // -------------------------------------------------------------------- /** * Decrypt via MCrypt * * @param string $data Encrypted data * @param array $params Input parameters * @return string */ protected function _mcrypt_decrypt($data, $params) { if ( ! is_resource($params['handle'])) { return FALSE; } // The greater-than-1 comparison is mostly a work-around for a bug, // where 1 is returned for ARCFour instead of 0. if (($iv_size = mcrypt_enc_get_iv_size($params['handle'])) > 1) { if (mcrypt_enc_get_modes_name($params['handle']) !== 'ECB') { $iv = self::substr($data, 0, $iv_size); $data = self::substr($data, $iv_size); } else { // MCrypt is dumb and this is ignored, only size matters $iv = str_repeat("\x0", $iv_size); } } else { $iv = NULL; } if (mcrypt_generic_init($params['handle'], $params['key'], $iv) < 0) { if ($params['handle'] !== $this->_handle) { mcrypt_module_close($params['handle']); } return FALSE; } $data = mdecrypt_generic($params['handle'], $data); // Remove PKCS#7 padding, if necessary if (in_array(strtolower(mcrypt_enc_get_modes_name($params['handle'])), array('cbc', 'ecb'), TRUE)) { $data = self::substr($data, 0, -ord($data[self::strlen($data)-1])); } mcrypt_generic_deinit($params['handle']); if ($params['handle'] !== $this->_handle) { mcrypt_module_close($params['handle']); } return $data; } // -------------------------------------------------------------------- /** * Decrypt via OpenSSL * * @param string $data Encrypted data * @param array $params Input parameters * @return string */ protected function _openssl_decrypt($data, $params) { if ($iv_size = openssl_cipher_iv_length($params['handle'])) { $iv = self::substr($data, 0, $iv_size); $data = self::substr($data, $iv_size); } else { $iv = NULL; } return empty($params['handle']) ? FALSE : openssl_decrypt( $data, $params['handle'], $params['key'], OPENSSL_RAW_DATA, $iv ); } // -------------------------------------------------------------------- /** * Get params * * @param array $params Input parameters * @return array */ protected function _get_params($params) { if (empty($params)) { return isset($this->_cipher, $this->_mode, $this->_key, $this->_handle) ? array( 'handle' => $this->_handle, 'cipher' => $this->_cipher, 'mode' => $this->_mode, 'key' => NULL, 'base64' => TRUE, 'hmac_digest' => 'sha512', 'hmac_key' => NULL ) : FALSE; } elseif ( ! isset($params['cipher'], $params['mode'], $params['key'])) { return FALSE; } if (isset($params['mode'])) { $params['mode'] = strtolower($params['mode']); if ( ! isset($this->_modes[$this->_driver][$params['mode']])) { return FALSE; } $params['mode'] = $this->_modes[$this->_driver][$params['mode']]; } if (isset($params['hmac']) && $params['hmac'] === FALSE) { $params['hmac_digest'] = $params['hmac_key'] = NULL; } else { if ( ! isset($params['hmac_key'])) { return FALSE; } elseif (isset($params['hmac_digest'])) { $params['hmac_digest'] = strtolower($params['hmac_digest']); if ( ! isset($this->_digests[$params['hmac_digest']])) { return FALSE; } } else { $params['hmac_digest'] = 'sha512'; } } $params = array( 'handle' => NULL, 'cipher' => $params['cipher'], 'mode' => $params['mode'], 'key' => $params['key'], 'base64' => isset($params['raw_data']) ? ! $params['raw_data'] : FALSE, 'hmac_digest' => $params['hmac_digest'], 'hmac_key' => $params['hmac_key'] ); $this->_cipher_alias($params['cipher']); $params['handle'] = ($params['cipher'] !== $this->_cipher OR $params['mode'] !== $this->_mode) ? $this->{'_'.$this->_driver.'_get_handle'}($params['cipher'], $params['mode']) : $this->_handle; return $params; } // -------------------------------------------------------------------- /** * Get MCrypt handle * * @param string $cipher Cipher name * @param string $mode Encryption mode * @return resource */ protected function _mcrypt_get_handle($cipher, $mode) { return mcrypt_module_open($cipher, '', $mode, ''); } // -------------------------------------------------------------------- /** * Get OpenSSL handle * * @param string $cipher Cipher name * @param string $mode Encryption mode * @return string */ protected function _openssl_get_handle($cipher, $mode) { // OpenSSL methods aren't suffixed with '-stream' for this mode return ($mode === 'stream') ? $cipher : $cipher.'-'.$mode; } // -------------------------------------------------------------------- /** * Cipher alias * * Tries to translate cipher names between MCrypt and OpenSSL's "dialects". * * @param string $cipher Cipher name * @return void */ protected function _cipher_alias(&$cipher) { static $dictionary; if (empty($dictionary)) { $dictionary = array( 'mcrypt' => array( 'aes-128' => 'rijndael-128', 'aes-192' => 'rijndael-128', 'aes-256' => 'rijndael-128', 'des3-ede3' => 'tripledes', 'bf' => 'blowfish', 'cast5' => 'cast-128', 'rc4' => 'arcfour', 'rc4-40' => 'arcfour' ), 'openssl' => array( 'rijndael-128' => 'aes-128', 'tripledes' => 'des-ede3', 'blowfish' => 'bf', 'cast-128' => 'cast5', 'arcfour' => 'rc4-40', 'rc4' => 'rc4-40' ) ); // Notes: // // - Rijndael-128 is, at the same time all three of AES-128, // AES-192 and AES-256. The only difference between them is // the key size. Rijndael-192, Rijndael-256 on the other hand // also have different block sizes and are NOT AES-compatible. // // - Blowfish is said to be supporting key sizes between // 4 and 56 bytes, but it appears that between MCrypt and // OpenSSL, only those of 16 and more bytes are compatible. // Also, don't know what MCrypt's 'blowfish-compat' is. // // - CAST-128/CAST5 produces a longer cipher when encrypted via // OpenSSL, but (strangely enough) can be decrypted by either // extension anyway. // Also, it appears that OpenSSL uses 16 rounds regardless of // the key size, while RFC2144 says that for key sizes lower // than 11 bytes, only 12 rounds should be used. This makes // it portable only with keys of between 11 and 16 bytes. // // - RC4 (ARCFour) has a strange implementation under OpenSSL. // Its 'rc4-40' cipher method seems to work flawlessly, yet // there's another one, 'rc4' that only works with a 16-byte key. // // - DES is compatible, but doesn't need an alias. // // Other seemingly matching ciphers between MCrypt, OpenSSL: // // - RC2 is NOT compatible and only an obscure forum post // confirms that it is MCrypt's fault. } if (isset($dictionary[$this->_driver][$cipher])) { $cipher = $dictionary[$this->_driver][$cipher]; } } // -------------------------------------------------------------------- /** * HKDF * * @link https://tools.ietf.org/rfc/rfc5869.txt * @param $key Input key * @param $digest A SHA-2 hashing algorithm * @param $salt Optional salt * @param $length Output length (defaults to the selected digest size) * @param $info Optional context/application-specific info * @return string A pseudo-random key */ public function hkdf($key, $digest = 'sha512', $salt = NULL, $length = NULL, $info = '') { if ( ! isset($this->_digests[$digest])) { return FALSE; } if (empty($length) OR ! is_int($length)) { $length = $this->_digests[$digest]; } elseif ($length > (255 * $this->_digests[$digest])) { return FALSE; } self::strlen($salt) OR $salt = str_repeat("\0", $this->_digests[$digest]); $prk = hash_hmac($digest, $key, $salt, TRUE); $key = ''; for ($key_block = '', $block_index = 1; self::strlen($key) < $length; $block_index++) { $key_block = hash_hmac($digest, $key_block.$info.chr($block_index), $prk, TRUE); $key .= $key_block; } return self::substr($key, 0, $length); } // -------------------------------------------------------------------- /** * __get() magic * * @param string $key Property name * @return mixed */ public function __get($key) { // Because aliases if ($key === 'mode') { return array_search($this->_mode, $this->_modes[$this->_driver], TRUE); } elseif (in_array($key, array('cipher', 'driver', 'drivers', 'digests'), TRUE)) { return $this->{'_'.$key}; } return NULL; } // -------------------------------------------------------------------- /** * Byte-safe strlen() * * @param string $str * @return int */ protected static function strlen($str) { return (self::$func_overload) ? mb_strlen($str, '8bit') : strlen($str); } // -------------------------------------------------------------------- /** * Byte-safe substr() * * @param string $str * @param int $start * @param int $length * @return string */ protected static function substr($str, $start, $length = NULL) { if (self::$func_overload) { return mb_substr($str, $start, $length, '8bit'); } return isset($length) ? substr($str, $start, $length) : substr($str, $start); } }
mit
hoangductho/original
application/modules/app/controllers/User.php
2468
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class User extends MY_Controller { protected $__ISSERVICE__ = false; protected $__RULES__ = [ 'signin' => [ 'method' => 'GET', 'data' => [] ], 'signup' => [ 'method' => 'GET', 'data' => [] ], 'signout' => [ 'method' => 'GET', 'data' => [] ], 'forgot' => [ 'method' => 'GET', 'data' => [] ], 'reset' => [ 'method' => 'GET', 'data' => [] ], 'active' => [ 'method' => 'GET', 'data' => [ ] ], 'resend' => [ 'method' => 'GET', 'data' => [ ] ], ]; public function __construct() { parent::__construct(); if(!empty($this->__ACCOUNT__) && $this->__FUNCTION__ != 'signout') { redirect('/app/dashboard'); } // set layout $this->load->set_layout('user_layout.php'); } /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see https://codeigniter.com/user_guide/general/urls.html */ public function signin() { $this->load->render('User/signin'); } /** * Sign Up page * * Form for user sign up new account */ public function signup() { $this->load->render('User/signup'); } /** * Sign Up page * * Form for user sign up new account */ public function signout() { if (isset($_COOKIE['session_token'])) { unset($_COOKIE['session_token']); setcookie('session_token', '', -1, '/'); } // redirect('/app/user/signin'); header("Location: /app/user/signin"); } /** * Forgot Password * * Form to case of forget password */ public function forgot() { $this->load->render('User/forgot'); } /** * Reset Password * */ public function reset($key) { $code = json_decode(base64_decode(urldecode($key)), true); $data = [ 'code' => $key, 'email' => $code['email'] ]; $this->load->render('User/reset', $data); } /** * Active account * */ public function active($key) { $code = json_decode(base64_decode(urldecode($key)), true); $data = [ 'code' => $key, 'email' => $code['email'] ]; $this->load->render('User/active', $data); } }
mit
revnode/todo
todo-ui/js/pages/login.js
1719
var pages_login = { 'public render_login': function() { r.inject( this.dom.form = form({ c:['table', 'box', 'align_center'], e: { submit: this.event_submit_login.bind(this) } }, div({c:['column', 'title']}, 'Please Login'), this.dom.message = div({c:['column', 'message']}), div({c:['column', 'body']}, input({ type: 'text', name: 'user', placeholder: 'Username' }), span('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'), input({ type: 'password', name: 'password', placeholder: 'Password' }), br, br, button({ type:'submit', name:'submit' }, 'Login' ), br, br, span('If you don\'t have an account, you can register '), span({c:'a', e:{click:this.render_register.bind(this)}}, 'here'), span('.') ) ), r._(this.dom.content) ); }, 'public event_submit_login': function(event) { event.preventDefault(); r._(this.dom.message); var data = r.form.to(this.dom.form), flag = true; if(flag && !data.user) { this.render_error('Please enter a username!', 'error'); flag = false; } if(flag && !/^[a-zA-Z_0-9]+$/.test(data.user)) { this.render_error('The username must only have letters, numbers, or underscores!', 'error'); flag = false; } if(flag && !data.password) { this.render_error('Please enter a password for the account!', 'error'); flag = false; } if(flag && data.password.length < 4) { this.render_error('Please enter a password that is at least 4 characters!', 'error'); flag = false; } if(flag) { r.xhr.rpc('token', 'GET', data, this.rpc, this); } } };
mit
blairanderson/that-music-blog
lib/publify_textfilter_lightbox.rb
6162
require 'net/http' class PublifyApp class Textfilter class Lightbox < TextFilterPlugin::MacroPost plugin_display_name 'Lightbox' plugin_description 'Automatically generate tags for images displayed in a lightbox' def self.help_text %{ You can use `<publify:lightbox>` to display images from [Flickr](http://flickr.com) or a provided URL which, when clicked, will be shown in a lightbox using Lokesh Dhakar's [Lightbox](http://www.huddletogether.com/projects/lightbox/) Javascript Example: <publify:lightbox img="31367273" thumbsize="thumbnail" displaysize="original"/> <publify:lightbox src="/files/myimage.png" thumbsrc="/files/myimage-thumb.png"/> The first will produce an `<img>` tag showing image number 31367273 from Flickr using the thumbnail image size. The image will be linked to the original image file from Flickr. When the link is clicked, the larger picture will be overlaid on top of the existing page instead of taking you over to the Flickr site. The second will do the same but use the `src` URL as the large picture and the `thumbsrc` URL as the thumbnail image. To understand what this looks like, have a peek at Lokesh Dhakar's [examples](http://www.huddletogether.com/projects/lightbox/). It will also have a comment block attached if a description has been attached to the picture in Flickr or the caption attribute is used. For theme writers, the link is enclosed in a div tag with a "lightboxplugin" class. Because this filter requires javascript and css include files, it will only work with themes using the `<%= page_header %>` convenience function in their layouts. As of this writing only Azure does this. This macro takes a number of parameters: Flickr attributes: * **img** The Flickr image ID of the picture that you wish to use. This shows up in the URL whenever you're viewing a picture in Flickr; for example, the image ID for <http://flickr.com/photos/scottlaird/31367273> is 31367273. * **thumbsize** The image size that you'd like to display. Typically you would use square, thumbnail or small. Options are: * square (75x75) * thumbnail (maximum size 100 pixels) * small (maximum size 240 pixels) * medium (maximum size 500 pixels) * large (maximum size 1024 pixels) * original * **displaysize** The image size for the lightbox overlay shown when the user clicks the thumbnail. Options are the same as for thumbsize, but typically you would use medium or large. If your image files are quite large on Flickr you probably want to avoid using original. Direct URL attributes: * **src** The URL to the picture you wish to use. * **thumbsrc** The URL to the thumbnail you would like to use. If this is not provided, the original picture will be used with the width and height properties of the `<img>` tag set to 100x100. Common attributes: * **style** This is passed through to the enclosing `<div>` that this macro generates. To float the image on the right, use `style="float:right"`. * **caption** The caption displayed below the image. By default, this is Flickr's description of the image. to disable, use `caption=""`. * **title** The tooltip title associated with the image. Defaults to Flickr's image title. * **alt** The alt text associated with the image. By default, this is the same as the title. * **set** Add image to a set * **class** adds an existing CSS class } end def self.macrofilter(blog, content, attrib, _params, _text = '') style = attrib['style'] caption = attrib['caption'] title = attrib['title'] alt = attrib['alt'] theclass = attrib['class'] set = attrib['set'] thumburl = '' displayurl = '' img = attrib['img'] if img thumbsize = attrib['thumbsize'] || 'square' displaysize = attrib['displaysize'] || 'original' FlickRaw.api_key = FLICKR_KEY FlickRaw.shared_secret = FLICKR_SECRET flickrimage = flickr.photos.getInfo(photo_id: img) sizes = flickr.photos.getSizes(photo_id: img) thumbdetails = sizes.find { |s| s['label'].downcase == thumbsize.downcase } || sizes.first displaydetails = sizes.find { |s| s['label'].downcase == displaysize.downcase } || sizes.first width = thumbdetails['width'] height = thumbdetails['height'] # use protocol-relative URL after getting the source address # so not to break HTTPS support thumburl = thumbdetails['source'].sub(/^https?:/, '') displayurl = displaydetails['source'].sub(/^https?:/, '') caption ||= flickrimage.description title ||= flickrimage.title alt ||= title else thumburl = attrib['thumbsrc'] unless attrib['thumbsrc'].nil? displayurl = attrib['src'] unless attrib['src'].nil? if thumburl.empty? thumburl = displayurl width = 100 height = 100 else width = height = nil end end rel = (set.blank?) ? 'lightbox' : "lightbox[#{set}]" if caption.blank? captioncode = '' else captioncode = "<p class=\"caption\" style=\"width:#{width}px\">#{caption}</p>" end set_whiteboard blog, content unless content.nil? img_attrs = %(src="#{thumburl}") img_attrs << %( class="#{theclass}") if theclass img_attrs << %( width="#{width}") if width img_attrs << %( height="#{height}") if height img_attrs << %( alt="#{alt}" title="#{title}") %(<a href="#{displayurl}" data-toggle="#{rel}" title="#{title}"><img #{img_attrs}/></a>#{captioncode}) end def self.set_whiteboard(blog, content) content.whiteboard['page_header_lightbox'] = <<-HTML <link href="#{blog.base_url}/stylesheets/lightbox.css" media="all" rel="Stylesheet" type="text/css" /> <script src="#{blog.base_url}/javascripts/lightbox.js" type="text/javascript"></script> HTML end end end end
mit
thomasvanhorde/self-engine
ext/rockmongo/app/views/index/createDatabase.php
602
<h3><a href="<?php h(url("databases"));?>"><?php hm("databases"); ?></a> &raquo; <?php hm("create_database");?></h3> <?php if(isset($error)):?> <p class="error"><?php h($error);?></p> <?php endif;?> <?php if(isset($message)):?> <p class="message"><?php h($message);?></p> <?php endif;?> <?php if (!empty($_POST)):?> <script language="javascript"> window.parent.frames["left"].location.reload(); </script> <?php endif;?> <form method="post"> <?php hm("name"); ?>:<br/> <input type="text" name="name" value="<?php h(x("name"));?>"/><br/> <input type="submit" value="<?php hm("create"); ?>" /> </form>
mit
vnguyen94/react-commute
src/components/CommuteDataInput.js
1321
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { Button, Input } from 'react-bootstrap'; import { importData } from '../actions'; import calculateStatistics from '../utils/calculateStatistics'; @connect(state => ({ commuteData: state.commuteData })) export default class CommuteDataInput extends Component { constructor(props) { super(props); this.handleCommuteInput = this.handleCommuteInput.bind(this); this.processCSV = this.processCSV.bind(this); } processCSV(commuteData) { let [ headersRaw, ...rowsRaw ] = commuteData.split('\n'); let headers = headersRaw.split(','); rowsRaw = rowsRaw.map(row => (row.split(','))); return { headers, rowsRaw }; } handleCommuteInput(e) { const { dispatch } = this.props; let commuteData = document.getElementById('commute-data-text').value; let { headers, rowsRaw } = this.processCSV(commuteData); let stats = calculateStatistics(headers, rowsRaw); dispatch(importData(stats)); window.location.assign('/#/data'); } render() { return ( <div> <Input id="commute-data-text" type="textarea" rows="30" placeholder="Paste CSV here" /> <Button onClick={ this.handleCommuteInput } bsStyle="primary">Import CSV Data</Button> </div> ); } }
mit
bencallis1/the-shop
node_modules/history/lib/createLocation.js
1420
'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _warning = require('warning'); var _warning2 = _interopRequireDefault(_warning); var _Actions = require('./Actions'); function extractPath(string) { var match = string.match(/https?:\/\/[^\/]*/); if (match == null) return string; _warning2['default'](false, 'Location path must be pathname + query string only, not a fully qualified URL like "%s"', string); return string.substring(match[0].length); } function createLocation() { var path = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0]; var state = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; var action = arguments.length <= 2 || arguments[2] === undefined ? _Actions.POP : arguments[2]; var key = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; path = extractPath(path); var index = path.indexOf('?'); var pathname, search; if (index !== -1) { pathname = path.substring(0, index); search = path.substring(index); } else { pathname = path; search = ''; } if (pathname === '') pathname = '/'; return { pathname: pathname, search: search, state: state, action: action, key: key }; } exports['default'] = createLocation; module.exports = exports['default'];
mit
dbunibas/Speedy
src/speedy/persistence/xml/operators/IXSDNodeVisitor.java
653
package speedy.persistence.xml.operators; import speedy.persistence.xml.model.AttributeDeclaration; import speedy.persistence.xml.model.ElementDeclaration; import speedy.persistence.xml.model.PCDATA; import speedy.persistence.xml.model.SimpleType; import speedy.persistence.xml.model.TypeCompositor; public interface IXSDNodeVisitor { void visitSimpleType(SimpleType node); void visitElementDeclaration(ElementDeclaration node); void visitTypeCompositor(TypeCompositor node); void visitAttributeDeclaration(AttributeDeclaration node); void visitPCDATA(PCDATA node); Object getResult(); }
mit
clay584/chuck
chuck/inventory/migrations/0002_auto_20150410_0013.py
427
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('inventory', '0001_initial'), ] operations = [ migrations.AlterField( model_name='inventory', name='device_parent', field=models.ForeignKey(to='inventory.Inventory', blank=True), ), ]
mit
StoychoMihaylov/ShopSystem
ShopSystem.App/ShopSystem.Data/Properties/AssemblyInfo.cs
1406
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("ShopSystem.Data")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ShopSystem.Data")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("126a005d-58a6-4976-99e0-61939ea472d2")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
romainneutron/PHPExiftool
lib/PHPExiftool/Driver/Tag/DICOM/BackProjectorCoefficient.php
822
<?php /* * This file is part of PHPExifTool. * * (c) 2012 Romain Neutron <imprec@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPExiftool\Driver\Tag\DICOM; use JMS\Serializer\Annotation\ExclusionPolicy; use PHPExiftool\Driver\AbstractTag; /** * @ExclusionPolicy("all") */ class BackProjectorCoefficient extends AbstractTag { protected $Id = '0019,10DB'; protected $Name = 'BackProjectorCoefficient'; protected $FullName = 'DICOM::Main'; protected $GroupName = 'DICOM'; protected $g0 = 'DICOM'; protected $g1 = 'DICOM'; protected $g2 = 'Image'; protected $Type = '?'; protected $Writable = false; protected $Description = 'Back Projector Coefficient'; }
mit
xsilium-frameworks/xsilium-engine
Engine/Input/KeyboardMap.cpp
3164
/* * \file KeyboardMap.cpp * * Created on: \date 4 aožt 2014 * Author: \author joda * \brief : */ #include "KeyboardMap.h" namespace Engine { KeyboardMap::KeyboardMap() { // TODO Auto-generated constructor stub } KeyboardMap::~KeyboardMap() { // TODO Auto-generated destructor stub } void KeyboardMap::load(const std::string& file) { fileName = file ; std::ifstream fichierConfKey(file.c_str()); if (fichierConfKey.fail()) { printf("Fichier %s non trouve chargement de la configuration par defaut \n",fileName.c_str()); loadDefault(); saveKeyboardMap(); return; } fichierConfKey.seekg(0, std::ios::end); size_t length = fichierConfKey.tellg(); fichierConfKey.seekg(0, std::ios::beg); char* buffer = new char[length + 1]; fichierConfKey.read(buffer, length); buffer[length] = '\0'; fichierConfKey.close(); rapidxml::xml_document<> doc; doc.parse<0>(buffer); delete [] buffer; for (rapidxml::xml_node<>* n = doc.first_node("KEYBOARD")->first_node(); n; n = n->next_sibling()) { KeyboardBinding[n->name()] = static_cast<OIS::KeyCode>(strtol(n->value(), NULL, 0)); } } const char * KeyboardMap::checkKey(OIS::KeyCode key) { for ( KeyMap::iterator increment = KeyboardBinding.begin(); increment != KeyboardBinding.end(); ++increment ) { if ( (*increment).second == key) { return ((*increment).first).c_str(); } } return ""; } const OIS::KeyCode KeyboardMap::checkKey(const char * touche) { KeyMap::iterator increment = KeyboardBinding.find(touche); if( increment != KeyboardBinding.end() ) { return static_cast<OIS::KeyCode>((*increment).second) ; } else return OIS::KC_UNASSIGNED; } void KeyboardMap::changeKey(const char * touche,OIS::KeyCode key) { KeyboardBinding[touche] = static_cast<int>(key); } void KeyboardMap::saveKeyboardMap() { rapidxml::xml_document<> doc; rapidxml::xml_node<>* decl = doc.allocate_node(rapidxml::node_declaration); decl->append_attribute(doc.allocate_attribute("version", "1.0")); decl->append_attribute(doc.allocate_attribute("encoding", "ISO-8859-1")); doc.append_node(decl); rapidxml::xml_node<> *Keyboard = doc.allocate_node(rapidxml::node_element, "KEYBOARD"); doc.append_node(Keyboard); for ( KeyMap::iterator increment = KeyboardBinding.begin(); increment != KeyboardBinding.end(); ++increment ) { rapidxml::xml_node<> *Key = doc.allocate_node(rapidxml::node_element, ((*increment).first).c_str()); std::stringstream ss; ss << "0x" << std::hex << (*increment).second ; char* numBuff = doc.allocate_string(ss.str().c_str()); Key->value(numBuff); Keyboard->append_node(Key); } std::string data; rapidxml::print(std::back_inserter(data), doc); std::ofstream myfile(fileName.c_str()) ; myfile << data; myfile.close(); } void KeyboardMap::loadDefault() { KeyboardBinding["AVANCER"] = static_cast<int>(0x11); KeyboardBinding["DROITE"] = static_cast<int>(0x20); KeyboardBinding["GAUCHE"] = static_cast<int>(0x1e); KeyboardBinding["RECULER"] = static_cast<int>(0x1f); KeyboardBinding["DEGAINER"] = static_cast<int>(0x2c); KeyboardBinding["SAUTE"] = static_cast<int>(0x39); } } /* namespace Engine */
mit
bsherrill480/website-asd-init
app/containers/UserRegister/constants.js
517
/* * * UserRegister constants * */ export const CHANGE_USERNAME = 'app/UserRegister/CHANGE_USERNAME'; export const CHANGE_PASSWORD = 'app/UserRegister/CHANGE_PASSWORD'; export const CHANGE_VERIFY_PASSWORD = 'app/UserRegister/CHANGE_VERIFY_PASSWORD'; export const DO_REGISTER = 'app/UserRegister/DO_REGISTER'; export const REGISTER_SUCCESS = 'app/UserRegister/REGISTER_SUCCESS'; export const USERNAME_UID = 'username'; export const PASSWORD_UID = 'password'; export const VERIFY_PASSWORD_UID = 'verify-password';
mit
epfremmer/retrofit-php
tests/Mock/Service/MockServiceBody.php
2710
<?php /* * Copyright (c) Nate Brunette. * Distributed under the MIT License (http://opensource.org/licenses/MIT) */ namespace Tebru\Retrofit\Test\Mock\Service; use Tebru\Retrofit\Annotation as Rest; use Tebru\Retrofit\Test\Mock\MockUser; /** * Interface MockServiceBody * * @author Nate Brunette <n@tebru.net> */ interface MockServiceBody { /** * @Rest\POST("/post") * @Rest\Body("myBody") * @Rest\FormUrlEncoded() */ public function simpleBody(array $myBody); /** * @Rest\POST("/post") * @Rest\Body("myBody", var="foo") * @Rest\FormUrlEncoded() */ public function bodyChangeName(array $foo); /** * @Rest\POST("/post") * @Rest\Body("user") * @Rest\JsonBody() */ public function objectBody(MockUser $user); /** * @Rest\POST("/post") * @Rest\Body("user", var="foo") * @Rest\JsonBody() */ public function objectBodyChangeName(MockUser $foo); /** * @Rest\POST("/post") * @Rest\Body("user") * @Rest\FormUrlEncoded() */ public function objectBodyAsFromEncoded(MockUser $user); /** * @Rest\POST("/post") * @Rest\Body("user") * @Rest\FormUrlEncoded() */ public function objectBodyOptional(MockUser $user = null); /** * @Rest\POST("/post") * @Rest\Body("user") * @Rest\FormUrlEncoded() */ public function objectBodyJsonSerializable(MockUser $user); /** * @Rest\POST("/post") * @Rest\Part("foo") * @Rest\Part("bar") * @Rest\FormUrlEncoded() */ public function parts($foo, $bar); /** * @Rest\POST("/post") * @Rest\Part("foo", var="bar") * @Rest\Part("bar", var="foo") * @Rest\FormUrlEncoded() */ public function partsChangeName($bar, $foo); /** * @Rest\POST("/post") * @Rest\Body("myBody") * @Rest\JsonBody */ public function jsonBody(array $myBody); /** * @Rest\POST("/post") * @Rest\Body("user") * @Rest\JsonBody */ public function objectJsonBody(MockUser $user); /** * @Rest\POST("/post") * @Rest\Part("foo") * @Rest\Part("bar") * @Rest\JsonBody */ public function partsJsonBody($foo, $bar); /** * @Rest\POST("/post") * @Rest\Header("foo") * @Rest\Body("bar") * @Rest\JsonBody() */ public function headerJsonBody($foo, array $bar); /** * @Rest\POST("/post") * @Rest\Body("bar") * @Rest\Multipart() */ public function multipart(array $bar); /** * @Rest\POST("/post") * @Rest\Part("foo") * @Rest\Multipart() */ public function multipartWithParts($foo); }
mit
VIS-ETH/vis-beer
visbeer/test/test_server.py
3409
import unittest from visbeer.server import app from visbeer.test.mocks.coffee_service_mock import CoffeeServiceMock from visbeer.test.mocks.beer_service_mock import BeerServiceMock from visbeer.test.mocks.flag_service_mock import FlagServiceMock class ServerTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() app.config['FlagService'] = FlagServiceMock app.config['BeerService'] = BeerServiceMock app.config['CoffeeService'] = CoffeeServiceMock app.config['ApiKey'] = 'llxPd3Krm2y4dLMa5YGCkLumvx0Mb1DZaZiPH' def authorized_get(self, url): return self.app.get(url + '?key=' + app.config['ApiKey']) def test_home(self): rv = self.app.get('/') self.assertEqual('api online', rv.data.decode('utf-8')) def test_validate_key(self): rv = self.app.get('/validate_key') self.assertEqual(401, rv.status_code) self.assertNotEqual('API key is valid', rv.data.decode('utf-8')) rv = self.app.get('/validate_key?key=' + 'some_invalid_key') self.assertEqual(401, rv.status_code) rv = self.app.get('/validate_key?key=' + app.config['ApiKey']) self.assertEqual('API key is valid', rv.data.decode('utf-8')) def test_beer_status(self): self.assertEqual(401, self.app.get('/beer/status/010101@rfid.ethz.ch').status_code) self.assertEqual('1', self.authorized_get('/beer/status/010101@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('010101@rfid.ethz.ch', BeerServiceMock.lastRfidCallStatus) self.assertEqual('2', self.authorized_get('/beer/status/020202@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('020202@rfid.ethz.ch', BeerServiceMock.lastRfidCallStatus) def test_beer_dispensed(self): self.assertEqual(401, self.app.get('/beer/dispensed/010101@rfid.ethz.ch').status_code) self.assertEqual('77', self.authorized_get('/beer/dispensed/010101@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('010101@rfid.ethz.ch', BeerServiceMock.lastRfidCallDispensed) self.assertEqual('77', self.authorized_get('/beer/dispensed/020202@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('020202@rfid.ethz.ch', BeerServiceMock.lastRfidCallDispensed) def test_coffee_status(self): self.assertEqual(401, self.app.get('/coffee/status/310101@rfid.ethz.ch').status_code) self.assertEqual('1', self.authorized_get('/coffee/status/310101@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('310101@rfid.ethz.ch', CoffeeServiceMock.lastRfidCallStatus) self.assertEqual('2', self.authorized_get('/coffee/status/320202@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('320202@rfid.ethz.ch', CoffeeServiceMock.lastRfidCallStatus) def test_coffee_dispensed(self): self.assertEqual(401, self.app.get('/coffee/dispensed/310101@rfid.ethz.ch').status_code) self.assertEqual('71', self.authorized_get('/coffee/dispensed/310101@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('310101@rfid.ethz.ch', CoffeeServiceMock.lastRfidCallDispensed) self.assertEqual('71', self.authorized_get('/coffee/dispensed/320202@rfid.ethz.ch').data.decode('utf-8')) self.assertEqual('320202@rfid.ethz.ch', CoffeeServiceMock.lastRfidCallDispensed) if __name__ == '__main__': unittest.main()
mit
volkd/Opserver
Opserver.Core/Data/Dashboard/Providers/OrionDataProvider.cs
14488
using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Net; using System.Threading.Tasks; using StackExchange.Opserver.Helpers; using StackExchange.Profiling; namespace StackExchange.Opserver.Data.Dashboard.Providers { public class OrionDataProvider : DashboardDataProvider<OrionSettings> { public override bool HasData => NodeCache.HasData(); public string Host => Settings.Host; public int QueryTimeoutMs => Settings.QueryTimeoutMs; public override int MinSecondsBetweenPolls => 5; public override string NodeType => "Orion"; public override IEnumerable<Cache> DataPollers { get { yield return NodeCache; } } public OrionDataProvider(OrionSettings settings) : base(settings) { } protected override IEnumerable<MonitorStatus> GetMonitorStatus() { yield break; } protected override string GetMonitorStatusReason() { return null; } public override List<Node> AllNodes => NodeCache.Data ?? new List<Node>(); private Cache<List<Node>> _nodeCache; public Cache<List<Node>> NodeCache => _nodeCache ?? (_nodeCache = ProviderCache(GetAllNodes, 10)); public async Task<List<Node>> GetAllNodes() { using (MiniProfiler.Current.Step("Get Server Nodes")) { using (var conn = await GetConnectionAsync()) { var nodes = await conn.QueryAsync<Node>(@" Select Cast(n.NodeID as varchar(50)) as Id, Caption as Name, LastSync, MachineType, Cast(Status as int) Status, LastBoot, Coalesce(Cast(vm.CPULoad as smallint), n.CPULoad) as CPULoad, TotalMemory, MemoryUsed, IP_Address as Ip, PollInterval as PollIntervalSeconds, Cast(vmh.NodeID as varchar(50)) as VMHostID, Cast(IsNull(vh.HostID, 0) as Bit) IsVMHost, IsNull(UnManaged, 0) as IsUnwatched, UnManageFrom as UnwatchedFrom, UnManageUntil as UnwatchedUntil, hi.Manufacturer, hi.Model, hi.ServiceTag From Nodes n Left Join VIM_VirtualMachines vm On n.NodeID = vm.NodeID Left Join VIM_Hosts vmh On vm.HostID = vmh.HostID Left Join VIM_Hosts vh On n.NodeID = vh.NodeID Left Join APM_HardwareInfo hi On n.NodeID = hi.NodeID Order By Id, Caption", commandTimeout: QueryTimeoutMs); var interfaces = await conn.QueryAsync<Interface>(@" Select Cast(InterfaceID as varchar(50)) as Id, Cast(NodeID as varchar(50)) as NodeId, InterfaceIndex [Index], LastSync, InterfaceName as Name, FullName, Caption, Comments, InterfaceAlias Alias, IfName, InterfaceTypeDescription TypeDescription, PhysicalAddress, IsNull(UnManaged, 0) as IsUnwatched, UnManageFrom as UnwatchedFrom, UnManageUntil as UnwatchedUntil, Cast(Status as int) Status, InBps, OutBps, InPps, OutPps, InPercentUtil, OutPercentUtil, InterfaceMTU as MTU, InterfaceSpeed as Speed From Interfaces", commandTimeout: QueryTimeoutMs); var volumes = await conn.QueryAsync<Volume>(@" Select Cast(VolumeID as varchar(50)) as Id, Cast(NodeID as varchar(50)) as NodeId, LastSync, VolumeIndex as [Index], FullName as Name, Caption, VolumeDescription as [Description], VolumeType as Type, VolumeSize as Size, VolumeSpaceUsed as Used, VolumeSpaceAvailable as Available, VolumePercentUsed as PercentUsed From Volumes", commandTimeout: QueryTimeoutMs); var apps = await conn.QueryAsync<Application>(@" Select Cast(com.ApplicationID as varchar(50)) as Id, Cast(NodeID as varchar(50)) as NodeId, app.Name as AppName, IsNull(app.Unmanaged, 0) as IsUnwatched, app.UnManageFrom as UnwatchedFrom, app.UnManageUntil as UnwatchedUntil, com.Name as ComponentName, ccs.TimeStamp as LastUpdated, --pe.PID as ProcessID, ccs.ProcessName, ccs.LastTimeUp, ccs.PercentCPU as CurrentPercentCPU, ccs.PercentMemory as CurrentPercentMemory, ccs.MemoryUsed as CurrentMemoryUsed, ccs.VirtualMemoryUsed as CurrentVirtualMemoryUsed, pe.AvgPercentCPU as PercentCPU, pe.AvgPercentMemory as PercentMemory, pe.AvgMemoryUsed as MemoryUsed, pe.AvgVirtualMemoryUsed as VirtualMemoryUsed, pe.ErrorMessage From APM_Application app Inner Join APM_Component com On app.ID = com.ApplicationID Inner Join APM_CurrentComponentStatus ccs On com.ID = ccs.ComponentID Inner Join APM_ProcessEvidence pe On ccs.ComponentStatusID = pe.ComponentStatusID Order By NodeID", commandTimeout: QueryTimeoutMs); foreach (var a in apps) { a.NiceName = a.ComponentName == "Process Monitor - WMI" || a.ComponentName == "Wrapper Process" ? a.AppName : (a.ComponentName ?? "").Replace(" IIS App Pool", ""); } var ips = await GetNodeIPMap(conn); foreach (var n in nodes) { n.DataProvider = this; n.ManagementUrl = GetManagementUrl(n); n.Interfaces = interfaces.Where(i => i.NodeId == n.Id).ToList(); n.Volumes = volumes.Where(v => v.NodeId == n.Id).ToList(); n.Apps = apps.Where(a => a.NodeId == n.Id).ToList(); n.IPs = ips.Where(t => t.Item1 == n.Id).Select(t => t.Item2).ToList(); n.VMs = nodes.Where(on => on.VMHostID == n.Id).ToList(); n.VMHost = nodes.FirstOrDefault(on => n.VMHostID == on.Id); } return nodes; } } } private class OrionIPMap { public int NodeID { get; set; } public int InterfaceIndex { get; set; } } public async Task<List<Tuple<string, IPAddress>>> GetNodeIPMap(DbConnection conn) { var ipList = await conn.QueryAsync<string, string, Tuple<string, string>>( @"Select Cast(NodeID as varchar(50)) NodeID, IPAddress From NodeIPAddresses", commandTimeout: QueryTimeoutMs, map: Tuple.Create, splitOn: "IPAddress"); var result = new List<Tuple<string, IPAddress>>(); foreach (var entry in ipList) { IPAddress addr; if (!IPAddress.TryParse(entry.Item2, out addr)) continue; result.Add(Tuple.Create(entry.Item1, addr)); } return result; } public override string GetManagementUrl(Node node) { return !Host.HasValue() ? null : $"{Host}Orion/NetPerfMon/NodeDetails.aspx?NetObject=N:{node.Id}"; } public override async Task<List<GraphPoint>> GetCPUUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null) { const string allSql = @" Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch, c.AvgLoad From CPULoad c Where c.DateTime > @minDate And c.NodeID = @id"; const string sampledSql = @" Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch, c.AvgLoad From (Select c.DateTime, c.AvgLoad, Row_Number() Over(Order By c.DateTime) as RowNumber From CPULoad c Where {dateRange} And c.NodeID = @id) c Where c.RowNumber % ((Select Count(*) + @intervals From CPULoad c Where {dateRange} And c.NodeID = @id)/@intervals) = 0 Order By c.DateTime"; return (await UtilizationQuery<Node.CPUUtilization>(node.Id, allSql, sampledSql, "c.DateTime", start, end, pointCount)).ToList<GraphPoint>(); } public override async Task<List<GraphPoint>> GetMemoryUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null) { const string allSql = @" Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch, c.AvgMemoryUsed From CPULoad c Where c.DateTime > @minDate And c.NodeID = @id"; const string sampledSql = @" Select DateDiff(s, '1970-01-01 00:00:00', c.DateTime) as DateEpoch, c.AvgMemoryUsed From (Select c.DateTime, c.AvgMemoryUsed, Row_Number() Over(Order By c.DateTime) as RowNumber From CPULoad c Where {dateRange} And c.NodeID = @id) c Where c.RowNumber % ((Select Count(*) + @intervals From CPULoad c Where {dateRange} And c.NodeID = @id)/@intervals) = 0 Order By c.DateTime"; return (await UtilizationQuery<Node.MemoryUtilization>(node.Id, allSql, sampledSql, "c.DateTime", start, end, pointCount)).ToList<GraphPoint>(); } public override async Task<List<DoubleGraphPoint>> GetNetworkUtilization(Node node, DateTime? start, DateTime? end, int? pointCount = null) { const string allSql = @" Select DateDiff(s, '1970-01-01', itd.DateTime) as DateEpoch, Sum(itd.In_Averagebps) InAvgBps, Sum(itd.Out_Averagebps) OutAvgBps From InterfaceTraffic itd Where itd.InterfaceID In @Ids And {dateRange} Group By itd.DateTime "; const string sampledSql = @" Select DateDiff(s, '1970-01-01', itd.DateTime) as DateEpoch, Sum(itd.InAvgBps) InAvgBps, Sum(itd.OutAvgBps) OutAvgBps From (Select itd.DateTime, itd.In_Averagebps InAvgBps, itd.Out_Averagebps OutAvgBps, Row_Number() Over(Order By itd.DateTime) RowNumber From InterfaceTraffic itd Where itd.InterfaceID In @Ids And {dateRange}) itd Where itd.RowNumber % ((Select Count(*) + @intervals From InterfaceTraffic itd Where itd.InterfaceID In @Ids And {dateRange})/@intervals) = 0 Group By itd.DateTime"; if (!node.PrimaryInterfaces.Any()) return new List<DoubleGraphPoint>(); using (var conn = await GetConnectionAsync()) { var result = await conn.QueryAsync<Interface.InterfaceUtilization>( (pointCount.HasValue ? sampledSql : allSql) .Replace("{dateRange}", GetOptionalDateClause("itd.DateTime", start, end)), new { Ids = node.PrimaryInterfaces.Select(i => int.Parse(i.Id)), start, end, intervals = pointCount }); return result.ToList<DoubleGraphPoint>(); } } public override async Task<List<GraphPoint>> GetUtilization(Volume volume, DateTime? start, DateTime? end, int? pointCount = null) { const string allSql = @" Select DateDiff(s, '1970-01-01 00:00:00', v.DateTime) as DateEpoch, v.AvgDiskUsed From VolumeUsage v Where {dateRange} And v.VolumeID = @id"; const string sampledSql = @" Select DateDiff(s, '1970-01-01 00:00:00', v.DateTime) as DateEpoch, v.AvgDiskUsed From (Select v.DateTime v.AvgDiskUsed, Row_Number() Over(Order By v.DateTime) as RowNumber From VolumeUsage v Where {dateRange} And v.VolumeID = @id) v Where v.RowNumber % ((Select Count(*) + @intervals From VolumeUsage v Where {dateRange} And v.VolumeID = @id)/@intervals) = 0 Order By v.DateTime"; return (await UtilizationQuery<Volume.VolumeUtilization>(volume.Id, allSql, sampledSql, "v.DateTime", start, end, pointCount)).ToList<GraphPoint>(); } public override async Task<List<DoubleGraphPoint>> GetUtilization(Interface nodeInteface, DateTime? start, DateTime? end, int? pointCount = null) { const string allSql = @" Select DateDiff(s, '1970-01-01 00:00:00', itd.DateTime) as DateEpoch, itd.In_Averagebps InAvgBps, itd.Out_Averagebps OutAvgBps From InterfaceTraffic itd Where itd.InterfaceID = @Id And {dateRange} "; const string sampledSql = @" Select DateDiff(s, '1970-01-01 00:00:00', itd.DateTime) as DateEpoch, itd.InAvgBps, itd.OutAvgBps From (Select itd.DateTime, itd.In_Averagebps InAvgBps, itd.Out_Averagebps OutAvgBps, Row_Number() Over(Order By itd.DateTime) RowNumber From InterfaceTraffic itd Where itd.InterfaceID = @Id And {dateRange}) itd Where itd.RowNumber % ((Select Count(*) + @intervals From InterfaceTraffic itd Where itd.InterfaceID = @Id And {dateRange})/@intervals) = 0"; return (await UtilizationQuery<Interface.InterfaceUtilization>(nodeInteface.Id, allSql, sampledSql, "itd.DateTime", start, end, pointCount)).ToList<DoubleGraphPoint>(); } public Task<DbConnection> GetConnectionAsync() { return Connection.GetOpenAsync(Settings.ConnectionString, QueryTimeoutMs); } private string GetOptionalDateClause(string field, DateTime? start, DateTime? end) { if (start.HasValue && end.HasValue) // start & end return $"{field} Between @start and @end"; if (start.HasValue) // no end return $"{field} >= @start"; if (end.HasValue) return $"{field} <= @end"; return "1 = 1"; } private async Task<List<T>> UtilizationQuery<T>(string id, string allSql, string sampledSql, string dateField, DateTime? start, DateTime? end, int? pointCount) where T : IGraphPoint { using (var conn = await GetConnectionAsync()) { return await conn.QueryAsync<T>( (pointCount.HasValue ? sampledSql : allSql) .Replace("{dateRange}", GetOptionalDateClause(dateField, start, end)), new { id = int.Parse(id), start, end, intervals = pointCount }); } } } }
mit