Posts

Showing posts from March, 2012

imaging - MDT 2012 image Failure - Unable to find Imagex.exe -

i running windows server 2012 r2 mdt 2012, installed windows 8 adk before installing mdt 2012. have created deployment share , set up, when try run build fails. have included error log bellow; findfile: file imagex.exe not found in standard locations. ltiapply 01/06/2015 09:54:30 0 (0x0000) failure ( 5441 ): 1: findfile: imagex.exe ltiapply 01/06/2015 09:54:30 0 (0x0000) command completed, return code = -2147467259 litetouch 01/06/2015 09:54:30 0 (0x0000) litetouch deployment failed, return code = -2147467259 0x80004005 litetouch 01/06/2015 09:54:30 0 (0x0000) more information, consult task sequencer log ...\smsts.log. litetouch 01/06/2015 09:54:30 0 (0x0000) i see unable find 'imagex.exe' file, should located, , can copy file directory? any ideas? kind regards, copy imagex.exe , wimgapi.dll (this may optional, still copy it) installation of adk tools\x86 , tools\x64 directories in deployment share. for example (using 8.1 adk instead of

floating action button - Error inflating class android.support.design.widget.CoordinatorLayout -

i use floatingactionbutton on application, read : https://guides.codepath.com/android/floating-action-buttons#google-s-official-support-library when run activity have error : java.lang.runtimeexception: unable start activity componentinfo{com.xavier_laffargue.podcast/com.xavier_laffargue.podcast.act_test}: android.view.inflateexception: binary xml file line #1: error inflating class android.support.design.widget.coordinatorlayout xml file <android.support.design.widget.coordinatorlayout android:id="@+id/main_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <listview android:id="@+id/lvtodolist" android:layout_width="match_parent" android:layout_height="match_parent"></listview> <a

Logging rows that are deleted in a table sql server -

i have made topic before, think have not been clear, going try explain in detail possibly can. i have table called list, has 32000 rows, 2000 each year(1999-2014) has columns: songid,top2000year,position, what has happen: if deletes example year 2000, 2000 songs of year 2000 deleted, theres no problem that delete list top2000year = 2000 but, problem facing is: need logged, created log table called logtable columns: title,artist,year,position title song title, year year song came out , position position in list those different table, join them this select title, name[artist],song.year[songyear], position list left join song on song.songid = list.songid left join artist on artist.artistid = song.artistid top2000year = 2013 order position asc this shows query http://puu.sh/i8f2u/8702ee7010.png (censored server, it's teachers figured i'd censor it) i trying fill logtable that, if year 2013 deleted, 2000 rows should inserted logtable using trigger edit: used

javascript - Pagination manipulated with jquery on CI working, but the link is updated -

Image
i have 1 page on html, named view_closing.php. in view, there 1 table integrated 1 pagination. goal is, how can make table move record without refreshing page.so, still on 1 address, : http://localhost/tresnamuda/control_closing/ i googling while, , decide make 2 view, 1 view page, , 1 view table requested ajax. this main page : <div class="row-fluid sortable" id="isi"> <div class="box span12"> <div class="box-header"> <h2><i class="halflings-icon align-justify"></i><span class="break"></span>data request</h2> <div class="box-icon"> <a href="#" class="btn-minimize"><i class="halflings-icon chevron-up"></i></a> </div> </div> <div class="box-content" id="things_table"> <?php $this->load->view(

c# - Multi Mapping Enum at runtime -

due question here marked duplicated, here repeat question , make more explanation question. hope can give suggestions. ======================================= as described in question, here enum: public enum myenum { one, two, three} is going parsed based on mutl strings.for example, below strings going parsed myenum.two: "two", "two", "second", "2" the reason can't leverage description attributes or mapping dictionary directly mapping strings come external xml file. mapping change after period of time , it's not possible adding description attribute above declared enum. for example, mappings above build 1 month ago , there items required below , these new items add xml file: "2nd", "the second one" furthermore, use self developed script engine parse above , other similar needs (that's why don't use simple mapping function) : object x = engine.execute( /*some script codes defined in ex

php - How can i add file upload to my existing contact form -

this question has answer here: send attachments php mail()? 11 answers i have existing html contact form, add feature upload photo sent attachment. how can add php script. have added file upload field in html form name=datafile , have set attribute enctype="multipart/form-data" <?php $youremailaddress = '123@123.com'; //put own email address here. //check make sure name field not empty if(trim($_post['contactname']) == '') { $haserror = true; } else { $name = trim($_post['contactname']); } //check make sure subject field not empty if(trim($_post['subject']) == '') { $haserror = true; } else { $subject = trim($_post['subject']); } //check make sure sure valid email address submitted if(trim($_post['email']) == '') { $haserror = true; } else if (!preg_matc

ios - GTM OAuth2 unable to detect successful authentication -

i trying access user data fitbit using gtm oauth2. ios. gtmoauth2viewcontrollertouch working, , can log in no problem. after logged in, controller should able detect authentication stated: the controller watch server redirect web view uri, uri not loaded, need not actual web page. if use real url, load url straight forward. if use arbitrary url, won't @ all. what right setting detect authentication? - (gtmoauth2authentication *)authforfitbit { nsurl *tokenurl = [nsurl urlwithstring:@"https://api.fitbit.com/oauth2/token"]; // we'll make arbitrary redirecturi. controller watch // server redirect web view uri, uri not // loaded, need not actual web page. nsstring *redirecturi = @"http://www.notexistcallback.com"; nsstring *clientid = kfitbitclientid; nsstring *clientsecret = kfitbitclientsecret; gtmoauth2authentication *auth; auth = [gtmoauth2authentication authenticationwithserviceprovider:kfitbitservicen

Azure-search document count issue -

we using azure-search , experiencing strange issues. have 2 environments (internal production , external production), both of have own separate index (indexinternal , indexexternal). i using red dog search portal check document size , count ( https://github.com/reddog-io/reddog.search.portal ). what have experienced this: re-indexed internal production site , there 14500 documents re-indexed external production site , there 14500 documents after 3/4 days have checked indexes , count seem have changed drastically: internal production site has 24500 documents external production site has 24500 documents when query indexes there doesn't seem unusual in there. there no way 10000 documents have been pushed since re-index of sites. has idea happening here? thanks in advance, adam the count shown azure search not updated real-time. possible looked @ count after documents , showing count based on current numbers have? also, please remember takes ti

javascript - Check online or offline? -

what easiest way trigger function when device becomes online or offline android webview .i found one. window.addeventlistener('online', update onlinestatus); but not working in android webview do whatever want in callback there alert when connection lost document.addeventlistener("offline", function(){ alert("no connection found") }, false);

javascript - UIAutomation script for setting textfield values in UItableView -

i’m new uiautomation , i’m trying enter value 2 textfields in uitabelview. the script tried below var target = uiatarget.localtarget(); var app = target.frontmostapp(); var window = app.mainwindow(); target.delay(1); var tableview = window.tableviews()[0]; tableview.logelementtree(); var cellone = tableview.cells()[0].textfields()[0].setvalue(“username”); var celltwo = tableview.cells()[1].textfields()[0].setvalue(“password”); textfield in first cell gets entered second 1 fails. , when tried log element tree returns uielementnil is there wrong script? i went through apple's document on automation ui testing , followed recording manual user interface actions automation scripts , instruments created script me based on manual actions. if struck mine , stupid me not go through apple's document. please don't , refer apple's document first. here's reference https://developer.apple.com/library/mac/documentation/developertools/conceptual/ins

rust - How to look up a method within the compiler given the type and a name? -

i have lint warns on x.len() == 0 , suggesting use x.is_empty() instead. however, wanted rid of false positives if x has no is_empty(self: &self) method. thus began quest methods within rustc. first step, x : matched node of expr exprmethodcall(ref method, _, ref args) (and made sure args.len() == 1 , method.node.as_str() == "len" ) , used &*args[0] , call expr on. next step, type of x : can done using rustc::middle::ty::expr_ty(cx.tcx, expr) . note rustc::middle::ty::ty (and not syntax::ast::ty , led confusion). to methods, ctxt.impl_items , ctxt.trait_item_def_ids looked promising, defid type rustc::middle::ty::ty::ty_to_def_id(ty) , try ids. however, approach has few problems: for let x = [1, 2]; x.len() == 2 // <- lookee here i have no defid. ok though, because have ty_vec in case, , std::vec::vec known have both len() , is_empty() . the message ctxt.trait_item_def_ids has suitable entry trait is_empty method. alas, follow

c++ - Slow access to HID top-level collection -

brief description: my hid device holds many top-level collections. application queries collection details. bottleneck - setupdigetclassdevs() seems slow. detailed description: my code follows ms recommendations on how find , obtain handle hid collection. then, use handle obtain corresponding preparsed data data need. currently, code every time user needs obtain data (e.g. number of buttons, axis min/max). slow business. profiler says main culprit setupdigetclassdevs() seems slow. it impossible save handle (or think) may block system making changes such removing device or rearranging devices. still need see happens if hold top-level handle open entire session. another option contemplating save preparsed data. ms implores release calling hidd_freepreparseddata(). happens if don't? the last thing thinking of speed-up setupdigetclassdevs(). current usage is: hdevinfo hardwaredeviceinfo = setupdigetclassdevs ( &hidguid, null, // define no

Laravel routing - relative path issues -

i have directory structure follows: docs - index.php - js/ - css/ - img/ mylaravelapp - app/ - bootstrap/ - config/ - database/ - public/ - resources/ - storage/ - tests/ - etc. what want happen when user navigates to: http://localhost/myprojects/mylaravelapp/public/docs they served files "docs" folder (including javascript, css , images...) i tried: putting symlink ../../docs inside "public" folder (didn't work - "sorry, page looking not found." error) .htaccess rules such rewriterule ^docs/(.*) {request_filename}/../../docs/$1 [l] i'm struggling here... can somehow in routes.php? think having in routes.php file suit me best. something like: route::get('docs', 'docscontroller@index'); but how return reference folder not in public directory? i'm new laravel, please go easy on me... why make "docs" folder outside app? in situation, if have directory &quo

osx - Can't load X11 in R after OS X Yosemite upgrade, not root -

i following error message when try install packages r. shell-init: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory error in setwd(cdir) : character argument expected in addition: warning message: in dotrycatch(return(expr), name, parentenv, handler) : unable load shared object '/library/frameworks/r.framework/resources/modules//r_x11.so': dlopen(/library/frameworks/r.framework/resources/modules//r_x11.so, 6): library not loaded: /opt/x11/lib/libsm.6.dylib referenced from: /library/frameworks/r.framework/resources/modules//r_x11.so reason: image not found error in setwd(cdir) : character argument expected this problem had been solved here : can't load x11 in r after os x yosemite upgrade my problem not have root access on mac. there way solve issue without root access ? thanks

android - Playing sound when ViewPager is swiped -

this question has answer here: want play sound on viewpager swipe 1 answer how can play sound when viewpager swiped? should put player code? code use playing sound sample follows: mediaplayer mp; mp = mediaplayer.create(context, r.raw.sample); mp.setoncompletionlistener(new mediaplayer.oncompletionlistener() { @override public void oncompletion(mediaplayer mp) { // todo auto-generated method stub mp.reset(); mp.release(); mp=null; } }); mp.start(); where should put player code? viewpager gives possibility register instance of class extends interface onpagechangelistener , contains 3 callbacks: onpagescrollstatechanged(int state) onpagescrolled(int position, float positionoffset, int positionoffsetpixels) onpageselected(int position) you run when onpageselected

java - How Could I add Jcomponent during runtime with Swing Timer -

i have problem making adding randomtext(with random size, font,x,y) jframe every seconds code first 1 jcomponent expects randomly made string appear public class randomtextgenerator extends jcomponent{ private string str; private random r; private color c; private font f; private int x; private int y; graphics g; public randomtextgenerator(string s) { r = new random(); c = new color(r.nextint(255),r.nextint(255),r.nextint(255)); f = new font("random",font.bold,r.nextint(100)); x = r.nextint(100); y = r.nextint(100)+100; //setpreferredsize(new dimension(500,500)); str = s; } public void paintcomponent(graphics g) { g.setcolor(c); g.setfont(f); system.out.println(str); g.drawstring(str, x, y); } } another 1 jframe public class textframe extends jframe{ public textframe() { this.setsize(500, 500); this.setde

ssas - How to get the Percentage using MDX -

Image
i want find percentage of claims in run time. learn can achieved using calculated measure, not know how that. please guide me how find percentage of claims((line count/grandtotoal) *100). try following: with member [measures].[percentageofall] [tmp claim dim].[claimno].currentmember / ([tmp claim dim].[claimno].[all]) ,format_string = 'percent'; select {[measures].[tmp claim dim count], [measures].[percentageofall]} on 0, [tmp claim dim].[claimno].members on 1 [acoe pi]; if want above apply measure [tmp claim dim count] use tuples measure in new measure: with member [measures].[percentageofall_claimcnt] ([tmp claim dim].[claimno].currentmember, [measures].[tmp claim dim count]) / ([tmp claim dim].[claimno].[all], [measures].[tmp claim dim count]) ,format_string = 'percent'; select {[measures].[tmp claim dim count]} on 0, [tmp claim dim].[claimno].members on 1 [acoe pi

java - Display TableView<ObservableList<String>> inside TreeView<E> -

the design had in mind this: there's treeview<e> , e wrapper class implementation this: public class e { private int key; private string value; public e(int key, string value) { this.key = key; this.value = value; } public int getkey(){ return key; } public string getvalue() { return value; } public string tostring(){ return value; } } so treeview<e> contain bunch of treeitem<e> instances. , tostring() method of e displays value. and when press of tree items, want tableview<observablelist<string>> shown below selected treeitem<e> containing rows db connected key value of treeitem<e> . is possible? know treetableview decent option, don't want show columns unless press 1 of tree items. , want each treeitem<e> have own table. although, record, tables have same columns, different amount of rows. update: of @uluk biy i've man

c# - Graphics.TextRenderingHint property doesn't change in printing -

i have application job print on preexisting preprinted labels, important text printed in precise way, looks when user places during editing. use gdi+ methods that. i noticed there difference between printed font , 1 shown in preview , found out during printing not possible set graphics.textrenderinghint property value singlebitperpixelgridfit. try set value of textrenderinghint antialias, doesn't change. here example of code: private void printdoc_printpage(object sender, printpageeventargs e) { printdocument printdoc = (printdocument)sender; e.graphics.pageunit = graphicsunit.millimeter; //i try set value of textrenderinghint antialias, doesn't change e.graphics.textrenderinghint = system.drawing.text.textrenderinghint.antialias; string line = "line of text"; system.drawing.font textfont = new system.drawing.font("arial", 5f, fontstyle.regular); stringformat sf = new stringformat(strin

javascript - Ionic - Back button close keyboard but input still focused -

this causes awkward behaviour. when reselect input field keyboard pops again, input field stays behind keyboard. when closing keyboard without using button works intended. this didn't use problem, after created new project using newest version (v1.0.0 "uranium-unicorn") of ionic bug occurred. any suggestions? i managed fixed problem, missing following plugin: cordova plugin add com.ionic.keyboard (i had realisation after posted question)

design patterns - Running code in a PHP once -

i'm trying write class in php acts wrapper collection of command line tools make them easier use php. i have single class ( myclass ) in file myclass.php . i have code checks see if required tools installed , sets constant ( tools_available ) either true or false . although it's not lot of code, want run first time tries instantiate class or use of static functions. what's best practice handling this? i want run first time tries instantiate class or use of static functions. well, best answer not have static methods. can stick code in constructor method per answer @treegarden. if must have static methods, you'll need static flag within class indicate when you've called 'run once' code, can avoid running again. , call explicitly each of static methods , constructor. this: <?php class myclass { private static $hasrunonce = false; private static runmeonce() { if (!self::$hasrunonce) { self::$hasru

python - using the .split method -

my question after using .split() method, how python know start split? for example if have opened txt file using python , decide use line split method this; user = line.split(':')[0] john: hhwoeioawn: 802:0933:iama john:/home/john:/bin/sh as can see, ( ":" ) occurs more once. as said, question isn't absolutely clear. looking @ code, seems want first word returned split , in case, may use like: user = line[:line.index(":")] best regards.

r - finding first three maximum element and their index of a vector -

i have vector looks this [12,3,4,5,6,7,8,12] i want find index , value of first 3 maximum number.the maximum number can repeat above vector 12 repeats . i used which but returns index 1 number how can done the output [12,12,8] [1,8,7] i read stack overflow did not help x <- c(12, 3, 4, 5, 6, 7, 8, 12) sort.int(x, decreasing = true, index.return = true) # $x # [1] 12 12 8 7 6 5 4 3 # $ix # [1] 1 8 7 6 5 4 3 2 then, first 3 elements: sort.int(x, decreasing = true, index.return = true)$ix[1:3] # [1] 1 8 7

linux - Including "Force "option to onclick "install" button for a particular package -

is possible include --force-overwrite option inside on-click of "install" button particular package in openwrt lua web page?? i included --force-overwrite (subcommand options) inside return install () function particular lua scripts

SIP messages in IPSec communication -

we have sip client (endpoint) , wanted integrate ipsec sip client. client sent security-client header server , server send security-server header client. in these messages, client , server sending spi-c , sip-s value each other further communication. please clarify me below questions ? do need two(i.e. server , client) spi values @ time of communication on udp or tcp ? at time of communication on ipsec how can share pre-shared key ? from sip point of view - to establish ipsec connection both endpoint share security attributes called security association (sa) contains multiple parameters. there 2 security associations, 1 client server , server client. each sa contains 1 spi. yes there 2 spi involved. ipsec uses ike (internet key exchange) key management. ike internally uses diffe hellman algorithm key exchange. hope answers.

How can i separate fields in JSP from text file? -

i have perl script search latest modified files in specified folders. when search end script put data in text file structure: [comp] = folder1 [date] = 2015.06.01 08:12 [comp] = folder1 [date] = 2015.06.01 05:27 [comp] = folder1 [date] = 2015.05.31 11:44:44 ...etc for display have use jsp, because server running tomcat. here's index.jsp: <%@ page import = "java.io.*, java.util.*" %> <% servletcontext context = getservletcontext(); string file = (context.getrealpath("/list.txt")); string s, list = new string(); try { datainputstream in = new datainputstream( new bufferedinputstream( new fileinputstream(file))); while((s = in.readline())!= null) { list += s + "\n"; } in.close(); } catch(exception e) {system.out.println(e);} %> <pre> <%=list%> </pre> now, "list" variable contain comp ,

ssas - Parent not include children if parrent is miss in another year in MDX -

i have data, parentid geo customerid sales year 171 171 10 2014 171 172 20 2015 171 172 30 2014 171 173 40 2014 query, select non empty { [measures].[sales] } on columns, non empty { ([dimcustomer].[parentgeocode].[parentgeolcode].allmembers ) } dimension properties member_caption, member_unique_name on rows ( select ( { [dimcustomer].[parentskid].[level 02].allmembers } ) on columns ( select ( { [dimcustomer].[hierarchycategory].&[hierarchy] } ) on columns ( select ( { [year].[year].&[2015], [year].[year].&[2014] } ) on columns [cube]))) ( [year].[year].currentmember, [dimcustomer].[hierarchycategory].&[hierarchy], [dimcustomer].[parentskid].[level 02].allmembers) output- coming query 10 per requirment need 100 if select year 2014 , 2015 try taking [year].[year].currentmember out of where clause , replacing member of hierarchy [year].[year].[all] by way: 1. not need

php - fetching products of current user_id -

i have function fetch products ci_products table code follows function get_product_selections($product_ids = array()) { $this->db->select('*'); $this->db->from('ci_products'); $this->db->where_in('product_id', $product_ids); $products = $this->db->get(); return $products; } now want fetch user_id current user_id have tried few things not working have tried` function get_product_selections($product_ids = array()) { $this->db->select('*'); $this->db->from('ci_products'); $this->db->where_in('product_id', $product_ids); $this->db->where('user_id',$this->session->userdata('user_id')); $products = $this->db->get(); return $products; } $data = $this->db->get_where('product_ids',$product_ids); $this->db->where_in('product_ids',$data); $this->db->where('user_id'

java - NullPointerException with GoogleGuave Event-Bus and JavaFX FXML-UI-Object -

i hope can my, because have no more idea: problem: if set text of buttons in gui javafx , fxml works fine. if run same function googleguave event-bus returned nullpointer exception. the example down below show problem: function setlabel() call 2 times. first time function initialize(url arg0, resourcebundle bundle). works, fine , no exception. second time, if event arrived, called listen(localchangeevent event). nullpointer exception comes back. what reason? 1 package de.iav.bottommenu; import java.io.printwriter; import java.io.stringwriter; 5 import java.net.url; import java.util.resourcebundle; import javafx.fxml.fxml; import javafx.fxml.initializable; 10 import javafx.scene.control.button; import javax.inject.inject; import com.google.common.eventbus.subscribe; import de.iav.events.localchangeevent; 15 public class bottommenupresenter implements initializable { @fxml button b_back, b_next, b_abort; 20 @inject public bottommenuview mainbottommenu;

ruby - Rails param value decoding in strange format -

i have strange issue not able figure out why happening url decode "-" dash. here params processed on debian server, check filename contains stange characters dash "-". started "/attachments/download/55388/ve11%20ftart%20%e2%80%93%20large%20model.pptx" x.x.x.x @ 2015-06-01 07:54:19 +0200 processing attachmentscontroller#download html parameters: {"id"=>"55388", "filename"=>"ve11 ftart ̢~@~s large model.pptx"} the same format in development environment decoded properly. parameters: {"id"=>"55388", "filename"=>"ve11 ftart Рlarge model.pptx"} anyone know issue? thanks in advance.

sql server 2008 - How to update data faster in sql using c# -

i want update database think code takes lot of time in doing it. takes 20secs or more in updating. possible make faster? if please me. this code: for (int = 0; < listview1.items.count; i++) { if (listview1.items[i].subitems[13].text.tostring() == ("active") || listview1.items[i].subitems[13].text.tostring() == ("active")) { (int x = 0; x < listview1.items[i].subitems.count; x++) { string = listview1.items[i].subitems[7].text; timespan time = convert.todatetime(datetime.now.tostring("mmmm dd, yyyy")) - convert.todatetime(a.tostring()); int days = (int)time.totaldays; listview1.items[i].subitems[11].text = days.tostring() + " day(s)"; class1.connecttodb(); class1.sqlstatement = "update tblhd set aging = '" + days.tostring() + " day(s)" + "'"

java - JsonSchema2pojo doesnot generate POJO -

i given pojo below, { "id": "yyy", "$schema": "http://json-schema.org/draft-04/schema#", "packages": { "id": "#/packages", "description": "xxx", "type": "object", "properties": { "xx": { "description": "total number of elements in collection.", "type": "integer", "minimum": 1, "minlength": 1 } .............. ............... }, "additionalproperties": false, "required": [ "xx", ... ... ] } } when trying generate pojo jsonschema2pojo see package being created no class files in it. no exceptions occur. when add "properties" around "packages" tag generates pojo if other json refe

java - Error while opening oracle-sqldeveloper -

Image
when open oracle-sqldeveloper asking full pathname java.exe. have installed java , added path this c:\program files\java\jre1.8.0_45\bin but after adding path getting following. when open oracle-sqldeveloper asking full pathname java.exe. this issue missing jdk. sql developer cannot run jre , needs jdk debugger work, related java debug wire protocol . i think sql developer version 4 onwards, jdk embedded installation software. so, if have downloaded version 4 or up, should able run without additional installation of jdk, if prompted provide path embedded jdk. else, if sql developer version below 4, need additionally download jdk. see download link . the sql developer configuration file present at: $oracle_home/sqldeveloper/sqldeveloper/bin/sqldeveloper.conf

Validate scala forms, when form contains inner case classes -

help scala forms validation, here case class form data: case class data( firstname: string, lastname: string, email: string, confirm_email: string, password: string, confirm_password: string) } and scala form: val form = form( mapping( "firstname" -> nonemptytext, "lastname" -> nonemptytext, "email" -> email, "confirm_email" -> email, "password" -> nonemptytext(minlength = 8), "confirm_password" -> nonemptytext(minlength = 8))(data.apply)(data.unapply)) now problem need validate "email" , "confirm" email, problem need create tuples or mapping . , best way handle these kinds of form validation situations. can done using tuples , not mapping case class. but can done if requried use mapping , case classes in forms . first things first, i'd rid of confirm_email , confirm_password fields since t

Android 2D repetitive wave animation -

i need make 2d repetitive wave animation on background of view imageview or simple view link : https://github.com/romainpiel/titanic but problem library putting waves on text of textview not it's background .. i think have simple solution, yet can't figure out! simple 2d horizontal repetitive wave animation goes left right or vice versa . (and it's not possible duplicate of something! have searched ;) ) any appreciated.

iphone - Delegating a string to a UILabel and an image to a UIImageView - Swift -

so, what's happening: have 2 controllers; mainviewcontroller , detailstableviewcontroller. on detailstableviewcontroller want write name random recipe, pick image photo library. after that, want send data cell in mainviewcontroller. code this: import uikit import coredata class mainviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate, senddetailstomvcdelegate { @iboutlet weak var mainimage: uiimageview! @iboutlet weak var tableview: uitableview! var nameslistarray: [string] = [] var imageslistarray: [uiimage] = [] override func viewdidload() { super.viewdidload() } override func viewdidappear(animated: bool) { super.viewdidappear(animated) } func senddetailstomvc (name: string, image: uiimage) { nameslistarray.append(name) imageslistarray.append(image) } func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return nameslistarray.c

ambiguous - Why G++ cannot resolve the scope of this apparently easy ambiguity when attempting to polymorphysm with CRTP? -

i attempting create template classes each can solve specific facet of problem able mishmash them without resorting creating traditional abstract virtual classes. that, believe crtp best paradigm. however, when using crtp bit more found trapped on weak resolution logic - compiler (g++ 4.8.2) cannot distinguish between 2 methods on different classes though signature different - method name same. the classes implementation: template< class t > class { public: void foo( uint32_t val ) { t* me = static_cast<t*>( ); me->doit(); } }; template< class t > class b { public: void foo() { uint32_t v32 = 10; t* me = static_cast<t*>( ); me->foo( v32 ); } }; class derived : public a<derived>, public b<derived> { public: void doit() { std::cout << "here" << std::endl; } }; then used derived d; d.foo(); when compiled, error surfaces:

java - How to create a textbox in Gui that can hold my print statements? -

i'm trying make texted based game ask user series of questions similar how survey works. want make gui box these questions can asked , box can input answers. i've researched bit i'm not sure how text input answer because depending on how answer question, different action occurs. question how create text box can hold print statements , text box user can input answers. if using swing: questions can use jlabel , set text in either through constructor or through settext() method. as user answers can use jtextfield or jtextarea object (depending on expected size of user input) , call gettext() methods retrieve user input string.

c++ - How to show realtime output SFML -

i making form in box. have give input, , whatever enter shown in box type. have got point input unable show on box. here's snippet: case event::textentered: if (isselected) { char print; int xcor = 149; sf::text t; t.setfont(font); { print = event.text.unicode; //149.25 t.setcharactersize(15); t.setcolor(color::black); t.setstring(print); t.setposition(xcor+1, 25); window.draw(t); //window.display(); } while (event.text.unicode!=13); //cout << (char) event.text.unicode; } break; you should draw text every frame, whether there textentered event or not. need string store text in. main loop this: sf::string text_string; sf::text text; text.setcharactersize(15); text.setcolor(color::black); text.setposition(150, 25); while (window.isopen()) { // process events sf::event ev

python - How can I write asyncio coroutines that optionally act as regular functions? -

i'm writing library i'd end-users able optionally use if methods , functions not coroutines. for example, given function: @asyncio.coroutine def blah_getter(): return (yield http_client.get('http://blahblahblah')) an end user doesn't care use asynchronous features in own code, still has import asyncio , run this: >>> response = asyncio.get_event_loop().run_until_complete(blah_getter()) it cool if could, inside of blah_getter determine if being called coroutine or not , react accordingly. so like: @asyncio.coroutine def blah_getter(): if magically_determine_if_being_yielded_from(): return (yield http_client.get('http://blahblahblah')) else: el = asyncio.get_event_loop() return el.run_until_complete(http_client.get('http://blahblahblah')) you need 2 functions -- asynchronous coroutine , synchronous regular function: @asyncio.coroutine def async_gettter(): return (yield http_