answer
stringlengths 15
1.25M
|
|---|
<?php
$caminho = @$_GET['caminho'];
$pastas = preg_split('@/@', $caminho, -1, PREG_SPLIT_NO_EMPTY);
$arvore = array('' => NULL);
$nivelAtual = &$arvore[''];
$pai = 0;
for ($i=0; $i<count($pastas); $i++) {
$nivelAtual = array();
$subpastas = Query::query(false, NULL, 'SELECT id, nome, visibilidade, criador FROM pastas WHERE pai=? AND id!=0 ORDER BY nome', $pai);
$achou = false;
foreach ($subpastas as $dados)
if (<API key>('pasta', $dados['id'], $dados['visibilidade'], $dados['criador'])) {
$nivelAtual[$dados['nome']] = NULL;
if ($dados['nome'] == $pastas[$i]) {
$achou = true;
$pai = $dados['id'];
}
}
if (!$achou)
retornarErro();
$nivelAtual = &$nivelAtual[$pastas[$i]];
}
retornar($arvore);
|
<?php namespace Test\Deserializer;
use Test\Serializer\EntityNode\Vehicle;
class VehicleChecker
{
public function <API key>(Vehicle $vehicle)
{
return $vehicle;
}
}
|
function <API key>(v) {
document.write("Last updated " + v.substr(7, 19));
}
|
package com.baeldung.jhipster5.web.rest;
import com.baeldung.jhipster5.BookstoreApp;
import com.baeldung.jhipster5.config.Constants;
import com.baeldung.jhipster5.domain.Authority;
import com.baeldung.jhipster5.domain.User;
import com.baeldung.jhipster5.repository.AuthorityRepository;
import com.baeldung.jhipster5.repository.UserRepository;
import com.baeldung.jhipster5.security.<API key>;
import com.baeldung.jhipster5.service.MailService;
import com.baeldung.jhipster5.service.UserService;
import com.baeldung.jhipster5.service.dto.PasswordChangeDTO;
import com.baeldung.jhipster5.service.dto.UserDTO;
import com.baeldung.jhipster5.web.rest.errors.ExceptionTranslator;
import com.baeldung.jhipster5.web.rest.vm.KeyAndPasswordVM;
import com.baeldung.jhipster5.web.rest.vm.ManagedUserVM;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.http.converter.<API key>;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.<API key>.*;
import static org.springframework.test.web.servlet.result.<API key>.*;
/**
* Test class for the AccountResource REST controller.
*
* @see AccountResource
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BookstoreApp.class)
public class <API key> {
@Autowired
private UserRepository userRepository;
@Autowired
private AuthorityRepository authorityRepository;
@Autowired
private UserService userService;
@Autowired
private PasswordEncoder passwordEncoder;
@Autowired
private <API key><?>[] <API key>;
@Autowired
private ExceptionTranslator exceptionTranslator;
@Mock
private UserService mockUserService;
@Mock
private MailService mockMailService;
private MockMvc restMvc;
private MockMvc restUserMockMvc;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
doNothing().when(mockMailService).sendActivationEmail(any());
AccountResource accountResource =
new AccountResource(userRepository, userService, mockMailService);
AccountResource <API key> =
new AccountResource(userRepository, mockUserService, mockMailService);
this.restMvc = MockMvcBuilders.standaloneSetup(accountResource)
.<API key>(<API key>)
.setControllerAdvice(exceptionTranslator)
.build();
this.restUserMockMvc = MockMvcBuilders.standaloneSetup(<API key>)
.setControllerAdvice(exceptionTranslator)
.build();
}
@Test
public void <API key>() throws Exception {
restUserMockMvc.perform(get("/api/authenticate")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().string(""));
}
@Test
public void <API key>() throws Exception {
restUserMockMvc.perform(get("/api/authenticate")
.with(request -> {
request.setRemoteUser("test");
return request;
})
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().string("test"));
}
@Test
public void <API key>() throws Exception {
Set<Authority> authorities = new HashSet<>();
Authority authority = new Authority();
authority.setName(<API key>.ADMIN);
authorities.add(authority);
User user = new User();
user.setLogin("test");
user.setFirstName("john");
user.setLastName("doe");
user.setEmail("john.doe@jhipster.com");
user.setImageUrl("http://placehold.it/50x50");
user.setLangKey("en");
user.setAuthorities(authorities);
when(mockUserService.<API key>()).thenReturn(Optional.of(user));
restUserMockMvc.perform(get("/api/account")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.<API key>))
.andExpect(jsonPath("$.login").value("test"))
.andExpect(jsonPath("$.firstName").value("john"))
.andExpect(jsonPath("$.lastName").value("doe"))
.andExpect(jsonPath("$.email").value("john.doe@jhipster.com"))
.andExpect(jsonPath("$.imageUrl").value("http://placehold.it/50x50"))
.andExpect(jsonPath("$.langKey").value("en"))
.andExpect(jsonPath("$.authorities").value(<API key>.ADMIN));
}
@Test
public void <API key>() throws Exception {
when(mockUserService.<API key>()).thenReturn(Optional.empty());
restUserMockMvc.perform(get("/api/account")
.accept(MediaType.<API key>))
.andExpect(status().<API key>());
}
@Test
@Transactional
public void testRegisterValid() throws Exception {
ManagedUserVM validUser = new ManagedUserVM();
validUser.setLogin("test-register-valid");
validUser.setPassword("password");
validUser.setFirstName("Alice");
validUser.setLastName("Test");
validUser.setEmail("test-register-valid@example.com");
validUser.setImageUrl("http://placehold.it/50x50");
validUser.setLangKey(Constants.DEFAULT_LANGUAGE);
validUser.setAuthorities(Collections.singleton(<API key>.USER));
assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isFalse();
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(validUser)))
.andExpect(status().isCreated());
assertThat(userRepository.findOneByLogin("test-register-valid").isPresent()).isTrue();
}
@Test
@Transactional
public void <API key>() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM();
invalidUser.setLogin("funky-log!n");// <-- invalid
invalidUser.setPassword("password");
invalidUser.setFirstName("Funky");
invalidUser.setLastName("One");
invalidUser.setEmail("funky@example.com");
invalidUser.setActivated(true);
invalidUser.setImageUrl("http://placehold.it/50x50");
invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE);
invalidUser.setAuthorities(Collections.singleton(<API key>.USER));
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.<API key>("funky@example.com");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void <API key>() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM();
invalidUser.setLogin("bob");
invalidUser.setPassword("password");
invalidUser.setFirstName("Bob");
invalidUser.setLastName("Green");
invalidUser.setEmail("invalid");// <-- invalid
invalidUser.setActivated(true);
invalidUser.setImageUrl("http://placehold.it/50x50");
invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE);
invalidUser.setAuthorities(Collections.singleton(<API key>.USER));
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByLogin("bob");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void <API key>() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM();
invalidUser.setLogin("bob");
invalidUser.setPassword("123");// password with only 3 digits
invalidUser.setFirstName("Bob");
invalidUser.setLastName("Green");
invalidUser.setEmail("bob@example.com");
invalidUser.setActivated(true);
invalidUser.setImageUrl("http://placehold.it/50x50");
invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE);
invalidUser.setAuthorities(Collections.singleton(<API key>.USER));
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByLogin("bob");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void <API key>() throws Exception {
ManagedUserVM invalidUser = new ManagedUserVM();
invalidUser.setLogin("bob");
invalidUser.setPassword(null);// invalid null password
invalidUser.setFirstName("Bob");
invalidUser.setLastName("Green");
invalidUser.setEmail("bob@example.com");
invalidUser.setActivated(true);
invalidUser.setImageUrl("http://placehold.it/50x50");
invalidUser.setLangKey(Constants.DEFAULT_LANGUAGE);
invalidUser.setAuthorities(Collections.singleton(<API key>.USER));
restUserMockMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(invalidUser)))
.andExpect(status().isBadRequest());
Optional<User> user = userRepository.findOneByLogin("bob");
assertThat(user.isPresent()).isFalse();
}
@Test
@Transactional
public void <API key>() throws Exception {
// First registration
ManagedUserVM firstUser = new ManagedUserVM();
firstUser.setLogin("alice");
firstUser.setPassword("password");
firstUser.setFirstName("Alice");
firstUser.setLastName("Something");
firstUser.setEmail("alice@example.com");
firstUser.setImageUrl("http://placehold.it/50x50");
firstUser.setLangKey(Constants.DEFAULT_LANGUAGE);
firstUser.setAuthorities(Collections.singleton(<API key>.USER));
// Duplicate login, different email
ManagedUserVM secondUser = new ManagedUserVM();
secondUser.setLogin(firstUser.getLogin());
secondUser.setPassword(firstUser.getPassword());
secondUser.setFirstName(firstUser.getFirstName());
secondUser.setLastName(firstUser.getLastName());
secondUser.setEmail("alice2@example.com");
secondUser.setImageUrl(firstUser.getImageUrl());
secondUser.setLangKey(firstUser.getLangKey());
secondUser.setCreatedBy(firstUser.getCreatedBy());
secondUser.setCreatedDate(firstUser.getCreatedDate());
secondUser.setLastModifiedBy(firstUser.getLastModifiedBy());
secondUser.setLastModifiedDate(firstUser.getLastModifiedDate());
secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities()));
// First user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(firstUser)))
.andExpect(status().isCreated());
// Second (non activated) user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(secondUser)))
.andExpect(status().isCreated());
Optional<User> testUser = userRepository.<API key>("alice2@example.com");
assertThat(testUser.isPresent()).isTrue();
testUser.get().setActivated(true);
userRepository.save(testUser.get());
// Second (already activated) user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(secondUser)))
.andExpect(status().is4xxClientError());
}
@Test
@Transactional
public void <API key>() throws Exception {
// First user
ManagedUserVM firstUser = new ManagedUserVM();
firstUser.setLogin("<API key>");
firstUser.setPassword("password");
firstUser.setFirstName("Alice");
firstUser.setLastName("Test");
firstUser.setEmail("<API key>@example.com");
firstUser.setImageUrl("http://placehold.it/50x50");
firstUser.setLangKey(Constants.DEFAULT_LANGUAGE);
firstUser.setAuthorities(Collections.singleton(<API key>.USER));
// Register first user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(firstUser)))
.andExpect(status().isCreated());
Optional<User> testUser1 = userRepository.findOneByLogin("<API key>");
assertThat(testUser1.isPresent()).isTrue();
// Duplicate email, different login
ManagedUserVM secondUser = new ManagedUserVM();
secondUser.setLogin("<API key>");
secondUser.setPassword(firstUser.getPassword());
secondUser.setFirstName(firstUser.getFirstName());
secondUser.setLastName(firstUser.getLastName());
secondUser.setEmail(firstUser.getEmail());
secondUser.setImageUrl(firstUser.getImageUrl());
secondUser.setLangKey(firstUser.getLangKey());
secondUser.setAuthorities(new HashSet<>(firstUser.getAuthorities()));
// Register second (non activated) user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(secondUser)))
.andExpect(status().isCreated());
Optional<User> testUser2 = userRepository.findOneByLogin("<API key>");
assertThat(testUser2.isPresent()).isFalse();
Optional<User> testUser3 = userRepository.findOneByLogin("<API key>");
assertThat(testUser3.isPresent()).isTrue();
// Duplicate email - with uppercase email address
ManagedUserVM <API key> = new ManagedUserVM();
<API key>.setId(firstUser.getId());
<API key>.setLogin("<API key>");
<API key>.setPassword(firstUser.getPassword());
<API key>.setFirstName(firstUser.getFirstName());
<API key>.setLastName(firstUser.getLastName());
<API key>.setEmail("<API key>@example.com");
<API key>.setImageUrl(firstUser.getImageUrl());
<API key>.setLangKey(firstUser.getLangKey());
<API key>.setAuthorities(new HashSet<>(firstUser.getAuthorities()));
// Register third (not activated) user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(<API key>)))
.andExpect(status().isCreated());
Optional<User> testUser4 = userRepository.findOneByLogin("<API key>");
assertThat(testUser4.isPresent()).isTrue();
assertThat(testUser4.get().getEmail()).isEqualTo("<API key>@example.com");
testUser4.get().setActivated(true);
userService.updateUser((new UserDTO(testUser4.get())));
// Register 4th (already activated) user
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(secondUser)))
.andExpect(status().is4xxClientError());
}
@Test
@Transactional
public void <API key>() throws Exception {
ManagedUserVM validUser = new ManagedUserVM();
validUser.setLogin("badguy");
validUser.setPassword("password");
validUser.setFirstName("Bad");
validUser.setLastName("Guy");
validUser.setEmail("badguy@example.com");
validUser.setActivated(true);
validUser.setImageUrl("http://placehold.it/50x50");
validUser.setLangKey(Constants.DEFAULT_LANGUAGE);
validUser.setAuthorities(Collections.singleton(<API key>.ADMIN));
restMvc.perform(
post("/api/register")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(validUser)))
.andExpect(status().isCreated());
Optional<User> userDup = userRepository.findOneByLogin("badguy");
assertThat(userDup.isPresent()).isTrue();
assertThat(userDup.get().getAuthorities()).hasSize(1)
.containsExactly(authorityRepository.findById(<API key>.USER).get());
}
@Test
@Transactional
public void testActivateAccount() throws Exception {
final String activationKey = "some activation key";
User user = new User();
user.setLogin("activate-account");
user.setEmail("activate-account@example.com");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(false);
user.setActivationKey(activationKey);
userRepository.saveAndFlush(user);
restMvc.perform(get("/api/activate?key={activationKey}", activationKey))
.andExpect(status().isOk());
user = userRepository.findOneByLogin(user.getLogin()).orElse(null);
assertThat(user.getActivated()).isTrue();
}
@Test
@Transactional
public void <API key>() throws Exception {
restMvc.perform(get("/api/activate?key=wrongActivationKey"))
.andExpect(status().<API key>());
}
@Test
@Transactional
@WithMockUser("save-account")
public void testSaveAccount() throws Exception {
User user = new User();
user.setLogin("save-account");
user.setEmail("save-account@example.com");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
userRepository.saveAndFlush(user);
UserDTO userDTO = new UserDTO();
userDTO.setLogin("not-used");
userDTO.setFirstName("firstname");
userDTO.setLastName("lastname");
userDTO.setEmail("save-account@example.com");
userDTO.setActivated(false);
userDTO.setImageUrl("http://placehold.it/50x50");
userDTO.setLangKey(Constants.DEFAULT_LANGUAGE);
userDTO.setAuthorities(Collections.singleton(<API key>.ADMIN));
restMvc.perform(
post("/api/account")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(userDTO)))
.andExpect(status().isOk());
User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null);
assertThat(updatedUser.getFirstName()).isEqualTo(userDTO.getFirstName());
assertThat(updatedUser.getLastName()).isEqualTo(userDTO.getLastName());
assertThat(updatedUser.getEmail()).isEqualTo(userDTO.getEmail());
assertThat(updatedUser.getLangKey()).isEqualTo(userDTO.getLangKey());
assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword());
assertThat(updatedUser.getImageUrl()).isEqualTo(userDTO.getImageUrl());
assertThat(updatedUser.getActivated()).isEqualTo(true);
assertThat(updatedUser.getAuthorities()).isEmpty();
}
@Test
@Transactional
@WithMockUser("save-invalid-email")
public void <API key>() throws Exception {
User user = new User();
user.setLogin("save-invalid-email");
user.setEmail("save-invalid-email@example.com");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
userRepository.saveAndFlush(user);
UserDTO userDTO = new UserDTO();
userDTO.setLogin("not-used");
userDTO.setFirstName("firstname");
userDTO.setLastName("lastname");
userDTO.setEmail("invalid email");
userDTO.setActivated(false);
userDTO.setImageUrl("http://placehold.it/50x50");
userDTO.setLangKey(Constants.DEFAULT_LANGUAGE);
userDTO.setAuthorities(Collections.singleton(<API key>.ADMIN));
restMvc.perform(
post("/api/account")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(userDTO)))
.andExpect(status().isBadRequest());
assertThat(userRepository.<API key>("invalid email")).isNotPresent();
}
@Test
@Transactional
@WithMockUser("save-existing-email")
public void <API key>() throws Exception {
User user = new User();
user.setLogin("save-existing-email");
user.setEmail("save-existing-email@example.com");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
userRepository.saveAndFlush(user);
User anotherUser = new User();
anotherUser.setLogin("<API key>");
anotherUser.setEmail("<API key>@example.com");
anotherUser.setPassword(RandomStringUtils.random(60));
anotherUser.setActivated(true);
userRepository.saveAndFlush(anotherUser);
UserDTO userDTO = new UserDTO();
userDTO.setLogin("not-used");
userDTO.setFirstName("firstname");
userDTO.setLastName("lastname");
userDTO.setEmail("<API key>@example.com");
userDTO.setActivated(false);
userDTO.setImageUrl("http://placehold.it/50x50");
userDTO.setLangKey(Constants.DEFAULT_LANGUAGE);
userDTO.setAuthorities(Collections.singleton(<API key>.ADMIN));
restMvc.perform(
post("/api/account")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(userDTO)))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin("save-existing-email").orElse(null);
assertThat(updatedUser.getEmail()).isEqualTo("save-existing-email@example.com");
}
@Test
@Transactional
@WithMockUser("<API key>")
public void <API key>() throws Exception {
User user = new User();
user.setLogin("<API key>");
user.setEmail("<API key>@example.com");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
userRepository.saveAndFlush(user);
UserDTO userDTO = new UserDTO();
userDTO.setLogin("not-used");
userDTO.setFirstName("firstname");
userDTO.setLastName("lastname");
userDTO.setEmail("<API key>@example.com");
userDTO.setActivated(false);
userDTO.setImageUrl("http://placehold.it/50x50");
userDTO.setLangKey(Constants.DEFAULT_LANGUAGE);
userDTO.setAuthorities(Collections.singleton(<API key>.ADMIN));
restMvc.perform(
post("/api/account")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(userDTO)))
.andExpect(status().isOk());
User updatedUser = userRepository.findOneByLogin("<API key>").orElse(null);
assertThat(updatedUser.getEmail()).isEqualTo("<API key>@example.com");
}
@Test
@Transactional
@WithMockUser("change-<API key>)
public void testChange<API key>() throws Exception {
User user = new User();
String current<API key>.random(60);
user.setPassword(passwordEncoder.encode(currentPassword));
user.setLogin("change-<API key>);
user.setEmail("change-<API key>@example.com");
userRepository.saveAndFlush(user);
restMvc.perform(post("/api/account/change-password")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(new PasswordChangeDTO("1"+currentPassword, "new password"))))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin("change-<API key>).orElse(null);
assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isFalse();
assertThat(passwordEncoder.matches(currentPassword, updatedUser.getPassword())).isTrue();
}
@Test
@Transactional
@WithMockUser("change-password")
public void testChangePassword() throws Exception {
User user = new User();
String current<API key>.random(60);
user.setPassword(passwordEncoder.encode(currentPassword));
user.setLogin("change-password");
user.setEmail("change-password@example.com");
userRepository.saveAndFlush(user);
restMvc.perform(post("/api/account/change-password")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(new PasswordChangeDTO(currentPassword, "new password"))))
.andExpect(status().isOk());
User updatedUser = userRepository.findOneByLogin("change-password").orElse(null);
assertThat(passwordEncoder.matches("new password", updatedUser.getPassword())).isTrue();
}
@Test
@Transactional
@WithMockUser("<API key>")
public void <API key>() throws Exception {
User user = new User();
String current<API key>.random(60);
user.setPassword(passwordEncoder.encode(currentPassword));
user.setLogin("<API key>");
user.setEmail("<API key>@example.com");
userRepository.saveAndFlush(user);
String new<API key>.random(ManagedUserVM.PASSWORD_MIN_LENGTH - 1);
restMvc.perform(post("/api/account/change-password")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(new PasswordChangeDTO(currentPassword, newPassword))))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin("<API key>").orElse(null);
assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword());
}
@Test
@Transactional
@WithMockUser("<API key>")
public void <API key>() throws Exception {
User user = new User();
String current<API key>.random(60);
user.setPassword(passwordEncoder.encode(currentPassword));
user.setLogin("<API key>");
user.setEmail("<API key>@example.com");
userRepository.saveAndFlush(user);
String new<API key>.random(ManagedUserVM.PASSWORD_MAX_LENGTH + 1);
restMvc.perform(post("/api/account/change-password")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(new PasswordChangeDTO(currentPassword, newPassword))))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin("<API key>").orElse(null);
assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword());
}
@Test
@Transactional
@WithMockUser("<API key>")
public void <API key>() throws Exception {
User user = new User();
String current<API key>.random(60);
user.setPassword(passwordEncoder.encode(currentPassword));
user.setLogin("<API key>");
user.setEmail("<API key>@example.com");
userRepository.saveAndFlush(user);
restMvc.perform(post("/api/account/change-password")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(new PasswordChangeDTO(currentPassword, ""))))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin("<API key>").orElse(null);
assertThat(updatedUser.getPassword()).isEqualTo(user.getPassword());
}
@Test
@Transactional
public void <API key>() throws Exception {
User user = new User();
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
user.setLogin("password-reset");
user.setEmail("password-reset@example.com");
userRepository.saveAndFlush(user);
restMvc.perform(post("/api/account/reset-password/init")
.content("password-reset@example.com"))
.andExpect(status().isOk());
}
@Test
@Transactional
public void testRequest<API key>() throws Exception {
User user = new User();
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
user.setLogin("password-reset");
user.setEmail("password-reset@example.com");
userRepository.saveAndFlush(user);
restMvc.perform(post("/api/account/reset-password/init")
.content("password-reset@EXAMPLE.COM"))
.andExpect(status().isOk());
}
@Test
public void <API key>() throws Exception {
restMvc.perform(
post("/api/account/reset-password/init")
.content("<API key>@example.com"))
.andExpect(status().isBadRequest());
}
@Test
@Transactional
public void <API key>() throws Exception {
User user = new User();
user.setPassword(RandomStringUtils.random(60));
user.setLogin("<API key>");
user.setEmail("<API key>@example.com");
user.setResetDate(Instant.now().plusSeconds(60));
user.setResetKey("reset key");
userRepository.saveAndFlush(user);
KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM();
keyAndPassword.setKey(user.getResetKey());
keyAndPassword.setNewPassword("new password");
restMvc.perform(
post("/api/account/reset-password/finish")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(keyAndPassword)))
.andExpect(status().isOk());
User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null);
assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isTrue();
}
@Test
@Transactional
public void <API key>() throws Exception {
User user = new User();
user.setPassword(RandomStringUtils.random(60));
user.setLogin("finish-<API key>);
user.setEmail("finish-<API key>@example.com");
user.setResetDate(Instant.now().plusSeconds(60));
user.setResetKey("reset key too small");
userRepository.saveAndFlush(user);
KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM();
keyAndPassword.setKey(user.getResetKey());
keyAndPassword.setNewPassword("foo");
restMvc.perform(
post("/api/account/reset-password/finish")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(keyAndPassword)))
.andExpect(status().isBadRequest());
User updatedUser = userRepository.findOneByLogin(user.getLogin()).orElse(null);
assertThat(passwordEncoder.matches(keyAndPassword.getNewPassword(), updatedUser.getPassword())).isFalse();
}
@Test
@Transactional
public void <API key>() throws Exception {
KeyAndPasswordVM keyAndPassword = new KeyAndPasswordVM();
keyAndPassword.setKey("wrong reset key");
keyAndPassword.setNewPassword("new password");
restMvc.perform(
post("/api/account/reset-password/finish")
.contentType(TestUtil.<API key>)
.content(TestUtil.<API key>(keyAndPassword)))
.andExpect(status().<API key>());
}
}
|
import { defineMessages } from 'react-intl';
export default defineMessages({
save: {
id: 'cboard.components.FormDialog.save',
defaultMessage: 'Save'
},
cancel: {
id: 'cboard.components.FormDialog.cancel',
defaultMessage: 'Cancel'
}
});
|
package CGRB::BLASTDB;
# $Id: BLASTDB.pm,v 1.4 2004/11/16 21:38:43 givans Exp $
use warnings;
use strict;
use Carp;
use CGRB::CGRBDB;
use vars qw/ @ISA /;
@ISA = qw/ CGRBDB /;
1;
sub new {
my $pkg = shift;
my $user = shift;
my $psswd = shift;
$user = 'gcg' unless ($user);
$psswd = 'sequences' unless ($psswd);
# print "using user=$user, passwd=$psswd\n";
my $self = $pkg->generate('seq_databases',$user,$psswd);
return $self;
}
sub availDB {
my $self = shift;
my $db = shift;
my $avail = shift;
$avail ? $self->_set_availDB($db,$avail) : $self->_get_availDB($db);
}
sub _set_availDB {
my $self = shift;
my $db = shift;
my $avail = shift;# should be T or F
my $dbh = $self->dbh();
my ($sth,$rslt);
my $dbFile = $self->dbFile($db);# dbFile will be name of DB
if ($avail ne 'T' && $avail ne 'F') {
return "database available should be either 'T' or 'F'";
}
$sth = $dbh->prepare("update DB set Avail = ? where db_file = ?");
$sth->bind_param(1,$avail);
$sth->bind_param(2,$dbFile);
$rslt = $self->_dbAction($dbh,$sth,3);
if (ref $rslt eq 'ARRAY') {
return $rslt->[0]->[0];
} else {
return 0;
}
}
sub _get_availDB {
my $self = shift;
my $db = shift;
my $dbh = $self->dbh();
my ($sth,$rslt);
my $dbFile = $self->dbFile($db);
$sth = $dbh->prepare("select Avail from DB where db_file = ?");
$sth->bind_param(1,$dbFile);
$rslt = $self->_dbAction($dbh,$sth,2);
if (ref $rslt eq 'ARRAY') {
return $rslt->[0]->[0];
} else {
return 0;
}
}
sub availDB_byType {
my $self = shift;
my $dbType = shift;
my $avail = shift;
$avail ? $self->_set_availDB_byType($dbType,$avail) : $self->_get_availDB_byType($dbType);
}
sub _set_availDB_byType {
warn("setting DB availability by type no yet implemented");
}
sub _get_availDB_byType {
my $self = shift;
my $dbType = shift;
my $dbh = $self->dbh();
my ($sth,$rslt);
$sth = $dbh->prepare("select db_name from DB where db_type = ? and Avail = 'F'");
$sth->bind_param(1, $dbType);
$rslt = $self->_dbAction($dbh,$sth,2);
if (ref $rslt eq 'ARRAY') {
if ($rslt->[0]->[0]) {
return 'F';
} else {
return 'T';
}
} else {
return 0;
}
}
sub dbFile {
my $self = shift;
my $db = shift;
my $file = shift;
$file ? $self->_set_dbFile($db,$file) : $self->_get_dbFile($db);
}
sub _set_dbFile {
warn("setting db file not yet implemented");
}
sub _get_dbFile {
my $self = shift;
my $db = shift;
my $dbh = $self->dbh();
my ($sth,$rslt);
$sth = $dbh->prepare("select db_file from DB where db_name = ?");
$sth->bind_param(1,$db);
$rslt = $self->_dbAction($dbh,$sth,2);
if (ref $rslt eq 'ARRAY') {
return $rslt->[0]->[0];
} else {
return 0;
}
}
sub dbInfo {
my $self = shift;
my $dbh = $self->dbh();
my ($sth,$dates,%date);
$sth = $dbh->prepare("select D.displayName, D.dwnld_date, D.description, T.type, D.displayOrder, D.db_name from DB D, DBType T where D.db_type = T.number AND D.displayOrder > 0");
$dates = $self->_dbAction($dbh,$sth,2);
if (ref $dates eq 'ARRAY') {
foreach my $ref (@$dates) {
$date{$ref->[0]} = [$ref->[1], $ref->[2], $ref->[3], $ref->[4], $ref->[5]];
}
return \%date;
} else {
return 0;
}
}
|
<!DOCTYPE html >
<html>
<head>
<title><API key> - ScalaFX API 8.0.0-R4 - scalafx.util.converter.<API key></title>
<meta name="description" content="<API key> - ScalaFX API 8.0.0 - R4 - scalafx.util.converter.<API key>" />
<meta name="keywords" content="<API key> ScalaFX API 8.0.0 R4 scalafx.util.converter.<API key>" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../../lib/template.js"></script>
<script type="text/javascript" src="../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../../index.html';
var hash = 'scalafx.util.converter.<API key>';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
</head>
<body class="type">
<div id="definition">
<a href="<API key>$.html" title="Go to companion"><img src="../../../lib/class_to_object_big.png" /></a>
<p id="owner"><a href="../../package.html" class="extype" name="scalafx">scalafx</a>.<a href="../package.html" class="extype" name="scalafx.util">util</a>.<a href="package.html" class="extype" name="scalafx.util.converter">converter</a></p>
<h1><a href="<API key>$.html" title="Go to companion"><API key></a></h1>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name"><API key></span><span class="result"> extends <a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a>[<span class="extype" name="java.math.BigDecimal">BigDecimal</span>, <span class="extype" name="scala.BigDecimal">BigDecimal</span>, <span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span>]</span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a>[<span class="extype" name="java.math.BigDecimal">BigDecimal</span>, <span class="extype" name="scala.BigDecimal">BigDecimal</span>, <span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span>], <a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a>[<span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span>], <a href="../StringConverter.html" class="extype" name="scalafx.util.StringConverter">StringConverter</a>[<span class="extype" name="scala.BigDecimal">BigDecimal</span>], <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="scalafx.util.converter.<API key>"><span><API key></span></li><li class="in" name="scalafx.util.converter.<API key>"><span><API key></span></li><li class="in" name="scalafx.delegate.SFXDelegate"><span>SFXDelegate</span></li><li class="in" name="scalafx.util.StringConverter"><span>StringConverter</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="constructors" class="members">
<h3>Instance Constructors</h3>
<ol><li name="scalafx.util.converter.<API key>#<init>" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="<init>(delegate:javafx.util.converter.<API key>):scalafx.util.converter.<API key>"></a>
<a id="<init>:<API key>"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">new</span>
</span>
<span class="symbol">
<span class="name"><API key></span><span class="params">(<span name="delegate">delegate: <span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span> = <span class="symbol">new jfxuc.<API key></span></span>)</span>
</span>
</h4>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scalafx.util.converter.<API key>#delegate" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="delegate:C"></a>
<a id="delegate:javafx.util.converter.<API key>"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">delegate</span><span class="result">: <span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span></span>
</span>
</h4>
<p class="shortcomment cmt">JavaFx StringConverter to be wrapped.</p><div class="fullcomment"><div class="comment cmt"><p>JavaFx StringConverter to be wrapped.
</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a> → <a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a></dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scalafx.delegate.SFXDelegate#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(ref:Any):Boolean"></a>
<a id="equals(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="ref">ref: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<p class="shortcomment cmt">Verifies if a object is equals to this delegate.</p><div class="fullcomment"><div class="comment cmt"><p>Verifies if a object is equals to this delegate.
</p></div><dl class="paramcmts block"><dt class="param">ref</dt><dd class="cmt"><p>Object to be compared.</p></dd><dt>returns</dt><dd class="cmt"><p>if the other object is equals to this delegate or not.
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a> → AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scalafx.util.converter.<API key>#fromString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="fromString(s:String):BigDecimal"></a>
<a id="fromString(String):BigDecimal"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">fromString</span><span class="params">(<span name="s">s: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <span class="extype" name="scala.BigDecimal">BigDecimal</span></span>
</span>
</h4>
<p class="shortcomment cmt">Converts the string provided into an object defined by the specific converter.</p><div class="fullcomment"><div class="comment cmt"><p>Converts the string provided into an object defined by the specific converter.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>A new T instance generated from argument.
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="scalafx.util.converter.<API key>"><API key></a> → <a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a> → <a href="../StringConverter.html" class="extype" name="scalafx.util.StringConverter">StringConverter</a></dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scalafx.delegate.SFXDelegate#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<a id="hashCode():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<p class="shortcomment cmt"></p><div class="fullcomment"><div class="comment cmt"></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>The delegate hashcode
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a> → AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scalafx.util.converter.<API key>#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString(b:BigDecimal):String"></a>
<a id="toString(BigDecimal):String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">(<span name="b">b: <span class="extype" name="scala.BigDecimal">BigDecimal</span></span>)</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt">Converts the object provided into its string form.</p><div class="fullcomment"><div class="comment cmt"><p>Converts the object provided into its string form.
</p></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>String version of argument.
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="scalafx.util.converter.<API key>"><API key></a> → <a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a> → <a href="../StringConverter.html" class="extype" name="scalafx.util.StringConverter">StringConverter</a></dd></dl></div>
</li><li name="scalafx.delegate.SFXDelegate#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<a id="toString():String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
</h4>
<p class="shortcomment cmt"></p><div class="fullcomment"><div class="comment cmt"></div><dl class="paramcmts block"><dt>returns</dt><dd class="cmt"><p>Returns the original delegate's <code>toString()</code> adding a <code>[SFX]</code> prefix.
</p></dd></dl><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a> → AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scalafx.util.converter.<API key>">
<h3>Inherited from <a href="<API key>.html" class="extype" name="scalafx.util.converter.<API key>"><API key></a>[<span class="extype" name="java.math.BigDecimal">BigDecimal</span>, <span class="extype" name="scala.BigDecimal">BigDecimal</span>, <span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span>]</h3>
</div><div class="parent" name="scalafx.delegate.SFXDelegate">
<h3>Inherited from <a href="../../delegate/SFXDelegate.html" class="extype" name="scalafx.delegate.SFXDelegate">SFXDelegate</a>[<span class="extype" name="javafx.util.converter.<API key>">javafx.util.converter.<API key></span>]</h3>
</div><div class="parent" name="scalafx.util.StringConverter">
<h3>Inherited from <a href="../StringConverter.html" class="extype" name="scalafx.util.StringConverter">StringConverter</a>[<span class="extype" name="scala.BigDecimal">BigDecimal</span>]</h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html>
|
package xmv.solutions.IT2JZ.Jira;
/**
*
* @author David Koller XMV Solutions GmbH
*/
public class JiraTestcaseStep {
/**
* Name of Step (e.g. "Step 1")
*/
private String stepName;
/**
* Action to give in actual step (e.g. "Press red button")
*/
private String testData;
/**
* Expected result of action for current step (e.g. "Popup is shown saying 'Done!'")
*/
private String expectedResult;
public String getStepName() {
return stepName;
}
public void setStepName(String stepName) {
this.stepName = stepName;
}
public String getTestData() {
return testData;
}
public void setTestData(String testData) {
this.testData = testData;
}
public String getExpectedResult() {
return expectedResult;
}
public void setExpectedResult(String expectedResult) {
this.expectedResult = expectedResult;
}
}
|
pizzasys
=====
A system for pizzerias
|
package tempconv
// CToF converts a Celsius temperature to Fahrenheit
func CToF(c Celsius) Fahrenheit {
return Fahrenheit(c * 9 / 5 + 32)
}
// FToC converts s Fahrenheit temperature to Celsius
func FToC(f Fahrenheit) Celsius {
return Celsius((f - 32) * 5 / 9)
}
|
const { nativeImage } = require('electron')
const { resolve } = require('path')
exports.size16 = nativeImage.createFromPath(resolve(__dirname, '../icon16.png'))
exports.size16.setTemplateImage(true)
|
package yio.tro.antiyoy.menu.customizable_list;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import yio.tro.antiyoy.gameplay.diplomacy.DiplomaticEntity;
import yio.tro.antiyoy.menu.render.<API key>;
import yio.tro.antiyoy.menu.render.MenuRender;
import yio.tro.antiyoy.menu.scenes.Scenes;
import yio.tro.antiyoy.menu.scenes.gameplay.choose_entity.IDipEntityReceiver;
import yio.tro.antiyoy.stuff.Fonts;
import yio.tro.antiyoy.stuff.GraphicsYio;
public class SimpleDipEntityItem extends <API key>{
public DiplomaticEntity diplomaticEntity;
public int backgroundColor;
@Override
protected BitmapFont getTitleFont() {
return Fonts.smallerMenuFont;
}
@Override
protected double getHeight() {
return 0.07f * GraphicsYio.height;
}
@Override
protected void onClicked() {
Scenes.<API key>.<API key>(diplomaticEntity);
}
public void setDiplomaticEntity(DiplomaticEntity diplomaticEntity) {
this.diplomaticEntity = diplomaticEntity;
backgroundColor = getGameController().colorsManager.getColorByFraction(diplomaticEntity.fraction);
setTitle("" + diplomaticEntity.capitalName);
}
@Override
public <API key> getRender() {
return MenuRender.<API key>;
}
}
|
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
namespace SimpleZIP_UI.Presentation.View.Model
{
<summary>
Represents a list box item for the <see cref="MessageDigestPage"/>.
</summary>
public class MessageDigestModel
{
<summary>
The name of the file whose hash value is to be displayed.
</summary>
public string FileName { get; }
<summary>
The physical location (full path) of the file.
</summary>
public string Location { get; }
<summary>
The calculated hash value of the file.
</summary>
public string HashValue { get; internal set; }
<summary>
Displays the location in the model if set to true.
</summary>
public BooleanModel IsDisplayLocation { get; set; } = false;
<summary>
Sets the color brush of the <see cref="FileName"/>.
</summary>
public <API key> FileNameColorBrush { get; set; }
<summary>
Constructs a new model for the ListBox in <see cref="MessageDigestPage"/>.
</summary>
<param name="fileName">The name of the file to be displayed.</param>
<param name="location">The location of the file to be displayed.</param>
<param name="hashValue">The hash value of the file to be displayed.</param>
public MessageDigestModel(string fileName, string location, string hashValue)
{
FileName = fileName;
Location = location;
HashValue = hashValue;
}
}
}
|
#!/usr/bin/env bash
INTERFACE="${INTERFACE:-wlo1}"
systemctl enable netctl-auto@$INTERFACE
systemctl --user enable maintenance.timer
systemctl --user enable battery.timer
|
package standalone_tools;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import framework.DataQuery;
import framework.DiffComplexDetector;
import framework.DiffComplexDetector.SPEnrichment;
import framework.<API key>;
import framework.QuantDACOResultSet;
import framework.Utilities;
/**
* CompleXChange cmd-tool
* @author Thorsten Will
*/
public class CompleXChange {
static String version_string = "CompleXChange 1.01";
private static String path_group1 = "[GROUP1-FOLDER]";
private static String path_group2 = "[GROUP2-FOLDER]";
private static Map<String, QuantDACOResultSet> group1;
private static Map<String, QuantDACOResultSet> group2;
private static String path_seed = "no seed file defined";
private static Set<String> seed = null;
private static String output_folder;
private static double FDR = 0.05;
private static boolean parametric = false;
private static boolean paired = false;
private static boolean <API key> = false;
private static double <API key> = 0.75;
private static boolean human_readable = false;
private static boolean also_seedcomb_calcs = false;
private static boolean also_seed_enrich = false;
private static boolean filter_allosome = false;
private static int no_threads = Math.max(Runtime.getRuntime().availableProcessors() / 2, 1); // assuming HT/SMT systems
/**
* Reads all matching output pairs of JDACO results/major transcripts from a certain folder:
* [folder]/[sample-string]_complexes.txt(.gz) and [folder]/[sample-string]_major-transcripts.txt(.gz)
* @param folder
* @return
*/
public static Map<String, QuantDACOResultSet> <API key>(String folder) {
Map<String, QuantDACOResultSet> data = new HashMap<>();
for (File f:Utilities.<API key>(folder, "_major-transcripts.txt")) {
String gz = "";
if (f.getName().endsWith(".gz"))
gz = ".gz";
String pre = f.getAbsolutePath().split("_major-transcripts")[0];
String sample = f.getName().split("_major-transcripts")[0];
QuantDACOResultSet qdr = new QuantDACOResultSet(pre + "_complexes.txt" + gz, seed, pre + "_major-transcripts.txt" + gz);
data.put(sample, qdr);
}
return data;
}
/**
* Prints the help message
*/
public static void printHelp() {
System.out.println("usage: java -jar CompleXChange.jar ([OPTIONS]) [GROUP1-FOLDER] [GROUP2-FOLDER] [OUTPUT-FOLDER]");
System.out.println();
System.out.println("[OPTIONS] (optional) :");
System.out.println(" -fdr=[FDR] : false discovery rate (default: 0.05)");
System.out.println(" -mf=[MIN_VAR_FRACTION] : fraction of either group a complex must be part of to be considered in the analysis (default: 0.75)");
System.out.println(" -s=[SEED-FILE] : file listing proteins around which the complexes are centered, e.g. seed file used for JDACO complex predictions (default: none)");
System.out.println(" -t=[#threads] : number of threads to be used (default: #cores/2)");
System.out.println(" -nd : assume normal distribution when testing (default: no assumption, non-parametric tests applied)");
System.out.println(" -p : assume paired/dependent data (default: unpaired/independent tests applied)");
System.out.println(" -ss : also associate supersets in the analyses (default: no supersets)");
System.out.println(" -enr : determine seed proteins enriched in up/down-regulated complexes (as in GSEA)");
System.out.println(" -sc : additional analysis based on seed combinations rather than sole complexes (as in GSEA)");
System.out.println(" -hr : additionally output human readable files with gene names and rounded numbers (default: no output)");
System.out.println(" -f : filter complexes with allosome proteins (default: no filtering)");
System.out.println();
System.out.println("[GROUPx-FOLDER] :");
System.out.println(" Standard PPIXpress/JDACO-output is read from those folders. JDACO results and major transcripts are needed.");
System.out.println();
System.out.println("[OUTPUT-FOLDER]");
System.out.println(" The outcome is written to this folder. If it does not exist, it is created.");
System.out.println();
System.exit(0);
}
/**
* Prints the version of the program
*/
public static void printVersion() {
System.out.println(version_string);
System.exit(0);
}
/**
* Parse arguments
* @param args
*/
public static void parseInput(String[] args) {
for (String arg:args) {
// help needed?
if (arg.equals("-h") || arg.equals("-help"))
printHelp();
// output version
else if (arg.equals("-version"))
printVersion();
// parse FDR
else if (arg.startsWith("-fdr="))
FDR = Double.parseDouble(arg.split("=")[1]);
// parse <API key>
else if (arg.startsWith("-mf="))
<API key> = Double.parseDouble(arg.split("=")[1]);
// add seed file
else if (arg.startsWith("-s=")) {
path_seed = arg.split("=")[1];
seed = Utilities.readEntryFile(path_seed);
if (seed == null)
System.exit(1); // error will be thrown by the utility-function
if (seed.isEmpty()) {
System.err.println("Seed file " + path_seed + " is empty.");
System.exit(1);
}
}
// parse #threads
else if (arg.startsWith("-t="))
no_threads = Math.max(Integer.parseInt(arg.split("=")[1]), 1);
// parametric?
else if (arg.equals("-nd"))
parametric = true;
// paired?
else if (arg.equals("-p"))
paired = true;
// supersets?
else if (arg.equals("-ss"))
<API key> = true;
// seed combinations?
else if (arg.equals("-sc"))
also_seedcomb_calcs = true;
// seed enrichment?
else if (arg.equals("-enr"))
also_seed_enrich = true;
// output human readable files?
else if (arg.equals("-hr"))
human_readable = true;
// filter allosome proteins?
else if (arg.equals("-f"))
filter_allosome = true;
// read groupwise input
else if (group1 == null) {
path_group1 = arg;
if (!path_group1.endsWith("/"))
path_group1 += "/";
group1 = <API key>(path_group1);
}
else if (group2 == null) {
path_group2 = arg;
if (!path_group2.endsWith("/"))
path_group2 += "/";
group2 = <API key>(path_group2);
}
// set output-folder
else if (output_folder == null) {
output_folder = arg;
if (!output_folder.endsWith("/"))
output_folder += "/";
}
}
// some final checks
if (group1 == null || group1.isEmpty() || group2 == null || group2.isEmpty()) {
if (group1 == null || group1.isEmpty())
System.err.println(path_group1 + " does not exist or contains no useable data.");
if (group2 == null || group2.isEmpty())
System.err.println(path_group2 + " does not exist or contains no useable data.");
System.exit(1);
}
if (group1.size() < 2 || group2.size() < 2) {
if (group1.size() < 2)
System.err.println(path_group1 + " does not contain enough data. At least two samples per group are needed for a statistical evaluation.");
if (group2.size() < 2)
System.err.println(path_group2 + " does not contain enough data. At least two samples per group are needed for a statistical evaluation.");
System.exit(1);
}
if (output_folder == null) {
System.err.println("Please add an output folder.");
System.exit(1);
}
// check for invalid usage of seedcomb mode
if (also_seedcomb_calcs && seed == null) {
also_seedcomb_calcs = false;
System.out.println("Analysis of seed combination variants in complexes requires a seed file, this additional analysis is skipped.");
}
if (also_seed_enrich && seed == null) {
also_seed_enrich = false;
System.out.println("Analysis of seed protein enrichment in complexes requires a seed file, this additional analysis is skipped.");
}
}
public static void main(String[] args) {
if (args.length == 1 && args[0].equals("-version"))
printVersion();
if (args.length < 3) {
printHelp();
}
// parse cmd-line and set all parameters
try {
parseInput(args);
} catch (Exception e) {
System.out.println("Something went wrong while reading the command-line, please check your input!");
System.out.println();
printHelp();
}
// preface
if (group1.size() < 5 || group2.size() < 5) {
System.out.println("Computations will run as intended, but be aware that at least five samples per group are recommended to gather meaningful results.");
}
System.out.println("Seed: " + path_seed);
System.out.println("FDR: " + FDR);
String test = "Wilcoxon rank sum test (unpaired, non-parametric)";
if (paired && parametric)
test = "paired t-test (paired, parametric)";
else if (paired)
test = "Wilcoxon signed-rank test (paired, non-parametric)";
else if (parametric)
test = "Welch's unequal variances t-test (unpaired, parametric)";
System.out.println("Statistical test: " + test);
System.out.println("Min. fraction: " + <API key>);
System.out.println("Incorporate supersets: " + (<API key> ? "yes" : "no"));
if (filter_allosome) {
System.out.print("Filtering of complexes with allosome proteins enabled. Downloading data ... ");
String db = DataQuery.<API key>(group1.values().iterator().next().<API key>());
DataQuery.getAllosomeProteins(db);
System.out.println("done.");
}
System.out.println();
// computations
boolean output_to_write = false;
System.out.println("Processing " + path_group1 + " (" + group1.keySet().size() + ") vs " + path_group2 + " (" + group2.keySet().size() + ") ...");
System.out.flush();
DiffComplexDetector dcd = new DiffComplexDetector(group1, group2, FDR, parametric, paired, <API key>, <API key>, no_threads, filter_allosome);
if (seed != null)
System.out.println(dcd.getRawPValues().size() + " complexes tested, " + dcd.<API key>().size() +" (" + dcd.<API key>(false, false).size() + " seed combination variants) significant.");
else
System.out.println(dcd.getRawPValues().size() + " complexes tested, " + dcd.<API key>().size() + " significant.");
System.out.flush();
output_to_write = !dcd.<API key>().isEmpty();
<API key> dscd = null;
if (also_seedcomb_calcs) {
dscd = new <API key>(group1, group2, FDR, parametric, paired, <API key>, <API key>, no_threads, filter_allosome);
System.out.println(dscd.<API key>().size() + " seed combinations tested, " + dscd.<API key>().size() + " significant.");
if (!dscd.<API key>().isEmpty())
output_to_write = true;
System.out.flush();
}
SPEnrichment spe = null;
if (seed == null && also_seed_enrich) {
System.out.println("Please specify a seed protein file if seed protein enrichment should be determined.");
System.out.flush();
}
else if (seed != null && also_seed_enrich) {
System.out.println("Calculating seed protein enrichment with 10000 permutations to approximate null distribution and only considering seed proteins participating in at least 10 complexes.");
System.out.flush();
spe = dcd.<API key>(FDR, 10000, 10);
if (!spe.<API key>().isEmpty())
output_to_write = true;
}
/*
* write file-output
*/
if (!output_to_write) {
System.out.println("Since there is nothing to report, no output is written.");
System.exit(0);
}
// check if output-folder exists, otherwise create it
File f = new File(output_folder);
if (!f.exists())
f.mkdir();
// write output files
System.out.println("Writing results ...");
dcd.<API key>(output_folder + "diff_complexes.txt", false);
if (seed != null) {
dcd.<API key>(output_folder + "<API key>.txt", false);
if (also_seedcomb_calcs)
dscd.<API key>(output_folder + "<API key>.txt", false);
if (also_seed_enrich)
spe.<API key>(output_folder + "<API key>.txt");
}
if (human_readable) {
System.out.println("Retrieving data on gene names ...");
System.out.flush();
System.out.println("Output human readable results ...");
dcd.<API key>(output_folder + "diff_complexes_hr.txt", true);
if (seed != null) {
dcd.<API key>(output_folder + "<API key>.txt", true);
if (also_seedcomb_calcs)
dscd.<API key>(output_folder + "<API key>.txt", true);
}
}
}
}
|
// black-box testing
package router_test
import (
"testing"
"github.com/kataras/iris"
"github.com/kataras/iris/context"
"github.com/kataras/iris/core/router"
"github.com/kataras/iris/httptest"
)
type testController struct {
router.Controller
}
var writeMethod = func(c router.Controller) {
c.Ctx.Writef(c.Ctx.Method())
}
func (c *testController) Get() {
writeMethod(c.Controller)
}
func (c *testController) Post() {
writeMethod(c.Controller)
}
func (c *testController) Put() {
writeMethod(c.Controller)
}
func (c *testController) Delete() {
writeMethod(c.Controller)
}
func (c *testController) Connect() {
writeMethod(c.Controller)
}
func (c *testController) Head() {
writeMethod(c.Controller)
}
func (c *testController) Patch() {
writeMethod(c.Controller)
}
func (c *testController) Options() {
writeMethod(c.Controller)
}
func (c *testController) Trace() {
writeMethod(c.Controller)
}
type (
testControllerAll struct{ router.Controller }
testControllerAny struct{ router.Controller } // exactly same as All
)
func (c *testControllerAll) All() {
writeMethod(c.Controller)
}
func (c *testControllerAny) All() {
writeMethod(c.Controller)
}
func <API key>(t *testing.T) {
app := iris.New()
app.Controller("/", new(testController))
app.Controller("/all", new(testControllerAll))
app.Controller("/any", new(testControllerAny))
e := httptest.New(t, app)
for _, method := range router.AllMethods {
e.Request(method, "/").Expect().Status(httptest.StatusOK).
Body().Equal(method)
e.Request(method, "/all").Expect().Status(httptest.StatusOK).
Body().Equal(method)
e.Request(method, "/any").Expect().Status(httptest.StatusOK).
Body().Equal(method)
}
}
type <API key> struct {
router.Controller
Data string `iris:"persistence"`
}
func (t *<API key>) Get() {
t.Ctx.WriteString(t.Data)
}
func <API key>(t *testing.T) {
data := "this remains the same for all requests"
app := iris.New()
app.Controller("/", &<API key>{Data: data})
e := httptest.New(t, app)
e.GET("/").Expect().Status(httptest.StatusOK).
Body().Equal(data)
}
type <API key> struct {
router.Controller
Username string
}
// called before of every method (Get() or Post()).
// useful when more than one methods using the
// same request values or context's function calls.
func (t *<API key>) BeginRequest(ctx context.Context) {
t.Username = ctx.Params().Get("username")
// or t.Params.Get("username") because the
// t.Ctx == ctx and is being initialized before this "BeginRequest"
}
// called after every method (Get() or Post()).
func (t *<API key>) EndRequest(ctx context.Context) {
ctx.Writef("done") // append "done" to the response
}
func (t *<API key>) Get() {
t.Ctx.Writef(t.Username)
}
func (t *<API key>) Post() {
t.Ctx.Writef(t.Username)
}
func <API key>(t *testing.T) {
app := iris.New()
app.Controller("/profile/{username}", new(<API key>))
e := httptest.New(t, app)
usernames := []string{
"kataras",
"makis",
"efi",
"rg",
"bill",
"whoisyourdaddy",
}
doneResponse := "done"
for _, username := range usernames {
e.GET("/profile/" + username).Expect().Status(httptest.StatusOK).
Body().Equal(username + doneResponse)
e.POST("/profile/" + username).Expect().Status(httptest.StatusOK).
Body().Equal(username + doneResponse)
}
}
|
package eu.geopaparazzi.library.profiles.objects;
import android.os.Parcel;
import android.os.Parcelable;
import eu.geopaparazzi.library.network.download.IDownloadable;
public class ProfileOtherfiles extends <API key> implements Parcelable, IDownloadable {
public String url = "";
public String modifiedDate = "";
public long size = -1;
private String destinationPath = "";
public ProfileOtherfiles() {
}
protected ProfileOtherfiles(Parcel in) {
url = in.readString();
modifiedDate = in.readString();
size = in.readLong();
destinationPath = in.readString();
}
public static final Creator<ProfileOtherfiles> CREATOR = new Creator<ProfileOtherfiles>() {
@Override
public ProfileOtherfiles createFromParcel(Parcel in) {
return new ProfileOtherfiles(in);
}
@Override
public ProfileOtherfiles[] newArray(int size) {
return new ProfileOtherfiles[size];
}
};
@Override
public long getSize() {
return size;
}
@Override
public String getUrl() {
return url;
}
@Override
public String getDestinationPath() {
return destinationPath;
}
@Override
public void setDestinationPath(String path) {
destinationPath = path;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(url);
dest.writeString(modifiedDate);
dest.writeLong(size);
dest.writeString(destinationPath);
}
}
|
#from moderation import moderation
#from .models import SuccessCase
#moderation.register(SuccessCase)
|
document.addEventListener("DOMContentLoaded", function(event) {
if (/android|blackberry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === false) {
var linkDescrs = document.querySelectorAll('.link-descr');
Array.prototype.forEach.call(linkDescrs, function(el, i) {
el.parentNode.addEventListener('mouseenter', animateTypeText);
el.parentNode.addEventListener('mouseleave', destroyTypeText);
});
} else {
var linkDescrs = document.querySelectorAll('.link-descr');
Array.prototype.forEach.call(linkDescrs, function(el, i) {
removeClass(el, 'link-descr');
});
}
});
var addClass = function(elem, add_class) {
elem.setAttribute("class", elem.getAttribute("class") + ' ' + add_class);
};
var removeClass = function(elem, rem_class) {
var origClass = elem.getAttribute("class");
var remClassRegex = new Regexp("(\\s*)"+rem_class+"(\\s*)");
var classMatch = origClass.match(remClassRegex);
var replaceString = '';
if (classMatch[1].length > 0 || classMatch[2].length > 0) {
replaceString = ' ';
}
var newClass = origClass.replace(remClassRegex, replaceString);
elem.setAttribute("class", newClass);
};
var animateTypeText = function() {
var elem = this;
var typeArea = document.createElement("span");
typeArea.setAttribute("class", "link-subtext");
elem.insertBefore(typeArea, elem.querySelector("span:last-of-type"));
setTimeout(addLetter(elem), 40);
};
var addLetter = function(elem) {
var subtextSpan = elem.querySelector(".link-subtext");
var descrText = elem.querySelector(".link-descr").textContent;
if (subtextSpan === null) {
return;
}
var currentText = subtextSpan.textContent.slice(0,-1);
var currentPos = currentText.length;
subtextSpan.textContent = currentText +
descrText.slice(currentPos, currentPos+1) + "\u258B";
if (currentText.length < descrText.length) {
setTimeout(function(){addLetter(elem)}, 40);
}
};
var destroyTypeText = function() {
var elem = this;
elem.removeChild(elem.querySelector('.link-subtext'));
};
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>File Source for THead.php</title>
<link rel="stylesheet" href="../media/stylesheet.css" />
</head>
<body>
<h1>Source for file THead.php</h1>
<p>Documentation is available at <a href="../Elements/<API key>.php.html">THead.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php"><?php</span></div></li>
<li><div class="src-line"><a name="a26"></a>namespace <span class="src-id">HTMLBuilder</span>\<span class="src-id">Elements</span>\<span class="src-id"><a href="../Elements/General/Table.html">Table</a></span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a27"></a>use <span class="src-id">HTMLBuilder</span>\<span class="src-id">Elements</span>\<span class="src-id"><a href="../Elements/Base/Root.html">Root</a></span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a28"></a> </div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-key">class </span><a href="../Elements/General/THead.html">THead</a> <span class="src-key">extends </span><a href="../Elements/General/RootRow.html">RootRow</a> <span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a51"></a> </div></li>
<li><div class="src-line"><a name="a52"></a> <span class="src-key">public </span><span class="src-key">function </span><a href="../Elements/General/THead.html#methodinitElement">initElement</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a53"></a> </div></li>
<li><div class="src-line"><a name="a54"></a> <span class="src-var">$this</span><span class="src-sym">-></span><a href="../Elements/Base/Root.html#var$_allowedChildren">_allowedChildren</a> = <span class="src-key">array </span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a55"></a> <span class="src-str">"tr"</span></div></li>
<li><div class="src-line"><a name="a56"></a> <span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a57"></a> <span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-sym">}</span></div></li>
</ol></div>
</div>
<p class="notes" id="credit">
Documentation generated on Sat, 22 Dec 2012 00:28:46 +0100 by <a href="http:
</p>
</body>
</html>
|
package de.turnierverwaltung.control.settingsdialog;
import java.awt.Dialog;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.sql.SQLException;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.<API key>;
import de.turnierverwaltung.control.ExceptionHandler;
import de.turnierverwaltung.control.MainControl;
import de.turnierverwaltung.control.Messages;
import de.turnierverwaltung.control.PropertiesControl;
import de.turnierverwaltung.control.ratingdialog.<API key>;
import de.turnierverwaltung.control.ratingdialog.<API key>;
import de.turnierverwaltung.control.sqlite.<API key>;
import de.turnierverwaltung.model.TournamentConstants;
import de.turnierverwaltung.view.settingsdialog.SettingsView;
import say.swing.JFontChooser;
public class <API key> {
private final MainControl mainControl;
private final SettingsControl esControl;
private JDialog dialog;
public <API key>(final MainControl mainControl, final SettingsControl esControl) {
super();
this.mainControl = mainControl;
this.esControl = esControl;
<API key>();
}
public void addActionListeners() {
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
final JFontChooser fontChooser = esControl.<API key>().getFontChooser();
fontChooser.setSelectedFont(mainControl.<API key>().getFont());
final int result = fontChooser.showDialog(esControl.<API key>());
if (result == JFontChooser.OK_OPTION) {
final Font selectedFont = fontChooser.getSelectedFont();
MainControl.setUIFont(selectedFont);
mainControl.<API key>().setFont(selectedFont);
mainControl.<API key>().writeProperties();
}
}
});
esControl.<API key>().getOkButton().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent arg0) {
mainControl.<API key>().<API key>(dialog.getBounds().x,
dialog.getBounds().y, dialog.getBounds().width, dialog.getBounds().height);
dialog.dispose();
final PropertiesControl ppC = mainControl.<API key>();
final SettingsView settingsView = esControl.<API key>();
ppC.setTableComumnBlack(settingsView.getBlackTextField().getText());
ppC.setTableComumnWhite(settingsView.getWhiteTextField().getText());
ppC.<API key>(settingsView.getMeetingTextField().getText());
ppC.<API key>(settingsView.getNewDWZTextField().getText());
ppC.<API key>(settingsView.getOldDWZTextField().getText());
ppC.<API key>(settingsView.getNewELOTextField().getText());
ppC.<API key>(settingsView.getOldELOTextField().getText());
ppC.<API key>(settingsView.getPlayerTextField().getText());
ppC.<API key>(settingsView.getPointsTextField().getText());
ppC.<API key>(settingsView.getRankingTextField().getText());
ppC.<API key>(settingsView.getResultTextField().getText());
ppC.<API key>(settingsView.getSbbTextField().getText());
ppC.setTableComumnRound(settingsView.getRoundTextField().getText());
ppC.setSpielfrei(settingsView.<API key>().getText());
if (mainControl.<API key>() != null) {
mainControl.<API key>().<API key>();
}
ppC.setCutForename(settingsView.<API key>().getValue());
ppC.setCutSurname(settingsView.getSurnameLengthBox().getValue());
ppC.setWebserverPath(settingsView.<API key>().getText());
ppC.<API key>();
ppC.<API key>();
ppC.setCSSTable(settingsView.<API key>().getText());
ppC.writeProperties();
esControl.setTableColumns();
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
// vereine.csv
final File path = new File(mainControl.<API key>().getDefaultPath());
final JFileChooser fc = new JFileChooser(path);
final FileFilter filter = new <API key>("CSV file", "csv", "CSV");
fc.setFileFilter(filter);
final int returnVal = fc.showOpenDialog(esControl.<API key>());
if (returnVal == JFileChooser.APPROVE_OPTION) {
final File file = fc.getSelectedFile();
// This is where a real application would open the
// file.
mainControl.<API key>().setPathToVereineCVS(file.getAbsolutePath());
mainControl.<API key>().writeProperties();
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToVereineCVS());
}
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent arg0) {
final <API key> dwzL = new <API key>(mainControl);
dwzL.<API key>();
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersCSV());
esControl.<API key>().<API key>().setEnabled(false);
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
// spieler.csv
final File path = new File(mainControl.<API key>().getDefaultPath());
final JFileChooser fc = new JFileChooser(path);
final FileFilter filter = new <API key>("CSV or SQLite file", "csv", "CSV", "sqlite",
"SQLite");
fc.setFileFilter(filter);
final int returnVal = fc.showOpenDialog(esControl.<API key>());
if (returnVal == JFileChooser.APPROVE_OPTION) {
final File file = fc.getSelectedFile();
// This is where a real application would open the
// file.
mainControl.<API key>().setPathToPlayersCSV(file.getAbsolutePath());
mainControl.<API key>().writeProperties();
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersCSV());
final String filename = file.getName();
final int positionEXT = filename.lastIndexOf('.');
if (positionEXT > 0) {
final String newFile = filename.substring(positionEXT);
if (newFile.equals(".sqlite")) {
esControl.<API key>().<API key>().setEnabled(false);
} else {
esControl.<API key>().<API key>().setEnabled(true);
}
}
}
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent arg0) {
final <API key> eloL = new <API key>(mainControl);
eloL.<API key>();
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersELO());
esControl.<API key>().<API key>().setEnabled(false);
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
// spieler.csv
final File path = new File(mainControl.<API key>().getDefaultPath());
final JFileChooser fc = new JFileChooser(path);
final FileFilter filter = new <API key>("TXT or SQLite file", "txt", "TXT", "sqlite",
"SQLite");
fc.setFileFilter(filter);
final int returnVal = fc.showOpenDialog(esControl.<API key>());
if (returnVal == JFileChooser.APPROVE_OPTION) {
final File file = fc.getSelectedFile();
// This is where a real application would open the
// file.
mainControl.<API key>().setPathToPlayersELO(file.getAbsolutePath());
mainControl.<API key>().writeProperties();
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersELO());
final String filename = file.getName();
final int positionEXT = filename.lastIndexOf('.');
if (positionEXT > 0) {
final String newFile = filename.substring(positionEXT);
if (newFile.equals(".sqlite")) {
esControl.<API key>().<API key>().setEnabled(false);
} else {
esControl.<API key>().<API key>().setEnabled(true);
}
}
}
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
final File path = new File(mainControl.<API key>().getDefaultPath());
final JFileChooser fc = new JFileChooser(path);
fc.<API key>(JFileChooser.DIRECTORIES_ONLY);
fc.<API key>(false);
final int returnVal = fc.showOpenDialog(esControl.<API key>());
if (returnVal == JFileChooser.APPROVE_OPTION) {
final File file = fc.getSelectedFile();
// This is where a real application would open the
// file.
mainControl.<API key>().setDefaultPath(file.getAbsolutePath());
mainControl.<API key>().writeProperties();
esControl.<API key>()
.<API key>(mainControl.<API key>().getDefaultPath());
}
}
});
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToVereineCVS());
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersCSV());
esControl.<API key>()
.<API key>(mainControl.<API key>().getPathToPlayersELO());
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
mainControl.<API key>().setLanguageToGerman();
mainControl.<API key>().writeProperties();
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
mainControl.<API key>().<API key>();
mainControl.<API key>().writeProperties();
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
final int anzahlProTab = esControl.<API key>().<API key>()
.getSelectedIndex();
mainControl.<API key>().setSpielerProTab(anzahlProTab);
mainControl.<API key>().writeProperties();
}
});
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent arg0) {
final int anzahlProTab = esControl.<API key>().<API key>()
.getSelectedIndex();
mainControl.<API key>().setTurniereProTab(anzahlProTab);
mainControl.<API key>().writeProperties();
}
});
String filename = mainControl.<API key>().getPathToPlayersELO();
int positionEXT = filename.lastIndexOf('.');
if (positionEXT > 0) {
final String newFile = filename.substring(positionEXT);
if (newFile.equals(".sqlite")) {
esControl.<API key>().<API key>().setEnabled(false);
} else {
esControl.<API key>().<API key>().setEnabled(true);
}
} else {
esControl.<API key>().<API key>().setEnabled(false);
}
filename = mainControl.<API key>().getPathToPlayersCSV();
positionEXT = filename.lastIndexOf('.');
if (positionEXT > 0) {
final String newFile = filename.substring(positionEXT);
if (newFile.equals(".sqlite")) {
esControl.<API key>().<API key>().setEnabled(false);
} else {
esControl.<API key>().<API key>().setEnabled(true);
}
} else {
esControl.<API key>().<API key>().setEnabled(false);
}
esControl.<API key>().<API key>().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
final int abfrage = beendenHinweis();
if (abfrage > 0) {
if (mainControl.getHauptPanel().getTabCount() == TournamentConstants.<API key> + 1) {
if (mainControl.getChangedGames().isEmpty() == false) {
final <API key> saveTournament = new <API key>(mainControl);
try {
saveTournament.saveChangedPartien();
} catch (final SQLException e1) {
final ExceptionHandler eh = new ExceptionHandler(mainControl);
eh.fileSQLError(e1.getMessage());
}
}
}
}
mainControl.<API key>().resetProperties();
mainControl.<API key>().writeProperties();
JOptionPane.showMessageDialog(null, Messages.getString("<API key>.29"),
Messages.getString("<API key>.28"), JOptionPane.INFORMATION_MESSAGE);
System.exit(0);
}
});
}
private void <API key>() {
mainControl.getNaviView().getPropertiesButton().addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent arg0) {
mainControl.getSettingsControl().<API key>(new SettingsView());
final SettingsView eigenschaftenView = mainControl.getSettingsControl().<API key>();
mainControl.getSettingsControl().<API key>(
new <API key>(mainControl, mainControl.getSettingsControl()));
mainControl.getSettingsControl().<API key>().addItemListeners();
if (dialog == null) {
dialog = new JDialog();
} else {
dialog.dispose();
dialog = new JDialog();
}
// dialog.setAlwaysOnTop(true);
dialog.getContentPane().add(eigenschaftenView);
dialog.pack();
dialog.<API key>(null);
dialog.setBounds(mainControl.<API key>().getSettingsDialogX(),
mainControl.<API key>().getSettingsDialogY(),
mainControl.<API key>().<API key>(),
mainControl.<API key>().<API key>());
dialog.setEnabled(true);
if (mainControl.<API key>() == null) {
mainControl.<API key>(new PropertiesControl(mainControl));
}
final PropertiesControl ppC = mainControl.<API key>();
ppC.readProperties();
eigenschaftenView.<API key>().setSelected(ppC.getOnlyTables());
eigenschaftenView.getCheckBoxohneDWZ().setSelected(ppC.getNoDWZ());
eigenschaftenView.<API key>().setSelected(ppC.getNoFolgeDWZ());
eigenschaftenView.getCheckBoxohneELO().setSelected(ppC.getNoELO());
eigenschaftenView.<API key>().setSelected(ppC.getNoFolgeELO());
eigenschaftenView.<API key>().setSelectedIndex(ppC.getSpielerProTab());
eigenschaftenView.<API key>().setSelectedIndex(ppC.getTurniereProTab());
eigenschaftenView.<API key>().setValue(ppC.getCutForename());
eigenschaftenView.getSurnameLengthBox().setValue(ppC.getCutSurname());
eigenschaftenView.<API key>().setText(ppC.getWebserverPath());
// eigenschaftenView.getCheckBoxohneDWZ().setSelected(ppC.getNoDWZ());
eigenschaftenView.<API key>().setSelected(ppC.gethtmlToClipboard());
if (eigenschaftenView.getCheckBoxohneDWZ().isSelected() == true) {
eigenschaftenView.<API key>().setSelected(true);
eigenschaftenView.<API key>().setEnabled(false);
ppC.setNoFolgeDWZ(true);
}
if (eigenschaftenView.getCheckBoxohneELO().isSelected() == true) {
eigenschaftenView.<API key>().setSelected(true);
eigenschaftenView.<API key>().setEnabled(false);
ppC.setNoFolgeELO(true);
}
eigenschaftenView.getCheckBoxPDFLinks().setSelected(ppC.getPDFLinks());
eigenschaftenView.<API key>().setEnabled(ppC.getPDFLinks());
if (mainControl.<API key>().getLanguage().equals("german")) { //$NON-NLS-1$
eigenschaftenView.<API key>().setSelected(true);
eigenschaftenView.<API key>().setSelected(false);
mainControl.<API key>().setLanguageToGerman();
} else if (mainControl.<API key>().getLanguage().equals("english")) { //$NON-NLS-1$
eigenschaftenView.<API key>().setSelected(false);
eigenschaftenView.<API key>().setSelected(true);
mainControl.<API key>().<API key>();
}
eigenschaftenView.<API key>(ppC.getDefaultPath());
eigenschaftenView.<API key>().setText(ppC.getCSSTable());
esControl.setTableColumns();
addActionListeners();
esControl.<API key>().addItemListeners();
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
dialog.setVisible(true);
}
});
}
private int beendenHinweis() {
int abfrage = 0;
if (mainControl.getHauptPanel().getTabCount() == TournamentConstants.<API key> + 1) {
if (mainControl.getChangedGames().isEmpty() == false) {
final String hinweisText = Messages.getString("NaviController.21") //$NON-NLS-1$
+ Messages.getString("NaviController.22") //$NON-NLS-1$
+ Messages.getString("NaviController.33"); //$NON-NLS-1$
abfrage = 1;
// Custom button text
final Object[] options = { Messages.getString("NaviController.24"), //$NON-NLS-1$
Messages.getString("NaviController.25") }; //$NON-NLS-1$
abfrage = JOptionPane.showOptionDialog(mainControl, hinweisText,
Messages.getString("NaviController.26"), //$NON-NLS-1$
JOptionPane.<API key>, JOptionPane.WARNING_MESSAGE, null, options, options[1]);
}
}
return abfrage;
}
}
|
namespace Ribbonizer.Ribbon
{
using System.Collections.Generic;
using System.Linq;
using Ribbonizer.Ribbon.<API key>;
using Ribbonizer.Ribbon.Tabs;
internal class RibbonInitializer : IRibbonInitializer
{
private readonly IEnumerable<<API key>> <API key>;
private readonly <API key> <API key>;
public RibbonInitializer(IEnumerable<<API key>> <API key>, <API key> <API key>)
{
this.<API key> = <API key>;
this.<API key> = <API key>;
}
public void <API key>()
{
IEnumerable<<API key>> violations = this.<API key>
.SelectMany(x => x.Validate())
.ToList();
if (violations.Any())
{
throw new <API key>(violations);
}
this.<API key>.InitializeCache();
}
}
}
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of satpy.
# satpy is free software: you can redistribute it and/or modify it under the
# version.
# satpy is distributed in the hope that it will be useful, but WITHOUT ANY
"""Fetch avhrr calibration coefficients."""
import datetime as dt
import os.path
import sys
import h5py
import urllib2
BASE_URL = "http:
"AVHRR/Op_Cal_AVHRR/"
URLS = {
"Metop-B":
{"ch1": BASE_URL + "<API key>.txt",
"ch2": BASE_URL + "<API key>.txt",
"ch3a": BASE_URL + "<API key>.txt"},
"Metop-A":
{"ch1": BASE_URL + "<API key>.txt",
"ch2": BASE_URL + "<API key>.txt",
"ch3a": BASE_URL + "<API key>.txt"},
"NOAA-16":
{"ch1": BASE_URL + "N16_AVHRR_Libya_ch1.txt",
"ch2": BASE_URL + "N16_AVHRR_Libya_ch2.txt"},
"NOAA-17":
{"ch1": BASE_URL + "N17_AVHRR_Libya_ch1.txt",
"ch2": BASE_URL + "N17_AVHRR_Libya_ch2.txt",
"ch3a": BASE_URL + "<API key>.txt"},
"NOAA-18":
{"ch1": BASE_URL + "N18_AVHRR_Libya_ch1.txt",
"ch2": BASE_URL + "N18_AVHRR_Libya_ch2.txt"},
"NOAA-19":
{"ch1": BASE_URL + "N19_AVHRR_Libya_ch1.txt",
"ch2": BASE_URL + "N19_AVHRR_Libya_ch2.txt"}
}
def get_page(url):
"""Retrieve the given page."""
return urllib2.urlopen(url).read()
def get_coeffs(page):
"""Parse coefficients from the page."""
coeffs = {}
coeffs['datetime'] = []
coeffs['slope1'] = []
coeffs['intercept1'] = []
coeffs['slope2'] = []
coeffs['intercept2'] = []
slope1_idx, intercept1_idx, slope2_idx, intercept2_idx = \
None, None, None, None
date_idx = 0
for row in page.lower().split('\n'):
row = row.split()
if len(row) == 0:
continue
if row[0] == 'update':
# Get the column indices from the header line
slope1_idx = row.index('slope_lo')
intercept1_idx = row.index('int_lo')
slope2_idx = row.index('slope_hi')
intercept2_idx = row.index('int_hi')
continue
if slope1_idx is None:
continue
# In some cases the fields are connected, skip those rows
if max([slope1_idx, intercept1_idx,
slope2_idx, intercept2_idx]) >= len(row):
continue
try:
dat = dt.datetime.strptime(row[date_idx], "%m/%d/%Y")
except ValueError:
continue
coeffs['datetime'].append([dat.year, dat.month, dat.day])
coeffs['slope1'].append(float(row[slope1_idx]))
coeffs['intercept1'].append(float(row[intercept1_idx]))
coeffs['slope2'].append(float(row[slope2_idx]))
coeffs['intercept2'].append(float(row[intercept2_idx]))
return coeffs
def get_all_coeffs():
"""Get all available calibration coefficients for the satellites."""
coeffs = {}
for platform in URLS:
if platform not in coeffs:
coeffs[platform] = {}
for chan in URLS[platform].keys():
url = URLS[platform][chan]
print(url)
page = get_page(url)
coeffs[platform][chan] = get_coeffs(page)
return coeffs
def save_coeffs(coeffs, out_dir=''):
"""Save calibration coefficients to HDF5 files."""
for platform in coeffs.keys():
fname = os.path.join(out_dir, "%s_calibration_data.h5" % platform)
fid = h5py.File(fname, 'w')
for chan in coeffs[platform].keys():
fid.create_group(chan)
fid[chan]['datetime'] = coeffs[platform][chan]['datetime']
fid[chan]['slope1'] = coeffs[platform][chan]['slope1']
fid[chan]['intercept1'] = coeffs[platform][chan]['intercept1']
fid[chan]['slope2'] = coeffs[platform][chan]['slope2']
fid[chan]['intercept2'] = coeffs[platform][chan]['intercept2']
fid.close()
print("Calibration coefficients saved for %s" % platform)
def main():
"""Create calibration coefficient files for AVHRR."""
out_dir = sys.argv[1]
coeffs = get_all_coeffs()
save_coeffs(coeffs, out_dir=out_dir)
if __name__ == "__main__":
main()
|
<?php
$NAME='<API key> malware_signature- ID 2155';
$TAGCLEAR='A<?php[^}]{1,600}}}define([\'"]startTime[\'"],getTime());if(!function_exists([\'"]shellexec[\'"])){functions+shellexec($cmd){';
$TAGBASE64='QTw/cGhwW159XXsxLDYwMH19fWRlZmluZShbXCciXXN0YXJ0VGltZVtcJyJdLGdldFRpbWUoKSk7aWYoIWZ1bmN0aW9uX2V4aXN0cyhbXCciXXNoZWxsZXhlY1tcJyJdKSl7ZnVuY3Rpb25zK3NoZWxsZXhlYygkY21kKXs=';
$TAGHEX='413c3f7068705b5e7d5d7b312c3630307d7d7d646566696e65285b5c27225d737461727454696d655b5c27225d2c67657454696d652829293b6966282166756e6374696f6e5f657869737473285b5c27225d7368656c6c657865635b5c27225d29297b66756e6374696f6e732b7368656c6c657865632824636d64297b';
$TAGHEXPHP='';
$TAGURI='A%3C%3Fphp%5B%5E%7D%5D%7B1%2C600%7D%7D%7Ddefine%28%5B%5C%27%22%5DstartTime%5B%5C%27%22%5D%2CgetTime%28%29%29%3Bif%28%21function_exists%28%5B%5C%27%22%5Dshellexec%5B%5C%27%22%5D%29%29%7Bfunctions%2Bshellexec%28%24cmd%29%7B';
$TAGCLEAR2='';
$TAGBASE642='';
$TAGHEX2='';
$TAGHEXPHP2='';
$TAGURI2='';
$DATEADD='10/09/2019';
$LINK='Webexploitscan.org ;<API key> malware_signature- ID 2155 ';
$ACTIVED='1';
$VSTATR='malware_signature';
|
#define TYPEDEPARGS 0, 1, 2, 3
#define SINGLEARGS
#define REALARGS
#define OCTFILENAME <API key> // change to filename
#define OCTFILEHELP "This function calls the C-library\n\
phase=<API key>(s,tgrad,fgrad,cfreq,a,do_real,tol,phasetype)\n Yeah."
#include "<API key>.h"
static inline void
<API key>(
const double s[], const double tgrad[], const double fgrad[], const double cfreq[],
ltfat_int a, ltfat_int M, ltfat_int L, ltfat_int W,
int do_real, double tol, int phasetype, double phase[])
{
if (phasetype == 1)
<API key>(
s, tgrad, fgrad, cfreq, a, M, L, W, do_real, tol, phase);
else
<API key>(
s, tgrad, fgrad, cfreq, a, M, L, W, do_real, tol, phase);
}
static inline void
<API key>(
const float s[], const float tgrad[], const float fgrad[], const float cfreq[],
ltfat_int a, ltfat_int M, ltfat_int L, ltfat_int W,
int do_real, float tol, int phasetype, float phase[])
{
if (phasetype == 1)
<API key>(
s, tgrad, fgrad, cfreq, a, M, L, W, do_real, tol, phase);
else
<API key>(
s, tgrad, fgrad, cfreq, a, M, L, W, do_real, tol, phase);
}
template <class LTFAT_TYPE, class LTFAT_REAL, class LTFAT_COMPLEX>
octave_value_list octFunction(const octave_value_list& args, int nargout)
{
// Input data
MArray<LTFAT_REAL> s = ltfatOctArray<LTFAT_REAL>(args(0));
MArray<LTFAT_REAL> tgrad = ltfatOctArray<LTFAT_REAL>(args(1));
MArray<LTFAT_REAL> fgrad = ltfatOctArray<LTFAT_REAL>(args(2));
MArray<LTFAT_REAL> cfreq = ltfatOctArray<LTFAT_REAL>(args(3));
octave_idx_type a = args(4).int_value();
octave_idx_type do_real = args(5).int_value();
double tol = args(6).double_value();
octave_idx_type phasetype = args(7).int_value();
octave_idx_type M = s.columns();
octave_idx_type N = s.rows();
octave_idx_type W = 1;
octave_idx_type L = (octave_idx_type)( N * a);
// phasetype--;
MArray<LTFAT_REAL> phase(dim_vector(N, M, W));
<API key>(
s.data(), tgrad.data(), fgrad.data(), cfreq.data(),
a, M, L, W, do_real, tol, phasetype, phase.fortran_vec());
return octave_value(phase);
}
|
#ifndef COMMON_MD5CALC_H
#define COMMON_MD5CALC_H
#include "common/ragemu.h"
The md5 interface
struct md5_interface {
/**
* Hashes a string, returning the hash in string format.
*
* @param[in] string The source string (NUL terminated).
* @param[out] output Output buffer (at least 33 bytes available).
*/
void (*string) (const char *string, char *output);
/**
* Hashes a string, returning the buffer in binary format.
*
* @param[in] string The source string.
* @param[out] output Output buffer (at least 16 bytes available).
*/
void (*binary) (const uint8 *buf, const int buf_size, uint8 *output);
/**
* Generates a random salt.
*
* @param[in] len The desired salt length.
* @param[out] output The output buffer (at least len bytes available).
*/
void (*salt) (int len, char *output);
};
#ifdef RAGEMU_CORE
void md5_defaults(void);
#endif // RAGEMU_CORE
HPShared struct md5_interface *md5; ///< Pointer to the md5 interface.
#endif /* COMMON_MD5CALC_H */
|
// OpenCppCoverage is an open source code coverage for C++.
// This program is free software: you can redistribute it and/or modify
// any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.Shell.Interop;
using System;
namespace OpenCppCoverage.VSPackage
{
class OutputWindowWriter
{
public OutputWindowWriter(DTE2 dte, IVsOutputWindow outputWindow)
{
// These lines show the output windows
Window output = dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
output.Activate();
if (Microsoft.VisualStudio.ErrorHandler.Failed(outputWindow.GetPane(<API key>, out outputWindowPane_)))
{
if (Microsoft.VisualStudio.ErrorHandler.Failed(outputWindow.CreatePane(<API key>, "OpenCppCoverage", 1, 1)))
throw new Exception("Cannot create new pane.");
if (Microsoft.VisualStudio.ErrorHandler.Failed(outputWindow.GetPane(<API key>, out outputWindowPane_)))
throw new Exception("Cannot get the pane.");
}
outputWindowPane_.Clear();
ActivatePane();
}
public void ActivatePane()
{
outputWindowPane_.Activate();
}
public bool WriteLine(string message)
{
return Microsoft.VisualStudio.ErrorHandler.Succeeded(outputWindowPane_.OutputString(message + "\n"));
}
readonly IVsOutputWindowPane outputWindowPane_;
public readonly static Guid <API key> = new Guid("<API key>");
}
}
|
<?php
/* PHP-NUKE: Advanced Content Management System */
/* This is the language module with all the system messages */
/* If you made a translation, please go to the site and send to me */
/* the translated file. Please keep the original text order by modules, */
/* and just one message per line, also double check your translation! */
/* You need to change the second quoted phrase, not the capital one! */
/* If you need to use double quotes (') remember to add a backslash (\), */
/* so your entry will look like: This is \'double quoted\' text. */
/* And, if you use HTML code, please double check it. */
/* If you create the correct translation for this file please post it */
define('_MA_ARTICLE','Articles');
define('_MA_ARTICLEID','Article
define('<API key>','has been tied to ');
define('<API key>','You must enter an Article ID <strong>and</strong> an author username to move an article.');
define('<API key>','Reads to make top 10: ');
define('_MA_NO_AUTHORS','No User Authors');
define('_TOPWELCOME','Welcome to the Articles and Authors page for ');
define('_WELCOME','Welcome');
define('_SUBMITCONTENT','Submit Content');
define('_SUBMITARTICLE','Submit Article');
define('_WRITEREVIEW','Write Review');
define('_SUBMITWEBLINK','Submit Web Link');
define('_STATISTICS','Statistics');
define('_QUICKSTATOVERVIEW','Quick Stat Overview');
define('_TOPRECENTSTORIES','Top Stories in the last 30 days');
define('_TOPALLSTORIES','Top Stories of all time');
define('_TOPAUTHORS','Top Authors');
define('<API key>','Monthly Article Overview');
define('<API key>','Article Count By Topic');
define('<API key>','Article Count By Category');
define('_STORYREADS','Reads');
define('_STORIES','Stories');
define('_STORYAVGREADS','Avg Reads');
define('_OVERALL','Overall');
define('_RECENT','Recent');
define('_STORYTITLE','Title');
define('_STORYDATE','Date');
define('_AUTHORNAME','Author');
define('_READSPERDAY','Reads Per Day');
define('_READSTORIES','most read stories');
define('_TOP','Top');
define('_AUTHORS','Authors');
define('_NUMSTORIES','# Stories');
define('_TOTALRATINGS','Total Ratings');
define('_AVGRATINGS','Avg Rating');
define('_MONTH','Month');
define('_CATEGORY','Category');
define('_LVOTES','votes');
define('_HITS','Hits');
define('_LINKSDATESTRING','%d. %m. %Y');
?>
|
#include "<API key>.hpp"
<API key>::<API key>(GrisLookAndFeel & lookAndFeel, <API key> & smallLookAndFeel)
: mLayout(LayoutComponent::Orientation::vertical, false, false, lookAndFeel)
, mVuMeter(smallLookAndFeel)
, mMuteSoloComponent(*this, lookAndFeel, smallLookAndFeel)
{
<API key>;
addAndMakeVisible(mLayout);
}
void <API key>::setState(PortState const state, bool const soloMode)
{
<API key>;
mMuteSoloComponent.setPortState(state);
mVuMeter.setMuted(soloMode ? state != PortState::solo : state == PortState::muted);
repaint();
}
|
#include "main/SimpleCardProtocol.hh"
#include "bridge/BridgeConstants.hh"
#include "bridge/CardShuffle.hh"
#include "bridge/CardType.hh"
#include "bridge/Position.hh"
#include "engine/SimpleCardManager.hh"
#include "main/Commands.hh"
#include "main/PeerCommandSender.hh"
#include "messaging/<API key>.hh"
#include "messaging/<API key>.hh"
#include "messaging/JsonSerializer.hh"
#include "messaging/<API key>.hh"
#include "messaging/UuidJsonSerializer.hh"
#include "Logging.hh"
#include <algorithm>
#include <optional>
#include <string>
#include <tuple>
#include <utility>
namespace Bridge {
namespace Main {
using CardVector = std::vector<CardType>;
using Engine::CardManager;
using Messaging::failure;
using Messaging::Identity;
using Messaging::JsonSerializer;
using Messaging::Reply;
using Messaging::success;
class SimpleCardProtocol::Impl :
public Bridge::Observer<CardManager::ShufflingState> {
public:
Impl(
const Uuid& gameUuid,
std::shared_ptr<PeerCommandSender> peerCommandSender);
bool acceptPeer(
const Identity& identity, const PositionVector& positions);
Reply<> deal(const Identity& identity, const CardVector& cards);
const Uuid gameUuid;
const std::shared_ptr<Engine::SimpleCardManager> cardManager {
std::make_shared<Engine::SimpleCardManager>()};
private:
void handleNotify(const CardManager::ShufflingState& state) override;
bool expectingCards {false};
std::optional<Identity> leaderIdentity;
const std::shared_ptr<PeerCommandSender> peerCommandSender;
};
SimpleCardProtocol::Impl::Impl(
const Uuid& gameUuid,
std::shared_ptr<PeerCommandSender> peerCommandSender) :
gameUuid {gameUuid},
peerCommandSender {std::move(peerCommandSender)}
{
}
void SimpleCardProtocol::Impl::handleNotify(
const CardManager::ShufflingState& state)
{
if (state == CardManager::ShufflingState::REQUESTED) {
if (!leaderIdentity) {
log(LogLevel::DEBUG,
"Simple card protocol: Generating deck");
auto cards = <API key>();
assert(cardManager);
cardManager->shuffle(cards.begin(), cards.end());
dereference(peerCommandSender).sendCommand(
JsonSerializer {},
DEAL_COMMAND,
std::pair {GAME_COMMAND, gameUuid},
std::pair {CARDS_COMMAND, std::move(cards)});
} else {
log(LogLevel::DEBUG,
"Simple card protocol: Expecting deck");
expectingCards = true;
}
}
}
bool SimpleCardProtocol::Impl::acceptPeer(
const Identity& identity, const PositionVector& positions)
{
if (std::find(positions.begin(), positions.end(), Positions::NORTH) !=
positions.end()) {
leaderIdentity = identity;
}
return true;
}
Reply<> SimpleCardProtocol::Impl::deal(
const Identity& identity, const CardVector& cards)
{
log(LogLevel::DEBUG, "Deal command from %s", identity);
if (expectingCards && leaderIdentity == identity) {
cardManager->shuffle(cards.begin(), cards.end());
expectingCards = false;
return success();
}
return failure();
}
SimpleCardProtocol::SimpleCardProtocol(
const Uuid& gameUuid,
std::shared_ptr<PeerCommandSender> peerCommandSender) :
impl {
std::make_shared<Impl>(gameUuid, std::move(peerCommandSender))}
{
assert(impl->cardManager);
impl->cardManager->subscribe(impl);
}
bool SimpleCardProtocol::handleAcceptPeer(
const Identity& identity, const PositionVector& positions,
const OptionalArgs&)
{
assert(impl);
return impl->acceptPeer(identity, positions);
}
void SimpleCardProtocol::handleInitialize()
{
}
std::shared_ptr<Messaging::MessageHandler>
SimpleCardProtocol::<API key>()
{
return Messaging::makeMessageHandler(
*impl, &Impl::deal, JsonSerializer {},
std::tuple {CARDS_COMMAND});
}
SimpleCardProtocol::SocketVector SimpleCardProtocol::handleGetSockets()
{
return {};
}
std::shared_ptr<CardManager> SimpleCardProtocol::<API key>()
{
assert(impl);
return impl->cardManager;
}
}
}
|
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// Includes
#include "MantidDataHandling/RemoveLogs.h"
#include "MantidAPI/FileProperty.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/Glob.h"
#include "MantidKernel/PropertyWithValue.h"
#include "MantidKernel/Strings.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include <Poco/DateTimeFormat.h>
#include <Poco/DateTimeParser.h>
#include <Poco/DirectoryIterator.h>
#include <Poco/File.h>
#include <Poco/Path.h>
#include <boost/algorithm/string.hpp>
#include <algorithm>
#include <fstream> // used to get ifstream
#include <sstream>
namespace Mantid {
namespace DataHandling {
// Register the algorithm into the algorithm factory
DECLARE_ALGORITHM(RemoveLogs)
using namespace Kernel;
using namespace API;
using DataObjects::Workspace2D_sptr;
Empty default constructor
RemoveLogs::RemoveLogs() {}
Initialisation method.
void RemoveLogs::init() {
// When used as a Child Algorithm the workspace name is not used - hence the
// "Anonymous" to satisfy the validator
declareProperty(
make_unique<WorkspaceProperty<MatrixWorkspace>>("Workspace", "Anonymous",
Direction::InOut),
"The name of the workspace to which the log data will be removed");
declareProperty(
make_unique<ArrayProperty<std::string>>("KeepLogs", Direction::Input),
"List(comma separated) of logs to be kept");
}
/** Executes the algorithm. Reading in log file(s)
*
* @throw Mantid::Kernel::Exception::FileError Thrown if file is not
*recognised to be a raw datafile or log file
* @throw std::runtime_error Thrown with Workspace problems
*/
void RemoveLogs::exec() {
// Get the input workspace and retrieve run from workspace.
// the log file(s) will be loaded into the run object of the workspace
const <API key> localWorkspace = getProperty("Workspace");
const std::vector<Mantid::Kernel::Property *> &logData =
localWorkspace->run().getLogData();
std::vector<std::string> keepLogs = getProperty("KeepLogs");
std::vector<std::string> logNames;
logNames.reserve(logData.size());
for (const auto property : logData) {
logNames.push_back(property->name());
}
for (const auto &name : logNames) {
auto location = std::find(keepLogs.cbegin(), keepLogs.cend(), name);
if (location == keepLogs.cend()) {
localWorkspace->mutableRun().removeLogData(name);
}
}
// operation was a success and ended normally
return;
}
} // namespace DataHandling
} // namespace Mantid
|
#ifndef <API key>
#define <API key>
#ifdef <API key>
#include <mirror/config.hpp>
<API key>
<API key>
#endif // DOCUMENTATION_ONLY
#endif //include guard
|
#sidebar {
display: none;
}
#sidebar * {
border-radius: 0 !important;
}
#sidebar > nav {
background-color: #222222;
}
@media (min-width: 768px) {
#sidebar {
position: fixed;
top: 0;
bottom: 0;
left: 0;
z-index: 1000;
display: block;
padding: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: #222222;
border-right: 1px solid #111111;
}
}
li.brand {background-color: #000;}
.brand a.brand {
padding: 0;
width: 100%;
height: 50px;
margin: 0;
display: block;
background-image: url(../img/logo-light.png);
background-position: center;
background-size: 90%;
background-repeat: no-repeat;
}
#sidebar .nav.nav-sidebar {
border-bottom: 1px solid #ccc;
}
#sidebar .nav.nav-sidebar:last-child {
border-bottom: 0;
}
#sidebar ul, #sidebar li, #sidebar li a {
display: block;
width: 100%;
}
#sidebar a.gradient > i {
width: 24px;
font-size: 16px;
text-align: left;
}
#sidebar a.gradient {
border-right: 5px solid transparent;
}
#sidebar a.gradient:hover,
#sidebar a.gradient:active,
#sidebar a.gradient:focus {
border-right: 5px solid #00BCD4;
}
#sidebar li.active a.gradient,
#sidebar a.gradient.active {
border-right: 5px solid #ff0000;
}
#sidebar li.dropdown ul li.normal.by-0:not(:last-child) {
border-bottom: 1px solid #3e3e3e !important;
}
.child-bg {
background-color: #111;
}
#sidebar li.dropdown a span.caret {
position: absolute;
right: 15px;
top: calc(50% - 1px);
}
#sidebar .activated {
border-left: 3px solid #f43000;
}
#sidebar li.dropdown ul li a {
padding-top: 8px;
padding-bottom: 8px;
}
#sidebar li.dropdown ul li a:hover,
#sidebar li.dropdown ul li a:active,
#sidebar li.dropdown ul li a:focus {
color: #848484;
background-color: #0d0d0d;
}
|
namespace GemsCraft.Entities.Metadata.Flags
{
public enum TameableFlags: byte
{
IsSitting = 0x01,
<summary>
Only used with wolves
</summary>
IsAngry = 0x02,
IsTamed = 0x04
}
}
|
import React from 'react';
import { connect } from 'react-redux';
import { View, Text, FlatList } from 'react-native';
import sb from '<API key>';
import dateHelper from '@shared/utils/date-helper';
import appConfig from '../config.app';
import ConvItem from '../components/ConvItem';
import { reloadConverseList } from '@shared/redux/actions/chat';
import styled from 'styled-components/native';
import TRefreshControl from '../components/TComponent/TRefreshControl';
import { ChatType } from '../types/params';
import type { TRPGState, TRPGDispatchProp } from '@redux/types/__all__';
import _get from 'lodash/get';
import _values from 'lodash/values';
import _sortBy from 'lodash/sortBy';
import _size from 'lodash/size';
import { TMemo } from '@shared/components/TMemo';
import { useSpring, animated } from 'react-spring/native';
import { useTRPGSelector } from '@shared/hooks/useTRPGSelector';
import { TRPGTabScreenProps } from '@app/router';
import { switchToChatScreen } from '@app/navigate';
const NetworkContainer = styled(animated.View as any)<{
isOnline: boolean;
tryReconnect: boolean;
}>`
position: absolute;
top: -26px;
left: 0;
right: 0;
height: 26px;
background-color: ${({ isOnline, tryReconnect }) =>
isOnline ? '#2ecc71' : tryReconnect ? '#f39c12' : '#c0392b'};
color: white;
align-items: center;
justify-content: center;
`;
const NetworkText = styled.Text`
color: white;
`;
const NetworkTip: React.FC = TMemo((props) => {
const network = useTRPGSelector((state) => state.ui.network);
const style = useSpring({
to: {
top: network.isOnline ? -26 : 0,
},
});
return (
<NetworkContainer
style={style}
isOnline={network.isOnline}
tryReconnect={network.tryReconnect}
>
<NetworkText>{network.msg}</NetworkText>
</NetworkContainer>
);
});
NetworkTip.displayName = 'NetworkTip';
interface Props extends TRPGDispatchProp, TRPGTabScreenProps<'TRPG'> {
converses: any;
conversesDesc: any;
groups: any;
usercache: any;
}
class HomeScreen extends React.Component<Props> {
state = {
isRefreshing: false,
};
getList() {
if (_size(this.props.converses) > 0) {
const arr: any[] = _sortBy(
_values(this.props.converses),
(item) => new Date(item.lastTime || 0)
)
.reverse()
.map((item, index) => {
const uuid = item.uuid;
const defaultIcon =
uuid === 'trpgsystem'
? appConfig.defaultImg.trpgsystem
: appConfig.defaultImg.user;
let avatar: string;
if (item.type === 'user') {
avatar = _get(this.props.usercache, [uuid, 'avatar']);
} else if (item.type === 'group') {
const group = this.props.groups.find((g) => g.uuid === uuid);
avatar = group ? group.avatar : '';
}
return {
icon: item.icon || avatar || defaultIcon,
title: item.name,
content: item.lastMsg,
time: item.lastTime ? dateHelper.getShortDiff(item.lastTime) : '',
uuid,
unread: item.unread,
onPress: () => {
this.<API key>(uuid, item.type, item);
},
};
});
return (
<FlatList
refreshControl={
<TRefreshControl
refreshing={this.state.isRefreshing}
onRefresh={() => this.handleRefresh()}
/>
}
keyExtractor={(item, index) => item.uuid}
data={arr}
renderItem={({ item }) => <ConvItem {...item} />}
/>
);
} else {
return <Text style={styles.tipText}>{this.props.conversesDesc}</Text>;
}
}
handleRefresh() {
this.setState({ isRefreshing: true });
const timer = setTimeout(() => {
this.setState({ isRefreshing: false });
}, 10000);
this.props.dispatch(
reloadConverseList(() => {
this.setState({ isRefreshing: false });
clearTimeout(timer);
})
);
}
<API key>(uuid: string, type: ChatType, info) {
switchToChatScreen(
this.props.navigation.<API key>(),
uuid,
type,
info.name
);
}
render() {
return (
<View style={styles.container}>
{this.getList()}
<NetworkTip />
</View>
);
}
}
const styles = {
container: [sb.flex()],
tipText: [sb.textAlign('center'), sb.margin(80, 0, 0, 0), sb.color('#999')],
};
export default connect((state: TRPGState) => ({
converses: state.chat.converses,
conversesDesc: state.chat.conversesDesc,
groups: state.group.groups,
usercache: state.cache.user,
}))(HomeScreen);
|
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
public partial class <API key> {
<summary>
PollNew control.
</summary>
<remarks>
Auto-generated field.
To modify move field declaration from designer file to code-behind file.
</remarks>
protected global::<API key> PollNew;
}
|
import java.io.BufferedReader;
import java.io.<API key>;
import java.io.FileReader;
import java.io.IOException;
public class ReadSavedData
{
public static void StartRead() throws IOException
{
FileReader file = new FileReader("C:/Users/Public/Documents/SavedData.txt");
BufferedReader reader = new BufferedReader(file);
String text = "";
String line = reader.readLine();
while (line != null)
{
text += line;
line = reader.readLine();
}
reader.close();
System.out.println(text);
}
}
|
enum MessageType
{
TYPE_CHAT_MESSAGE = 2000
};
enum PropertyType
{
PR_CHAT_NICK = 3000,
PR_CHAT_TEXT
};
|
.block {
background:yellow;
/*max-height:50px;*/
border:5px;
border-color:red;
max-width:300px;
-moz-border-radius: 15px;
padding-left:5px;
padding-right:10px;
z-index:11;
}
.block:not(.block-inlist):last-of-type,.block-inlist{
<API key>: 10px;
}
.block-instack {
list-style-position:inside;
position:relative;
left:-20px;
z-index:11;
}
.stack {
list-style-type:none;
list-style-position:inside;
padding: 0;
padding-bottom:10px;
margin-left: 0;
position:absolute;
background:green;
overflow:visible;
max-height:100%;
/*max-width:500px;*/
min-width:100px;
min-height:50px;
background:green;
z-index:-1;
border-radius:5px;
}
#trash img {
max-width:100px;
max-height:100px;
position:fixed;
right:0px;
bottom:0px;
z-index:-1;
}
.createStack {
background:green;
max-height:50px;
border:5px;
max-width:300px;
}
.canvas {
min-width:100%;
min-height:100%;
top:0px;left:0px;
position:absolute;
z-index:5;
overflow:auto;
}
#objects li {
border-style:solid;
border-width:1px;
border-color:orange;
}
custom-menu {
list-style-type:none;
list-style-position:inside;
z-index:99;
background:white;
border-style:solid;
border-width:1px;
border-radius:5px;
border-color:grey;
min-width:100px;
padding-left:-5px;
margin-left:0px;
font-size:14px;
padding-right:500px;
}
custom-menu li, cmenu-item {
width:100%;
border-width:1px;
border-color:white;
border-style:solid;
border-top-color:black;
border-left-color:black;
font-size:14px;
position:relative;
left:-3px;
top:-3px;
padding:0px;
margin:0px;
padding-right:5px;
}
custom-menu li:last-child, custom-menu cmenu-item:last-child {
<API key>:5px;
<API key>:5px;
margin-bottom:-6px;
border-bottom-color:grey;
}
custom-menu li:first-child, custom-menu cmenu-item:first-child {
<API key>:5px;
<API key>:5px;
}
custom-menu li:hover, custom-menu cmenu-item:hover {
border-color:black;
border-radius:5px;
}
cmenu-item {
display:list-item;
}
.block-type-variable {
background-color:#F000FC;
}
.data {
border-radius:10px;
background-color:#00FFFF;
padding-left:5px;
}
.block-type-camera, .camera {
background-color:#FF0040;
}
#webcam-ask {
z-index: 1000;
}
#webcam-hide {
opacity:0.0;
filter:alpha(opacity=0);
}
#webcam-dialog {
background-color:#DDDDDD;
min-width:100px;
min-height:100px;
z-index:999;
}
.hide {
z-index:9999;
opacity:0;
}
#window {
x-index:9999;
opacity:1;
width:300px;
height:300px;
border-width: 1px;
border-color: black;
border-radius: 5px;
}
|
#ifndef BACKGROUND_H
#define BACKGROUND_H
#include <QImage>
#include "ffmpegvideodecoder.h"
class Background
{
public:
Background();
virtual ~Background();
// Actual draw function to implement. Should return time when the next
// doDraw() should be called - for example, for videos it should only
// be called when it is time to show the next frame; for static images
// it should not be called at all. If 0 is returned, doDraw() will be called
// again the next update. If -1 is returned, doDraw() will never be called
// again, and the cached image will be used.
virtual qint64 doDraw( QImage& image, qint64 timing ) = 0;
// This function is called if timing went backward (user seek back), in which
// case it will be called before doDraw() with a new time. Video players, for
// example, may use it to seek back to zero. Default implementation does nothing.
virtual void reset();
// Should return true if the event was created successfully
virtual bool isValid() const = 0;
};
class BackgroundImage : public Background
{
public:
BackgroundImage( const QString& filename );
bool isValid() const;
qint64 doDraw( QImage& image, qint64 timing );
private:
QImage m_image;
};
class BackgroundVideo : public Background
{
public:
BackgroundVideo( const QString& arg );
bool isValid() const;
qint64 doDraw( QImage& image, qint64 timing );
private:
FFMpegVideoDecoder m_videoDecoder;
bool m_valid;
};
#endif // BACKGROUND_H
|
#!/bin/sh
declare -x PATH_TO_SOURCE=`dirname $0`/..
cd $PATH_TO_SOURCE
bsc -e "(<API key> \"ensanche-core\" 'main)"
|
class <API key> < ActionController::Base
class ForbiddenException < StandardError; end
<API key>
before_filter :set_locale
before_filter :authenticate_user!
layout :get_layout
def set_locale
I18n.locale = params[:locale] || I18n.default_locale
end
def get_layout
if !user_signed_in?
get_layout = "logged_out"
else
get_layout = "application"
end
end
def <API key>(resource)
<API key>
end
def <API key>
unless user_signed_in? && current_user.admin?
raise <API key>::ForbiddenException
end
end
end
|
package com.uwyn.jhighlight.pcj.hash;
/**
* This interface represents hash functions from char values
* to int values. The int value result is chosen to achieve
* consistence with the common
* {@link Object#hashCode() hashCode()}
* method. The interface is provided to alter the hash functions used
* by hashing data structures, like
* {@link com.uwyn.rife.pcj.map.<API key> <API key>}
* or
* {@link com.uwyn.rife.pcj.set.CharChainedHashSet CharChainedHashSet}.
*
* @see <API key>
*
* @author Søren Bak
* @version 1.0 2002/29/12
* @since 1.0
*/
public interface CharHashFunction
{
/**
* Returns a hash code for a specified char value.
*
* @param v
* the value for which to return a hash code.
*
* @return a hash code for the specified value.
*/
int hash(char v);
}
|
using System;
using System.Diagnostics;
using System.Text;
using System.Windows.Forms;
using OpenDentBusiness;
namespace OpenDental.Eclaims
{
<summary>
Summary description for BCBSGA.
</summary>
public class BCBSGA{
<summary></summary>
public static string ErrorMessage="";
public BCBSGA()
{
}
<summary>Returns true if the communications were successful, and false if they failed. If they failed, a rollback will happen automatically by deleting the previously created X12 file. The batchnum is supplied for the possible rollback.</summary>
public static bool Launch(Clearinghouse clearinghouseClin,int batchNum){ //called from Eclaims.cs. Clinic-level clearinghouse passed in.
bool retVal=true;
FormTerminal FormT=new FormTerminal();
try{
FormT.Show();
FormT.OpenConnection(clearinghouseClin.ModemPort);
//1. Dial
FormT.Dial("17065713158");
//2. Wait for connect, then pause 3 seconds
FormT.WaitFor("CONNECT 9600",50000);
FormT.Pause(3000);
FormT.ClearRxBuff();
//3. Send Submitter login record
string submitterLogin=
//position,length indicated for each
"/SLRON"//1,6 /SLRON=Submitter login
+FormT.Sout(clearinghouseClin.LoginID,12,12)//7,12 Submitter ID
+FormT.Sout(clearinghouseClin.Password,8,8)//19,8 submitter password
+"NAT"//27,3 use NAT
//30,8 suggested 8-BYTE CRC of the file for unique ID. No spaces.
//But I used the batch number instead
+batchNum.ToString().PadLeft(8,'0')
+"ANSI837D 1 "//38,15 "ANSI837D 1 "=Dental claims
+"X"//53,1 X=Xmodem, or Y for transmission protocol
+"ANSI"//54,4 use ANSI
+"BCS"//58,3 BCS=BlueCrossBlueShield
+"00";//61,2 use 00 for filler
FormT.Send(submitterLogin);
//4. Receive Y, indicating login accepted
if(FormT.WaitFor("Y","N",20000)=="Y"){
//5. Wait 1 second.
FormT.Pause(1000);
}
else{
//6. If login rejected, receive an N,
//followed by Transmission acknowledgement explaining
throw new Exception(FormT.Receive(5000));
}
//7. Send file using X-modem or Z-modem
//slash not handled properly if missing:
FormT.UploadXmodem(clearinghouseClin.ExportPath+"claims"+batchNum.ToString()+".txt");
//8. After transmitting, pause for 1 second.
FormT.Pause(1000);
FormT.ClearRxBuff();
//9. Send submitter logout record
string submitterLogout=
"/SLROFF"//1,7 /SLROFF=Submitter logout
+FormT.Sout(clearinghouseClin.LoginID,12,12)//8,12 Submitter ID
+batchNum.ToString().PadLeft(8,'0')//20,8 matches field in submitter Login
+"!"//28,1 use ! to retrieve transmission acknowledgement record
+"\r\n";
FormT.Send(submitterLogout);
//10. Prepare to receive the Transmission acknowledgement. This is a receipt.
FormT.Receive(5000);//this is displayed in the progress box so user can see.
}
catch(Exception ex){
ErrorMessage=ex.Message;
x837Controller.Rollback(clearinghouseClin,batchNum);
retVal=false;
}
finally{
FormT.CloseConnection();
}
return retVal;
}
<summary>Retrieves any waiting reports from this clearinghouse. Returns true if the communications were successful, and false if they failed.</summary>
public static bool Retrieve(Clearinghouse clearinghouseClin) { //Called from FormClaimReports. Clinic-level Clearinghouse passed in.
bool retVal=true;
FormTerminal FormT=new FormTerminal();
try{
FormT.Show();
FormT.OpenConnection(clearinghouseClin.ModemPort);
FormT.Dial("17065713158");
//2. Wait for connect, then pause 3 seconds
FormT.WaitFor("CONNECT 9600",50000);
FormT.Pause(3000);
FormT.ClearRxBuff();
//1. Send submitter login record
string submitterLogin=
"/SLRON"//1,6 /SLRON=Submitter login
+FormT.Sout(clearinghouseClin.LoginID,12,12)//7,12 Submitter ID
+FormT.Sout(clearinghouseClin.Password,8,8)//19,8 submitter password
+" "//27,3 use 3 spaces
//Possible issue with Trans ID
+"12345678"//30,8. they did not explain this field very well in documentation
+"* "//38,15 " * "=All available. spacing ok?
+"X"//53,1 X=Xmodem, or Y for transmission protocol
+"MDD "//54,4 use 'MDD '
+"VND"//58,3 Vendor ID is yet to be assigned by BCBS
+"00";//61,2 Software version not important
byte response=(byte)'Y';
string retrieveFile="";
while(response==(byte)'Y'){
FormT.ClearRxBuff();
FormT.Send(submitterLogin);
response=0;
while(response!=(byte)'N'
&& response!=(byte)'Y'
&& response!=(byte)'Z')
{
response=FormT.GetOneByte(20000);
FormT.ClearRxBuff();
Application.DoEvents();
}
//2. If not accepted, N is returned
//3. and must receive transmission acknowledgement
if(response==(byte)'N'){
MessageBox.Show(FormT.Receive(10000));
break;
}
//4. If login accepted, but no records, Z is returned. Hang up.
if(response==(byte)'Z'){
MessageBox.Show("No reports to retrieve");
break;
}
//5. If record(s) available, Y is returned, followed by dos filename and 32 char subj.
//less than one second since all text is supposed to immediately follow the Y
retrieveFile=FormT.Receive(800).Substring(0,12);//12 char in dos filename
FormT.ClearRxBuff();
//6. Pause for 1 second. (already mostly handled);
FormT.Pause(200);
//7. Receive file using Xmodem
//path must include trailing slash for now.
FormT.DownloadXmodem(clearinghouseClin.ResponsePath+retrieveFile);
//8. Pause for 5 seconds.
FormT.Pause(5000);
//9. Repeat all steps including login until a Z is returned.
}
}
catch(Exception ex){
ErrorMessage=ex.Message;
//FormT.Close();//Also closes connection
retVal=false;
}
finally{
FormT.CloseConnection();
}
return retVal;
}
}
}
|
#include "inventorypage.h"
#include "ui_inventorypage.h"
#include "fak.h"
#include "inventorypage.h"
#include <QtDebug>
#include "QtDebug"
#include <QSqlQuery>
#include <QSqlError>
#include <QSqlRecord>
static const QString path = "C:/Sr.GUI/FAKKIT/db/fakdb4.db";
InventoryPage::InventoryPage(QWidget *parent) :
QDialog(parent),
ui(new Ui::InventoryPage)
{
ui->setupUi(this);
this->setStyleSheet("background-color:#626065;");
DbManager db(path);
qDebug() << "Stuff in db:";
QSqlQuery query;
query.exec("SELECT * FROM codes");
int idName = query.record().indexOf("name");
while (query.next())
{
QString name = query.value(idName).toString();
qDebug() << "===" << name;
//ui->dbOutput->setPlainText(name);
ui->dbOutput->append(name);
}
}
DbManager::DbManager(const QString &path)
{
m_db = QSqlDatabase::addDatabase("QSQLITE");
m_db.setDatabaseName(path);
if (!m_db.open())
{
qDebug() << "Error: connection with database fail";
}
else
{
qDebug() << "Database: connection ok";
}
}
InventoryPage::~InventoryPage()
{
delete ui;
}
void InventoryPage::<API key>()
{
}
|
var gulp = require('gulp');
var browserSync = require('browser-sync');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
gulp.task('browser-sync', function() {
browserSync.init({
|
#ifndef __CLOCK_ROM_H__
#define __CLOCK_ROM_H__
#define ROM_ALARM0_DAY_MASK 0
#define ROM_ALARM0_HOUR 1
#define ROM_ALARM0_MIN 2
#define ROM_ALARM0_DUR 3
#define ROM_ALARM1_ENABLE 4
#define ROM_TIME_IS12 10
#define <API key> 11
#define ROM_BEEPER_ENABLE 12
#define ROM_POWERSAVE_TO 13
#define ROM_REMOTE_ONOFF 14
#define <API key> 15
#define ROM_FUSE_HG_ONOFF 20
#define ROM_FUSE_MPU 21
#define ROM_FUSE_THERMO_HI 22
#define ROM_FUSE_THERMO_LO 23
#define <API key> 24
#define ROM_FUSE_PASSWORD 25
// 6password
#define ROM_LT_TIMER_YEAR 40
#define ROM_LT_TIMER_MONTH 41
#define ROM_LT_TIMER_DATE 42
#define ROM_LT_TIMER_HOUR 43
#define ROM_LT_TIMER_MIN 44
#define ROM_LT_TIMER_SEC 45
#define ROM_RADIO_FREQ_HI 50
#define ROM_RADIO_FREQ_LO 51
#define ROM_RADIO_VOLUME 52
#define ROM_RADIO_HLSI 53
#define ROM_RADIO_MS 54
#define ROM_RADIO_BL 55
#define ROM_RADIO_HCC 56
#define ROM_RADIO_SNC 57
#define ROM_RADIO_DTC 58
unsigned char rom_read(unsigned char addr);
void rom_write(unsigned char addr, unsigned char val);
void rom_initialize(void);
bit <API key>(void);
#endif
|
#ifndef SERIALTASK_H_
#define SERIALTASK_H_
#include "TemplateNamedTask.h"
#include <vector>
namespace Ember
{
namespace Tasks
{
/**
* @author Erik Hjortsberg <erik.hjortsberg@gmail.com>
* @brief A task which wraps two or more other tasks, which will be executed in order.
* This is useful if you want to make sure that a certain task is executed after another task.
*/
class SerialTask: public TemplateNamedTask<SerialTask>
{
public:
typedef std::vector<ITask*> TaskStore;
/**
* @brief Ctor.
* @param subTasks The tasks to execute, in order.
*/
SerialTask(const TaskStore& subTasks);
/**
* @brief Ctor.
* This is a convenience constructor which allows you to specify the tasks directly without having to first create a vector instance.
* @param firstTask The first task to execute.
* @param secondTask The second task to execute.
* @param thirdTask The third task to execute.
* @param firstTask The fourth task to execute.
*/
SerialTask(ITask* firstTask, ITask* secondTask, ITask* thirdTask = 0, ITask* fourthTask = 0);
virtual ~SerialTask();
virtual void <API key>(<API key>& context);
private:
TaskStore mSubTasks;
};
}
}
#endif /* SERIALTASK_H_ */
|
\hypertarget{_coloring_8java}{}\doxysection{src/ch/innovazion/arionide/menu/structure/\+Coloring.java File Reference}
\label{_coloring_8java}\index{src/ch/innovazion/arionide/menu/structure/Coloring.java@{src/ch/innovazion/arionide/menu/structure/Coloring.java}}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item
class \mbox{\hyperlink{<API key>}{ch.\+innovazion.\+arionide.\+menu.\+structure.\+Coloring}}
\end{DoxyCompactItemize}
\doxysubsection*{Packages}
\begin{DoxyCompactItemize}
\item
package \mbox{\hyperlink{<API key>}{ch.\+innovazion.\+arionide.\+menu.\+structure}}
\end{DoxyCompactItemize}
|
/* Source Of Evil Engine */
/* Dynamic object list */
class C4ObjectLink
{
public:
C4Object *Obj;
C4ObjectLink *Prev,*Next;
};
class C4ObjectList
{
public:
C4ObjectList();
~C4ObjectList();
public:
C4ObjectLink *First,*Last;
int Mass;
char *szEnumerated;
public:
void SortByCategory();
void Default();
void Clear();
void Sort();
void Enumerate();
void Denumerate();
void Copy(C4ObjectList &rList);
void Draw(C4FacetEx &cgo);
void DrawList(C4Facet &cgo, int iSelection=-1, DWORD dwCategory=C4D_All);
void DrawIDList(C4Facet &cgo, int iSelection, C4DefList &rDefs, DWORD dwCategory, C4RegionList *pRegions=NULL, int iRegionCom=COM_None, BOOL fDrawOneCounts=TRUE);
void DrawSelectMark(C4FacetEx &cgo);
void CloseMenus();
void UpdateFaces();
void SyncClearance();
void ResetAudibility();
void UpdateTransferZones();
void SetOCF();
void GetIDList(C4IDList &rList, DWORD dwCategory=C4D_All);
void ClearInfo(C4ObjectInfo *pInfo);
void PutSolidMasks();
void RemoveSolidMasks(BOOL fCauseInstability=TRUE);
BOOL Add(C4Object *nObj, BOOL fSorted=TRUE);
BOOL Remove(C4Object *pObj);
BOOL Save(const char *szFilename, BOOL fSaveGame);
BOOL Save(C4Group &hGroup, BOOL fSaveGame);
BOOL AssignInfo();
BOOL ValidateOwners();
BOOL WriteNameList(char *szTarget, C4DefList &rDefs, DWORD dwCategory=C4D_All);
BOOL IsClear();
BOOL ReadEnumerated(const char *szSource);
BOOL DenumerateRead();
BOOL Write(char *szTarget);
int Load(C4Group &hGroup);
int ObjectNumber(C4Object *pObj);
int ClearPointers(C4Object *pObj);
int ObjectCount(C4ID id=C4ID_None, DWORD dwCategory=C4D_All);
int MassCount();
int ListIDCount(DWORD dwCategory);
C4Object* Denumerated(C4Object *pObj);
C4Object* Enumerated(C4Object *pObj);
C4Object* ObjectPointer(int iNumber);
C4Object* GetObject(int Index=0);
C4Object* Find(C4ID id, int iOwner=ANY_OWNER);
C4Object* FindOther(C4ID id, int iOwner=ANY_OWNER);
C4ObjectLink* GetLink(C4Object *pObj);
C4ID GetListID(DWORD dwCategory, int Index);
protected:
void InsertLink(C4ObjectLink *pLink, C4ObjectLink *pAfter);
void RemoveLink(C4ObjectLink *pLnk);
};
|
using UnityEngine;
using System.Collections;
public class TimeScaleManager : MonoBehaviour {
public static TimeScaleManager instance;
public delegate void <API key>();
public event <API key> TimeScaleChange;
public bool isPlaying;
public bool IsPaused {
get { return !isPlaying; }
}
public enum TimeScale{
ONE, TWO, THREE
}
public TimeScale timeScale;
void Awake(){
instance = this;
timeScale = TimeScale.ONE;
Time.timeScale = 0f;
isPlaying = false;
}
public void SelectNextTimeScale(){
switch(timeScale){
case TimeScale.ONE:
timeScale = TimeScale.TWO;
if (isPlaying) {
Time.timeScale = 2f;
}
if (TimeScaleChange != null){
TimeScaleChange();
}
break;
case TimeScale.TWO:
timeScale = TimeScale.THREE;
if (isPlaying) {
Time.timeScale = 3f;
}
if (TimeScaleChange != null){
TimeScaleChange();
}
break;
case TimeScale.THREE:
timeScale = TimeScale.ONE;
if (isPlaying) {
Time.timeScale = 1f;
}
if (TimeScaleChange != null){
TimeScaleChange();
}
break;
}
}
public string <API key>(){
switch(timeScale){
case TimeScale.ONE:
return "1";
case TimeScale.TWO:
return "2";
case TimeScale.THREE:
return "3";
default:
return "error";
}
}
}
|
#ifndef __ASSIGN_SPRITES_H
#define __ASSIGN_SPRITES_H
void AssignSprites(void);
#endif
|
# Dockerfile "Big"
Intended for a big webapplications which expects the following tools:
- texlive (pdflatex)
|
package org.amse.marinaSokol.model.interfaces.object.net;
public interface IActivationFunctor {
double getFunction(double x);
double getDerivation(double x);
String getNameFunction();
}
|
/*
<API key>: 2007 Jean-Baptiste Mardelle <jb@kdenlive.org>
<API key>: GPL-3.0-only OR <API key>
*/
#include "definitions.h"
#include <klocalizedstring.h>
#include <QColor>
#include <utility>
#ifdef CRASH_AUTO_TEST
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wfloat-equal"
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wpedantic"
#include <rttr/registration>
#pragma GCC diagnostic pop
RTTR_REGISTRATION
{
using namespace rttr;
// clang-format off
registration::enumeration<GroupType>("GroupType")(
value("Normal", GroupType::Normal),
value("Selection", GroupType::Selection),
value("AVSplit", GroupType::AVSplit),
value("Leaf", GroupType::Leaf)
);
registration::enumeration<PlaylistState::ClipState>("PlaylistState")(
value("VideoOnly", PlaylistState::VideoOnly),
value("AudioOnly", PlaylistState::AudioOnly),
value("Disabled", PlaylistState::Disabled)
);
// clang-format on
}
#endif
QDebug operator<<(QDebug qd, const ItemInfo &info)
{
qd << "ItemInfo " << &info;
qd << "\tTrack" << info.track;
qd << "\tStart pos: " << info.startPos.toString();
qd << "\tEnd pos: " << info.endPos.toString();
qd << "\tCrop start: " << info.cropStart.toString();
qd << "\tCrop duration: " << info.cropDuration.toString();
return qd.maybeSpace();
}
CommentedTime::CommentedTime()
: m_time(GenTime(0))
{
}
CommentedTime::CommentedTime(const GenTime &time, QString comment, int markerType)
: m_time(time)
, m_comment(std::move(comment))
, m_type(markerType)
{
}
CommentedTime::CommentedTime(const QString &hash, const GenTime &time)
: m_time(time)
, m_comment(hash.section(QLatin1Char(':'), 1))
, m_type(hash.section(QLatin1Char(':'), 0, 0).toInt())
{
}
QString CommentedTime::comment() const
{
return (m_comment.isEmpty() ? i18n("Marker") : m_comment);
}
GenTime CommentedTime::time() const
{
return m_time;
}
void CommentedTime::setComment(const QString &comm)
{
m_comment = comm;
}
void CommentedTime::setTime(const GenTime &t)
{
m_time = t;
}
void CommentedTime::setMarkerType(int newtype)
{
m_type = newtype;
}
QString CommentedTime::hash() const
{
return QString::number(m_type) + QLatin1Char(':') + (m_comment.isEmpty() ? i18n("Marker") : m_comment);
}
int CommentedTime::markerType() const
{
return m_type;
}
bool CommentedTime::operator>(const CommentedTime &op) const
{
return m_time > op.time();
}
bool CommentedTime::operator<(const CommentedTime &op) const
{
return m_time < op.time();
}
bool CommentedTime::operator>=(const CommentedTime &op) const
{
return m_time >= op.time();
}
bool CommentedTime::operator<=(const CommentedTime &op) const
{
return m_time <= op.time();
}
bool CommentedTime::operator==(const CommentedTime &op) const
{
return m_time == op.time();
}
bool CommentedTime::operator!=(const CommentedTime &op) const
{
return m_time != op.time();
}
const QString groupTypeToStr(GroupType t)
{
switch (t) {
case GroupType::Normal:
return QStringLiteral("Normal");
case GroupType::Selection:
return QStringLiteral("Selection");
case GroupType::AVSplit:
return QStringLiteral("AVSplit");
case GroupType::Leaf:
return QStringLiteral("Leaf");
}
Q_ASSERT(false);
return QString();
}
GroupType groupTypeFromStr(const QString &s)
{
std::vector<GroupType> types{GroupType::Selection, GroupType::Normal, GroupType::AVSplit, GroupType::Leaf};
for (const auto &t : types) {
if (s == groupTypeToStr(t)) {
return t;
}
}
Q_ASSERT(false);
return GroupType::Normal;
}
std::pair<bool, bool> stateToBool(PlaylistState::ClipState state)
{
return {state == PlaylistState::VideoOnly, state == PlaylistState::AudioOnly};
}
PlaylistState::ClipState stateFromBool(std::pair<bool, bool> av)
{
Q_ASSERT(!av.first || !av.second);
if (av.first) {
return PlaylistState::VideoOnly;
} else if (av.second) {
return PlaylistState::AudioOnly;
} else {
return PlaylistState::Disabled;
}
}
SubtitledTime::SubtitledTime()
: m_starttime(0)
, m_endtime(0)
{
}
SubtitledTime::SubtitledTime(const GenTime &start, QString sub, const GenTime &end)
: m_starttime(start)
, m_subtitle(std::move(sub))
, m_endtime(end)
{
}
QString SubtitledTime::subtitle() const
{
return m_subtitle;
}
GenTime SubtitledTime::start() const
{
return m_starttime;
}
GenTime SubtitledTime::end() const
{
return m_endtime;
}
void SubtitledTime::setSubtitle(const QString& sub)
{
m_subtitle = sub;
}
void SubtitledTime::setEndTime(const GenTime& end)
{
m_endtime = end;
}
bool SubtitledTime::operator>(const SubtitledTime& op) const
{
return(m_starttime > op.m_starttime && m_endtime > op.m_endtime && m_starttime > op.m_endtime);
}
bool SubtitledTime::operator<(const SubtitledTime& op) const
{
return(m_starttime < op.m_starttime && m_endtime < op.m_endtime && m_endtime < op.m_starttime);
}
bool SubtitledTime::operator==(const SubtitledTime& op) const
{
return(m_starttime == op.m_starttime && m_endtime == op.m_endtime);
}
bool SubtitledTime::operator!=(const SubtitledTime& op) const
{
return(m_starttime != op.m_starttime && m_endtime != op.m_endtime);
}
|
// THE ABOVE NOTICE MUST REMAIN INTACT.
using System;
using <API key>;
using <API key>.<API key>;
namespace <API key>
{
<summary>
Summary description for tableorder_process.
</summary>
public partial class tableorder_process : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
Response.CacheControl = "private";
Response.Expires = 0;
Response.AddHeader("pragma", "no-cache");
Customer ThisCustomer = ((<API key>)Context.User).ThisCustomer;
ThisCustomer.<API key>();
<API key> cart = new <API key>(null, 1, ThisCustomer, CartTypeEnum.ShoppingCart, String.Empty, false,true);
bool redirectToWishList = false;
foreach (string key in Request.Form.AllKeys)
{
try
{
if (!key.StartsWith("ProductID")) { continue; }
// retrieve the item counter
// This may look obvious 4 but we want to make it expressive
string itemCounterValue = Request.Form[key];
string <API key> = Request.Form["Quantity"];
if (string.IsNullOrEmpty(<API key>))
{
<API key> = Request.Form["Quantity_" + itemCounterValue];
if (!string.IsNullOrEmpty(<API key>))
{
<API key> = <API key>.Split(',')[0];
}
}
int counter = 0;
int quantityOrdered = 0;
if (!string.IsNullOrEmpty(itemCounterValue) &&
int.TryParse(itemCounterValue, out counter) &&
!string.IsNullOrEmpty(<API key>) &&
int.TryParse(<API key>, out quantityOrdered) &&
quantityOrdered > 0)
{
string unitMeasureFieldKey = "UnitMeasureCode_" + counter.ToString();
bool <API key> = string.IsNullOrEmpty(Request.Form[unitMeasureFieldKey]);
string isWishListFieldKey = "IsWishList_" + counter.ToString();
bool isWishList = !string.IsNullOrEmpty(Request.Form[isWishListFieldKey]);
redirectToWishList = isWishList;
// we've got a valid counter
string itemCode = string.Empty;
using (var con = DB.NewSqlConnection())
{
con.Open();
using (var reader = DB.GetRSFormat(con, "SELECT ItemCode FROM InventoryItem with (NOLOCK) WHERE Counter = {0}", counter))
{
if (reader.Read())
{
itemCode = DB.RSField(reader, "ItemCode");
}
}
}
if(!string.IsNullOrEmpty(itemCode))
{
UnitMeasureInfo? umInfo = null;
if(!<API key>)
{
umInfo = InterpriseHelper.GetItemUnitMeasure(itemCode, Request.Form[unitMeasureFieldKey]);
}
if(null == umInfo && <API key>)
{
umInfo = InterpriseHelper.<API key>(itemCode);
}
if (null != umInfo && umInfo.HasValue)
{
if (isWishList)
{
cart.CartType = CartTypeEnum.WishCart;
}
cart.AddItem(ThisCustomer, ThisCustomer.<API key>, itemCode, counter, quantityOrdered, umInfo.Value.Code, CartTypeEnum.ShoppingCart); //, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, CartTypeEnum.ShoppingCart, false, false, string.Empty, decimal.Zero);
}
}
}
}
catch
{
// do nothing, add the items that we can
}
}
if (redirectToWishList)
{
Response.Redirect("WishList.aspx");
}
else
{
Response.Redirect("ShoppingCart.aspx?add=true");
}
}
}
}
|
package net.sareweb.emg.service;
import com.liferay.portal.kernel.bean.<API key>;
import com.liferay.portal.kernel.util.ReferenceRegistry;
import com.liferay.portal.service.InvokableService;
/**
* Provides the remote service utility for Draw. This utility wraps
* {@link net.sareweb.emg.service.impl.DrawServiceImpl} and is the
* primary access point for service operations in application layer code running
* on a remote server. Methods of this service are expected to have security
* checks based on the propagated JAAS credentials because this service can be
* accessed remotely.
*
* @author A.Galdos
* @see DrawService
* @see net.sareweb.emg.service.base.DrawServiceBaseImpl
* @see net.sareweb.emg.service.impl.DrawServiceImpl
* @generated
*/
public class DrawServiceUtil {
/*
* NOTE FOR DEVELOPERS:
*
* Never modify this class directly. Add custom service methods to {@link net.sareweb.emg.service.impl.DrawServiceImpl} and rerun ServiceBuilder to regenerate this class.
*/
/**
* Returns the Spring bean ID for this bean.
*
* @return the Spring bean ID for this bean
*/
public static java.lang.String getBeanIdentifier() {
return getService().getBeanIdentifier();
}
/**
* Sets the Spring bean ID for this bean.
*
* @param beanIdentifier the Spring bean ID for this bean
*/
public static void setBeanIdentifier(java.lang.String beanIdentifier) {
getService().setBeanIdentifier(beanIdentifier);
}
public static java.lang.Object invokeMethod(java.lang.String name,
java.lang.String[] parameterTypes, java.lang.Object[] arguments)
throws java.lang.Throwable {
return getService().invokeMethod(name, parameterTypes, arguments);
}
public static java.util.List<net.sareweb.emg.model.Draw> <API key>(
long date) throws com.liferay.portal.kernel.exception.SystemException {
return getService().<API key>(date);
}
public static void clearService() {
_service = null;
}
public static DrawService getService() {
if (_service == null) {
InvokableService invokableService = (InvokableService)<API key>.locate(ClpSerializer.<API key>(),
DrawService.class.getName());
if (invokableService instanceof DrawService) {
_service = (DrawService)invokableService;
}
else {
_service = new DrawServiceClp(invokableService);
}
ReferenceRegistry.registerReference(DrawServiceUtil.class,
"_service");
}
return _service;
}
/**
* @deprecated As of 6.2.0
*/
public void setService(DrawService service) {
}
private static DrawService _service;
}
|
#define ICON_SIZE QSize(48,48)
#define EXPANDED_HEIGHT 413
#define UNEXPANDED_HEIGHT 137
#include "mainpage.h"
#include "ui_options.h"
#include <QWidget>
#include <QComboBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QGroupBox>
#include <QCheckBox>
#include <QLineEdit>
#include <QMimeData>
#include <QLabel>
#include <QToolBar>
#include <QAction>
#include <QToolButton>
#include <QFileDialog>
#include <QUrl>
#include <SMasterIcons>
#include <SDeviceList>
#include <SComboBox>
#include <SDialogTools>
class MainPagePrivate
{
public:
QVBoxLayout *layout;
QHBoxLayout *image_layout;
QToolButton *open_btn;
QLineEdit *src_line;
SComboBox *dst_combo;
QLabel *label;
QToolBar *toolbar;
QAction *go_action;
QAction *more_action;
SDeviceList *device_list;
Ui::OptionsUi *options_ui;
QWidget *options_widget;
QList<SDeviceItem> devices;
};
MainPage::MainPage( SApplication *parent )
: SPage( tr("Image Burner") , parent , SPage::WindowedPage )
{
p = new MainPagePrivate;
p->device_list = new SDeviceList( this );
p->src_line = new QLineEdit();
p->src_line->setReadOnly( true );
p->src_line->setFixedHeight( 28 );
p->src_line->setPlaceholderText( tr("Please select a Disc Image") );
p->src_line->setFocusPolicy( Qt::NoFocus );
p->open_btn = new QToolButton();
p->open_btn->setIcon( SMasterIcons::icon( ICON_SIZE , "document-open.png" ) );
p->open_btn->setFixedSize( 28 , 28 );
p->image_layout = new QHBoxLayout();
p->image_layout->addWidget( p->src_line );
p->image_layout->addWidget( p->open_btn );
p->dst_combo = new SComboBox();
p->dst_combo->setIconSize( QSize(22,22) );
p->label = new QLabel();
p->label->setText( tr("To") );
p->toolbar = new QToolBar();
p->toolbar->setToolButtonStyle( Qt::<API key> );
p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" );
p->options_widget = new QWidget();
p->options_ui = new Ui::OptionsUi;
p->options_ui->setupUi( p->options_widget );
p->layout = new QVBoxLayout( this );
p->layout->addLayout( p->image_layout );
p->layout->addWidget( p->label );
p->layout->addWidget( p->dst_combo );
p->layout->addWidget( p->options_widget );
p->layout->addWidget( p->toolbar );
p->layout->setContentsMargins( 10 , 10 , 10 , 10 );
setFixedWidth( 413 );
setFixedHeight( EXPANDED_HEIGHT );
p->dst_combo->setCurrentIndex( 0 );
connect( p->device_list , SIGNAL(deviceDetected(SDeviceItem)) , SLOT(deviceDetected(SDeviceItem)) );
connect( p->open_btn , SIGNAL(clicked()) , SLOT(select_src_image()) );
connect( p->dst_combo , SIGNAL(currentIndexChanged(int)) , SLOT(<API key>(int)) );
connect( p->options_ui->scan_check , SIGNAL(toggled(bool)) , p->options_ui->scan_widget , SLOT(setVisible(bool)) );
p->options_ui->scan_check->setChecked( false );
p->device_list->refresh();
init_actions();
more_prev();
setAcceptDrops( true );
}
void MainPage::init_actions()
{
QWidget *spr1 = new QWidget();
spr1->setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Minimum );
p->go_action = new QAction( SMasterIcons::icon(ICON_SIZE,"<API key>.png") , tr("Go") , this );
p->more_action = new QAction( SMasterIcons::icon(ICON_SIZE,"edit-rename.png") , tr("More") , this );
p->toolbar->addAction( p->more_action );
p->toolbar->addWidget( spr1 );
p->toolbar->addAction( p->go_action );
connect( p->go_action , SIGNAL(triggered()) , SLOT(go_prev()) );
connect( p->more_action , SIGNAL(triggered()) , SLOT(more_prev()) );
}
void MainPage::deviceDetected( const SDeviceItem & device )
{
if( !p->devices.contains(device) )
{
p->devices << device;
p->dst_combo->insertItem( p->devices.count()-1 , SMasterIcons::icon(ICON_SIZE,"drive-optical.png") , device.name() );
}
else
{
int index = p->devices.indexOf( device );
p->devices.removeAt( index );
p->devices.insert( index , device );
p->dst_combo->setItemText( index , device.name() );
<API key>( p->dst_combo->currentIndex() );
}
}
void MainPage::<API key>( int index )
{
if( index < 0 )
return ;
const SDeviceItem & device = p->devices.at( index );
const SDiscFeatures & disc = device.currentDiscFeatures();
QList<int> list;
if( disc.<API key>.contains("blu",Qt::CaseInsensitive) )
list = device.deviceFeatures().bluray_speed_list;
else if( disc.<API key>.contains("dvd",Qt::CaseInsensitive) )
list = device.deviceFeatures().dvd_speed_list;
else
list = device.deviceFeatures().cd_speed_list;
if( list.isEmpty() )
list << 2 << 1;
p->options_ui->speed_combo->clear();
for( int i=0 ; i<list.count() ; i++ )
p->options_ui->speed_combo->addItem( QString::number(list.at(i)) );
}
QString MainPage::sourceImage() const
{
return p->src_line->text();
}
const SDeviceItem & MainPage::destinationDevice() const
{
return p->devices.at( p->dst_combo->currentIndex() );
}
void MainPage::go_prev()
{
SDialogTools::getTimer( this , tr("Your Request will be starting after count down.") , 7000 , this , SIGNAL(go()) );
}
void MainPage::more_prev()
{
if( height() == UNEXPANDED_HEIGHT )
{
setFixedHeight( EXPANDED_HEIGHT );
p->options_widget->show();
p->more_action->setText( tr("Less") );
}
else
{
setFixedHeight( UNEXPANDED_HEIGHT );
p->options_widget->hide();
p->more_action->setText( tr("More") );
}
setDefaultOptions();
}
void MainPage::setDefaultOptions()
{
int index = p->dst_combo->currentIndex();
if( index < 0 )
return ;
const SDeviceItem & device = p->devices.at(index);
const SDiscFeatures & disc = device.currentDiscFeatures();
p->options_ui->scan_line->setText( disc.volume_label_str );
}
bool MainPage::scan() const
{
return p->options_ui->scan_check->isChecked();
}
int MainPage::copiesNumber() const
{
return p->options_ui->copies_spin->value();
}
int MainPage::speed() const
{
return p->options_ui->speed_combo->currentText().toInt();
}
bool MainPage::eject() const
{
return p->options_ui->eject_check->isChecked();
}
bool MainPage::dummy() const
{
return p->options_ui->dummy_check->isChecked();
}
bool MainPage::remove() const
{
return p->options_ui->remove_check->isChecked();
}
QString MainPage::scanName() const
{
return p->options_ui->scan_line->text();
}
void MainPage::setSourceImage( const QString & file )
{
p->src_line->setText( file );
}
void MainPage::select_src_image()
{
SDialogTools::getOpenFileName( this , this , SLOT(setSourceImage(QString)) );
}
void MainPage::<API key>( const QString & bus_len_id )
{
for( int i=0 ; i<p->devices.count() ; i++ )
if( p->devices.at(i).toQString() == bus_len_id )
{
p->dst_combo->setCurrentIndex( i );
return ;
}
}
void MainPage::setScan( const QString & str )
{
p->options_ui->scan_check->setChecked( !str.isEmpty() );
p->options_ui->scan_line->setText( str );
}
void MainPage::setCopiesNumber( int value )
{
p->options_ui->copies_spin->setValue( value );
}
void MainPage::setSpeed( int speed )
{
p->options_ui->speed_combo->setEditText( QString::number(speed) );
}
void MainPage::setEject( bool stt )
{
p->options_ui->eject_check->setChecked( stt );
}
void MainPage::setDummy( bool stt )
{
p->options_ui->dummy_check->setChecked( stt );
}
void MainPage::setRemove( bool stt )
{
p->options_ui->remove_check->setChecked( stt );
}
void MainPage::dropEvent( QDropEvent *event )
{
QList<QUrl> list = event->mimeData()->urls();
QString url_path = list.first().path();
#ifdef Q_OS_WIN32
if( url_path[0] == '/' )
url_path.remove( 0 , 1 );
#endif
setSourceImage( url_path );
event-><API key>();
QWidget::dropEvent( event );
}
void MainPage::dragEnterEvent( QDragEnterEvent *event )
{
if( !event->mimeData()->hasUrls() )
return;
QList<QUrl> list = event->mimeData()->urls();
if( list.count() != 1 )
event->ignore();
else
event-><API key>();
QWidget::dragEnterEvent( event );
}
MainPage::~MainPage()
{
delete p->options_ui;
delete p;
}
|
# Makefile.in generated by automake 1.13.2 from Makefile.am.
# monte/Makefile. Generated from Makefile.in by configure.
# This Makefile.in is free software; the Free Software Foundation
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# PARTICULAR PURPOSE.
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
<API key> = \
case $${target_option-} in \
?) ;; \
*) echo "<API key>: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(<API key>))
am__make_keepgoing = (target_option=k; $(<API key>))
pkgdatadir = $(datadir)/gsl
pkgincludedir = $(includedir)/gsl
pkglibdir = $(libdir)/gsl
pkglibexecdir = $(libexecdir)/gsl
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(<API key>)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = <API key>
host_triplet = <API key>
check_PROGRAMS = test$(EXEEXT)
subdir = monte
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp \
$(noinst_HEADERS) $(pkginclude_HEADERS) \
$(top_srcdir)/test-driver ChangeLog README TODO
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(<API key>) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
<API key> =
LTLIBRARIES = $(noinst_LTLIBRARIES)
<API key> =
<API key> = miser.lo plain.lo vegas.lo
<API key> = $(<API key>)
AM_V_lt = $(am__v_lt_$(V))
am__v_lt_ = $(am__v_lt_$(<API key>))
am__v_lt_0 = --silent
am__v_lt_1 =
am_test_OBJECTS = test.$(OBJEXT)
test_OBJECTS = $(am_test_OBJECTS)
test_DEPENDENCIES = libgslmonte.la ../rng/libgslrng.la \
../ieee-utils/libgslieeeutils.la ../err/libgslerr.la \
../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(<API key>))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(<API key>))
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(<API key>))
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I. -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_$(V))
am__v_CC_ = $(am__v_CC_$(<API key>))
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_$(V))
am__v_CCLD_ = $(am__v_CCLD_$(<API key>))
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(<API key>) $(test_SOURCES)
DIST_SOURCES = $(<API key>) $(test_SOURCES)
<API key> = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
<API key> = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(<API key>); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
<API key> = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
<API key> = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
<API key> = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
am__tty_colors = { \
$(<API key>); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
am__color_tests=no; \
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
am__color_tests=yes; \
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
am__color_tests=yes; \
fi; \
if test $$am__color_tests = yes; then \
red='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
fi; \
}
am__recheck_rx = ^[ ]*:recheck:[ ]*
<API key> = ^[ ]*:global-test-result:[ ]*
<API key> = ^[ ]*:copy-in-global-log:[ ]*
# A command that, given a newline-separated list of test names on the
# standard input, print the name of the tests that are to be re-run
# upon "make recheck".
<API key> = $(AWK) '{ \
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
break; \
} \
}; \
if (recheck) \
print $$0; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# A command that, given a newline-separated list of test names on the
# standard input, create the global log from their .trs and .log files.
<API key> = $(AWK) ' \
function fatal(msg) \
{ \
print "fatal: making $@: " msg | "cat >&2"; \
exit 1; \
} \
function rst_section(header) \
{ \
print header; \
len = length(header); \
for (i = 1; i <= len; i = i + 1) \
printf "="; \
printf "\n\n"; \
} \
{ \
copy_in_global_log = 1; \
global_test_result = "RUN"; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".trs"); \
if (line ~ /$(<API key>)/) \
{ \
sub("$(<API key>)", "", line); \
sub("[ ]*$$", "", line); \
global_test_result = line; \
} \
else if (line ~ /$(<API key>)[nN][oO]/) \
copy_in_global_log = 0; \
}; \
if (copy_in_global_log) \
{ \
rst_section(global_test_result ": " $$0); \
while ((rc = (getline line < ($$0 ".log"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".log"); \
print line; \
}; \
printf "\n"; \
}; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# Restructured Text title.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
<API key> = \
--color-tests "$$am__color_tests" \
--enable-hard-errors "$$<API key>" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
# developer- defined test setup <API key> (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
case "$@" in \
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
*) am__odir=.;; \
esac; \
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
<API key>=no; \
else \
<API key>=yes; \
fi; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
am__expect_failure=yes;; \
*) \
am__expect_failure=no;; \
esac; \
$(<API key>) $(TESTS_ENVIRONMENT)
# A shell command to get the names of the tests scripts with any registered
# extension removed (i.e., equivalently, the names of the test logs, with
# the '.log' extension removed). The result is saved in the shell variable
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
# since that might cause problem with VPATH rewrites for suffix-less tests.
# See also '<API key>.sh' and 'test-trs-basic.sh'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$
bases=`echo $$bases`
RECHECK_LOGS = $(TEST_LOGS)
<API key> = check recheck
TEST_SUITE_LOG = test-suite.log
TEST_EXTENSIONS = .test
LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$
esac;; \
*) \
b='$*';; \
esac
am__test_logs1 = $(TESTS:=.log)
am__test_logs2 = $(am__test_logs1:.log=.log)
TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing aclocal-1.13
AMTAR = $${TAR-tar}
<API key> = 1
AR = ar
AUTOCONF = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing autoconf
AUTOHEADER = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing autoheader
AUTOMAKE = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing automake-1.13
AWK = mawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = false
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EXEEXT =
FGREP = /bin/grep -F
GREP = /bin/grep
GSL_CFLAGS = -I${prefix}/include
GSL_LIBM = -lm
GSL_LIBS = -L${exec_prefix}/lib -lgsl
<API key> = 0:0:0
GSL_LT_VERSION = 17:0:17
GSL_MAJOR_VERSION = 1
GSL_MINOR_VERSION = 16
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
<API key> =
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
<API key> = $(install_sh) -c -s
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS =
LIBM = -lm
LIBOBJS =
LIBS = -lm
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
LTLIBOBJS =
MAINT =
MAKEINFO = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/missing makeinfo
MANIFEST_TOOL = :
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OTOOL =
OTOOL64 =
PACKAGE = gsl
PACKAGE_BUGREPORT =
PACKAGE_NAME = gsl
PACKAGE_STRING = gsl 1.16
PACKAGE_TARNAME = gsl
PACKAGE_URL =
PACKAGE_VERSION = 1.16
PATH_SEPARATOR = :
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/bash
STRIP = strip
VERSION = 1.16
abs_builddir = /home/arne/src/github.com/barnex/gsl/gsl-1.16/monte
abs_srcdir = /home/arne/src/github.com/barnex/gsl/gsl-1.16/monte
abs_top_builddir = /home/arne/src/github.com/barnex/gsl/gsl-1.16
abs_top_srcdir = /home/arne/src/github.com/barnex/gsl/gsl-1.16
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
bindir = ${exec_prefix}/bin
build = <API key>
build_alias =
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = <API key>
host_alias =
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/arne/src/github.com/barnex/gsl/gsl-1.16/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
<API key> = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
noinst_LTLIBRARIES = libgslmonte.la
<API key> = miser.c plain.c gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h gsl_monte.h vegas.c
pkginclude_HEADERS = gsl_monte.h gsl_monte_vegas.h gsl_monte_miser.h gsl_monte_plain.h
INCLUDES = -I$(top_srcdir)
TESTS = $(check_PROGRAMS)
test_SOURCES = test.c
test_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../sys/libgslsys.la ../utils/libutils.la
noinst_HEADERS = test_main.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu monte/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu monte/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(<API key>)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
<API key>:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
libgslmonte.la: $(<API key>) $(<API key>) $(<API key>)
$(AM_V_CCLD)$(LINK) $(<API key>) $(<API key>) $(LIBS)
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$
echo " rm -f" $$list; \
rm -f $$list
test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) $(<API key>)
@rm -f test$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/miser.Plo
include ./$(DEPDIR)/plain.Plo
include ./$(DEPDIR)/test.Po
include ./$(DEPDIR)/vegas.Plo
.c.o:
$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# $(AM_V_CC)source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(AM_V_CC_no)$(COMPILE) -c $<
.c.obj:
$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
# $(AM_V_CC)source='$<' object='$@' libtool=no \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(AM_V_CC_no)$(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
# $(AM_V_CC)source='$<' object='$@' libtool=yes \
# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
<API key>: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \
done
<API key>:
@$(NORMAL_UNINSTALL)
@list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgincludedir)'; $(<API key>)
ID: $(am__tagged_files)
$(<API key>); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(<API key>); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(<API key>); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
# Recover from deleted '.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
# to avoid problems with "make -n".
.log.trs:
rm -f $< $@
$(MAKE) $(AM_MAKEFLAGS) $<
# Leading 'am--fnord' is there to ensure the list of targets does not
# expand to empty, as could happen e.g. with make check TESTS=''.
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
else \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
st=0; \
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
for i in $$redo_bases; do \
test -f $$i.trs && test -r $$i.trs \
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
test -f $$i.log && test -r $$i.log \
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
done; \
test $$st -eq 0 || exit 1; \
fi
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
br='==================='; br=$$br$$br$$br$$br; \
result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
if test $$maybe_colorize = yes && test $$count -gt 0; then \
color_start=$$3 color_end=$$std; \
else \
color_start= color_end=; \
fi; \
echo "$${color_start}# $$desc $$count$${color_end}"; \
}; \
<API key> () \
{ \
result_count $$1 "TOTAL:" $$all "$$brg"; \
result_count $$1 "PASS: " $$pass "$$grn"; \
result_count $$1 "SKIP: " $$skip "$$blu"; \
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
result_count $$1 "FAIL: " $$fail "$$red"; \
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
<API key> --no-color; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for b in $$bases; do echo $$b; done \
| $(<API key>); \
} >$(TEST_SUITE_LOG).tmp || exit 1; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
echo "$${col}$$br$${std}"; \
<API key> --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
fi; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
trs_list=`for i in $$bases; do echo $$i.trs; done`; \
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all $(check_PROGRAMS)
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
| $(<API key>)` || exit 1; \
log_list=`for i in $$bases; do echo $$i.log; done`; \
log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
test.log: test$(EXEEXT)
@p='test$(EXEEXT)'; \
b='test'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(<API key>) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(<API key>)
.test.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(<API key>) $(<API key>) $(<API key>) -- $(TEST_LOG_COMPILE) \
"$$tst" $(<API key>)
#.test$(EXEEXT).log:
# $(am__set_b); \
# $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
# --log-file $$b.log --trs-file $$b.trs \
# $(<API key>) $(<API key>) $(<API key>) -- $(TEST_LOG_COMPILE) \
# "$$tst" $(<API key>)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(<API key>)" \
install_sh_PROGRAM="$(<API key>)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(<API key>)" \
install_sh_PROGRAM="$(<API key>)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(<API key>)" || rm -f $(<API key>)
<API key>:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
<API key> mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: <API key>
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am <API key>
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: <API key>
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool \
<API key> cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am <API key> \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
<API key> mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am \
<API key>
#demo_SOURCES= demo.c
#demo_LDADD = libgslmonte.la ../rng/libgslrng.la ../ieee-utils/libgslieeeutils.la ../err/libgslerr.la ../test/libgsltest.la ../utils/libutils.la
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
|
package org.mozilla.javascript.optimizer;
import org.mozilla.javascript.ArrowFunction;
import org.mozilla.javascript.Callable;
import org.mozilla.javascript.ConsString;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.ES6Generator;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.JavaScriptException;
import org.mozilla.javascript.NativeFunction;
import org.mozilla.javascript.NativeGenerator;
import org.mozilla.javascript.NativeIterator;
import org.mozilla.javascript.Script;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.Undefined;
/**
* <p>OptRuntime class.</p>
*
*
*
*/
public final class OptRuntime extends ScriptRuntime
{
/** Constant <code>oneObj</code> */
public static final Double oneObj = Double.valueOf(1.0);
/** Constant <code>minusOneObj</code> */
public static final Double minusOneObj = Double.valueOf(-1.0);
/**
* Implement ....() call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call0(Callable fun, Scriptable thisObj,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* Implement ....(arg) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param arg0 a {@link java.lang.Object} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call1(Callable fun, Scriptable thisObj, Object arg0,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, new Object[] { arg0 } );
}
/**
* Implement ....(arg0, arg1) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param arg0 a {@link java.lang.Object} object.
* @param arg1 a {@link java.lang.Object} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object call2(Callable fun, Scriptable thisObj,
Object arg0, Object arg1,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, new Object[] { arg0, arg1 });
}
/**
* Implement ....(arg0, arg1, ...) call shrinking optimizer code.
*
* @param fun a {@link org.mozilla.javascript.Callable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param args an array of {@link java.lang.Object} objects.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callN(Callable fun, Scriptable thisObj,
Object[] args,
Context cx, Scriptable scope)
{
return fun.call(cx, scope, thisObj, args);
}
/**
* Implement name(args) call shrinking optimizer code.
*
* @param args an array of {@link java.lang.Object} objects.
* @param name a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callName(Object[] args, String name,
Context cx, Scriptable scope)
{
Callable f = <API key>(name, cx, scope);
Scriptable thisObj = <API key>(cx);
return f.call(cx, scope, thisObj, args);
}
/**
* Implement name() call shrinking optimizer code.
*
* @param name a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callName0(String name,
Context cx, Scriptable scope)
{
Callable f = <API key>(name, cx, scope);
Scriptable thisObj = <API key>(cx);
return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* Implement x.property() call shrinking optimizer code.
*
* @param value a {@link java.lang.Object} object.
* @param property a {@link java.lang.String} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link java.lang.Object} object.
*/
public static Object callProp0(Object value, String property,
Context cx, Scriptable scope)
{
Callable f = <API key>(value, property, cx, scope);
Scriptable thisObj = <API key>(cx);
return f.call(cx, scope, thisObj, ScriptRuntime.emptyArgs);
}
/**
* <p>add.</p>
*
* @param val1 a {@link java.lang.Object} object.
* @param val2 a double.
* @return a {@link java.lang.Object} object.
*/
public static Object add(Object val1, double val2)
{
if (val1 instanceof Scriptable)
val1 = ((Scriptable) val1).getDefaultValue(null);
if (!(val1 instanceof CharSequence))
return wrapDouble(toNumber(val1) + val2);
return new ConsString((CharSequence)val1, toString(val2));
}
/** {@inheritDoc} */
public static Object add(double val1, Object val2)
{
if (val2 instanceof Scriptable)
val2 = ((Scriptable) val2).getDefaultValue(null);
if (!(val2 instanceof CharSequence))
return wrapDouble(toNumber(val2) + val1);
return new ConsString(toString(val1), (CharSequence)val2);
}
/** {@inheritDoc} */
@Deprecated
public static Object elemIncrDecr(Object obj, double index,
Context cx, int incrDecrMask)
{
return elemIncrDecr(obj, index, cx, getTopCallScope(cx), incrDecrMask);
}
/** {@inheritDoc} */
public static Object elemIncrDecr(Object obj, double index,
Context cx, Scriptable scope,
int incrDecrMask)
{
return ScriptRuntime.elemIncrDecr(obj, Double.valueOf(index), cx, scope,
incrDecrMask);
}
/**
* <p>padStart.</p>
*
* @param currentArgs an array of {@link java.lang.Object} objects.
* @param count a int.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] padStart(Object[] currentArgs, int count) {
Object[] result = new Object[currentArgs.length + count];
System.arraycopy(currentArgs, 0, result, count, currentArgs.length);
return result;
}
/**
* <p>initFunction.</p>
*
* @param fn a {@link org.mozilla.javascript.NativeFunction} object.
* @param functionType a int.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
*/
public static void initFunction(NativeFunction fn, int functionType,
Scriptable scope, Context cx)
{
ScriptRuntime.initFunction(cx, scope, fn, functionType, false);
}
/**
* <p>bindThis.</p>
*
* @param fn a {@link org.mozilla.javascript.NativeFunction} object.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link org.mozilla.javascript.Function} object.
*/
public static Function bindThis(NativeFunction fn, Context cx, Scriptable scope, Scriptable thisObj)
{
return new ArrowFunction(cx, scope, fn, thisObj);
}
/** {@inheritDoc} */
public static Object callSpecial(Context cx, Callable fun,
Scriptable thisObj, Object[] args,
Scriptable scope,
Scriptable callerThis, int callType,
String fileName, int lineNumber)
{
return ScriptRuntime.callSpecial(cx, fun, thisObj, args, scope,
callerThis, callType,
fileName, lineNumber);
}
/**
* <p>newObjectSpecial.</p>
*
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param fun a {@link java.lang.Object} object.
* @param args an array of {@link java.lang.Object} objects.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param callerThis a {@link org.mozilla.javascript.Scriptable} object.
* @param callType a int.
* @return a {@link java.lang.Object} object.
*/
public static Object newObjectSpecial(Context cx, Object fun,
Object[] args, Scriptable scope,
Scriptable callerThis, int callType)
{
return ScriptRuntime.newSpecial(cx, fun, args, scope, callType);
}
/**
* <p>wrapDouble.</p>
*
* @param num a double.
* @return a {@link java.lang.Double} object.
*/
public static Double wrapDouble(double num)
{
if (num == 0.0) {
if (1 / num > 0) {
return zeroObj;
}
} else if (num == 1.0) {
return oneObj;
} else if (num == -1.0) {
return minusOneObj;
} else if (Double.isNaN(num)) {
return NaNobj;
}
return Double.valueOf(num);
}
static String encodeIntArray(int[] array)
{
// XXX: this extremely inefficient for small integers
if (array == null) { return null; }
int n = array.length;
char[] buffer = new char[1 + n * 2];
buffer[0] = 1;
for (int i = 0; i != n; ++i) {
int value = array[i];
int shift = 1 + i * 2;
buffer[shift] = (char)(value >>> 16);
buffer[shift + 1] = (char)value;
}
return new String(buffer);
}
private static int[] decodeIntArray(String str, int arraySize)
{
// XXX: this extremely inefficient for small integers
if (arraySize == 0) {
if (str != null) throw new <API key>();
return null;
}
if (str.length() != 1 + arraySize * 2 && str.charAt(0) != 1) {
throw new <API key>();
}
int[] array = new int[arraySize];
for (int i = 0; i != arraySize; ++i) {
int shift = 1 + i * 2;
array[i] = (str.charAt(shift) << 16) | str.charAt(shift + 1);
}
return array;
}
/**
* <p>newArrayLiteral.</p>
*
* @param objects an array of {@link java.lang.Object} objects.
* @param encodedInts a {@link java.lang.String} object.
* @param skipCount a int.
* @param cx a {@link org.mozilla.javascript.Context} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @return a {@link org.mozilla.javascript.Scriptable} object.
*/
public static Scriptable newArrayLiteral(Object[] objects,
String encodedInts,
int skipCount,
Context cx,
Scriptable scope)
{
int[] skipIndexces = decodeIntArray(encodedInts, skipCount);
return newArrayLiteral(objects, skipIndexces, cx, scope);
}
/**
* <p>main.</p>
*
* @param script a {@link org.mozilla.javascript.Script} object.
* @param args an array of {@link java.lang.String} objects.
*/
public static void main(final Script script, final String[] args)
{
ContextFactory.getGlobal().call(cx -> {
ScriptableObject global = getGlobal(cx);
// get the command line arguments and define "arguments"
// array in the top-level object
Object[] argsCopy = new Object[args.length];
System.arraycopy(args, 0, argsCopy, 0, args.length);
Scriptable argsObj = cx.newArray(global, argsCopy);
global.defineProperty("arguments", argsObj,
ScriptableObject.DONTENUM);
script.exec(cx, global);
return null;
});
}
/**
* <p>throwStopIteration.</p>
*
* @param scope a {@link java.lang.Object} object.
* @param genState a {@link java.lang.Object} object.
*/
public static void throwStopIteration(Object scope, Object genState) {
Object value = <API key>(genState);
Object si =
(value == Undefined.instance) ?
NativeIterator.<API key>((Scriptable)scope) :
new NativeIterator.StopIteration(value);
throw new JavaScriptException(si, "", 0);
}
/**
* <p><API key>.</p>
*
* @param funObj a {@link org.mozilla.javascript.NativeFunction} object.
* @param scope a {@link org.mozilla.javascript.Scriptable} object.
* @param thisObj a {@link org.mozilla.javascript.Scriptable} object.
* @param maxLocals a int.
* @param maxStack a int.
* @return a {@link org.mozilla.javascript.Scriptable} object.
*/
public static Scriptable <API key>(NativeFunction funObj,
Scriptable scope,
Scriptable thisObj,
int maxLocals,
int maxStack)
{
GeneratorState gs = new GeneratorState(thisObj, maxLocals, maxStack);
if (Context.getCurrentContext().getLanguageVersion() >= Context.VERSION_ES6) {
return new ES6Generator(scope, funObj, gs);
} else {
return new NativeGenerator(scope, funObj, gs);
}
}
/**
* <p><API key>.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] <API key>(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
if (rgs.stackState == null)
rgs.stackState = new Object[rgs.maxStack];
return rgs.stackState;
}
/**
* <p><API key>.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return an array of {@link java.lang.Object} objects.
*/
public static Object[] <API key>(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
if (rgs.localsState == null)
rgs.localsState = new Object[rgs.maxLocals];
return rgs.localsState;
}
/**
* <p><API key>.</p>
*
* @param obj a {@link java.lang.Object} object.
* @param val a {@link java.lang.Object} object.
*/
public static void <API key>(Object obj, Object val) {
GeneratorState rgs = (GeneratorState) obj;
rgs.returnValue = val;
}
/**
* <p><API key>.</p>
*
* @param obj a {@link java.lang.Object} object.
* @return a {@link java.lang.Object} object.
*/
public static Object <API key>(Object obj) {
GeneratorState rgs = (GeneratorState) obj;
return (rgs.returnValue == null ? Undefined.instance : rgs.returnValue);
}
public static class GeneratorState {
static final String CLASS_NAME =
"org/mozilla/javascript/optimizer/OptRuntime$GeneratorState";
@SuppressWarnings("unused")
public int resumptionPoint;
static final String <API key> = "resumptionPoint";
static final String <API key> = "I";
@SuppressWarnings("unused")
public Scriptable thisObj;
static final String thisObj_NAME = "thisObj";
static final String thisObj_TYPE =
"Lorg/mozilla/javascript/Scriptable;";
Object[] stackState;
Object[] localsState;
int maxLocals;
int maxStack;
Object returnValue;
GeneratorState(Scriptable thisObj, int maxLocals, int maxStack) {
this.thisObj = thisObj;
this.maxLocals = maxLocals;
this.maxStack = maxStack;
}
}
}
|
#include "relativelayout.h"
#include <QDebug>
RelativeLayout::RelativeLayout(View *parent) :
View(parent)
{
// By default, QQuickItem does not draw anything. If you subclass
// QQuickItem to create a visual item, you will need to uncomment the
// following line and re-implement updatePaintNode()
// setFlag(ItemHasContents, true);
}
RelativeLayout::~RelativeLayout()
{
}
void RelativeLayout::inflate()
{
View::inflate();
qDebug() << "Start rellayout inflate";
if (m_context != NULL && m_context->isValid()) {
m_object = new QAndroidJniObject("android/widget/RelativeLayout", "(Landroid/content/Context;)V", m_context->object());
qDebug() << m_object->isValid();
qDebug() << m_object->toString();
foreach (QObject *child, m_children) {
qDebug() << "add children to layout";
if (child != NULL) {
qDebug() << child->metaObject()->className();
child->dumpObjectInfo();
if (child->inherits("View"))
m_object->callMethod<void>("addView", "(Landroid/view/View;)V", qobject_cast<View*>(child)->object()->object());
}
}
} else
qDebug() << "No context, cannot inflate!";
}
|
.nav-tabs {
border-bottom: 1px solid #151313 !important;
background-color: rgba(0, 0, 0, 0.33);
padding: 5px;
}
li.btn {
height: 44px;
}
* {
margin:0;
padding:0;
border-radius: 0px;
}
.table-hover>tbody>tr:hover {
background-color: #8387F1;
border-radius: 0px ;
}
.table-hover>tbody>tr>td {
border-radius: 0px ;
}
.btn{
box-shadow: 1px 2px 5px #000000;
}
#tituloBarra{
font-style: oblique;
font-weight: bold;
cursor: pointer;
float: right;
background-color: #5bc0de;
border-radius: 4px;
border: 1px;
padding: 4px;
}
.fotoGrilla {
width: 40px;
height: 40px;
}
.fotoform {
max-width: 200px;
max-height: 200px;
}
.container {
margin-top: 12px;
}
#header {
position: fixed;
top: 0;
width: 100%;
height: 50px;
background-color: #333;
color: #FFFFFF;
padding: 10px;
z-index: 1;
}
.centrar {
text-align:center;
}
body {
margin: 0 auto;
color:#333;
padding-top: 40px;
background: linear-gradient(to right ,rgba(41, 137, 216, 0.39), #dff0d8, #999); /* Standard syntax */
/*background:rgba(85, 85, 85, 0.72);*/
font-family:'Open Sans',sans-serif;
}
caption {
font-size: 1.6em;
font-weight: 400;
padding: 10px 0;
}
footer {
height: 60px;
/*background-color: #C2C2C2;*/
background: linear-gradient(to right ,rgba(41, 137, 216, 0.39), #dff0d8, #999);
}
h1 {
margin: 0px;
border: black;
}
.imgLogin {
width:325px;
height:377px;
}
.CajaUno {
max-width: 30%;
width:400px;
margin:0 auto;
margin-top:8px;
margin-bottom:2%;
transition:opacity 1s;
-webkit-transition:opacity 1s;
}
.CajaInicio {
width:750px;
margin:0 auto;
margin-top:8px;
margin-bottom:2%;
transition:opacity 1s;
-webkit-transition:opacity 1s;
}
.CajaEnunciado {
max-width: 30%;
border: dashed;
position: fixed;
background: royalblue;
top: 0px;
width: 400px;
margin: 0;
padding: 10px;
margin-bottom: 2%;
transition: opacity 1s;
-webkit-transition: opacity 1s;
border-radius: 15px;
-<API key>: 15px;
}
.CajaInicio h1{
background:#010101 /*rgb(14, 26, 112);*/;
padding:20px 0;
font-size:140%;
font-weight:300;
text-align:center;
color:#fff;
}
.CajaAbajo {
margin-top: 100px;
width:400px;
top:0px;
left:0px;
transition:opacity 1s;
-webkit-transition:opacity 1s;
}
.CajaArriva {
margin-top: 20px;
width:400px;
top:0px;
left:0px;
transition:opacity 1s;
-webkit-transition:opacity 1s;
}
#FormIngreso {
background:#f0f0f0;
padding:7% 5%;
}
input[type="text"],input[type="file"],input[type="search"]{
width:100%;
background:#fff;
margin-bottom:2%;
border:1px solid #ccc;
padding:2%;
font-family:'Open Sans',sans-serif;
font-size:140%;
font-weight: 800;
color:#555;
}
select{
width:100%;
background:#fff;
margin-bottom:2%;
border:1px solid #ccc;
padding:2%;
font-family:'Open Sans',sans-serif;
font-size:95%;
color:#555;
}
.MiBotonUTN {
display:block;
text-transform: capitalize;
border:hidden;
width:100%;
background:#f50056;
margin:0 auto;
margin-top:1%;
padding:10px;
text-align:center;
text-decoration:none;
color:#fff;
cursor:pointer;
-moz-border-radius:7px;
-<API key>:7px;
border-radius:7px;
transition:background .3s;
-webkit-transition:background .3s;
}
.MiBotonUTN:hover{
background:#1BA045;
}
/*
.MiBotonUTNJuego {
text-transform: capitalize;
border:hidden;
width:32%;
background:#f50056;
margin:0 auto;
margin-top:1%;
padding:10px;
text-align:center;
text-decoration:none;
color:#fff;
cursor:pointer;
-moz-border-radius:7px;
-<API key>:7px;
border-radius:7px;
transition:background .3s;
-webkit-transition:background .3s;
}
*/
.MiBotonUTNMenu {
display:block;
text-transform: capitalize;
border:hidden;
width:100px;
background:#f50056;
margin-top:1%;
padding:6px;
text-align:center;
text-decoration:none;
color:#fff;
cursor:pointer;
-moz-border-radius:7px;
-<API key>:7px;
border-radius:7px;
transition:background .3s;
-webkit-transition:background .3s;
}
.MiBotonUTNMenu:hover{
background: #1e5799; /* Old browsers */
background: -moz-linear-gradient(45deg, #1e5799 0%, #2989d8 16%, #2989d8 16%, #ffffff 36%, #ffffff 43%, #ebf709 48%, #ffffff 52%, #ffffff 61%, #207cca 82%, #207cca 99%, #207cca 99%, #7db9e8 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left bottom, right top, color-stop(0%,#1e5799), color-stop(16%,#2989d8), color-stop(16%,#2989d8), color-stop(36%,#ffffff), color-stop(43%,#ffffff), color-stop(48%,#ebf709), color-stop(52%,#ffffff), color-stop(61%,#ffffff), color-stop(82%,#207cca), color-stop(99%,#207cca), color-stop(99%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */
background: -<API key>(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* IE10+ */
background: linear-gradient(45deg, #1e5799 0%,#2989d8 16%,#2989d8 16%,#ffffff 36%,#ffffff 43%,#ebf709 48%,#ffffff 52%,#ffffff 61%,#207cca 82%,#207cca 99%,#207cca 99%,#7db9e8 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
color:black;
}
/*
.MiBotonUTNLinea{
max-width: 150px;
position: absolute;
text-transform: capitalize;
border:hidden;
width:100%;
background:#00A1F5;
margin:0 auto;
margin-top:30%;
padding:10px;
text-align:center;
text-decoration:none;
color:#fff;
cursor:pointer;
-moz-border-radius:7px;
-<API key>:7px;
border-radius:7px;
transition:background .3s;
-webkit-transition:background .3s;
}
.MiBotonUTNLinea:hover{
background:red;
}
*/
.<API key> {
display:block;
border:hidden;
//width:150px;
background:Blue;
margin-top:1%;
padding:6px;
text-align:center;
text-decoration:none;
color:#fff;
cursor:pointer;
-moz-border-radius:7px;
-<API key>:7px;
border-radius:7px;
transition:background .3s;
-webkit-transition:background .3s;
}
.<API key>:hover{
background:red;
}
/*
.CajaUno h1{
background:#f50056;
padding:20px 0;
font-size:140%;
font-weight:300;
text-align:center;
color:#fff;
}
.CajaUno a:hover {
color:#f50056;
}
*/
/*
.CajaUno a {
color:#DDDDDD;
}
*/
/*
.PiedraPapelTijera
{
width: 100px;
height: 100px;
padding: 10px;
}*/
|
#ifndef <API key>
#define <API key>
#include <opm/core/simulator/SimulatorState.hpp>
#include <opm/core/pressure/tpfa/ifs_tpfa.h>
#include <vector>
struct UnstructuredGrid;
struct Wells;
struct <API key>;
namespace Opm
{
class <API key>;
class RockCompressibility;
class <API key>;
class WellState;
class SimulatoreState;
Encapsulating a tpfa pressure solver for the <API key> case.
Supports gravity, wells controlled by bhp or reservoir rates,
boundary conditions and simple sources as driving forces.
Rock compressibility can be included, and necessary nonlinear
iterations are handled.
Below we use the shortcuts D for the number of dimensions, N
for the number of cells and F for the number of faces.
class IncompTpfa
{
public:
Construct solver for incompressible case.
\param[in] grid A 2d or 3d grid.
\param[in] props Rock and fluid properties.
\param[in] linsolver Linear solver to use.
\param[in] gravity Gravity vector. If non-null, the array should
have D elements.
\param[in] wells The wells argument. Will be used in solution,
is ignored if NULL.
Note: this class observes the well object, and
makes the assumption that the well topology
and completions does not change during the
run. However, controls (only) are allowed
to change.
\param[in] src Source terms. May be empty().
\param[in] bcs Boundary conditions, treat as all noflow if null.
IncompTpfa(const UnstructuredGrid& grid,
const <API key>& props,
<API key>& linsolver,
const double* gravity,
const Wells* wells,
const std::vector<double>& src,
const <API key>* bcs);
Construct solver, possibly with rock compressibility.
\param[in] grid A 2d or 3d grid.
\param[in] props Rock and fluid properties.
\param[in] rock_comp_props Rock compressibility properties. May be null.
\param[in] linsolver Linear solver to use.
\param[in] residual_tol Solution accepted if inf-norm of residual is smaller.
\param[in] change_tol Solution accepted if inf-norm of change in pressure is smaller.
\param[in] maxiter Maximum acceptable number of iterations.
\param[in] gravity Gravity vector. If non-null, the array should
have D elements.
\param[in] wells The wells argument. Will be used in solution,
is ignored if NULL.
Note: this class observes the well object, and
makes the assumption that the well topology
and completions does not change during the
run. However, controls (only) are allowed
to change.
\param[in] src Source terms. May be empty().
\param[in] bcs Boundary conditions, treat as all noflow if null.
IncompTpfa(const UnstructuredGrid& grid,
const <API key>& props,
const RockCompressibility* rock_comp_props,
<API key>& linsolver,
const double residual_tol,
const double change_tol,
const int maxiter,
const double* gravity,
const Wells* wells,
const std::vector<double>& src,
const <API key>* bcs);
Destructor.
virtual ~IncompTpfa();
Solve the pressure equation. If there is no pressure
dependency introduced by rock compressibility effects,
the equation is linear, and it is solved directly.
Otherwise, the nonlinear equations ares solved by a
Newton-Raphson scheme.
May throw an exception if the number of iterations
exceed maxiter (set in constructor).
void solve(const double dt,
SimulatorState& state,
WellState& well_state);
Expose read-only reference to internal <API key>.
const std::vector<double>& getHalfTrans() const { return htrans_; }
protected:
// Solve with no rock compressibility (linear eqn).
void solveIncomp(const double dt,
SimulatorState& state,
WellState& well_state);
// Solve with rock compressibility (nonlinear eqn).
void solveRockComp(const double dt,
SimulatorState& state,
WellState& well_state);
private:
// Helper functions.
void computeStaticData();
virtual void <API key>(const double dt,
const SimulatorState& state,
const WellState& well_state);
void <API key>(const double dt,
const SimulatorState& state,
const WellState& well_state);
void assemble(const double dt,
const SimulatorState& state,
const WellState& well_state);
void solveIncrement();
double residualNorm() const;
double incrementNorm() const;
void computeResults(SimulatorState& state,
WellState& well_state) const;
protected:
const UnstructuredGrid& grid_;
const <API key>& props_;
const RockCompressibility* rock_comp_props_;
const <API key>& linsolver_;
const double residual_tol_;
const double change_tol_;
const int maxiter_;
const double* gravity_; // May be NULL
const Wells* wells_; // May be NULL, outside may modify controls (only) between calls to solve().
const std::vector<double>& src_;
const <API key>* bcs_;
std::vector<double> htrans_;
std::vector<double> gpress_;
std::vector<int> allcells_;
std::vector<double> trans_ ;
std::vector<double> wdp_;
std::vector<double> totmob_;
std::vector<double> omega_;
std::vector<double> <API key>;
std::vector<double> initial_porevol_;
struct ifs_tpfa_forces forces_;
std::vector<double> porevol_;
std::vector<double> rock_comp_;
std::vector<double> pressures_;
struct ifs_tpfa_data* h_;
};
} // namespace Opm
#endif // <API key>
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_65) on Thu Feb 05 20:10:13 EST 2015 -->
<title>ModDiscoverer (Forge API)</title>
<meta name="date" content="2015-02-05">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ModDiscoverer (Forge API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../cpw/mods/fml/common/discovery/ModCandidate.html" title="class in cpw.mods.fml.common.discovery"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?cpw/mods/fml/common/discovery/ModDiscoverer.html" target="_top">Frames</a></li>
<li><a href="ModDiscoverer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<div class="subTitle">cpw.mods.fml.common.discovery</div>
<h2 title="Class ModDiscoverer" class="title">Class ModDiscoverer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>cpw.mods.fml.common.discovery.ModDiscoverer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">ModDiscoverer</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#ModDiscoverer()">ModDiscoverer</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_summary">
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#findClasspathMods(cpw.mods.fml.common.ModClassLoader)">findClasspathMods</a></strong>(<a href="../../../../../cpw/mods/fml/common/ModClassLoader.html" title="class in cpw.mods.fml.common">ModClassLoader</a> modClassLoader)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#findModDirMods(java.io.File)">findModDirMods</a></strong>(java.io.File modsDir)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../cpw/mods/fml/common/discovery/ASMDataTable.html" title="class in cpw.mods.fml.common.discovery">ASMDataTable</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#getASMTable()">getASMTable</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.util.List<java.io.File></code></td>
<td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#getNonModLibs()">getNonModLibs</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.List<<a href="../../../../../cpw/mods/fml/common/ModContainer.html" title="interface in cpw.mods.fml.common">ModContainer</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../cpw/mods/fml/common/discovery/ModDiscoverer.html#identifyMods()">identifyMods</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
</a>
<h3>Constructor Detail</h3>
<a name="ModDiscoverer()">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ModDiscoverer</h4>
<pre>public ModDiscoverer()</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_detail">
</a>
<h3>Method Detail</h3>
<a name="findClasspathMods(cpw.mods.fml.common.ModClassLoader)">
</a>
<ul class="blockList">
<li class="blockList">
<h4>findClasspathMods</h4>
<pre>public void findClasspathMods(<a href="../../../../../cpw/mods/fml/common/ModClassLoader.html" title="class in cpw.mods.fml.common">ModClassLoader</a> modClassLoader)</pre>
</li>
</ul>
<a name="findModDirMods(java.io.File)">
</a>
<ul class="blockList">
<li class="blockList">
<h4>findModDirMods</h4>
<pre>public void findModDirMods(java.io.File modsDir)</pre>
</li>
</ul>
<a name="identifyMods()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>identifyMods</h4>
<pre>public java.util.List<<a href="../../../../../cpw/mods/fml/common/ModContainer.html" title="interface in cpw.mods.fml.common">ModContainer</a>> identifyMods()</pre>
</li>
</ul>
<a name="getASMTable()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>getASMTable</h4>
<pre>public <a href="../../../../../cpw/mods/fml/common/discovery/ASMDataTable.html" title="class in cpw.mods.fml.common.discovery">ASMDataTable</a> getASMTable()</pre>
</li>
</ul>
<a name="getNonModLibs()">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getNonModLibs</h4>
<pre>public java.util.List<java.io.File> getNonModLibs()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../cpw/mods/fml/common/discovery/ModCandidate.html" title="class in cpw.mods.fml.common.discovery"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?cpw/mods/fml/common/discovery/ModDiscoverer.html" target="_top">Frames</a></li>
<li><a href="ModDiscoverer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
</a></div>
</body>
</html>
|
// This file is part of zinc64.
use zinc64_core::{Ram, Rom, Shared, SharedCell};
pub struct VicMemory {
base_address: SharedCell<u16>,
charset: Shared<Rom>,
ram: Shared<Ram>,
}
impl VicMemory {
pub fn new(base_address: SharedCell<u16>, charset: Shared<Rom>, ram: Shared<Ram>) -> VicMemory {
VicMemory {
base_address,
charset,
ram,
}
}
pub fn read(&self, address: u16) -> u8 {
let full_address = self.base_address.get() | address;
let zone = full_address >> 12;
match zone {
0x01 => self.charset.borrow().read(full_address - 0x1000),
0x09 => self.charset.borrow().read(full_address - 0x9000),
_ => self.ram.borrow().read(full_address),
}
}
}
|
<html>
<head>
<title>Document Browser</title>
<link rel='stylesheet' href='./scdoc.css' type='text/css' />
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<script src="docmap.js" type="text/javascript"></script>
<script src="scdoc.js" type="text/javascript"></script>
<style>
.browser {
margin: 0em;
border-collapse: collapse;
margin-top: 1em;
}
.result {
padding: 2px;
}
.browser td {
vertical-align: top;
border: none;
}
.result_doc {
border-bottom: 1px solid #ddd;
margin-top: 0.5em;
}
.result_summary {
color: #444;
font-size: 9pt;
max-width: 18em;
margin-bottom: 0.6em;
}
.category, .cat_selected {
margin-bottom: 0.25em;
border-bottom: 1px solid transparent;
}
.cat_selected {
border-bottom: 1px solid #777;
}
.cat_header {
border-bottom: 2px solid #999;
color: #777;
/* background: #aaa;
color: white;*/
margin-bottom: 0.25em;
padding: 2px;
/* font-weight: bold;*/
}
.category a {
color: #555;
font-weight: bold;
}
.cat_selected a {
color: #000;
font-weight: bold;
}
.cat_arrow {
float: right;
padding-left: 1ex;
color: #555;
}
#search_checks {
font-size: 9pt;
color: #555;
border-bottom: 1px solid #ddd;
margin-top: 1em;
padding-bottom: 1em;
}
.cat_count {
color: #777;
font-size: 9pt;
}
#total_count {
font-size: 9pt;
color: #777;
}
.doc_kind {
color: #666;
float: right;
font-size: 8pt;
padding: 0 2px;
margin-left: 0.5ex;
font-weight: bold;
}
</style>
<noscript>
<!--<meta http-equiv="refresh" content="3; URL=Overviews/Categories.html">
<p>JavaScript is not available, redirecting to <a href="Overviews/Categories.html">static category overview</a>...
<p>The document browser needs JavaScript.
</noscript>
<script type="text/javascript">
var categorytree = null;
var path = [];
function GotoPath(p) {
path = p.split(">");
var x = escape(p);
if(window.location.hash != x)
window.location.hash = x;
updateTree();
}
function updateTree() {
var el = document.getElementById("browser");
var res = "<tr><td>";
var lev = 0;
var tree = {entries:[],subcats:categorytree};
var p;
var done = 0;
var sel;
var colors = {
"Classes": "#7ab",
"Reference": "#7b9",
"Overviews": "#ca6",
"Guides": "#b87",
"Tutorials": "#b77",
};
link = "";
while(1) {
res += "<div class='result'>";
p=path[lev++];
var l = [];
for(var k in tree.subcats)
l.push(k);
l = l.sort();
sel = "";
for(var i=0;i<l.length;i++) {
var k = l[i];
if(k==p) {
res += "<div class='cat_selected'>";
sel = k;
} else
res += "<div class='category'>";
res += "<a href='javascript:GotoPath(\""+link+k+"\")'>"+k+"</a>";
res += " <span class='cat_count'>("+tree.subcats[k].count+")</span>";
if(k==p)
res += "<span class='cat_arrow'> ►</span>";
res += "</div>";
}
for(var i=0;i<tree.entries.length;i++) {
var v = tree.entries[i];
var x = v.path.split("/");
res += "<div class='result_doc'><span class='doc_kind' ";
var clr = colors[x[0]];
if(clr) {
res += "style='color:"+clr+";'";
};
res += ">";
if(v.installed=="extension")
res += "+";
else if(v.installed=="missing")
res += "(not installed) ";
var link = v.hasOwnProperty("oldhelp")?v.oldhelp:(v.path+".html");
res += x[0].toUpperCase()+"</span><a href='"+link+"'>"+v.title+"</a></div><div class='result_summary'>"+v.summary+"</div>";
}
res += "</div>";
if(!p)
break;
tree = tree.subcats[p];
link += p+">";
res += "<td>";
res += "<div class='cat_header'>"+sel+"</div>";
if(!tree) {
res += "<div class='result_summary'>► Category not found: "+p+"</div>";
break;
}
}
el.innerHTML = res;
}
function countTree(t) {
var x = 0;
for(var k in t.subcats)
x += countTree(t.subcats[k]);
x += t.entries.length;
return t.count = x;
}
function buildCategoryTree() {
var cats = {};
for(var k in docmap) {
var v = docmap[k];
if(v.installed=="extension" && !check_extensions.checked)
continue;
if(filter.value != "all" && v.path.split("/")[0].toLowerCase() != filter.value)
continue;
var c2 = v.categories.match(/[^, ]+[^,]*[^, ]+/g) || ["Uncategorized"];
for(var i=0;i<c2.length;i++) {
var c = c2[i];
if(!cats[c])
cats[c]=[];
cats[c].push(v);
}
}
var tree = {};
var p,l,e,a;
for(var cat in cats) {
var files = cats[cat];
p=tree;
l=cat.split(">");
for(var i=0;i<l.length;i++) {
var c = l[i];
if(!p[c]) {
p[c]={};
p[c].subcats = {};
p[c].entries = [];
p[c].count = 0;
}
e=p[c];
p=p[c].subcats;
}
for(var i=0;i<files.length;i++)
e.entries.push(files[i]);
e.entries = e.entries.sort(function(a,b) {
a=a.title; b=b.title;
if(a<b) return -1;
else
if(a>b) return +1;
else
return 0;
});
}
categorytree = tree;
document.getElementById("total_count").innerHTML = countTree({subcats:tree,entries:[],count:0}) + " documents";
}
var check_extensions;
var filter;
window.onload = function() {
// restoreMenu();
helpRoot="."; fixTOC();
var onChange = function() {
buildCategoryTree();
updateTree();
};
check_extensions = document.getElementById("check_extensions");
check_extensions.onchange = onChange;
filter = document.getElementById("menu_filter");
filter.onchange = onChange;
buildCategoryTree();
GotoPath(unescape(window.location.hash.slice(1)));
}
window.onhashchange = function() {
GotoPath(unescape(window.location.hash.slice(1)));
}
</script>
</head>
<ul id="menubar"></ul>
<body>
<div class='contents'>
<div class='header'>
<div id='label'>SuperCollider</div>
<h1>Document Browser</h1>
<div id='summary'>Browse categories</div>
</div>
<div id="search_checks">
Filter:
<select id="menu_filter">
<option SELECTED value="all">All documents</option>
<option value="classes">Classes only</option>
<option value="reference">Reference only</option>
<option value="guides">Guides only</option>
<option value="tutorials">Tutorials only</option>
<option value="overviews">Overviews only</option>
<option value="other">Other only</option>
</select>
<input type="checkbox" id="check_extensions" checked="true">Include extensions</input>
</div>
<div id="total_count"></div>
<table class="browser" id="browser"></table>
</div>
</body>
</html>
|
<?php
/**
* Functions for building the page content for each codex page
*
* @since 1.0.0
* @package Codex_Creator
*/
/**
* Get and format content output for summary section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_summary', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for description section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
//$meta_value = get_post_meta($post_id, 'cdxc_description', true);
$meta_value = get_post_meta($post_id, 'cdxc_meta_docblock', true);
if (!$meta_value) {
return '';
}
$phpdoc = new \phpDocumentor\Reflection\DocBlock($meta_value);
$line_arr = explode(PHP_EOL, $phpdoc->getLongDescription()->getContents());
$line_arr = array_values(array_filter($line_arr));
if (empty($line_arr)) {
return '';
}
$sample_open = false;
$sample_close = false;
foreach ($line_arr as $key=>$line) {
//check for code sample opening
if($line=='' && substr($line_arr[$key+1], 0, 3) === ' '){// we have found a opening code sample
$sample_open = $key+1;
}
//check for code sample closing
if($sample_open && substr($line_arr[$key], 0, 3) === ' '){// we have found a closing code sample
$sample_close = $key;
}
}
if ($sample_open && $sample_close) {
$line_arr[$sample_open] = CDXC_SAMPLE_OPEN.$line_arr[$sample_open];
$line_arr[$sample_open] = $line_arr[$sample_close].CDXC_SAMPLE_CLOSE;
}
$meta_value = implode(PHP_EOL, $line_arr);
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for usage section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_usage_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_usage', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_usage_content', $content, $post_id, $title);
}
/**
* Get and format content output for access section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_access_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_access', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_access_content', $content, $post_id, $title);
}
/**
* Get and format content output for deprecated section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_deprecated', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for global section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_global_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_global', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $value) {
$value = <API key>($value);
$content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END;
}
} else {
$meta_value = <API key>($meta_value);
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
}
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_global_content', $content, $post_id, $title);
}
/**
* Arrange a param value into a usable HTML output.
*
* @since 1.0.0
* @package Codex_Creator
* @param string $param The param value to be used.
* @return string Formatted HTML on success.
*/
function <API key>($param)
{ if($param==''){return '';}
$output = '';
$param_arr = explode(' ',$param);
$param_arr = array_values(array_filter($param_arr));
//print_r($param_arr);
$output .= '<dl>';
//variable
if(!empty($param_arr[1])){
$var = $param_arr[1];
$output .= '<dt><b>'.$var.'</b></dt>';
unset($param_arr[1]);
}
$output .= '<dd>';
//datatype
if(!empty($param_arr[0])){
$datatype = $param_arr[0];
$link_open = '';
$link_close = '';
if($datatype=='string' || $datatype=='String'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#String" target="_blank">';
$link_close = '</a>';
}
if($datatype=='int'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Integer" target="_blank">';
$link_close = '</a>';
}
if($datatype=='bool'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Boolean" target="_blank">';
$link_close = '</a>';
}
$output .= '('.$link_open.'<i>'.$datatype.'</i>'.$link_close.') ';
unset($param_arr[0]);
}
//optional
$optional = '(<i>'.__('required', CDXC_TEXTDOMAIN).'</i>)';
if(!empty($param_arr[2])){
$opt = $param_arr[2];
if($opt=='Optional.' || $opt=='optional.'){
$optional = '(<i>'.__('optional', CDXC_TEXTDOMAIN).'</i>)';
unset($param_arr[2]);
}
}
$output .= $optional.' ';
//we now split into descriptions.
$param_str = implode(' ',$param_arr);
$param_arr = explode('.',$param_str);
$param_arr = array_filter($param_arr);
//print_r($param_arr);
//description/default
$default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.__('None', CDXC_TEXTDOMAIN).'</i></dd></dl>';
foreach ($param_arr as $bit) {
$bit = trim($bit);
//echo '#'.$bit.'#';
if(substr( $bit, 0, 7) === 'Default'){
$bits = explode('Default',$bit);
$default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.$bits[1].'</i></dd></dl>';
}else{
$output .= $bit.'. ';
}
}
$output .= $default;
$output .= '</dd>';
$output .= '</dl>';
return $output;
}
/**
* Get and format content output for internal section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_internal', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for ignore section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_ignore_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_ignore', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_ignore_content', $content, $post_id, $title);
}
/**
* Get and format content output for link section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_link_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_link', true);
if (!$meta_value) {
return;
}
/*
* @todo add checking for parsing links
*/
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START ."<a href='$meta_value' >".$meta_value . "</a>".CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_link_content', $content, $post_id, $title);
}
/**
* Get and format content output for method section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_method_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_method', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_method_content', $content, $post_id, $title);
}
/**
* Get and format content output for package section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_package', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for param section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_param_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_param', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $value) {
$value = <API key>($value);
$content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END;
}
} else {
$meta_value = <API key>($meta_value);
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
}
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_param_content', $content, $post_id, $title);
}
/**
* Arrange a param value into a usable HTML output.
*
* @since 1.0.0
* @package Codex_Creator
* @param string $param The param value to be used.
* @return string Formatted HTML on success.
*/
function <API key>($param)
{ if($param==''){return '';}
$output = '';
$param_arr = explode(' ',$param);
$param_arr = array_values(array_filter($param_arr));
//print_r($param_arr);
$output .= '<dl>';
//variable
if(!empty($param_arr[1])){
$var = $param_arr[1];
$output .= '<dt><b>'.$var.'</b></dt>';
unset($param_arr[1]);
}
$output .= '<dd>';
//datatype
if(!empty($param_arr[0])){
$datatype = $param_arr[0];
$link_open = '';
$link_close = '';
if($datatype=='string' || $datatype=='String'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#String" target="_blank">';
$link_close = '</a>';
}
if($datatype=='int'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Integer" target="_blank">';
$link_close = '</a>';
}
if($datatype=='bool'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Boolean" target="_blank">';
$link_close = '</a>';
}
$output .= '('.$link_open.'<i>'.$datatype.'</i>'.$link_close.') ';
unset($param_arr[0]);
}
//optional
$optional = '(<i>'.__('required', CDXC_TEXTDOMAIN).'</i>)';
if(!empty($param_arr[2])){
$opt = $param_arr[2];
if($opt=='Optional.' || $opt=='optional.'){
$optional = '(<i>'.__('optional', CDXC_TEXTDOMAIN).'</i>)';
unset($param_arr[2]);
}
}
$output .= $optional.' ';
//we now split into descriptions.
$param_str = implode(' ',$param_arr);
$param_arr = explode('.',$param_str);
$param_arr = array_filter($param_arr);
//print_r($param_arr);
//description/default
$default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.__('None', CDXC_TEXTDOMAIN).'</i></dd></dl>';
foreach ($param_arr as $bit) {
$bit = trim($bit);
//echo '#'.$bit.'#';
if(substr( $bit, 0, 7) === 'Default'){
$bits = explode('Default',$bit);
$default = '<dl><dd>'.__('Default', CDXC_TEXTDOMAIN).': <i>'.$bits[1].'</i></dd></dl>';
}else{
$output .= $bit.'. ';
}
}
$output .= $default;
$output .= '</dd>';
$output .= '</dl>';
return $output;
}
/**
* Get and format content output for example section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_example', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for return section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_return_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_return', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$meta_value = <API key>($meta_value);
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_return_content', $content, $post_id, $title);
}
/**
* Arrange a return value into a usable HTML output.
*
* @since 1.0.0
* @package Codex_Creator
* @param string $value The string value to be used.
* @return string Formatted HTML on success.
*/
function <API key>($value)
{
if($value==''){return '';}
$output = '';
$param_arr = explode(' ',$value);
$param_arr = array_values(array_filter($param_arr));
//print_r($param_arr);
$output .= '<dl>';
//datatype
if(!empty($param_arr[0])){
$datatype = $param_arr[0];
$link_open = '';
$link_close = '';
if($datatype=='string' || $datatype=='String'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#String" target="_blank">';
$link_close = '</a>';
}
if($datatype=='int'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Integer" target="_blank">';
$link_close = '</a>';
}
if($datatype=='bool'){
$link_open = '<a href="http://codex.wordpress.org/<API key>#Boolean" target="_blank">';
$link_close = '</a>';
}
$output .= '<dt><b>('.$link_open.'<i>'.$datatype.'</i>'.$link_close.')</b></dt>';
unset($param_arr[0]);
}
$output .= '<ul>';
//we now split into descriptions.
$param_str = implode(' ',$param_arr);
$param_arr = explode('.',$param_str);
$param_arr = array_filter($param_arr);
//print_r($param_arr);
//description/default
foreach ($param_arr as $bit) {
$bit = trim($bit);
$output .= '<li>'.$bit.'. </li>';
}
$output .= '</ul>';
$output .= '</dl>';
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return $output;
}
/**
* Get and format content output for see section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_see_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_see', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $value) {
$value = <API key>($value);
$content .= CDXC_CONTENT_START . $value . CDXC_CONTENT_END;
}
} else {
$meta_value = <API key>($meta_value);
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
}
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_see_content', $content, $post_id, $title);
}
/**
* Arrange a see value into a usable HTML output.
*
* @since 1.0.0
* @package Codex_Creator
* @param string $value The string value to be used.
* @return string Formatted HTML on success.
* @todo make this format URL's.
*/
function <API key>($text)
{
if ($text == '') {
return '';
}
if (strpos($text,'"') !== false || strpos($text,"'") !== false) {// we have a hook
$new_text = str_replace(array('"',"'"),'',$text);
$page = get_page_by_title($new_text, OBJECT, 'codex_creator');
if($page) {
$link = get_permalink($page->ID);
$text = "<a href='$link' >$text</a>";
}
}elseif(strpos($text,'()') !== false){
$new_text = str_replace('()','',$text);
$page = get_page_by_title($new_text, OBJECT, 'codex_creator');
if($page) {
$link = get_permalink($page->ID);
$text = "<a href='$link' >$text</a>";
}
}
return $text;
}
/**
* Get and format content output for since section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_since_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_since', true);
if (!$meta_value) {
return;
}
if (is_array($meta_value) && empty($meta_value)) {
return false;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$tags = array();
if (is_array($meta_value)) {
$i=0;
foreach ($meta_value as $value) {
if($i==0){$since = __('Since', CDXC_TEXTDOMAIN).': ';}else{$since='';}
if ($pieces = explode(" ", $value)) {
$ver = $pieces[0];
unset($pieces[0]);
$text = join(' ', $pieces);
$content .= CDXC_CONTENT_START .$since. '<a href="%' . $ver . '%">' . $ver . '</a>' . ' ' . $text . CDXC_CONTENT_END;
$tags[] = $ver;
} else {
$content .= CDXC_CONTENT_START . '<a href="%' . $value . '%">' . $value . '</a>' . CDXC_CONTENT_END;
$tags[] = $value;
}
$i++;
}
} else {
$content .= CDXC_CONTENT_START .__('Since', CDXC_TEXTDOMAIN). ': <a href="%' . $meta_value . '%">' . $meta_value . '</a>' . CDXC_CONTENT_END;
$tags[] = $meta_value;
}
// get the project slug
$project_slug = 'project-not-found';
$project_terms = wp_get_object_terms($post_id, 'codex_project');
if (!is_wp_error($project_terms) && !empty($project_terms) && is_object($project_terms[0])) {
foreach ($project_terms as $p_term) {
if ($p_term->parent == '0') {
$project_slug = $p_term->slug;
}
}
}
//set all tags to have prefix of the project
$alt_tags = array();
foreach ($tags as $temp_tag) {
$alt_tags[] = $project_slug . '_' . $temp_tag;
}
$tags = $alt_tags;
$tags_arr = wp_set_post_terms($post_id, $tags, 'codex_tags', false);
//print_r($tags_arr);//exit;
if (is_array($tags_arr)) {
foreach ($tags_arr as $key => $tag_id) {
//$term = get_term($tag_id, 'codex_tags');
$term = get_term_by('term_taxonomy_id', $tag_id, 'codex_tags');
$tag_link = get_term_link($term, 'codex_tags');
$orig_ver = str_replace($project_slug . '_', '', $tags[$key]);
$content = str_replace('%' . $orig_ver . '%', $tag_link, $content);
}
}
// print_r($tags_arr);exit;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_since_content', $content, $post_id, $title);
}
/**
* Get and format content output for subpackage section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_subpackage', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for todo section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_todo_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_todo', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_todo_content', $content, $post_id, $title);
}
/**
* Get and format content output for type section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_type_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_type', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_type_content', $content, $post_id, $title);
}
/**
* Get and format content output for uses section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_uses_content($post_id, $title)
{ return;// @todo make this work with arrays.
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_uses', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_uses_content', $content, $post_id, $title);
}
/**
* Get and format content output for var section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_var_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_var', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_var_content', $content, $post_id, $title);
}
/**
* Get and format content output for functions section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_meta_functions', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
//$content .= CDXC_CONTENT_START.$meta_value.CDXC_CONTENT_END;
if (is_array($meta_value)) {
foreach ($meta_value as $func) {
$func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator');
// print_r($func_arr);exit;
if (is_object($func_arr)) {
$link = get_permalink($func_arr->ID);
$content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $func[1] . '()</a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
} else {
$content .= CDXC_CONTENT_START . $func[1] . '() [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
}
}
}
//$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for actions section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_meta_actions', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $func) {
$func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator');
//print_r($func_arr);exit;
$name = "'".$func[1]."'";
if (is_object($func_arr)) {
$link = get_permalink($func_arr->ID);
$content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
} else {
$content .= CDXC_CONTENT_START . $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
}
}
}
//$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for filters section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_meta_filters', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $func) {
$func_arr = get_page_by_title($func[1], OBJECT, 'codex_creator');
// print_r($func_arr);exit;
$name = "'".$func[1]."'";
if (is_object($func_arr)) {
$link = get_permalink($func_arr->ID);
$content .= CDXC_CONTENT_START . '<a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
} else {
$content .= CDXC_CONTENT_START . $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func[2] . ']' . CDXC_CONTENT_END;
}
}
}
//$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for location section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_type = get_post_meta($post_id, 'cdxc_meta_type', true);
if ($meta_type == 'file' || $meta_type == 'action' || $meta_type == 'filter') {
return false;
}
$meta_value = get_post_meta($post_id, 'cdxc_meta_path', true);
if (!$meta_value) {
return;
}
$line = get_post_meta($post_id, 'cdxc_meta_line', true);
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
$file_name = basename($meta_value);
$func_arr = get_post($post_id);
$func_name = $func_arr->post_title;
if($meta_type=='function'){
$func_name_n = $func_name. '() ';
}else{
$func_name_n = "'".$func_name. "' ";
}
$file_arr = get_page_by_title($file_name, OBJECT, 'codex_creator');
if (is_object($file_arr)) {
$link = get_permalink($file_arr->ID);
$content .= CDXC_CONTENT_START .$func_name_n . __('is located in', CDXC_TEXTDOMAIN) . ' <a href="' . $link . '">' . $meta_value . '</a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $line . ']' . CDXC_CONTENT_END;
} else {
$content .= CDXC_CONTENT_START . $func_name_n . __('is located in', CDXC_TEXTDOMAIN) . ' ' . $meta_value . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $line . ']' . CDXC_CONTENT_END;
}
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
/**
* Get and format content output for source code section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function cdxc_code_content($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_meta_code', true);
if (!$meta_value) {
return;
}
$meta_value = "%%CDXC_SRC_CODE%%";
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
//$content .= CDXC_PHP_CODE_START . $meta_value . CDXC_PHP_CODE_END;
$content .= CDXC_CONTENT_START . $meta_value . CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('cdxc_code_content', $content, $post_id, $title);
}
/**
* Get and format content output for filters section of the codex page.
*
* @since 1.0.0
* @package Codex_Creator
* @param int $post_id Post ID of the post content required.
* @param string $title Title for the content section.
* @return string The formatted content.
*/
function <API key>($post_id, $title)
{
$content = '';
$meta_value = get_post_meta($post_id, 'cdxc_meta_used_by', true);
if (!$meta_value) {
return;
}
$content .= CDXC_TITLE_START . $title . CDXC_TITLE_END;
if (is_array($meta_value)) {
foreach ($meta_value as $func) {
$func_arr = get_page_by_title($func['function_name'], OBJECT, 'codex_creator');
// print_r($func_arr);exit;
$name = '';
if($func['function_name']){
$name = "".$func['function_name']."()";
}
if (is_object($func_arr)) {
$link = get_permalink($func_arr->ID);
$content .= CDXC_CONTENT_START . $func['file_path'].': <a href="' . $link . '">' . $name . ' </a> [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func['hook_line'] . ']' . CDXC_CONTENT_END;
} else {
$content .= CDXC_CONTENT_START .$func['file_path'].': '. $name . ' [' . __('Line', CDXC_TEXTDOMAIN) . ': ' . $func['hook_line'] . ']' . CDXC_CONTENT_END;
}
}
}
//$content .= CDXC_CONTENT_START.print_r($meta_value,true).CDXC_CONTENT_END;
/**
* Filter the content returned by the function.
*
* @since 1.0.0
* @param string $content The content to be output.
* @param int $post_id The post ID.
* @param string $title The title for the content.
*/
return apply_filters('<API key>', $content, $post_id, $title);
}
|
package verdandi;
public class <API key> extends Exception {
private static final long serialVersionUID = 1L;
public <API key>() {
super();
}
/**
* @param message
*/
public <API key>(String message) {
super(message);
}
}
|
/*
* This section contains meta informations.
*
* $Id$
*/
package jmul.web.page;
import java.io.File;
import java.io.FileInputStream;
import java.io.<API key>;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import jmul.io.NestedStreams;
import jmul.io.NestedStreamsImpl;
import jmul.misc.exceptions.<API key>;
import static jmul.string.Constants.FILE_SEPARATOR;
import static jmul.string.Constants.SLASH;
/**
* This class represents an entity which loads web content from the file
* system.
*
* @author Kristian Kutin
*/
public class PageLoader {
/**
* The base directory of the web content.
*/
private final File baseDirectory;
/**
* The file with the page content.
*/
private final File file;
/**
* Creates a new instance of a content loader.
*
* @param aBaseDirectory
* a base directory
* @param aFile
* a file (i.e. file path)
*/
public PageLoader(File aBaseDirectory, File aFile) {
baseDirectory = aBaseDirectory;
file = aFile;
}
/**
* Loads the web content.
*
* @return web content
*/
public PublishedPage loadContent() {
String path = getPath();
NestedStreams nestedStreams = null;
try {
nestedStreams = openStreams(file);
} catch (<API key> e) {
String message = "Unable to load the web content (\"" + file + "\")!";
throw new PageLoaderException(message, e);
}
byte[] content = null;
try {
content = loadContent(nestedStreams);
} catch (IOException e) {
Throwable followupError = null;
try {
nestedStreams.close();
} catch (IOException f) {
followupError = f;
}
String message = "Error while reading from file (\"" + file + "\")!";
if (followupError != null) {
throw new PageLoaderException(message, new <API key>(e, followupError));
} else {
throw new PageLoaderException(message, followupError);
}
}
return new PublishedPage(path, content);
}
/**
* Determines the web path for this file relative to the base directory.
*
* @param aBaseDirectory
* @param aFile
*
* @return a path
*
* @throws IOException
* is thrown if the specified directory or file cannot be resolved to
* absolute paths
*/
private static String determinePath(File aBaseDirectory, File aFile) throws IOException {
String directory = aBaseDirectory.getCanonicalPath();
String fileName = aFile.getCanonicalPath();
String path = fileName.replace(directory, "");
path = path.replace(FILE_SEPARATOR, SLASH);
return path;
}
/**
* Opens a stream to read from the specified file.
*
* @param aFile
*
* @return an input stream
*
* @throws <API key>
* is thrown if the specified file doesn't exist
*/
private static NestedStreams openStreams(File aFile) throws <API key> {
InputStream reader = new FileInputStream(aFile);
return new NestedStreamsImpl(reader);
}
/**
* Tries to load the web content from the specified file.
*
* @param someNestedStreams
*
* @return some web content
*
* @throws IOException
* is thrown if an error occurred while reading from the file
*/
private static byte[] loadContent(NestedStreams someNestedStreams) throws IOException {
InputStream reader = (InputStream) someNestedStreams.getOuterStream();
List<Byte> buffer = new ArrayList<>();
while (true) {
int next = reader.read();
if (next == -1) {
break;
}
buffer.add((byte) next);
}
int size = buffer.size();
byte[] bytes = new byte[size];
for (int a = 0; a < size; a++) {
Byte b = buffer.get(a);
bytes[a] = b;
}
return bytes;
}
/**
* Returns the path of the web page.
*
* @return a path
*/
public String getPath() {
String path = null;
try {
path = determinePath(baseDirectory, file);
} catch (IOException e) {
String message = "Unable to resolve paths (\"" + baseDirectory + "\" & \"" + file + "\")!";
throw new PageLoaderException(message, e);
}
return path;
}
}
|
#include "gensvm_debug.h"
/**
* @brief Print a dense matrix
*
* @details
* Debug function to print a matrix
*
* @param[in] M matrix
* @param[in] rows number of rows of M
* @param[in] cols number of columns of M
*/
void gensvm_print_matrix(double *M, long rows, long cols)
{
long i, j;
for (i=0; i<rows; i++) {
for (j=0; j<cols; j++) {
if (j > 0)
note(" ");
note("%+6.6f", matrix_get(M, cols, i, j));
}
note("\n");
}
note("\n");
}
/**
* @brief Print a sparse matrix
*
* @details
* Debug function to print a GenSparse sparse matrix
*
* @param[in] A a GenSparse matrix to print
*
*/
void gensvm_print_sparse(struct GenSparse *A)
{
long i;
// print matrix dimensions
note("Sparse Matrix:\n");
note("\tnnz = %li, rows = %li, cols = %li\n", A->nnz, A->n_row,
A->n_col);
// print nonzero values
note("\tvalues = [ ");
for (i=0; i<A->nnz; i++) {
if (i != 0) note(", ");
note("%f", A->values[i]);
}
note(" ]\n");
// print row indices
note("\tIA = [ ");
for (i=0; i<A->n_row+1; i++) {
if (i != 0) note(", ");
note("%i", A->ia[i]);
}
note(" ]\n");
// print column indices
note("\tJA = [ ");
for (i=0; i<A->nnz; i++) {
if (i != 0) note(", ");
note("%i", A->ja[i]);
}
note(" ]\n");
}
|
package au.edu.anu.datacommons.doi;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.StringWriter;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.datacite.schema.kernel_4.Resource;
import org.datacite.schema.kernel_4.Resource.Creators;
import org.datacite.schema.kernel_4.Resource.Creators.Creator;
import org.datacite.schema.kernel_4.Resource.Creators.Creator.CreatorName;
import org.datacite.schema.kernel_4.Resource.Identifier;
import org.datacite.schema.kernel_4.Resource.Titles;
import org.datacite.schema.kernel_4.Resource.Titles.Title;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sun.jersey.test.framework.JerseyTest;
public class DoiClientTest extends JerseyTest
{
private static final Logger LOGGER = LoggerFactory.getLogger(DoiClientTest.class);
private DoiClient doiClient;
private String sampleDoi = "10.5072/13/50639BFE25F18";
private static JAXBContext context;
private Marshaller marshaller;
private Unmarshaller unmarshaller;
public DoiClientTest()
{
super("au.edu.anu.datacommons.doi");
// LOGGER.trace("In Constructor");
// WebResource webResource = resource();
// DoiConfig doiConfig = new DoiConfigImpl(webResource.getURI().toString(), appId);
// doiClient = new DoiClient(doiConfig);
doiClient = new DoiClient();
}
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
context = JAXBContext.newInstance(Resource.class);
}
@AfterClass
public static void tearDownAfterClass() throws Exception
{
}
@Before
public void setUp() throws Exception
{
super.setUp();
marshaller = context.createMarshaller();
marshaller.setProperty(Marshaller.<API key>, true);
marshaller.setProperty(Marshaller.<API key>, "http:
}
@After
public void tearDown() throws Exception
{
super.tearDown();
}
@Ignore
public void testMint()
{
try
{
doiClient.mint("https://datacommons.anu.edu.au:8443/DataCommons/item/anudc:3320", <API key>());
String respStr = doiClient.<API key>();
LOGGER.trace(respStr);
}
catch (Exception e)
{
failOnException(e);
}
}
@Ignore
public void testUpdate()
{
try
{
Resource res = new Resource();
Creators creators = new Creators();
Creator creator = new Creator();
CreatorName creatorName = new CreatorName();
creatorName.setValue("Creator 1");
creator.setCreatorName(creatorName);
creators.getCreator().add(creator);
res.setCreators(creators);
Titles titles = new Titles();
Title title = new Title();
title.setValue("Title 1");
titles.getTitle().add(title);
res.setTitles(titles);
res.setPublisher("Publisher 1");
res.setPublicationYear("1987");
Identifier id = new Identifier();
id.setValue(sampleDoi);
id.setIdentifierType("DOI");
res.setIdentifier(id);
doiClient.update(sampleDoi, null, res);
Resource newRes = doiClient.getMetadata(sampleDoi);
String resAsStr = getResourceAsString(newRes);
LOGGER.trace(resAsStr);
}
catch (Exception e)
{
failOnException(e);
}
}
@Ignore
public void testDeactivate()
{
try
{
doiClient.deactivate(sampleDoi);
assertTrue(doiClient.<API key>().indexOf("AbsolutePath:" + resource().getURI().toString() + "deactivate.xml/") != -1);
// assertTrue(doiClient.<API key>().indexOf("QueryParam:app_id=TEST" + appId) != -1);
assertTrue(doiClient.<API key>().indexOf("QueryParam:doi=" + sampleDoi) != -1);
}
catch (Exception e)
{
failOnException(e);
}
}
@Ignore
public void testActivate()
{
try
{
doiClient.activate(sampleDoi);
assertTrue(doiClient.<API key>().indexOf("AbsolutePath:" + resource().getURI().toString() + "activate.xml/") != -1);
// assertTrue(doiClient.<API key>().indexOf("QueryParam:app_id=TEST" + appId) != -1);
assertTrue(doiClient.<API key>().indexOf("QueryParam:doi=" + sampleDoi) != -1);
}
catch (Exception e)
{
failOnException(e);
}
}
@Test
public void testGetDoiMetaData()
{
try
{
Resource res = doiClient.getMetadata(sampleDoi);
StringWriter strW = new StringWriter();
marshaller.marshal(res, strW);
// assertTrue(doiClient.<API key>().indexOf("AbsolutePath:" + resource().getURI().toString() + "xml.xml/") != -1);
// assertTrue(doiClient.<API key>().indexOf("QueryParam:doi=" + sampleDoi) != -1);
}
catch (Exception e)
{
failOnException(e);
}
}
private Resource <API key>()
{
Resource metadata = new Resource();
Titles titles = new Titles();
Title title1 = new Title();
title1.setValue("Some title without a type");
titles.getTitle().add(title1);
metadata.setTitles(titles);
Creators creators = new Creators();
metadata.setCreators(creators);
Creator creator = new Creator();
CreatorName creatorName = new CreatorName();
creatorName.setValue("Smith, John");
creator.setCreatorName(creatorName);
metadata.getCreators().getCreator().add(creator);
metadata.setPublisher("Some random publisher");
metadata.setPublicationYear("2010");
return metadata;
}
private String getResourceAsString(Resource res) throws JAXBException
{
StringWriter strW = new StringWriter();
marshaller.marshal(res, strW);
return strW.toString();
}
private void failOnException(Throwable e)
{
LOGGER.error(e.getMessage(), e);
fail(e.getMessage());
}
}
|
/* Borrowed from coreutils. */
#ifndef DIE_H
# define DIE_H
# include <error.h>
# include <stdbool.h>
# include <verify.h>
/* Like 'error (STATUS, ...)', except STATUS must be a nonzero constant.
This may pacify the compiler or help it generate better code. */
# define die(status, ...) \
verify_expr (status, (error (status, __VA_ARGS__), assume (false)))
#endif /* DIE_H */
|
// This program is free software: you can redistribute it and/or modify
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#include "version.h"
#define STR_HELPER(x)
#define STR(x) STR_HELPER(x)
#ifndef APP_NAME
#define APP_NAME "target"
#endif
#ifndef APP_MAJOR
#define APP_MAJOR 0
#endif
#ifndef APP_MINOR
#define APP_MINOR 0
#endif
#ifndef APP_PATCH
#define APP_PATCH 0
#endif
#ifndef APP_VERSION
#define APP_VERSION STR(APP_MAJOR) "." STR(APP_MINOR) "." STR(APP_PATCH)
#endif
const char *appName()
{
return STR(APP_NAME);
}
const char *appShortName()
{
return STR(APP_NAME);
}
const char *appFullName()
{
return STR(APP_NAME);
}
const char *appVersion()
{
return STR(APP_VERSION);
}
const char *appBuildNumber()
{
#ifdef APP_BUILD_NUMBER
return STR(APP_BUILD_NUMBER);
#else
return "0";
#endif
}
const char *appBuildDate()
{
#ifdef APP_BUILD_DATE
return STR(APP_BUILD_DATE);
#else
return "0000-00-00T00:00:00+0000";
#endif
}
const char *appRevision()
{
#ifdef APP_REVISION
return STR(APP_REVISION);
#else
return "0";
#endif
}
const char *appSources()
{
#ifdef APP_SOURCES
return STR(APP_SOURCES);
#else
return "";
#endif
}
|
import { Model } from "chomex";
import catalog from "./catalog";
export interface DeckCaptureLike {
_id: any;
title: string;
row: number; col: number; page: number;
cell: { x: number; y: number; w: number, h: number; };
protected?: boolean;
}
export default class DeckCapture extends Model {
static __ns = "DeckCapture";
static default = {
normal: {
title: "",
row: 3,
col: 2,
cell: catalog.fleet,
protected: true,
},
combined: {
title: "",
row: 3,
col: 2,
cell: catalog.fleet,
protected: true,
page: 2,
pagelabel: ["", ""],
},
aviation: {
title: "",
row: 1,
col: 3,
cell: catalog.aviation,
protected: true,
},
};
title: string;
row: number;
col: number;
cell: {
x: number; // X 1
y: number; // Y 1
w: number;
h: number;
};
protected = false;
page = 1;
pagelabel: string[] = [];
obj(): DeckCaptureLike {
return {
_id: this._id,
title: this.title,
row: this.row, col: this.col, page: this.page,
cell: {...this.cell},
protected: this.protected,
};
}
static listObj(): DeckCaptureLike[] {
return this.list<DeckCapture>().map(d => d.obj());
}
}
|
#include "ImageLoadQueue.h"
// synchronized against all other methods
ImageLoadItem ImageLoadQueue::pop ( void )
{
ImageLoadItem x;
_sem.acquire();
_mutex.lock();
x = QQueue<ImageLoadItem>::front();
QQueue<ImageLoadItem>::pop_front();
_mutex.unlock();
return x;
}
// synchronized against all other methods
ImageLoadItem ImageLoadQueue::popWithPriority ( void )
{
ImageLoadItem x;
_sem.acquire();
_mutex.lock();
QQueue<ImageLoadItem>::Iterator it;
QQueue<ImageLoadItem>::Iterator it_max;
int max_prio = -1;
for ( it = this->begin(); it != this->end(); it++ )
{
if ( it->priority > max_prio )
{
max_prio = it->priority;
it_max = it;
}
}
x = *it_max;
this->erase( it_max );
_mutex.unlock();
return x;
}
// synchronized only against pop
void ImageLoadQueue::push ( const ImageLoadItem &x )
{
_mutex.lock();
QQueue<ImageLoadItem>::push_back(x);
_sem.release();
_mutex.unlock();
}
// synchronized only against pop
QList<ImageLoadItem> ImageLoadQueue::clear( void )
{
QList<ImageLoadItem> cleared_items = QList<ImageLoadItem>();
while ( _sem.tryAcquire() )
{
ImageLoadItem x;
_mutex.lock();
x = QQueue<ImageLoadItem>::front();
QQueue<ImageLoadItem>::pop_front();
_mutex.unlock();
cleared_items.append( x );
}
return cleared_items;
}
void ImageLoadQueue::clearPriorities( void )
{
_mutex.lock();
QQueue<ImageLoadItem>::Iterator it;
for ( it = this->begin(); it != this->end(); it++ )
{
it->priority = 0;
}
_mutex.unlock();
}
void ImageLoadQueue::updatePriority( QImage ** dest, int priority )
{
_mutex.lock();
QQueue<ImageLoadItem>::Iterator it;
for ( it = this->begin(); it != this->end(); it++ )
{
if ( it->destination == dest )
it->priority = priority;
}
_mutex.unlock();
}
|
#include "Nucleus/Hash.h"
#include "Nucleus/Tests/Hash/HashTest.h"
const bool expectedToPass = true;
int main()
{
psonSessionContext context;
psonHash* pHash;
enum psoErrors errcode;
char* key1 = "My Key 1";
char* key2 = "My Key 2";
char* data1 = "My Data 1";
char* data2 = "My Data 2";
psonHashItem * pHashItem;
pHash = initHashTest( expectedToPass, &context );
errcode = psonHashInit( pHash, g_memObjOffset, 100, &context );
if ( errcode != PSO_OK ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
errcode = psonHashInsert( pHash,
(unsigned char*)key1,
strlen(key1),
data1,
strlen(data1),
&pHashItem,
&context );
if ( errcode != PSO_OK ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
/* A duplicate - not allowed */
errcode = psonHashInsert( pHash,
(unsigned char*)key1,
strlen(key1),
data2,
strlen(data2),
&pHashItem,
&context );
if ( errcode != <API key> ) {
ERROR_EXIT( expectedToPass, NULL, ; );
}
errcode = psonHashInsert( pHash,
(unsigned char*)key2,
strlen(key2),
data1,
strlen(data1),
&pHashItem,
&context );
if ( errcode != PSO_OK ) {
ERROR_EXIT( expectedToPass, &context.errorHandler, ; );
}
return 0;
}
|
#ifndef <API key>
#define <API key>
#include "module.h"
using namespace std;
using FeatureMap = vector<vector<Neuron*>>;
FeatureMap* matrifyNeurons(vector<Neuron*>& v, int sizex, int sizey) {
FeatureMap *fmap = new FeatureMap();
fmap->resize(sizex);
int z = 0;
for(unsigned int x = 0; x < fmap->size(); x++) {
fmap->at(x).resize(sizey);
for(unsigned int y = 0; y < fmap->at(x).size(); y++) {
fmap->at(x).at(y) = v.at(z);
z++;
}
}
return fmap;
}
class SubsampleModule : public Module {
private:
int inputSize;
double lowerWeightLimit,upperWeightLimit;
int sizex, sizey, numFeatures, featureSize;
vector<FeatureMap*> featureMaps;
public:
SubsampleModule(int numFeatures, int sizex, int sizey) {
this->sizex = sizex;
this->sizey = sizey;
this->featureSize = sizex*sizey;
this->numFeatures = numFeatures;
for(int n = 0; n < featureSize*numFeatures/pow(2,2); n++) {
neurons.push_back(new Neuron(0.25, 0.25));
}
for(int f = 0; f < numFeatures; f++) {
vector<Neuron*> v(neurons.begin()+(f*floor(sizex/2.0)*floor(sizey/2.0)),neurons.begin()+((f+1)*floor(sizex/2.0)*floor(sizey/2.0)));
featureMaps.push_back(matrifyNeurons(v,floor(sizex/2.0),floor(sizey/2.0)));
}
}
void connect(Module* prev) {
int z = 0;
for(int f = 0; f < numFeatures; f++) {
vector<Neuron*> v(prev->getNeurons().begin()+(f*sizex*sizey),prev->getNeurons().begin()+((f+1)*sizex*sizey));
FeatureMap* fmap = matrifyNeurons(v,sizex,sizey);
for(int fx = 0; fx < featureMaps[f]->size(); fx++) {
for(int fy = 0; fy < featureMaps[f]->at(0).size(); fy++) {
for(int ix = fx*2; ix < fx*2 + 2; ix++) {
for(int iy = fy*2; iy < fy*2 + 2; iy++) {
//cout << f << " connecting " << fx << "," << fy << " to " << ix << "," << iy << endl;
featureMaps[f]->at(fx).at(fy)->connect(fmap->at(ix).at(iy),new Weight());
}
}
}
}
}
//cout << "size " << neurons.size() << endl;
}
void gradientDescent(double learningRate) {}
};
#endif
|
// <auto-generated>
// This code was generated from a template.
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
namespace WithoutPath.DAL
{
using System;
using System.Collections.Generic;
public partial class ShipType
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:<API key>")]
public ShipType()
{
this.Characters = new HashSet<Character>();
}
public int Id { get; set; }
public long EveID { get; set; }
public string Name { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:<API key>")]
public virtual ICollection<Character> Characters { get; set; }
}
}
|
package co.edu.udea.ingenieriaweb.admitravel.bl;
import java.util.List;
import co.edu.udea.ingenieriaweb.admitravel.dto.PaqueteDeViaje;
import co.edu.udea.ingenieriaweb.admitravel.util.exception.IWBLException;
import co.edu.udea.ingenieriaweb.admitravel.util.exception.IWDaoException;
public interface PaqueteDeViajeBL {
public void guardar(String idPaquete, String destinos, String transporte, String alimentacion,
String duracionViaje) throws IWDaoException, IWBLException;
public void actualizar(PaqueteDeViaje paqueteDeViaje, String idPaquete, String destinos,
String transporte, String alimentacion, String duracionViaje)throws IWDaoException, IWBLException;
PaqueteDeViaje obtener(String idPaquete) throws IWDaoException, IWBLException;
}
|
// mailer.js
var nodemailer = require('nodemailer');
var smtpTransport = nodemailer.createTransport("SMTP", {
service: "Mandrill",
debug: true,
auth: {
user: "evanroman1@gmail.com",
pass: "<API key>"
}
});
exports.<API key> = function(emailaddress, username, firstname, expiremoment, token){
var mailOptions = {
from: "confirm@ativinos.com", // sender address
to: emailaddress, // list of receivers
subject: "Confirm email and start Ativinos", // Subject line
text: 'Hi '
+firstname+
', your account, '
+username+
', will be enabled after you confirm your email. Your account will be deleted by '
+ expiremoment +
' if you do not verify email before then. To verify your email, visit http:
+ token +
'&username='
+ username,
html: 'Hi '
+firstname+
', your account, '
+username+
', will be enabled after you confirm your email. Your account will be deleted by '
+ expiremoment +
' if you do not verify email before then. To verify your email, visit <a href="http:
+ token +
'&username='
+ username +
'">http:
+ token +
'&username='
+ username +
'</a>',
}
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}
})
}
|
$(function(){
$('#telefone').mask('(99)9999-9999');
$('.editar').on({
click : function(){
var url = URI+"sistema/editar/"+$(this).attr('data-item');
window.location.href = url;
}
});
$('.deletar').on({
click : function(){
var $selecionados = get_selecionados();
if($selecionados.length > 0)
{
var $url = URI+"sistema/remover/";
if (window.confirm("deseja apagar os ("+$selecionados.length+") itens selecionados? "))
{
$.post($url, { 'selecionados': $selecionados}, function(data){
pop_up(data, setTimeout(function(){location.reload()}, 100));
});
}
}
else
{
pop_up('nenhum item selecionado');
}
}
});
$('#description').on('keyup',function(){
var alvo = $("#char-digitado");
var max = 140;
var digitados = $(this).val().length;
var restante = max - digitados;
if(digitados > max)
{
var val = $(this).val();
$(this).val(val.substr(0, max));
restante = 0;
}
alvo.html(restante);
});
});
|
def plotHistory(plot_context, axes):
"""
@type axes: matplotlib.axes.Axes
@type plot_config: PlotConfig
"""
plot_config = plot_context.plotConfig()
if (
not plot_config.isHistoryEnabled()
or plot_context.history_data is None
or plot_context.history_data.empty
):
return
data = plot_context.history_data
style = plot_config.historyStyle()
lines = axes.plot_date(
x=data.index.values,
y=data,
color=style.color,
alpha=style.alpha,
marker=style.marker,
linestyle=style.line_style,
linewidth=style.width,
markersize=style.size,
)
if len(lines) > 0 and style.isVisible():
plot_config.addLegendItem("History", lines[0])
|
# -*- coding: UTF-8 -*-
from hashlib import md5
def gen_md5(content_str):
m = md5()
m.update(content_str)
return m.hexdigest()
|
#ifndef <API key>
#define <API key>
#include "Object.h"
#include "ObjectManager.h"
#include "icons/sketch.c"
#include <glibmm/i18n.h>
#include <cairomm/surface.h>
namespace Polka {
/*
class Palette;
class BitmapCanvas : public Polka::Object
{
public:
BitmapCanvas( int depth );
~BitmapCanvas();
enum Type { BP2, BP4, BP6, BRGB332, BRGB555 };
int width() const;
int height() const;
const Palette *getPalette( unsigned int slot = 0 ) const;
Cairo::RefPtr<Cairo::ImageSurface> getImage() const;
void setPalette( const Palette& palette, unsigned int slot = 0 );
protected:
virtual void doUpdate();
private:
Cairo::RefPtr<Cairo::ImageSurface> m_Image;
std::vector<char*> m_Data;
std::vector<const Palette *> m_Palettes;
};
class <API key> : public ObjectManager::ObjectFactory
{
public:
BitmapCanvasFactory()
: ObjectManager::ObjectFactory( _("16 Color Canvas"),
_("Sketch canvasses"), 20,
"BMP16CANVAS", "BITMAPCANVASEDIT",
"PAL1,PAL2,PALG9K",
sketch ) {}
Object *create() const { return new BitmapCanvas( BitmapCanvas::BP4 ); }
};
*/
} // namespace Polka
#endif // <API key>
|
#ifndef SD_CMD_H
#define SD_SD_CMD_H
/* CMD0: response R1 */
#define <API key> 0x00
/* CMD1: response R1 */
#define SD_CMD_SEND_OP_COND 0x01
/* CMD8: response R7 */
#define SD_CMD_SEND_IF_COND 0x08
/* CMD9: response R1 */
#define SD_CMD_SEND_CSD 0x09
/* CMD10: response R1 */
#define SD_CMD_SEND_CID 0x0a
/* CMD12: response R1 */
#define <API key> 0x0c
/* CMD13: response R2 */
#define SD_CMD_SEND_STATUS 0x0d
/* CMD16: arg0[31:0]: block length, response R1 */
#define SD_CMD_SET_BLOCKLEN 0x10
/* CMD17: arg0[31:0]: data address, response R1 */
#define <API key> 0x11
/* CMD18: arg0[31:0]: data address, response R1 */
#define <API key> 0x12
/* CMD24: arg0[31:0]: data address, response R1 */
#define <API key> 0x18
/* CMD25: arg0[31:0]: data address, response R1 */
#define <API key> 0x19
/* CMD27: response R1 */
#define SD_CMD_PROGRAM_CSD 0x1b
/* CMD28: arg0[31:0]: data address, response R1b */
#define <API key> 0x1c
/* CMD29: arg0[31:0]: data address, response R1b */
#define <API key> 0x1d
/* CMD30: arg0[31:0]: write protect data address, response R1 */
#define <API key> 0x1e
/* CMD32: arg0[31:0]: data address, response R1 */
#define <API key> 0x20
/* CMD33: arg0[31:0]: data address, response R1 */
#define <API key> 0x21
/* CMD34: arg0[31:0]: data address, response R1 */
#define SD_CMD_UNTAG_SECTOR 0x22
/* CMD35: arg0[31:0]: data address, response R1 */
#define <API key> 0x23
/* CMD36: arg0[31:0]: data address, response R1 */
#define <API key> 0x24
/* CMD37: arg0[31:0]: data address, response R1 */
#define <API key> 0x25
/* CMD38: arg0[31:0]: stuff bits, response R1b */
#define SD_CMD_ERASE 0x26
/* ACMD41: arg0[31:0]: OCR contents, response R1 */
#define SD_CMD_GET_OCR 0x29
/* CMD42: arg0[31:0]: stuff bits, response R1b */
#define SD_CMD_LOCK_UNLOCK 0x2a
/* CMD55: arg0[31:0]: stuff bits, response R1 */
#define SD_CMD_APP 0x37
/* CMD58: arg0[31:0]: stuff bits, response R3 */
#define SD_CMD_READ_OCR 0x3a
/* CMD59: arg0[31:1]: stuff bits, arg0[0:0]: crc option, response R1 */
#define SD_CMD_CRC_ON_OFF 0x3b
/* command responses */
/* R1: size 1 byte */
#define SD_R1_IDLE_STATE 0
#define SD_R1_ERASE_RESET 1
#define <API key> 2
#define SD_R1_COM_CRC_ERR 3
#define SD_R1_ERASE_SEQ_ERR 4
#define SD_R1_ADDR_ERR 5
#define SD_R1_PARAM_ERR 6
/* R1b: equals R1, additional busy bytes */
/* R2: size 2 bytes */
#define SD_R2_CARD_LOCKED 0
#define SD_R2_WP_ERASE_SKIP 1
#define SD_R2_ERR 2
#define SD_R2_CARD_ERR 3
#define SD_R2_CARD_ECC_FAIL 4
#define SD_R2_WP_VIOLATION 5
#define SD_R2_INVAL_ERASE 6
#define SD_R2_OUT_OF_RANGE 7
#define SD_R2_CSD_OVERWRITE 7
#define SD_R2_IDLE_STATE ( SD_R1_IDLE_STATE + 8)
#define SD_R2_ERASE_RESET ( SD_R1_ERASE_RESET + 8)
#define <API key> ( <API key> + 8)
#define SD_R2_COM_CRC_ERR ( SD_R1_COM_CRC_ERR + 8)
#define SD_R2_ERASE_SEQ_ERR ( SD_R1_ERASE_SEQ_ERR + 8)
#define SD_R2_ADDR_ERR ( SD_R1_ADDR_ERR + 8)
#define SD_R2_PARAM_ERR ( SD_R1_PARAM_ERR + 8)
/* R3: size 5 bytes */
#define SD_R3_OCR_MASK (0xffffffffUL)
#define SD_R3_IDLE_STATE ( SD_R1_IDLE_STATE + 32)
#define SD_R3_ERASE_RESET ( SD_R1_ERASE_RESET + 32)
#define <API key> ( <API key> + 32)
#define SD_R3_COM_CRC_ERR ( SD_R1_COM_CRC_ERR + 32)
#define SD_R3_ERASE_SEQ_ERR ( SD_R1_ERASE_SEQ_ERR + 32)
#define SD_R3_ADDR_ERR ( SD_R1_ADDR_ERR + 32)
#define SD_R3_PARAM_ERR ( SD_R1_PARAM_ERR + 32)
/* Data Response: size 1 byte */
#define SD_DR_STATUS_MASK 0x0e
#define <API key> 0x05
#define <API key> 0x0a
#define <API key> 0x0c
#endif // SD_CMD_H
|
using System;
namespace Server.Network
{
public delegate void OnPacketReceive( NetState state, PacketReader pvSrc );
public delegate bool <API key>( NetState state );
public class PacketHandler
{
public PacketHandler( int packetID, int length, bool ingame, OnPacketReceive onReceive )
{
PacketID = packetID;
Length = length;
Ingame = ingame;
OnReceive = onReceive;
}
public int PacketID { get; }
public int Length { get; }
public OnPacketReceive OnReceive { get; }
public <API key> ThrottleCallback { get; set; }
public bool Ingame { get; }
}
}
|
package com.github.wglanzer.redmine;
import java.util.function.Consumer;
/**
* Interface that is able to create background-tasks
*
* @author w.glanzer, 11.12.2016.
*/
public interface IRTaskCreator
{
/**
* Executes a given task in background
*
* @param pTask Task that should be done in background
* @return the given task
*/
<T extends ITask> T executeInBackground(T pTask);
/**
* Progress, that can be executed
*/
interface ITask extends Consumer<IProgressIndicator>
{
/**
* @return the name of the current progress
*/
String getName();
}
/**
* Indicator-Interface to call back to UI
*/
interface IProgressIndicator
{
/**
* Adds the given number to percentage
*
* @param pPercentage 0-100
*/
void addPercentage(double pPercentage);
}
}
|
<?php
$namespacetree = array(
'vector' => array(
),
'std' => array(
'vector' => array(
'inner' => array(
)
)
)
);
$string = "while(!acceptable(a)) <API key>(&a);";
|
#ifndef VIDDEF_H
#define VIDDEF_H
#include <QObject>
// FFmpeg is a pure C project, so to use the libraries within your C++ application you need
// to explicitly state that you are using a C library by using extern "C"."
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libswscale/swscale.h>
#include <libavutil/avstring.h>
#include <libavutil/time.h>
#include <libavutil/mem.h>
#include <libavutil/pixfmt.h>
}
#include <cmath>
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
#define AV_SYNC_THRESHOLD 0.01
#define AV_NOSYNC_THRESHOLD 10.0
#define <API key> 1
// YUV_Overlay is similar to SDL_Overlay
// A SDL_Overlay is similar to a SDL_Surface except it stores a YUV overlay.
// Possible format:
#define SDL_YV12_OVERLAY 0x32315659 /* Planar mode: Y + V + U */
#define SDL_IYUV_OVERLAY 0x56555949 /* Planar mode: Y + U + V */
#define SDL_YUY2_OVERLAY 0x32595559 /* Packed mode: Y0+U0+Y1+V0 */
#define SDL_UYVY_OVERLAY 0x59565955 /* Packed mode: U0+Y0+V0+Y1 */
#define SDL_YVYU_OVERLAY 0x55595659 /* Packed mode: Y0+V0+Y1+U0 */
typedef struct Overlay {
quint32 format;
int w, h;
int planes;
quint16 *pitches;
quint8 **pixels;
quint32 hw_overlay:1;
} YUV_Overlay;
typedef struct PacketQueue {
AVPacketList *first_pkt, *last_pkt;
int nb_packets;
int size;
} PacketQueue;
typedef struct VideoPicture {
YUV_Overlay *bmp;
int width, height; /* source height & width */
int allocated;
double pts;
} VideoPicture;
typedef struct VideoState {
AVFormatContext *pFormatCtx;
int videoStream;
double frame_timer;
double frame_last_pts;
double frame_last_delay;
double video_clock; ///<pts of last decoded frame / predicted pts of next decoded frame
AVStream *video_st;
PacketQueue videoq;
VideoPicture pictq[<API key>];
int pictq_size, pictq_rindex, pictq_windex;
int quit;
AVIOContext *io_context;
struct SwsContext *sws_ctx;
} VideoState;
#endif // VIDDEF_H
|
// ADOBE SYSTEMS INCORPORATED
// NOTICE: Adobe permits you to use, modify, and distribute this
// accompanying it. If you have received this file from a source
// other than Adobe, then your use, modification, or distribution
/*
File: NearestBaseUIWin.c
C source file for Windows specific code for Color Picker example.
*/
#include "NearestBase.h"
#include "DialogUtilities.h"
DLLExport BOOL WINAPI PickerProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam); // Win32 Change
void DoAbout (AboutRecordPtr about)
{
ShowAbout(about);
}
DLLExport BOOL WINAPI PickerProc(HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) // Win32 Change
{
int idd; // WIN32 Change
static GPtr globals=NULL; /* need to be static */
long x = 0;
switch (wMsg)
{
case WM_INITDIALOG:
/* set up globals */
globals = (GPtr) lParam;
CenterDialog(hDlg);
/* fall into WM_PAINT */
case WM_PAINT:
return FALSE;
break;
case WM_COMMAND:
idd = COMMANDID (wParam); // WIN32 Change
if (idd == x) // any radio groups
; // handle radios;
else
{
switch (idd)
{
case OK:
// assign to globals
EndDialog(hDlg, idd);
break;
case CANCEL:
gResult = userCanceledErr;
EndDialog(hDlg, idd); // WIN32 change
break;
default:
return FALSE;
break;
}
}
break;
default:
return FALSE;
break;
}
return TRUE;
}
Boolean DoParameters (GPtr globals)
{
INT_PTR nResult = noErr;
PlatformData *platform;
platform = (PlatformData *)((PickerRecordPtr) gStuff)->platformData;
/* Query the user for parameters. */
nResult = DialogBoxParam(GetDLLInstance(),
(LPSTR)"PICKERPARAM",
(HWND)platform->hwnd,
(DLGPROC)PickerProc,
(LPARAM)globals);
return (nResult == OK); // could be -1
}
// NearestBaseUIWin.cpp
|
# This file is part of Sick Beard.
# Sick Beard is free software: you can redistribute it and/or modify
# (at your option) any later version.
# Sick Beard is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
import lazylibrarian
from lazylibrarian import logger, common, formatter
# parse_qsl moved to urlparse module in v2.6
try:
from urlparse import parse_qsl #@UnusedImport
except:
from cgi import parse_qsl #@Reimport
import lib.oauth2 as oauth
import lib.pythontwitter as twitter
class TwitterNotifier:
<TwitterConsumerkey>"
consumer_<API key>
REQUEST_TOKEN_URL = 'https:
SIGNIN_URL = 'https://api.twitter.com/oauth/authenticate'
def notify_snatch(self, title):
if lazylibrarian.<TwitterConsumerkey>:
self._notifyTwitter(common.notifyStrings[common.NOTIFY_SNATCH]+': '+title)
def notify_download(self, title):
if lazylibrarian.<TwitterConsumerkey>:
self._notifyTwitter(common.notifyStrings[common.NOTIFY_DOWNLOAD]+': '+title)
def test_notify(self):
return self._notifyTwitter("This is a test notification from LazyLibrarian / " + formatter.now(), force=True)
def _get_authorization(self):
<API key> = oauth.<API key>() #@UnusedVariable
oauth_consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret)
oauth_client = oauth.Client(oauth_consumer)
logger.info('Requesting temp token from Twitter')
resp, content = oauth_client.request(self.REQUEST_TOKEN_URL, 'GET')
if resp['status'] != '200':
logger.info('Invalid respond from <TwitterConsumerkey> temp token: %s' % resp['status'])
else:
request_token = dict(parse_qsl(content))
lazylibrarian.TWITTER_USERNAME = request_token['oauth_token']
lazylibrarian.TWITTER_PASSWORD = request_token['oauth_token_secret']
return self.AUTHORIZATION_URL+"?oauth_token="+ request_token['oauth_token']
def _get_credentials(self, key):
request_token = {}
request_token['oauth_token'] = lazylibrarian.TWITTER_USERNAME
request_token['oauth_token_secret'] = lazylibrarian.TWITTER_PASSWORD
request_token['o<API key>] = 'true'
token = oauth.Token(request_token['oauth_token'], request_token['oauth_token_secret'])
token.set_verifier(key)
logger.info('Generating and signing request for an access token using key '+key)
<API key> = oauth.<API key>() #@UnusedVariable
oauth_consumer = oauth.Consumer(key=self.consumer_key, secret=self.consumer_secret)
logger.info('oauth_consumer: '+str(oauth_consumer))
oauth_client = oauth.Client(oauth_consumer, token)
logger.info('oauth_client: '+str(oauth_client))
resp, content = oauth_client.request(self.ACCESS_TOKEN_URL, method='POST', body='oauth_verifier=%s' % key)
logger.info('resp, content: '+str(resp)+','+str(content))
access_token = dict(parse_qsl(content))
logger.info('access_token: '+str(access_token))
logger.info('resp[status] = '+str(resp['status']))
if resp['status'] != '200':
logger.error('The request for a token with did not succeed: '+str(resp['status']))
return False
else:
logger.info('Your Twitter Access Token key: %s' % access_token['oauth_token'])
logger.info('Access Token secret: %s' % access_token['oauth_token_secret'])
lazylibrarian.TWITTER_USERNAME = access_token['oauth_token']
lazylibrarian.TWITTER_PASSWORD = access_token['oauth_token_secret']
return True
def _send_tweet(self, message=None):
username=self.consumer_key
password=self.consumer_<API key>=lazylibrarian.TWITTER_USERNAME
access_token_secret=lazylibrarian.TWITTER_PASSWORD
logger.info(u"Sending tweet: "+message)
api = twitter.Api(username, password, access_token_key, access_token_secret)
try:
api.PostUpdate(message)
except Exception, e:
logger.error(u"Error Sending Tweet: %s" %e)
return False
return True
def _notifyTwitter(self, message='', force=False):
prefix = lazylibrarian.TWITTER_PREFIX
if not lazylibrarian.USE_TWITTER and not force:
return False
return self._send_tweet(prefix+": "+message)
notifier = TwitterNotifier
|
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "platform.h"
#if defined(TELEMETRY) && defined(TELEMETRY_HOTT)
#include "build/build_config.h"
#include "build/debug.h"
#include "common/axis.h"
#include "common/time.h"
#include "drivers/time.h"
#include "drivers/serial.h"
#include "fc/runtime_config.h"
#include "flight/pid.h"
#include "io/serial.h"
#include "io/gps.h"
#include "navigation/navigation.h"
#include "sensors/sensors.h"
#include "sensors/battery.h"
#include "telemetry/telemetry.h"
#include "telemetry/hott.h"
//#define HOTT_DEBUG
typedef enum {
<API key>,
<API key>,
<API key>,
HOTT_TRANSMITTING,
<API key>
} hottState_e;
#define <API key> ((1000 * 1000) / 5)
#define HOTT_RX_SCHEDULE 4000
#define HOTT_TX_SCHEDULE 5000
#define HOTT_TX_DELAY_US 2000
#define <API key> 1000
static hottState_e hottState = <API key>;
static timeUs_t hottStateChangeUs = 0;
static uint8_t *hottTxMsg = NULL;
static uint8_t hottTxMsgSize;
static uint8_t hottTxMsgCrc;
#define HOTT_BAUDRATE 19200
#define <API key> MODE_RXTX
static serialPort_t *hottPort = NULL;
static serialPortConfig_t *portConfig;
static bool <API key> = false;
static portSharing_e hottPortSharing;
static HOTT_GPS_MSG_t hottGPSMessage;
static HOTT_EAM_MSG_t hottEAMMessage;
static void hottSwitchState(hottState_e newState, timeUs_t currentTimeUs)
{
if (hottState != newState) {
hottState = newState;
hottStateChangeUs = currentTimeUs;
}
}
static void <API key>(HOTT_EAM_MSG_t *msg, size_t size)
{
memset(msg, 0, size);
msg->start_byte = 0x7C;
msg->eam_sensor_id = <API key>;
msg->sensor_id = <API key>;
msg->stop_byte = 0x7D;
}
#ifdef GPS
typedef enum {
GPS_FIX_CHAR_NONE = '-',
GPS_FIX_CHAR_2D = '2',
GPS_FIX_CHAR_3D = '3',
GPS_FIX_CHAR_DGPS = 'D',
} gpsFixChar_e;
static void <API key>(HOTT_GPS_MSG_t *msg, size_t size)
{
memset(msg, 0, size);
msg->start_byte = 0x7C;
msg->gps_sensor_id = <API key>;
msg->sensor_id = <API key>;
msg->stop_byte = 0x7D;
}
#endif
static void initialiseMessages(void)
{
<API key>(&hottEAMMessage, sizeof(hottEAMMessage));
#ifdef GPS
<API key>(&hottGPSMessage, sizeof(hottGPSMessage));
#endif
}
#ifdef GPS
void addGPSCoordinates(HOTT_GPS_MSG_t *hottGPSMessage, int32_t latitude, int32_t longitude)
{
int16_t deg = latitude / GPS_DEGREES_DIVIDER;
int32_t sec = (latitude - (deg * GPS_DEGREES_DIVIDER)) * 6;
int8_t min = sec / 1000000L;
sec = (sec % 1000000L) / 100L;
uint16_t degMin = (deg * 100L) + min;
hottGPSMessage->pos_NS = (latitude < 0);
hottGPSMessage->pos_NS_dm_L = degMin;
hottGPSMessage->pos_NS_dm_H = degMin >> 8;
hottGPSMessage->pos_NS_sec_L = sec;
hottGPSMessage->pos_NS_sec_H = sec >> 8;
deg = longitude / GPS_DEGREES_DIVIDER;
sec = (longitude - (deg * GPS_DEGREES_DIVIDER)) * 6;
min = sec / 1000000L;
sec = (sec % 1000000L) / 100L;
degMin = (deg * 100L) + min;
hottGPSMessage->pos_EW = (longitude < 0);
hottGPSMessage->pos_EW_dm_L = degMin;
hottGPSMessage->pos_EW_dm_H = degMin >> 8;
hottGPSMessage->pos_EW_sec_L = sec;
hottGPSMessage->pos_EW_sec_H = sec >> 8;
}
void <API key>(HOTT_GPS_MSG_t *hottGPSMessage)
{
hottGPSMessage->gps_satelites = gpsSol.numSat;
// Report climb rate regardless of GPS fix
const int32_t climbrate = MAX(0, <API key>(Z) + 30000);
hottGPSMessage->climbrate_L = climbrate & 0xFF;
hottGPSMessage->climbrate_H = climbrate >> 8;
const int32_t climbrate3s = MAX(0, 3.0f * <API key>(Z) / 100 + 120);
hottGPSMessage->climbrate3s = climbrate3s & 0xFF;
if (!STATE(GPS_FIX)) {
hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_NONE;
return;
}
if (gpsSol.fixType == GPS_FIX_3D) {
hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_3D;
} else {
hottGPSMessage->gps_fix_char = GPS_FIX_CHAR_2D;
}
addGPSCoordinates(hottGPSMessage, gpsSol.llh.lat, gpsSol.llh.lon);
// GPS Speed is returned in cm/s (from io/gps.c) and must be sent in km/h (Hott requirement)
const uint16_t speed = (gpsSol.groundSpeed * 36) / 1000;
hottGPSMessage->gps_speed_L = speed & 0x00FF;
hottGPSMessage->gps_speed_H = speed >> 8;
hottGPSMessage->home_distance_L = GPS_distanceToHome & 0x00FF;
hottGPSMessage->home_distance_H = GPS_distanceToHome >> 8;
const uint16_t hottGpsAltitude = (gpsSol.llh.alt / 100) + <API key>; // meters
hottGPSMessage->altitude_L = hottGpsAltitude & 0x00FF;
hottGPSMessage->altitude_H = hottGpsAltitude >> 8;
hottGPSMessage->home_direction = GPS_directionToHome;
}
#endif
static inline void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
static uint32_t <API key> = 0;
if (((millis() - <API key>) >= (telemetryConfig()-><API key> * <API key>))){
<API key> = millis();
batteryState_e batteryState = getBatteryState();
if (batteryState == BATTERY_WARNING || batteryState == BATTERY_CRITICAL){
hottEAMMessage->warning_beeps = 0x10;
hottEAMMessage->alarm_invers1 = <API key>;
}
else {
hottEAMMessage->warning_beeps = <API key>;
hottEAMMessage->alarm_invers1 = <API key>;
}
}
}
static inline void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
hottEAMMessage->main_voltage_L = vbat & 0xFF;
hottEAMMessage->main_voltage_H = vbat >> 8;
hottEAMMessage->batt1_voltage_L = vbat & 0xFF;
hottEAMMessage->batt1_voltage_H = vbat >> 8;
<API key>(hottEAMMessage);
}
static inline void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
const int32_t amp = amperage / 10;
hottEAMMessage->current_L = amp & 0xFF;
hottEAMMessage->current_H = amp >> 8;
}
static inline void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
const int32_t mAh = mAhDrawn / 10;
hottEAMMessage->batt_cap_L = mAh & 0xFF;
hottEAMMessage->batt_cap_H = mAh >> 8;
}
static inline void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
const int32_t alt = MAX(0, <API key>(Z) / 100.0f + <API key>); // Value of 500 = 0m
hottEAMMessage->altitude_L = alt & 0xFF;
hottEAMMessage->altitude_H = alt >> 8;
const int32_t climbrate = MAX(0, <API key>(Z) + 30000);
hottEAMMessage->climbrate_L = climbrate & 0xFF;
hottEAMMessage->climbrate_H = climbrate >> 8;
const int32_t climbrate3s = MAX(0, 3.0f * <API key>(Z) / 100 + 120);
hottEAMMessage->climbrate3s = climbrate3s & 0xFF;
}
void <API key>(HOTT_EAM_MSG_t *hottEAMMessage)
{
// Reset alarms
hottEAMMessage->warning_beeps = 0x0;
hottEAMMessage->alarm_invers1 = 0x0;
<API key>(hottEAMMessage);
<API key>(hottEAMMessage);
<API key>(hottEAMMessage);
<API key>(hottEAMMessage);
}
static void hottSerialWrite(uint8_t c)
{
static uint8_t serialWrites = 0;
serialWrites++;
serialWrite(hottPort, c);
}
void <API key>(void)
{
closeSerialPort(hottPort);
hottPort = NULL;
<API key> = false;
}
void initHoTTTelemetry(void)
{
portConfig = <API key>(<API key>);
hottPortSharing = <API key>(portConfig, <API key>);
initialiseMessages();
}
void <API key>(void)
{
if (!portConfig) {
return;
}
hottPort = openSerialPort(portConfig->identifier, <API key>, NULL, HOTT_BAUDRATE, <API key>, SERIAL_NOT_INVERTED);
if (!hottPort) {
return;
}
<API key> = true;
}
static void <API key>(uint8_t *buffer, int length)
{
hottTxMsg = buffer;
hottTxMsgSize = length;
}
static bool <API key>(uint8_t address)
{
switch (address) {
#ifdef GPS
case 0x8A:
if (sensors(SENSOR_GPS)) {
<API key>(&hottGPSMessage);
<API key>((uint8_t *)&hottGPSMessage, sizeof(hottGPSMessage));
return true;
}
break;
#endif
case 0x8E:
<API key>(&hottEAMMessage);
<API key>((uint8_t *)&hottEAMMessage, sizeof(hottEAMMessage));
return true;
}
return false;
}
static void flushHottRxBuffer(void)
{
while (<API key>(hottPort) > 0) {
serialRead(hottPort);
}
}
static bool <API key>(timeUs_t currentTimeUs)
{
static timeUs_t byteSentTimeUs = 0;
// Guard intra-byte interval
if (currentTimeUs - byteSentTimeUs < HOTT_TX_DELAY_US) {
return false;
}
if (hottTxMsgSize == 0) {
// Send CRC byte
hottSerialWrite(hottTxMsgCrc);
return true;
}
else {
// Send data byte
hottTxMsgCrc += *hottTxMsg;
hottSerialWrite(*hottTxMsg);
hottTxMsg++;
hottTxMsgSize
return false;
}
}
void <API key>(void)
{
bool <API key> = <API key>(hottPortSharing);
if (<API key> == <API key>) {
return;
}
if (<API key>)
<API key>();
else
<API key>();
}
void handleHoTTTelemetry(timeUs_t currentTimeUs)
{
static uint8_t hottRequestBuffer[2];
static int <API key> = 0;
if (!<API key>)
return;
bool reprocessState;
do {
reprocessState = false;
switch (hottState) {
case <API key>:
if (<API key>(hottPort)) {
<API key> = 0;
hottSwitchState(<API key>, currentTimeUs);
reprocessState = true;
}
break;
case <API key>:
if ((currentTimeUs - hottStateChangeUs) >= HOTT_RX_SCHEDULE) {
// Waiting for too long - resync
flushHottRxBuffer();
hottSwitchState(<API key>, currentTimeUs);
}
else {
while (<API key>(hottPort) && <API key> < 2) {
hottRequestBuffer[<API key>++] = serialRead(hottPort);
}
if (<API key> >= 2) {
if ((hottRequestBuffer[0] == 0) || (hottRequestBuffer[0] == <API key>)) {
/*
* FIXME the first byte of the HoTT request frame is ONLY either 0x80 (binary mode) or 0x7F (text mode).
* The binary mode is read as 0x00 (error reading the upper bit) while the text mode is correctly decoded.
* The (requestId == 0) test is a workaround for detecting the binary mode with no ambiguity as there is only
* one other valid value (0x7F) for text mode.
* The error reading for the upper bit should nevertheless be fixed
*/
if (<API key>(hottRequestBuffer[1])) {
hottSwitchState(<API key>, currentTimeUs);
}
else {
hottSwitchState(<API key>, currentTimeUs);
}
}
else if (hottRequestBuffer[0] == <API key>) {
// FIXME Text mode
hottSwitchState(<API key>, currentTimeUs);
}
else {
// Received garbage - resync
flushHottRxBuffer();
hottSwitchState(<API key>, currentTimeUs);
}
reprocessState = true;
}
}
break;
case <API key>:
if ((currentTimeUs - hottStateChangeUs) >= HOTT_TX_SCHEDULE) {
hottTxMsgCrc = 0;
hottSwitchState(HOTT_TRANSMITTING, currentTimeUs);
}
break;
case HOTT_TRANSMITTING:
if (<API key>(currentTimeUs)) {
hottSwitchState(<API key>, currentTimeUs);
}
break;
case <API key>:
if ((currentTimeUs - hottStateChangeUs) >= HOTT_TX_DELAY_US) {
flushHottRxBuffer();
hottSwitchState(<API key>, currentTimeUs);
reprocessState = true;
}
break;
};
} while (reprocessState);
}
#endif
|
#include <Python.h>
#include "core/utilities.h"
#include "playlist/songplaylistitem.h"
#include "scripting/script.h"
#include "scripting/scriptmanager.h"
#include "scripting/python/pythonengine.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "<API key>.h"
#include "test_utils.h"
#include <QSettings>
#include <QtDebug>
#include <boost/noncopyable.hpp>
class TemporaryScript : boost::noncopyable {
public:
TemporaryScript(const QString& code, const QString& directory_template = QString()) {
directory_ = Utilities::MakeTempDir(directory_template);
QSettings ini(directory_ + "/script.ini", QSettings::IniFormat);
ini.beginGroup("Script");
ini.setValue("language", "python");
ini.setValue("script_file", "script.py");
QFile script(directory_ + "/script.py");
script.open(QIODevice::WriteOnly);
script.write(code.toUtf8());
}
~TemporaryScript() {
if (!directory_.isEmpty()) {
Utilities::RemoveRecursive(directory_);
}
}
QString directory_;
};
class PythonTest : public ::testing::Test {
protected:
static void SetUpTestCase() {
sManager = new ScriptManager;
sEngine = qobject_cast<PythonEngine*>(
sManager->EngineForLanguage(ScriptInfo::Language_Python));
sEngine->EnsureInitialised();
PythonQt::self()->addDecorators(new <API key>());
}
static void TearDownTestCase() {
delete sManager;
}
static ScriptManager* sManager;
static PythonEngine* sEngine;
};
ScriptManager* PythonTest::sManager = NULL;
PythonEngine* PythonTest::sEngine = NULL;
TEST_F(PythonTest, HasPythonEngine) {
ASSERT_TRUE(sEngine);
}
TEST_F(PythonTest, InitFromDirectory) {
TemporaryScript script("pass");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
EXPECT_TRUE(info.is_valid());
EXPECT_EQ(script.directory_, info.path());
EXPECT_EQ(ScriptInfo::Language_Python, info.language());
EXPECT_EQ(NULL, info.loaded());
}
TEST_F(PythonTest, StdioIsRedirected) {
TemporaryScript script(
"import sys\n"
"print 'text on stdout'\n"
"print >>sys.stderr, 'text on stderr'\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
sEngine->CreateScript(info);
QString log = sManager->log_lines_plain().join("\n");
ASSERT_TRUE(log.contains("text on stdout"));
ASSERT_TRUE(log.contains("text on stderr"));
}
TEST_F(PythonTest, CleanupModuleDict) {
TemporaryScript script(
"class Foo:\n"
" def __init__(self):\n"
" print 'constructor'\n"
" def __del__(self):\n"
" print 'destructor'\n"
"f = Foo()\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
Script* s = sEngine->CreateScript(info);
ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("constructor"));
sEngine->DestroyScript(s);
ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("destructor"));
}
TEST_F(PythonTest, <API key>) {
TemporaryScript script(
"from PythonQt.QtCore import QCoreApplication\n"
"class Foo:\n"
" def __init__(self):\n"
" QCoreApplication.instance().connect('aboutToQuit()', self.aslot)\n"
" def __del__(self):\n"
" print 'destructor'\n"
" def aslot(self):\n"
" pass\n"
"f = Foo()\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
sEngine->DestroyScript(sEngine->CreateScript(info));
ASSERT_TRUE(sManager->log_lines_plain().last().endsWith("destructor"));
}
TEST_F(PythonTest, ModuleConstants) {
TemporaryScript script(
"print type(__builtins__)\n"
"print __file__\n"
"print __name__\n"
"print __package__\n"
"print __path__\n"
"print __script__\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
sEngine->CreateScript(info);
const QStringList log = sManager->log_lines_plain();
const int n = log.count();
ASSERT_GE(n, 6);
EXPECT_TRUE(log.at(n-6).endsWith("<type 'dict'>")); // __builtins__
EXPECT_TRUE(log.at(n-5).endsWith(script.directory_ + "/script.py")); // __file__
EXPECT_TRUE(log.at(n-4).endsWith("clementinescripts." + info.id())); // __name__
EXPECT_TRUE(log.at(n-3).endsWith("None")); // __package__
EXPECT_TRUE(log.at(n-2).endsWith("['" + script.directory_ + "']")); // __path__
EXPECT_TRUE(log.at(n-1).contains("ScriptInterface (QObject ")); // __script__
}
TEST_F(PythonTest, <API key>) {
// Tests 3rdparty/pythonqt/patches/<API key>.patch
TemporaryScript script(
"import PythonQt.QtGui\n"
"PythonQt.QtGui.QStyleOption().version = 123\n"
"PythonQt.QtGui.QStyleOption().version = 123\n"
"PythonQt.QtGui.QStyleOption().version = 123\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
EXPECT_TRUE(sEngine->CreateScript(info));
}
TEST_F(PythonTest, <API key>) {
// Tests 3rdparty/pythonqt/patches/<API key>.patch
TemporaryScript script(
"from PythonQt.QtCore import QFile, QObject\n"
"class Foo(QFile):\n"
" def Init(self, parent):\n"
" QFile.__init__(self, parent)\n"
"parent = QObject()\n"
"Foo().Init(parent)\n"
"assert parent\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
EXPECT_TRUE(sEngine->CreateScript(info));
}
TEST_F(PythonTest, <API key>) {
// Tests 3rdparty/pythonqt/patches/conversion-stack.patch
// This crash is triggered when a C++ thing calls a virtual method on a
// python wrapper and that wrapper returns a QString, QByteArray or
// QStringList. In this instance, initStyleOption() calls text() in Foo.
TemporaryScript script(
"from PythonQt.QtGui import QProgressBar, <API key>\n"
"class Foo(QProgressBar):\n"
" def text(self):\n"
" return 'something'\n"
"for _ in xrange(1000):\n"
" Foo().initStyleOption(<API key>())\n");
ScriptInfo info;
info.InitFromDirectory(sManager, script.directory_);
EXPECT_TRUE(sEngine->CreateScript(info));
}
|
<?php
class <API key> extends Controller {
public function index() {
$this->load->language('common/language');
$data['action'] = $this->url->link('common/language/language', '', $this->request->server['HTTPS']);
$data['code'] = $this->session->data['language'];
$this->load->model('localisation/language');
$data['languages'] = array();
$results = $this-><API key>->getLanguages();
foreach ($results as $result) {
if ($result['status']) {
$data['languages'][] = array(
'layout' => 1,
'name' => $result['name'],
'code' => $result['code']
);
}
}
if (!isset($this->request->get['route'])) {
$data['redirect'] = $this->url->link('common/home');
} else {
$url_data = $this->request->get;
unset($url_data['_route_']);
$route = $url_data['route'];
unset($url_data['route']);
$url = '';
if ($url_data) {
$url = '&' . urldecode(http_build_query($url_data, '', '&'));
}
$data['redirect'] = $this->url->link($route, $url, $this->request->server['HTTPS']);
}
return $this->load->view('common/language', $data);
}
public function language() {
if (isset($this->request->post['code'])) {
$this->session->data['language'] = $this->request->post['code'];
}
if (isset($this->request->post['redirect'])) {
$this->response->redirect($this->request->post['redirect']);
} else {
$this->response->redirect($this->url->link('common/home'));
}
}
}
|
//tracker_nio.h
#ifndef _TRACKER_NIO_H
#define _TRACKER_NIO_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fast_task_queue.h"
#ifdef __cplusplus
extern "C" {
#endif
void recv_notify_read(int sock, short event, void *arg);
int send_add_event(struct fast_task_info *pTask);
void <API key>(struct fast_task_info *pTask);
#ifdef __cplusplus
}
#endif
#endif
|
using System;
using System.Collections;
using System.IO;
namespace Server.Engines.Reports
{
public class StaffHistory : PersistableObject
{
#region Type Identification
public static readonly PersistableType ThisTypeID = new PersistableType("stfhst", new ConstructCallback(Construct));
private static PersistableObject Construct()
{
return new StaffHistory();
}
public override PersistableType TypeID
{
get
{
return ThisTypeID;
}
}
#endregion
private PageInfoCollection m_Pages;
private <API key> m_QueueStats;
private Hashtable m_UserInfo;
private Hashtable m_StaffInfo;
public PageInfoCollection Pages
{
get
{
return this.m_Pages;
}
set
{
this.m_Pages = value;
}
}
public <API key> QueueStats
{
get
{
return this.m_QueueStats;
}
set
{
this.m_QueueStats = value;
}
}
public Hashtable UserInfo
{
get
{
return this.m_UserInfo;
}
set
{
this.m_UserInfo = value;
}
}
public Hashtable StaffInfo
{
get
{
return this.m_StaffInfo;
}
set
{
this.m_StaffInfo = value;
}
}
public void AddPage(PageInfo info)
{
lock (SaveLock)
this.m_Pages.Add(info);
info.History = this;
}
public StaffHistory()
{
this.m_Pages = new PageInfoCollection();
this.m_QueueStats = new <API key>();
this.m_UserInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
this.m_StaffInfo = new Hashtable(StringComparer.OrdinalIgnoreCase);
}
public StaffInfo GetStaffInfo(string account)
{
lock (RenderLock)
{
if (account == null || account.Length == 0)
return null;
StaffInfo info = this.m_StaffInfo[account] as StaffInfo;
if (info == null)
this.m_StaffInfo[account] = info = new StaffInfo(account);
return info;
}
}
public UserInfo GetUserInfo(string account)
{
if (account == null || account.Length == 0)
return null;
UserInfo info = this.m_UserInfo[account] as UserInfo;
if (info == null)
this.m_UserInfo[account] = info = new UserInfo(account);
return info;
}
public static readonly object RenderLock = new object();
public static readonly object SaveLock = new object();
public void Save()
{
lock (SaveLock)
{
if (!Directory.Exists("Output"))
{
Directory.CreateDirectory("Output");
}
string path = Path.Combine(Core.BaseDirectory, "Output/staffHistory.xml");
PersistanceWriter pw = new <API key>(path, "Staff");
pw.WriteDocument(this);
pw.Close();
}
}
public void Load()
{
string path = Path.Combine(Core.BaseDirectory, "Output/staffHistory.xml");
if (!File.Exists(path))
return;
PersistanceReader pr = new <API key>(path, "Staff");
pr.ReadDocument(this);
pr.Close();
}
public override void SerializeChildren(PersistanceWriter op)
{
for (int i = 0; i < this.m_Pages.Count; ++i)
this.m_Pages[i].Serialize(op);
for (int i = 0; i < this.m_QueueStats.Count; ++i)
this.m_QueueStats[i].Serialize(op);
}
public override void DeserializeChildren(PersistanceReader ip)
{
DateTime min = DateTime.UtcNow - TimeSpan.FromDays(8.0);
while (ip.HasChild)
{
PersistableObject obj = ip.GetChild();
if (obj is PageInfo)
{
PageInfo pageInfo = obj as PageInfo;
pageInfo.UpdateResolver();
if (pageInfo.TimeSent >= min || pageInfo.TimeResolved >= min)
{
this.m_Pages.Add(pageInfo);
pageInfo.History = this;
}
else
{
pageInfo.Sender = null;
pageInfo.Resolver = null;
}
}
else if (obj is QueueStatus)
{
QueueStatus queueStatus = obj as QueueStatus;
if (queueStatus.TimeStamp >= min)
this.m_QueueStats.Add(queueStatus);
}
}
}
public StaffInfo[] GetStaff()
{
StaffInfo[] staff = new StaffInfo[this.m_StaffInfo.Count];
int index = 0;
foreach (StaffInfo staffInfo in this.m_StaffInfo.Values)
staff[index++] = staffInfo;
return staff;
}
public void Render(ObjectCollection objects)
{
lock (RenderLock)
{
objects.Add(this.GraphQueueStatus());
StaffInfo[] staff = this.GetStaff();
BaseInfo.SortRange = TimeSpan.FromDays(7.0);
Array.Sort(staff);
objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.None, "New pages by hour", "graph_new_pages_hr"));
objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Handled, "Handled pages by hour", "<API key>"));
objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Deleted, "Deleted pages by hour", "<API key>"));
objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Canceled, "Canceled pages by hour", "<API key>"));
objects.Add(this.GraphHourlyPages(this.m_Pages, PageResolution.Logged, "Logged-out pages by hour", "<API key>"));
BaseInfo.SortRange = TimeSpan.FromDays(1.0);
Array.Sort(staff);
objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(1.0), "1 Day"));
objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(1.0), "1 Day", "graph_daily_pages"));
BaseInfo.SortRange = TimeSpan.FromDays(7.0);
Array.Sort(staff);
objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(7.0), "1 Week"));
objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(7.0), "1 Week", "graph_weekly_pages"));
BaseInfo.SortRange = TimeSpan.FromDays(30.0);
Array.Sort(staff);
objects.Add(this.ReportTotalPages(staff, TimeSpan.FromDays(30.0), "1 Month"));
objects.AddRange((PersistableObject[])this.ChartTotalPages(staff, TimeSpan.FromDays(30.0), "1 Month", "graph_monthly_pages"));
for (int i = 0; i < staff.Length; ++i)
objects.Add(this.GraphHourlyPages(staff[i]));
}
}
public static int GetPageCount(StaffInfo staff, DateTime min, DateTime max)
{
return GetPageCount(staff.Pages, PageResolution.Handled, min, max);
}
public static int GetPageCount(PageInfoCollection pages, PageResolution res, DateTime min, DateTime max)
{
int count = 0;
for (int i = 0; i < pages.Count; ++i)
{
if (res != PageResolution.None && pages[i].Resolution != res)
continue;
DateTime ts = pages[i].TimeResolved;
if (ts >= min && ts < max)
++count;
}
return count;
}
private BarGraph GraphQueueStatus()
{
int[] totals = new int[24];
int[] counts = new int[24];
DateTime max = DateTime.UtcNow;
DateTime min = max - TimeSpan.FromDays(7.0);
for (int i = 0; i < this.m_QueueStats.Count; ++i)
{
DateTime ts = this.m_QueueStats[i].TimeStamp;
if (ts >= min && ts < max)
{
DateTime date = ts.Date;
TimeSpan time = ts.TimeOfDay;
int hour = time.Hours;
totals[hour] += this.m_QueueStats[i].Count;
counts[hour]++;
}
}
BarGraph barGraph = new BarGraph("Average pages in queue", "graph_pagequeue_avg", 10, "Time", "Pages", BarGraphRenderMode.Lines);
barGraph.FontSize = 6;
for (int i = 7; i <= totals.Length + 7; ++i)
{
int val;
if (counts[i % totals.Length] == 0)
val = 0;
else
val = (totals[i % totals.Length] + (counts[i % totals.Length] / 2)) / counts[i % totals.Length];
int realHours = i % totals.Length;
int hours;
if (realHours == 0)
hours = 12;
else if (realHours > 12)
hours = realHours - 12;
else
hours = realHours;
barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val);
}
return barGraph;
}
private BarGraph GraphHourlyPages(StaffInfo staff)
{
return this.GraphHourlyPages(staff.Pages, PageResolution.Handled, "Average pages handled by " + staff.Display, "graphs_" + staff.Account.ToLower() + "_avg");
}
private BarGraph GraphHourlyPages(PageInfoCollection pages, PageResolution res, string title, string fname)
{
int[] totals = new int[24];
int[] counts = new int[24];
DateTime[] dates = new DateTime[24];
DateTime max = DateTime.UtcNow;
DateTime min = max - TimeSpan.FromDays(7.0);
bool sentStamp = (res == PageResolution.None);
for (int i = 0; i < pages.Count; ++i)
{
if (res != PageResolution.None && pages[i].Resolution != res)
continue;
DateTime ts = (sentStamp ? pages[i].TimeSent : pages[i].TimeResolved);
if (ts >= min && ts < max)
{
DateTime date = ts.Date;
TimeSpan time = ts.TimeOfDay;
int hour = time.Hours;
totals[hour]++;
if (dates[hour] != date)
{
counts[hour]++;
dates[hour] = date;
}
}
}
BarGraph barGraph = new BarGraph(title, fname, 10, "Time", "Pages", BarGraphRenderMode.Lines);
barGraph.FontSize = 6;
for (int i = 7; i <= totals.Length + 7; ++i)
{
int val;
if (counts[i % totals.Length] == 0)
val = 0;
else
val = (totals[i % totals.Length] + (counts[i % totals.Length] / 2)) / counts[i % totals.Length];
int realHours = i % totals.Length;
int hours;
if (realHours == 0)
hours = 12;
else if (realHours > 12)
hours = realHours - 12;
else
hours = realHours;
barGraph.Items.Add(hours + (realHours >= 12 ? " PM" : " AM"), val);
}
return barGraph;
}
private Report ReportTotalPages(StaffInfo[] staff, TimeSpan ts, string title)
{
DateTime max = DateTime.UtcNow;
DateTime min = max - ts;
Report report = new Report(title + " Staff Report", "400");
report.Columns.Add("65%", "left", "Staff Name");
report.Columns.Add("35%", "center", "Page Count");
for (int i = 0; i < staff.Length; ++i)
report.Items.Add(staff[i].Display, GetPageCount(staff[i], min, max));
return report;
}
private PieChart[] ChartTotalPages(StaffInfo[] staff, TimeSpan ts, string title, string fname)
{
DateTime max = DateTime.UtcNow;
DateTime min = max - ts;
PieChart staffChart = new PieChart(title + " Staff Chart", fname + "_staff", true);
int other = 0;
for (int i = 0; i < staff.Length; ++i)
{
int count = GetPageCount(staff[i], min, max);
if (i < 12 && count > 0)
staffChart.Items.Add(staff[i].Display, count);
else
other += count;
}
if (other > 0)
staffChart.Items.Add("Other", other);
PieChart resChart = new PieChart(title + " Resolutions", fname + "_resol", true);
int countTotal = GetPageCount(this.m_Pages, PageResolution.None, min, max);
int countHandled = GetPageCount(this.m_Pages, PageResolution.Handled, min, max);
int countDeleted = GetPageCount(this.m_Pages, PageResolution.Deleted, min, max);
int countCanceled = GetPageCount(this.m_Pages, PageResolution.Canceled, min, max);
int countLogged = GetPageCount(this.m_Pages, PageResolution.Logged, min, max);
int countUnres = countTotal - (countHandled + countDeleted + countCanceled + countLogged);
resChart.Items.Add("Handled", countHandled);
resChart.Items.Add("Deleted", countDeleted);
resChart.Items.Add("Canceled", countCanceled);
resChart.Items.Add("Logged Out", countLogged);
resChart.Items.Add("Unresolved", countUnres);
return new PieChart[] { staffChart, resChart };
}
}
}
|
@file
Text alignment common conventions.
#pragma once
#include <Qt>
namespace scram::gui {
Default alignment of numerical values in tables.
const int <API key> = Qt::AlignRight | Qt::AlignVCenter;
} // namespace scram::gui
|
{% extends "layout.html" %}
{% block body %}
<div class="text_body">
<h2>Manage input variable groups</h2>
<form>
<h3>Create an input group</h3>
<p>
Input groups are used to select input variables for templates
They are managed at the partner level, so that members of your group
will only see the input groups that you manage.
</p>
<p>
You can make your own copy of an input group that was created by another partner
or leave the filters blank to create a new empty input group and add input variables below.
</p>
<dl>
<div id="<API key>">
<dd>Copy default variable groups or from a selected partner</dd>
<dt>{{ <API key>.partner_to_copy }}</dt>
<dd>Select the group to copy</dd>
<dt>{{ <API key>.group_to_copy }}</dt>
</div>
<div id="group_to_copy_div">
<div id = <API key>>
<dd>Group members:</dd>
<dt>
<ul id="<API key>">
</ul>
</dt>
</div>
<div id = <API key>>
<dd>Group available at levels:</dd>
<dt>
<ul id="<API key>">
</ul>
</dt>
</div>
</div>
</dl>
<dl>
<dd>Enter a name to create a new group</dd>
<dt>{{ <API key>.input_group_name }}
{{ <API key>.<API key> }}</dt>
{{ <API key>.csrf_token }}
</dl>
<div id="<API key>">
<div>
<h3>Manage group</h3>
<p>
Drag and drop between lists to add/remove items
or within the list to arrange their order of appearance.
Click commit to store these changes.
</p>
</div>
<div id="group_inputs_div">
<h4>Manage selected group</h4>
<dd>{{ <API key>.input_group_select }}</dd>
<div id="<API key>">
{{ <API key>.group_inputs }}
</div>
<h4>Select levels for this group</h4>
<p>
Note: This does not affect the availability of the groups input variables at each level.
It only affects the visibility of the input group.
</p>
<dd>{{ <API key>.group_levels_select }}</dd>
<dd>{{ <API key>.<API key> }}</dd>
{{ <API key>.csrf_token }}
</div>
<div id="all_inputs_div">
<h4>Find input variables</h4>
<dd>Record type:{{ <API key>.record_type }} Item level:{{ <API key>.item_level }}</dd>
<div id="all_inputs_list_div">
{{ <API key>.all_inputs }}
</div>
</div>
</div>
<div id="manage group visibility">
<h3>
</h3>
</div>
</form>
</div>
<script src="{{ url_for('static', filename='jquery_1.8.3_min.js') }}"></script>
<script src="{{ url_for('static', filename='jquery-ui-1.12.1.custom/jquery-ui.js') }}"></script>
<script src="{{ url_for('static', filename='<API key>.js') }}"></script>
{% endblock %}
|
[
bulbasaur = Oakdex::Pokedex::Pokemon.find(1)
# => #<Oakdex::Pokedex::Pokemon:0x007fe3dc55da80 @attributes={"names"=>{"fr"=>"Bulbizarre", "de"=>"Bisasam", ...>
bulbasaur.name
# => "Bulbasaur"
bulbasaur.name('de')
# => "Bisasam"
bulbasaur.types
# => ["Grass", "Poison"]
bulbasaur.attributes
# => {"names"=>{"fr"=>"Bulbizarre", "de"=>"Bisasam", "it"=>"Bulbasaur", "en"=>"Bulbasaur"}, "national_id"=>1, "types"=>["Grass", "Poison"], "abilities"=>[{"name"=>"Overgrow"}, {"name"=>"Chlorophyll", "hidden"=>true}], "gender_ratios"=>{"male"=>87.5, "female"=>12.5}, "catch_rate"=>45, "egg_groups"=...}
tackle = Oakdex::Pokedex::Move.find('Tackle')
# => #<Oakdex::Pokedex::Move:0x007fbc9a10cda0 @attributes={"index_number"=>33, "pp"=>35, "max_pp"=>56, "power"=>50, "accuracy"=>100, "category"=>"physical", "priority"=>0, "target"=>"target", ...>
contrary = Oakdex::Pokedex::Ability.find('Contrary')
fairy = Oakdex::Pokedex::Type.find('Fairy')
fairy.effectivness_for('Dark')
water1 = Oakdex::Pokedex::EggGroup.find('Water 1')
generation6 = Oakdex::Pokedex::Generation.find('Generation VI')
# => #<Oakdex::Pokedex::Generation:0x007fbc9b0382c0 @attributes={"number"=>6, "dex_name"=>"kalos_id", "names"=>{"en"=>"Generation VI", "de"=>"Generation VI"}, "games"=>[{"en"=>"X", "de"=>"X"}, {"en"=>"Y", "de"=>"Y"}, {"en"=>"Omega Ruby", "de"=>"Omega Rubin"}, {"en"=>"Alpha Sapphire", "de"=>"Alpha Saphir"}]}>
bold = Oakdex::Pokedex::Nature.find('Bold')
Oakdex::Pokedex::Pokemon.all.size
# => 802
Oakdex::Pokedex::Pokemon.where(type: 'Dark').size
Oakdex::Pokedex::Pokemon.where(egg_group: 'Human-Like').size
Oakdex::Pokedex::Pokemon.where(dex: 'alola').size
# => 302
Oakdex::Pokedex::Pokemon.where(alola_id: 1)
# => [#<Oakdex::Pokedex::Pokemon:0x007fbc9e542510 @attributes={"names"=>{"en"=>"Rowlet", "jp"=>" Mokuroh", "fr"=>"Brindibou", "es"=>"Rowlet", "de"=>"Bauz", "it"=>"Rowlet"}, "national_id"=>722, "alola_id"=>1, ...>]
Oakdex::Pokedex::Move.where(type: 'Ground').size
Javascript
Install the package:
$ npm install oakdex-pokedex --save
Then you can use the library:
js
oakdexPokedex = require('oakdex-pokedex');
oakdexPokedex.findPokemon('Eevee', function(p) {
// returns data/pokemon/eevee.json
console.log(p.names.en); // Eeevee
});
oakdexPokedex.findPokemon(4, function(p) {
// returns data/pokemon/charmander.json
console.log(p.names.en); // Charmander
});
oakdexPokedex.findMove('Tackle', function(m) {
// returns data/move/tackle.json
console.log(m.names.en); // Tackle
});
oakdexPokedex.findAbility('Contrary', function(a) {
// returns data/ability/contrary.json
console.log(a.names.en); // Contrary
});
oakdexPokedex.findType('Fairy', function(t) {
// returns data/type/fairy.json
console.log(t.names.en); // Fairy
});
oakdexPokedex.findEggGroup('Water 1', function(e) {
// returns data/egg_group/water_1.json
console.log(e.names.en); // Water 1
});
oakdexPokedex.findGeneration('Generation VI', function(g) {
// returns data/generation/6.json
console.log(g.names.en); // Generation VI
});
oakdexPokedex.findNature('Bold', function(n) {
// returns data/nature/bold.json
console.log(n.names.en); // Bold
});
oakdexPokedex.allPokemon(function(pokemon) {
console.log(pokemon.length); // 802
});
oakdexPokedex.allPokemon({ type: 'Dark' }, function(pokemon) {
console.log(pokemon.length);
});
oakdexPokedex.allPokemon({ egg_group: 'Human-Like' }, function(pokemon) {
console.log(pokemon.length);
});
oakdexPokedex.allPokemon({ dex: 'alola' }, function(pokemon) {
console.log(pokemon.length); // 302
});
oakdexPokedex.allMoves({ type: 'Ground' }, function(moves) {
console.log(moves.length);
});
Schemas
If you want to know what the structure of the given data is, checkout the following documentations:
- [Pokemon](doc/pokemon.md)
- [Move](doc/move.md)
- [Ability](doc/ability.md)
- [Type](doc/type.md)
- [Egg Group](doc/egg_group.md)
- [Nature](doc/nature.md)
- [Generation](doc/generation.md)
Sprites
If you want also to include sprites in your pokedex, check out [<API key>](https://github.com/jalyna/<API key>).
## Contributing
I would be happy if you want to add your contribution to the project. In order to contribute, you just have to fork this repository.
MIT License. See the included MIT-LICENSE file.
## Credits
Logo Icon by [Roundicons Freebies](http:
|
import numpy as np
import laspy as las
# Determine if a point is inside a given polygon or not
# Polygon is a list of (x,y) pairs. This function
# returns True or False. The algorithm is called
# the "Ray Casting Method".
# the point_in_poly algorithm was found here:
def point_in_poly(x,y,poly):
n = len(poly)
inside = False
p1x,p1y = poly[0]
for i in range(n+1):
p2x,p2y = poly[i % n]
if y > min(p1y,p2y):
if y <= max(p1y,p2y):
if x <= max(p1x,p2x):
if p1y != p2y:
xints = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x
if p1x == p2x or x <= xints:
inside = not inside
p1x,p1y = p2x,p2y
return inside
# This one is my own version of the ray-trace algorithm which utilises the numpy arrays so that a list of x and y coordinates can be processed in one call and only points inside polygon are returned alongside the indices in case required for future referencing. This saves a fair bit of looping.
def points_in_poly(x,y,poly):
n = len(poly)
inside=np.zeros(x.size,dtype=bool)
xints=np.zeros(x.size)
p1x,p1y = poly[0]
for i in range(n+1):
p2x,p2y=poly[i % n]
if p1y!=p2y:
xints[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)] = (y[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)]-p1y)*(p2x-p1x)/(p2y-p1y)+p1x
if p1x==p2x:
inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)] = np.invert(inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x)],axis=0)])
else:
inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x),x<=xints],axis=0)] = np.invert(inside[np.all([y>min(p1y,p2y), y<=max(p1y,p2y), x<=max(p1x,p2x),x<=xints],axis=0)])
p1x,p1y = p2x,p2y
return x[inside],y[inside], inside
# This retrieves all points within circular neighbourhood, Terget point is the location around which the neighbourhood search is conducted, for a specified search radius. x and y are vectors with the x and y coordinates of the test points
def points_in_radius(x,y,target_x, target_y,radius):
inside=np.zeros(x.size,dtype=bool)
d2=(x-target_x)**2+(y-target_y)**2
inside = d2<=radius**2
return x[inside],y[inside], inside
# filter lidar wth polygon
# This function has been updated to include an option to filter by first return location.
# The reason for this is so full collections of returns associated with each LiDAR pulse
# can be retrieved, which can be an issue at edges in multi-return analyses
def <API key>(in_pts,polygon,<API key> = False):
pts = np.zeros((0,in_pts.shape[1]))
if in_pts.shape[0]>0:
if <API key>:
# find first returns
mask = in_pts[:,3]==1
x_temp, y_temp, inside_temp = points_in_poly(in_pts[mask,0],in_pts[mask,1],polygon)
shots = np.unique(in_pts[mask,6][inside_temp]) # index 6 refers to GPS time
inside = np.in1d(in_pts[:,6],shots) # this function retrieves all points corresponding to this GPS time
x = in_pts[inside,0]
y = in_pts[inside,1]
x_temp=None
y_temp=None
inside_temp=None
else:
x,y,inside = points_in_poly(in_pts[:,0],in_pts[:,1],polygon)
pts = in_pts[inside,:]
else:
print("\t\t\t no points in polygon")
return pts
# filter lidar by circular neighbourhood
def <API key>(in_pts,target_xy,radius):
pts = np.zeros((0,in_pts.shape[1]))
if in_pts.shape[0]>0:
x,y,inside = points_in_radius(in_pts[:,0],in_pts[:,1],target_xy[0],target_xy[1],radius)
pts = in_pts[inside,:]
else:
print( "\t\t\t no points in neighbourhood")
return pts
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.