This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use result_iterator::ResultIterator; | |
use std::fs::{self, DirEntry}; | |
use std::io; | |
use std::path::Path; | |
fn file_names(path: &Path) -> Result<Vec<String>, io::Error> { | |
let result = fs::read_dir(path)? | |
.map_then(|entry| { | |
let is_file = entry.file_type()?.is_file(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* JavaFX Screen Capture with java.awt.Robot | |
* run: groovy javafx_screen-capture_with_awt-robot.groovy | |
*/ | |
import javafx.application.Application | |
import javafx.application.Platform | |
import javafx.embed.swing.SwingFXUtils | |
import javafx.geometry.Insets | |
import javafx.scene.Parent | |
import javafx.scene.Scene |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate piston_meta; | |
extern crate range; | |
extern crate dyon; | |
use std::sync::Arc; | |
use self::piston_meta::MetaData; | |
use self::range::Range; | |
use self::dyon::{error, load_meta, Module, Runtime}; | |
fn main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import time, json, datetime | |
import ntpath | |
import subprocess | |
maxFiles = 100000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::fs; | |
use std::io::Read; | |
/// Obtains a list of video extensions from the `/etc/mime.types` file on Linux. | |
pub fn get_video_extensions() -> Result<Vec<String>, &'static str> { | |
fs::File::open("/etc/mime.types").ok() | |
// Return an error if /etc/mime.types could not be found. | |
.map_or(Err("tv-renamer: unable to open /etc/mime.types"), |mut file| { | |
// Create a buffer with the capacity of the file | |
let mut contents = String::with_capacity(file.metadata().map(|x| x.len()).unwrap_or(0) as usize); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::thread; | |
use std::fs::{self, DirEntry}; | |
use std::path::{Path, PathBuf}; | |
use std::sync::{Arc, Mutex}; | |
use std::io; | |
macro_rules! or_return { | |
($expr:expr) => (match $expr { | |
::std::result::Result::Ok(val) => val, | |
::std::result::Result::Err(err) =>{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::path::{Path, PathBuf}; | |
struct Model { | |
u: f32, | |
} | |
fn texture_fname(path: &Path) -> PathBuf { | |
let fullname = format!("{}{}", path.file_stem().unwrap().to_str().unwrap(), "_diffuse"); | |
let mut buf = PathBuf::from(path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
-- Session causing the block | |
blockers.blocker_instance_id as blocker_instance_id, | |
blocker.sid as blocker_sid, | |
blocker.serial# as blocker_serial#, | |
blocker.username as blocker_username, | |
blocker.status as blocker_status, | |
blocker.machine as blocker_machine, | |
blocker.program as blocker_program, | |
blocker.sql_id as blocker_sql_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example | |
import griffon.core.artifact.GriffonController | |
import griffon.metadata.ArtifactProviderFor | |
@ArtifactProviderFor(GriffonController) | |
class ExemploActionsController { | |
ExemploActionsModel model | |
void somarAction() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(globs)] | |
#![feature(if_let)] | |
extern crate piston; | |
extern crate gfx; | |
mod snakeapp; | |
mod object; | |
mod settings; | |
mod text; |
NewerOlder