Posts

Showing posts from March, 2011

asp.net - How can I change any app code class after publishing the website? -

i upload website after publishing it, want change line of code in class resides in app_code folder. after changes again publish website , upload new app_code.dll replace old 1 not working. whole functionality of app_code not working. there solve problem? thanx in advance. the app_code folder parse source files drop in there, e.g. myclass.vb or myclass.cs. if compiling classes dll, want put dll file bin folder instead. if classes contained in project , have build action set compile, automatically compiled web application's dll when run build, , should update every time publish site publish automatically builds project/solution.

java - Setting class-path for testing applications in IntelliJ -

i'm developing test tool designed 3rd party java application. now, here's problem: the 3rd party application has many nested directories in layout, many jars. it has plugin framework allows people add code referencing whatever libraries use within plugins. when run test tool i'm developing, when use plugins in 3rd party app, test tool gives classnotfound exception @ run time (or whatever is). so, can build, haven't gotten class references need. is there way can add root of 3rd part application class path intellij use jars finds in , sub directories when executes? been open while , no alternative suggestions have been made, closing @crazycoder's comment answer. the following link reports lack of functionality; may addressed in newer versions of ide: http://youtrack.jetbrains.com/issue/idea-40818

wpf - C# - Bind CommandParameter to the "DataContext" of a ListViewItem -

i'd able bind commandparameter of button current listviewitem . here's xaml : <listview grid.row="1" x:name="playlists" itemssource="{binding playlists, updatesourcetrigger=propertychanged}"> <listview.itemspanel> <itemspaneltemplate> <wrappanel /> </itemspaneltemplate> </listview.itemspanel> <listview.itemtemplate> <datatemplate> <stackpanel horizontalalignment="center" verticalalignment="top" width="100" margin="5"> <button x:name="btnplayplaylist" content="play" command="{binding path=playplaylistcommand}" /> </stackpanel> </datatemplate> </listview.itemtemplate> </listview> when click btnplayplaylist button, i'd able receive in viewmodel corresponding playlist. either getting it...

mysql - A error while using case next to order by -

the code supposed give me table ordered after if value 'isonline' == 1 'onlinetime', if 'isonline' == 0 onlinetime + current milliseconds since midnight, january 1, 1970 utc (isonline tinyint, onlinetime bigint) select * onlinecountertable order case `isonline` when 0 `onlinetime` when 1 (onlinetime + (round(unix_timestamp(curtime(4)) * 1000)) else `onlinetime` end desc limit 30 but if use query above, gives me error: #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'else -1 end) desc limit 30 limit 0, 25' @ line 6 replace this when 1 (onlinetime + (round(unix_timestamp(curtime(4)) * 1000)) by this when 1 (onlinetime + round(unix_timestamp(curtime(4)) * 1000)) cheers ;-)

SQL Server CDC: Track additional column after the fact -

if cdc has been setup on table, tracking columns a,d,e instead of entire table, possible add column z source table, add column z list of tracked columns cdc? possible without losing cdc data? i've looked around , examples find tracking entire table , not cherry picking columns. i'm hoping way update table schema , not lose cdc history, without doing whole copy cdc temp table cdc process. do have create new instance of cdc schema changes? sql server 2012 the reason cdc allows 2 capture instances on given table reason. idea this: you have running instance tracking columns a, b, , c you want start tracking column d so set second capture instance track a, b, c, , d. you process original capture instance , note last lsn process using fn_cdc_increment_lsn() function, set start point start processing new capture instance once you're , running on new instance, can drop old one of course, if you're using cdc history of changes ever on table… that...

uml - Show condition in use case diagram -

Image
in system, user can have more 1 role. users 2 roles or more can switch between roles. however, it's impossible switch role user 1 role. how can represent fact in use case diagram? thank you. you shouldn't show condition in use case diagram. use case diagram meant give helicopter view of features of application , hide details. you can put condition in pre-condition of use case. if put user must have more 1 role pre-condition use case doesn't start if condition not true. ps. i'm assuming role different concept roles represented actors , role have been account or group or else.

php - I can't get both my header and footer menus to display properly in my wordpress theme -

i've been trying make header menu main hyperlinks , footer menu social media icons. i've had header 1 while, it's since i've tried add menu in footer it's started displaying footer menu in header , footer. i've ensured of settings correct in wordpress end, still can't work. in header.php have: <nav class="header-nav"> <?php $args = array('theme_location' => 'header'); ?> <?php wp_nav_menu(); ?> </nav> in footer.php have: <nav class="footer-nav"> <?php $args = array('theme_location' => 'footer'); ?> <?php wp_nav_menu(); ?> </nav> and in functions.php have: register_nav_menus(array( 'header' => __( 'header menu'), 'footer' => __( 'footer menu'), )); please change functions.php : function register_my_menus() { register_nav_menus( array( 'primary' => esc_h...

ruby - Why do we need attr_accessor? -

i fail understand why needed attr_reader , attr_writer, or attr_accessor declared in class. read both this , this posts, posts explain how work, not as why there. in case of class person attr_accessor :age end bob = person.new bob.age = 99 bob.age it seems little redundant having tell ruby write , read age, while not being able write , read instance variable outside class automatically. why need set reader , writer in class instead of following code , save few lines? class person end bob = person.new bob.age = 99 bob.age because makes code easier maintain. this way clear reading class code expect have happen, , expect other classes access these variables. without outside code access internal variables, , if refactor code , remove or rename such variable outside code breaks. thus accessor methods make clear intend other classes access these methods fyi: ruby powerful, , if want can go ahead , make work way want. don't recommend pointing out und...

Cannot generate texture from bitmap in Android -

i working on android app , until used eclipse android emulator testing it. today have decided try on phone (xiaomi mi2) when lunch (via usb debugging) face 2 problems: i have background picture emulator show doesn't appear on phone - black background shown. maybe problem previous one, logcat shows errors: 03-01 22:18:35.599: e/openglrenderer(1109): cannot generate texture bitmap 03-01 22:18:35.629: e/spannablestringbuilder(1109): span_exclusive_exclusive spans cannot have 0 length activity code: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="480dip" android:layout_margintop="10dip" android:background="@drawable/bg"> <edittext android:id="@+id/eu_un" android:layout_width="match_parent" android:layout_height="wrap_content" ...

lambda - Is there a better clean approach to single-use functions in R? -

in lot of cases, need write code makes logical bloc , feels right place in function. however, being used once, makes more cumbersome move code away applied , give single-use name polluting namespace. today, experimenting , came across question lambda expressions in r . implemented logic following: x <- (function(charsbase, n, m) { z <- apply( matrix( sample(unique(charsbase), n*m*3, replace = true) , nrow = n*3, ncol = m ) , 1 , paste, collapse="") head(unique(z), n) }) (letters, 1000, 3) questions: is there better way of creating lambda in r? while namespace apparently kept clean, how memory? in experience, r leaks when create / remove object in global environment. if extensive allocation / freeing done within function, keep memory under control? thanks lot in advance! you can use with list or data-frame first argument. example: result <- with(list(a=3, b=4), { foo <- + b foo^2 }) this kee...

Java: How To Use Arrays -

i learning arrays today in school, , trying problem, cannot figure // fortune teller import java.awt.color; import java.awt.container; import java.awt.flowlayout; import java.awt.event.actionlistener; import java.awt.event.actionevent; import javax.swing.jframe; import javax.swing.jtextfield; import javax.swing.jbutton; public class fortuneteller extends jframe implements actionlistener { private static final easysound ding = new easysound("ding.wav"); // declare array of "fortunes" (strings): ___________________________________________ ... private jtextfield display; public fortuneteller() { super("fortune teller"); display = new jtextfield(" press \"next\" see fortune...", 25); display.setbackground(color.white); display.seteditable(false); jbutton go = new jbutton("next"); go.addactionlistener(this); container c = getcontentpane(); c.setlayout(new flowlayout()...

unit testing - WebStorm - How to edit Jasmine code completion snippets -

when writing jasmine unit tests in webstorm (11.0.2), using command + n (os x) command gives me following popup menu: generate jasmine suite jasmine spec jasmine beforeeach jasmine aftereach i'd modify code these menu items generate. example, i'm using es6, , change jasmine suite option generate: describe('suite name', () => { }); instead of: describe('suite name', function () { }); i'm digging through webstorm preferences, can't see options modify this. ideas? i still haven't found way edit code template when using command-n keyboard shortcut, similar functionality can found using "live template", giving complete control of template. navigate to: preferences -> editor -> live templates select javascript option in right pane, , + icon add template. configuration values: abbreviation : desc description : jasmine suite template text : describe('$suite_desc$', () => { $e...

xcode - Why is a closing brace showing no code coverage? -

Image
i've got swift function xcode showing 0 passes in code coverage. line closing brace (highlighted in red below). is bug in xcode? if not, condition need hit run line? thought covering paths through method. xcode reports include measurements ending brackets, not typically desired. there nothing can in configuration fix (as far know). (fd work @ codecov) can use codecov , hosted solution, remove these lines automatically. learn more @ https://github.com/codecov/example-xcode . :)

postgresql - Heroku Schedule task with postgres connection and python -

i have web app running on heroku using flask , sqlalchemy. wondering how can start schedule task runs daily , database related tasks (deleting row if need know:) the documentation on heroku recommends use apscheduler heroku-scheduler. dispite decision know how connect postgres database in scheduler task. not find example or hint that. thanks time torsten heroku scheduler run command throw @ it. typical way create python script/command part of flask app. can similar http://flask-script.readthedocs.org/en/latest/ . within scheduler schedule similar to: python manage.py mytask

solr - On Windows 7, how can I find what a process is given the process number? -

background: i trying start solr on windows machine. able start , stop in cygwin window, got warning message needing lsof. thought i'd see happened if tried starting via windows command prompt. when did that, got message: error: process 7128 listening on port 8983. if solr, please s top first before starting (or use restart). if not solr, please choose different port using -p port question: i can't seem figure out process 7128 is. when in task manager under processes, not include process ids. when under services does, have nothing numbered 7128 in cygwin window had started , stopped solr, ps -ef | grep 7128 and ps -ef | grep solr both return no results. note not question starting solr on windows, gave background. what want know how figure out specific process on windows machine, given process id. you can ask task manager show process ids (and lots of other interesting stuff too). go view menu , choose select columns.

java - Spring Boot - JPA - Postgres ERROR: cross-database references are not implemented: -

i using spring boot, jpa , postgres , have 1 database multiple schemas. implement web service using jpa , receive error: o.h.engine.jdbc.spi.sqlexceptionhelper : error: cross-database references not implemented: "kaloudia_db_v2.enumeration.unit" do know way overcome error? my class @entity @table(name = "unit", schema = "enumeration", catalog = kaloudia_db_v2") @xmlrootelement @namedqueries({ @namedquery(name = "unit.findall", query = "select u unit u"), @namedquery(name = "unit.findbyid", query = "select u unit u u.id = :id"), @namedquery(name = "unit.findbynameen", query = "select u unit u u.nameen = :nameen"), @namedquery(name = "unit.findbynameel", query = "select u unit u u.nameel = :nameel")}) public class unit implements serializable { private static final long serialversionuid = 1l; @id and call of jpa function is: public object g...

ios - How do I prevent text from being cut off like in UITextView? -

Image
i have uilabel , uitextview both same text (the string "snellroundhand", in snell roundhand bold font, point size 21). text in uitextview appears correctly, uilabel has text cut off on left , right sides. how text in label appear properly? some notes: expanding frame of label won't work because might solve cutoff issue on right side of text not on left side. i can't take cheap way out , center text; text must stay @ whatever alignment in right now. the reason can't change uitextviews because app processing in background , crashes whenever instantiates uitextview. i'm hoping can around issue using uilabel instead render text. in ios 6, nice new feature of uilabel supports attributed strings. attributed strings can include paragraph margins. can add margins string, ensuring there space between edges of label , drawing of string. this section of book has sample code adds margins string drawn in uilabel: http://www.apeth.com/iosbook/ch23...

compiler warnings - Warn about name shadowing in scala 2.11 -

i'm using sbt build project , have in build.scala : scalacoptions ++= seq("-unchecked", "-deprecation", "-feature", "-xfatal-warnings") how can configure project warn on name/variable shadowing? i've browsed source here , here , don't see i'm looking among many options. comment on this old question mentions flag -ywarn-shadowing doesn't seem exist. as indicated in related question , start exploring -x . tried -xlint:help , yields settings shadowing: information:scalac: enable or disable specific warnings adapted-args warn if argument list modified match receiver. nullary-unit warn when nullary methods return unit. inaccessible warn inaccessible types in method signatures. nullary-override warn when non-nullary `def f()' overrides nullary `def f'. infer-any war...

javascript - Blueimp fileupload opens file picker when whitespace is clicked. -

working on pre-existing project, found fileupload input triggers when whitespace after input element clicked, extending through several tags above it, , ending, in page, when gets pair of <li> contain form elements. (if there 1 or fewer of these list items, problem persists bottom of page.) i have pair of jsfiddles minimal examples construct. i'm totally baffled what's going on here. example 1 list item, behavior continues bottom of window: https://jsfiddle.net/e980gzry/ example 2 list items, behavior stops above first list item: https://jsfiddle.net/o76qd639/5/ has run situation before, , how go addressing it? if don't mind using javascript trigger file browser, can using jquery: $(function () { // whenever .fileinput-button clicked, trigger click on input element $(".fileinput-button").on('click', function (e) { $("#fileupload").click(); }); }); but if use directly need move input outside of .fileinput...

Extracting NLP part-of-speech labels of customers' review in R -

i have following dataframe contains reviews customer have left on restaurant website: id<-c(1,2,3,4,5,6) review<- c("the food delicious , hearty - perfect warm during freezing winters day", "excellent service usual","love place!", "service , quality of food first class"," customer services exceptional staff","excellent services") df<-data.frame(id, review) now looking way (preferably without using for loop ) find part-of-speech labels in each customer's review in r . this pretty straightforward adaption of example on maxent_pos_tag_annotator page. df<-data.frame(id, review, stringsasfactors=false) library(nlp) library(opennlp) review.pos <- sapply(df$review, function(ii) { a2 <- annotation(1l, "sentence", 1l, nchar(ii)) a2 <- annotate(ii, maxent_word_token_annotator(), a2) a3 <- annotate(ii, maxent_pos_tag_annotator(), a2) a3w <- subset(a3, ty...

Save Python turtle canvas as a .jpeg or other file type which can be saved on top of -

i have created turtle program draws many things in many sizes based on user input. however, want include "save" button opens file dialog , allows user save current canvas .jpeg or other file type compatible macintosh. most efficient , direct way implement file dialog , save method in canvas saves canvas file (that can saved on top of afterwards if save pressed again in same window) on directory user chooses? regarding appreciated! :) note: have tried researching around ways in python 3.x, getting ways python 2.x.

javascript - Jquery on page load not working -

i doing request in php value, taking value , inputting textfield's value, have text-fields value call json request. it works on input , change, on page load. here code below: $(document).ready(function() { var runningrequest = false; var request; $('input#asd3').on('load', function(e) { var $q = $(this); if(runningrequest){ request.abort(); } runningrequest=true; var mystring = self.location.href; var mysplitresult = mystring.split("?"); request = $.getjson('search',{q:$q.val()},function(data){ showresults(data,$q.val()); showresults2(data,$q.val()); runningrequest=false; }); }); }); the html <input type="text" id="asd3" name="asd3" value="<?php echo $name ?>" class="form-control" autocomplete="off" placeholder=...

twitter bootstrap - CSS not working on Localhost -

i building site , had of css, html working wonderfully. wanted add in php functionality have created local development environment on mac apache. moved of site folders new sites folder can accessed localhost. when loading website , none of css styles loading. using twitter bootstrap locally. css links in html: link rel="stylesheet" type="text/css" href="http://localhost/~tromph/yoointoosite/bootstrap.min.css"> link rel="stylesheet" type="text/css" href="http://localhost/~tromph/yoointoosite/main.css"> i've tried every other path can think of , nothing else seems work. i changed folder structure , file path to: <link rel="stylesheet" type="text/css" href="/bootstrap-3.3.2-dist/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="/bootstrap-3.3.2-dist/css/main.css" /> this fixed problem of not having css render. ...

unity3d - Facebook Plugin in for unity, key hash incorrect -

unity 5.3.0 facebook plugin 7.3.0 i trying log on facebook in unity app. doing development build @ point , not signed release build. in editor, facebook settings shows 1 key hash value. when build , run app on device, login fails following message: [ 01-05 15:32:12.551 6001: 6001 v/com.facebook.unity.fb ] exception during service com.facebook.http.protocol.apiexception: [code] 404 [message]: key hash different_key_hash= not match stored key hashes. sending unity onlogincomplete({"error":"invalid key hash. key hash different_key_hash= not match stored key hashes. configure app key hashes @ http://developers.facebook.com/apps/12345678909876","callback_id":"1","key_hash":"different_key_hash=\n"}) the key hash in message different 1 in unity editor. had both key hashes added facebook developer's console. still above error message. why there 2 different key hash values, 1 displayed in editor , 1 in logcat? ...

c# - If statement in CompiledQueries Possible? -

basically, want execute same query different parameters based on flag. eg, following case when flag true:- private static func<dataclassesdatacontext, int, string, iqueryable<dal.viewtype>> getfunccomponentsbylibid = compiledquery.compile((dataclassesdatacontext dctx, int libid, string searchtext) => (from k in dctx.viewtypeattributes (from r in dctx.viewtypeattributes r.libraryid == libid && r.typeattributevalue.contains(searchtext) && r.typeattrstatus == null select r.typeid).contains(k.typeid) select k)); i want execute same query without libid parameter if flag false. private static func<dataclassesdatacontext, int, string, iqueryable<dal.viewtype>> getfunccomponentsbylibid = compiledquery.compile((dataclassesdatacontext dctx, int libid, string searchtext) => (from k in dctx.viewtypeattribut...

c++ - Directx8 error LNK2019: unresolved external symbol -

im making rpg game (diablo) graduation project. tried compiling jim adams programing rpg directx 8 sample. ignore comments in other language. /*-------------------------------------------------------------------------- ------------------===========================------------------------------- iiiiiiii iiiii iiii iii iii iiiii ii iiiii iii iii iii iii iii iii iii iii iii ii iii iii iii ii iii iii iii iii iii iii iii ii iii iii iii ii iii iiiiiiiiiii iii iii iii iii ii iii iii iiiiiiii iiiii iii iii iiii iiiiii iiiiii iiiiii =================||||||||||||||||||||||||||||=============================== (c) braniselj klemen 2013 ========================= ;;;;;;;;;;;;;;;;;;;/class za level 1 /;;;;;;;;;;;;;;;;;;;;;; ************************** */ #ifndef _act1_h_ #define _act1_h_ //dva tipa struktu...

Javascript - String split does not work well -

i making script receives string , separate on smaller strings. ex: "this long sentence, , separate smaller parts. lalala" it return "this long sentence","and separate smaller parts","lalala" the aim of use google translator transform text speech, feature has limit of 70-80 chars, if string large need chop it. first chop in sentences separated dot ("."), if there still long sentences, split them commas (",") , if there still long strings separate them in unique words. everything works until try join words audio become more continuous. reason strings separated commas joined again. not know why. this code: edit: relevant section split out , formatted function talk(text){ var audios = document.createelement('audio'); audios.setattribute('id','audio_speech'); var playlist = new array() if(text.length >= 75) { playlist = text.split("."); (var = 0;i<playlist...

mysql - Select 1 row multiple time if has more then 1 value in other column -

i have database structure. issue table complex (typo3). i simplify this: | id |cat | |==========|=====| |1 |44,15| |2 |16 | |3 |29,30| what want have result 1 row each category (cat), mean 1 44 1 15 2 16 3 29 3 30 i tried use simple select of course not work. i tried use left join table category using category.id in (table1.cat) 1.: db structure bad! not first normal form (1nf), because have array in column string representation. 2.: it's not tricky. some inspiration: http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/ or here: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_substring-index

xml - xsl:sort inside for-each-group() -

Image
for reason xsl:sort inside for-each-group throwing exception since upgrading saxon 9.7.0.1 xml- <table class="vv"> <tr><td>woot1</td><td>woot2</td></tr> <tr><td>woot1</td><td>woot2</td></tr> <tr><td>woot1</td><td>woot2</td></tr> <tr><td>woot1</td><td>woot2</td></tr> </table> xsl- <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="table[@class='vv']"> <div class="row"> <xsl:for-each-group select="tr" group-by="td[1]/text()"> <xsl:sort/> test </xsl:for-each-group> </div> </xsl:template> error- just want verify if bug in saxon or got changed way used work in xslt 3.0 a...

How do I use Entity Framework in Code First Drop-Create mode? -

i'm using entity framework v4. have followed instructions in nerd dinner tutorial . i'm in development mode (not released higher environments) , tables recreated on each new deployment, since models still highly volatile , don't care retain data. however, not occur. tables not created/modified, or happening db. if move migrations model using package manager commands: enable-migrations, add-migration (initial), works , uses migrations. however, since don't yet want have granular migrations , want initial create script, forced delete migrations folder, redo commands (enable-migrations, add-migration) , delete database manually, every time change anything. how drop/create behavior of code first occur? use dropcreatedatabasealways initializer database. recreate database during first usage of context in app domain: database.setinitializer(new dropcreatedatabasealways<yourcontextname>()); actually if want seed database, create own initializer, ...

c# - Different hash after relog -

have strange problem c# application. basicaly, creating client <-> server application send pdf files. want add md5 checksum security prevent unnecessary retransmissions. here md5 hasher: public static class cardfingerprint { static md5 md5; static cardfingerprint() { md5 = md5.create(); } public static string computefingerprint(string pathtofile) { byte[] hash = null; using (var stream = file.openread(pathtofile)) { hash = md5.computehash(stream); } return bitconverter.tostring(hash).replace("-", string.empty); } } here code file receive, basicaly tcpclient byte transmission: filereceiverstatus status = filereceiver.recievefile(packetstorecieve); string fingerprint = cardfingerprint.computefingerprint(status.downloadedfile); everyting works fine, when log system , send file 2 times i'll get: [ 06.01.2016 - 01:46:52 ] >> user: dell-ikaros s...

c# - Using CefSharp with Owin TestServer -

due potential firewall limitations , need have many instances of app cannot competing ports, use microsoft.owin.testing.testserver class create in-memory web server serve requests embedded cefsharp browser (either wpf or winforms fine). i can create testserver no issues. how can configure cefsharp webbrowser control use test server rather using standard os network stack? if forming own requests, either use httpclient provided testserver or create new httpclient using testserver's handler. there equivalent functionality in cefsharp webbrowser? you can intercept requests , fulfill them yourself. if implement iresourcehandlerfactory subsequently iresourcehandler (just return new instance of custom iresourcehandler in iresourcehandlerfactory.getresourcehandler ) https://github.com/cefsharp/cefsharp/blob/cefsharp/45/cefsharp/iresourcehandlerfactory.cs#l22 a new instance of custom resourcehandler instantiated every request. it's relatively simple process requ...

r - Filter data frame to retain rows that meet certain criteria -

i have following data frame trying filter. want retain rows @ least 1 value in row greater 0.5. appreciated. tried following system hangs: gbpre.mat<-as.matrix(gbpre) ind <- apply(gbpre.mat, 1, function(gbpre.mat) any(gbpre > 0.5)) ph1544_pre ph1545_pre ph1565_pre ph1571_pre ph1612_pre ph1616_pre bg00050873 0.88235087 0.6053853 0.6521263 0.2770632 0.82596713 0.635325831 bg00212031 0.01175069 0.1844859 0.4345596 0.2186097 0.03717635 0.670305781 bg00213748 0.64571987 0.7316865 0.4345596 0.5613724 0.81309068 0.900878028 bg00214611 0.04405524 0.7103071 0.6810916 0.6526317 0.03412550 0.008187867 bg00455876 0.72122206 0.1272784 0.2155168 0.4794622 0.70089805 0.668497074 bg01707559 0.03592823 0.3548602 0.2743443 0.2194279 0.57761264 0.061564411 the reason definition of ind not work in function apply, not using argument of function, rather whole of gbpre . if matrix large, might slow, because each of many rows of matrix entire large matrix checked....

Transforming OCaml code to F# -

i'm transforming ocaml code f# having problem ocaml let...and... exists in f# using recursive function. have given ocaml code: let matches s = let chars = explode s in fun c -> mem c chars let space = matches " \t\n\r" , punctuiation = matches "() [] {}," , symbolic = matches "~'!@#$%^&*-+=|\\:;<>.?/" , numeric = matches "0123456789" , alphanumeric = matches "abcdefghijklmopqrstuvwxyz_'abcdefghijklmnopqrstuvwxyz" which want use in these 2 methods: let rec lexwhile prop inp = match inp c::cs when prop c -> let tok,rest = lexwhile prop cs in c+tok,rest |_->"",inp let rec lex inp = match snd(lexwhile space inp)with []->[] |c::cs ->let prop = if alphanumeric(c) alphanumeric else if symbolic(c) symbolic else fun c ->false in let toktl,rest = lexwhile prop cs in (c+toktl)::lex rest has idea how have...

Trying to understand how the guess game works in Java -

public class guess { public static void main(string arg[]) throws java.io.ioexception { char ch, ignore, answer = 'k'; { system.out.println("i'm thinking of letter between a-z, can guess it?"); ch = (char) system.in.read(); { // <<question block, start** ignore = (char) system.in.read(); } while (ignore != '\n'); // <<<end block in question here** if (ch == answer) system.out.println("***winner***"); else { system.out.print("...sorry "); if (ch > answer) system.out.println("toooo lowwww "); else { system.out.println("tooooo highhh "); } } } while (answer != ch); } } how line make program execute properly? understand takes on value not ...

java - Get View when using fragments -

i trying 'view' of layout. need create button listeners , such clueless on way this. also, using 'viewpager' host tabs, , using layout fragments. code have, hope don't need more that. if do, ask me it. here's code: package net.dankrushen.filetosms; import android.app.dialog; import android.support.design.widget.tablayout; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.os.bundle; import android.telephony.smsmanager; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.button; import android.widget.edittext; import android.widget.li...