Posts

Showing posts from June, 2012

oracle - Query for delete -

i have employee table in database have 2 column employee_card , ledger_month. employee can have relation multiple ledger month. want keep employee highest ledger month , rest deleted. input: employee_card ledger_month 1 111112 1 111114 2 111112 2 111114 output : employee_card ledger_month 1 111114 2 111114 i tried query delete v2titas.employee_copy_upgraded card not in(select card,max(ledger_month) v2titas.employee_copy_upgraded group card) or ledger_month not in (select card,max(ledger_month) v2titas.employee_copy_upgraded group card) but showing error "too many value". how can this? delete v2titas.employee_copy_upgraded et exists ( select * v2titas.employee_copy_upgraded et.card = it.card , et.ledger_month < it.ledger_month );

objective c - AlertView issue in iOS 8 -

Image
i added uiview in alertview follow: uiview *alertsubview = [[uiview alloc]initwithframe:cgrectmake(0, 0, 260, 55)]; [alertsubview addsubview:textfield]; [alertsubview addsubview:charleftlabel]; [alert setvalue:alertsubview forkey:@"accessoryview"]; problem uiview* alertsubview = [alertview valueforkey:@"accessoryview"]; app crash when try subview in alertview delegate method. it working fine in ios7 there issue ios 8 only error terminating app due uncaught exception 'nsunknownkeyexception', reason: '[ valueforundefinedkey:]: class not key value coding-compliant key accessoryview. alert view deprecated. should use uialertcontroller . suggestion. for example aspect : uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:@"alert controller" message:@"alert message" ...

HTML5 audio from PHP script -

Image
i want play audio generated php script. client side: <audio controls autoplay src="audio.php"></audio> server side: $path = 'somefile.mp3'; header('content-type: audio/mpeg'); header('cache-control: no-cache'); header("content-transfer-encoding: binary"); readfile($path); it plays, can't change current time in audio element. range slider not working. it missing few things in header in order seekbar work. content-length , accept-ranges. html audio player needs them in order build player seekbar. try this: $path = 'somefile.mp3'; header('content-type: audio/mpeg'); header('cache-control: no-cache'); header('content-transfer-encoding: binary'); header('content-length: ' . filesize($path)); header('accept-ranges: bytes'); readfile($path);

android - How to add Recycler item SetOnClickListener in javatechig example -

i'm trying add onclicklistener recyclerview tryied , doesnt work!: feeditem: public class feeditem { private string title; private string thumbnail; private string date; private string tags; public string gettitle() { return title; } public void settitle(string title) { this.title = title; } public string getthumbnail() { return thumbnail; } public void setthumbnail(string thumbnail) { this.thumbnail = thumbnail; } public string getdate() { return date; } public void getdate(string date) { this.date = date; } public string gettags() { return tags; } public void settags(string tags) { this.tags = tags; } } feedlistrowholder: public class feedlistrowholder extends recyclerview.viewholder { protected imageview thumbnail; protected textview title; protected textview date; protected textview tags; publ...

javascript - Maxlength in Webview textfields for PhoneGap apps on Android -

i trying implement maxlength in phonegap android not able restrict characters cause never fetches proper character code. character code delete key below code same character code other key. $(".limit-thirtyfive").bind("paste", function(e) { // access clipboard using api if (e.keycode != 8 || e.keycode != 46) { if ($(this).val().length >= 33) { $(this).val($(this).val().substr(0, 33)); } } }); $('.limit-ten').keyup(function(e) { if (e.keycode != 8 || e.keycode != 46) { if ($(this).val().length >= 10) { $(this).val($(this).val().substr(0, 10)); } } }); length restriction on general you can use maxlength attribute of input element referring to. <input type="text" maxlength="5"/> restricting special characters for getting done, may want use onchange event of input fields. exampl...

How to install Grafana on Mac -

i tied following steps cd $gopath/src/github.com/grafana/grafana go run build.go setup got following version: 2.5.0-pre1, linux version: 2.5.0, package iteration: pre1 go -v github.com/tools/godep github.com/tools/godep (download) github.com/tools/godep/godeps/_workspace/src/github.com/kr/fs github.com/tools/godep/godeps/_workspace/src/github.com/pmezard/go-difflib/difflib github.com/tools/godep/godeps/_workspace/src/golang.org/x/tools/go/vcs github.com/tools/godep go -v github.com/blang/semver github.com/blang/semver (download) github.com/blang/semver go -v github.com/mattn/go-sqlite3 go install -v github.com/mattn/go-sqlite3 then executed $gopath/bin/godep restore got no putput command got executed then ran command go run build.go build version: 2.5.0-pre1, linux version: 2.5.0, package iteration: pre1 rm -r bin rm -r godeps/_workspace/pkg rm -r godeps/_workspace/bin rm -r dist ...

ios - Bar Button Items disappear from Navigation Controller -

i have strange problem app developing. bar button items disappear @ random times. i have navigation controller 1 button (as image) takes user menu table view controller via push segue. the menu table view controller has 3 rows, i.e. menu options. each menu option takes user view controller via push segue. each view controller has button shown using default buttons. it's pretty simple straightforward setup without code. i have noticed many occasions bar button items disappear. no buttons, no menu button etc. although can still tap on area , buttons still work - not visible. i not doing via code hiding buttons. i have noticed number of times if leave app in foreground , phone goes sleep, when come buttons gone. not though. however not time buttons disappear. have seen them disappear whilst using menu system. once again there's no code can see causing this. i'm on ios9, did same ios8. any idea problem? opps ... turns out blame disappearing bar ...

symfony - Symfony2: __toString() must not throw an exception -

i deploying symfony2 application, getting following error: fatalerrorexception in classes.php line 0: error: method symfony\component\httpfoundation\request::__tostring() must not throw exception apache more descriptive, stating monolog: php fatal error: method symfony\\component\\httpfoundation\\request::__tostring() must not throw exception in /my/path/vendor/monolog/monolog/src/monolog/formatter/normalizerformatter.php on line 0 it thing not clear me how happening. dev-environment on local machine running fine. i have tried clear prod cache, composer cache , restarted apache service. did fresh "composer install" after clearing cache. anyone has idea how can solved? running symfony v2.7.4.

Rails internationalization issue -

i have following file structure: models/modules/survey/survey.rb and controllers/modules/survey/surveys_controller.rb i having internationalization survey model working: pl: activerecord: models: 'modules/survey/survey': one: ankieta few: ankiet #... errors: answers_required: 'wymagana liczba poprawnych odpowiedzi to: %{required_number}, liczba zaznaczonych odpowiedzi to: %{given_number}' attributes: 'modules/survey/survey': type: typ name: nazwa # more attributes but can't controller's translation work. neither this: pl: 'modules/survey/surveys': index: header: lista ankiet # ... nor this: pl: modules: 'survey/surveys': index: header: lista ankiet # ... works.. any suggestions? ok, right after posting found solution - had nest 1 under another: pl: modules: surv...

actionscript 3 - Unable to delete new line if it is last character in text area flex as3 -

<mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minwidth="955" minheight="600"> <mx:script> <![cdata[ protected function button1_clickhandler(event:mouseevent):void { var str:string = textid.text; } ]]> </mx:script> <mx:vbox> <mx:hbox> <mx:textarea id="textid" restrict="^\r"/> </mx:hbox> <mx:hbox> <mx:button label="click here" click="button1_clickhandler(event)" /> </mx:hbox> </mx:vbox> </mx:application> first enter text as: "hi \n " in text area, see text in textid.text clicking button. delete last character text "hi". in textid.text still result showing "hi \n ". new line @ end not deleted. if don...

sql server - Previous and Next row record -

i have following output id number speed lat long datetime 101 ab01 15 73.066016 33.5840768 9/1/15 23:10 101 ab01 20 73.0619712 33.5871456 9/1/15 23:30 101 ab01 0 73.0722176 33.6007488 9/1/15 23:45 101 ab01 0 73.0722112 33.6007488 9/2/15 02:10 101 ab01 0 73.0722176 33.6007008 9/2/15 02:35 101 ab01 0 73.0722432 33.6007456 9/2/15 04:35 101 ab01 0 73.0721664 33.6007904 9/3/15 12:35 101 ab01 0 73.072192 33.6007488 9/3/15 13:35 101 ab01 0 73.072192 33.6007488 9/4/15 11:35 101 ab01 0 73.072192 33.6007488 9/4/15 14:35 101 ab01 1 73.072192 33.6007488 9/5/15 14:35 but required output id number speed lat long datetime 101 ab01 15 73.066016 33.5840768 9/1/15 23:10 101 ab01 20 73.0619712 33.5871456 9/1/15 ...

angularjs - Data not posting in multipart form data in angular and node js(File uploading with angular and node js) -

i fresher using angular js , node js. doing file uploading process angular , node js. create directives , services watching tutorial. in services form data not posting on nodejs server. here following code file file:- here directive :- myapp.directive('filemodel', ['$parse', function ($parse) { return { restrict: 'a', link: function(scope, element, attrs) { var model = $parse(attrs.filemodel); var modelsetter = model.assign; element.bind('change', function(){ scope.$apply(function(){ modelsetter(scope, element[0].files[0]); }); }); } }; }]); here service file code :- myapp.service('multipartform', ['$http', function($http){ this.post = function(uploadurl, data){ var fd = new formdata(); for(var key in data) fd.append(key,data[key]); console.log(fd); ...

Check if variable exist in specific array key (PHP, MYSQLI) -

edit: solved - works expected. issue $search variable. of help. i have typical while looks this: while ($row = $result->fetch_assoc()) in $row, have user_name key looks $row["user_name"]. i have variable called $search. theoretically, $search in key in $row array, example in $row["user_id"]. i'm trying use stripos see if there's non-case-sensitive instance $search "like", or in key, $row["user_name"]. i've tried storing $row["user_name"] in separate variable. basically. if(stripos($row["user_id"],$search) !== false){ echo("working"); } this never happens. please help! edit: let me rephrase. all need see if $row["user_name"] contains what's in string variable $search. i've tried convert $row["user_name"] array, string, etc , tried in_array , stripos , nothing works. the below work: if (stripos("hey guys","guys")){ echo...

html5 - Skew a line on canvas using JavaScript -

i drawing lines on canvas. user can select particular line , able skew line. skew , mean can drag 1 end point of line desired point on same x-axis. how can using javascript , html5 canvas? the general way draw line this: ctx.moveto(line.startx, line.starty); ctx.lineto(line.endx, line.endy); ctx.stroke(); and can add eventlisteners , check see if mouse near line... window.addeventlistener("mousemove", function(e) { mouse.x = e.layerx || e.offsetx; mouse.y = e.layery || e.offsety; // check see if mouse near line(s) here... // can change x/y , start/end // example: if (mouse.x <= line.startx + 5 || mouse.x >= line.startx - 5) { // mouse within 5px of first x } });

visual studio 2015 - VS Tools for Universal Windows Apps 1.1 can't create app package anymore -

i upgraded vs20154 visual studio tools universal windows apps. local build works fine in debugg configuration. when try create app package error: severity code description project file line manifest references file 'moneymanager.windows.dll' not part of payload. moneymanager.windows c:\users\ninop\documents\github\moneymanager\src\moneymanager.windows\package.appxmanifest does anyhoner have idea how fix that? thanks npadrutt it appears there answer on msdn forums: to workaround issue, add below itemgroup in project file , regenerate package. <itemgroup> <appxsystembinary include="<assembly mentioned in error>" /> </itemgroup> for example, if assembly name app1.dll, include: <itemgroup> <appxsystembinary include="app1.dll" /> </itemgroup> from: https://social.msdn.microsoft.com/forums/en-us/73f2d56d-9e8e-4b57-bcfa-0a972dfd75d7/update-11-generat...

cucumber - Multiple Tables -

i'm running test in cucumber table id clickable-rows . test result telling me there ambiguous match when navigating table, yet running xpath check via f12 shows table there once. is there way can search within first table found? until dev's can sort out? thanks the following find first table , can find within it first_table = page.find(:xpath, './/table[1]') first_table.find(...)

javascript - Add New Field to Form and Save it to database -

Image
first problem: i want add new field button, everytime button clicked create new field. try using jquery new in kind of programming language, can me? doing right? html <table> <tbody> <tr> <td> <?php $n = 0; $c = 0; echo "<select>"; do{ if($c>10){$n="";} echo "<option>".$n.$c.":00</option>"; echo "<option>".$n.$c.":30</option>"; $c++; }while($c<24); ?> </td> <td><input type="text"></td> </tr> </tbody> </table> <center><button id="addrow">add row</button></center> script <script> $(document).ready(function(){ $("#addrow").click(function(){ consoloe.log(...

jsf - FacesContext.getCurrentInstance() returns null in Runnable class -

i trying facescontext calling facescontext.getcurrentinstance() in run() method of runnable class, returns null . public class task implements runnable { @override public void run() { facescontext context = facescontext.getcurrentinstance(); // null! // ... } } how caused , how can solve it? the facescontext stored threadlocal variable in thread responsible http request invoked facesservlet , 1 responsible creating facescontext . thread goes through jsf managed bean methods only. facescontext not available in other threads spawned thread. you should not have need in other threads. moreover, when thread starts , runs independently, underlying http request continue processing http response , disappear. won't able http response anyway. you need solve problem differently. ask yourself: need for? obtain information? pass that information runnable during construction instead. the below example assumes you'd access session ...

jquery - FadeIn and FadeOut when page scroll -

i create div, put social link. want when user scroll page more > 100, div fade in, , when user come < 100, fadeout. how can it? demo: http://so.devilmaycode.it/fadein-and-fadeout-when-page-scroll/ <style type="text/css"> #social-icons-wrapper { /* custom properties */ padding:10px; text-align:center; font-size:20px; background: #000; color:#fff; width:100%; height:32px; /* required properties */ display:none; position: fixed; top: 0; z-index: 999999; } </style> <div id="social-icons-wrapper"><!-- social icons here --></div> <script type="text/javascript"> //<![cdata[ $(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('#social-icons-wrapper').stop().fadein(200); } else { $('#social-icons-wrapper').stop().fadeout(200); } ...

java - How do I get Checkstyle CustomImportOrder to work with IntelliJ properly? -

i'm trying checkstyle (via maven-checkstyle-plugin) have intellij imports checked using checkstyle customimportorder module. despite having ordered imports according intellij's default rules, checkstyle still says import order wrong. here's imports (ordered according intellij rules (ctrl+o): import org.codehaus.jackson.jsonnode; import javax.sql.rowset.serial.sqloutputimpl; import java.util.arraylist; import java.util.list; here's warning message checkstyle: [warning] src\main\java\com\example\hej\enklass.java[5] (imports) customimportorder: import statement in wrong order. should in 'special_imports' group. [warning] src\main\java\com\example\hej\enklass.java[6] (imports) customimportorder: import statement in wrong order. should in 'standard_java_package' group. [warning] src\main\java\com\example\hej\enklass.java[7] (imports) customimportorder: import statement in wrong order. should in 'standard_java_package' group. here's ...

string - Javascript- Uppercase letters to lower case and vise versa -

i interested in making uppercase letters lowercase , lowercase letters uppercase. if have code below code, should put in blank spaces of if/else statement: if (string[i] == ) , else if (string [i] == ) . here rest of code: var sentence = "whats up! make me uppercase or lowercase"; var thestring = sentence.split("") (var = thestring.length; >= 0; i--) { if (thestring[i] == ) { thestring[i].tolowercase(); } else if (thestring [i] == ) { thestring[i].touppercase(); } } var connectedsentence = thestring.join(""); console.log(connectedsentence); have made other mistakes? expected output make me uppercase or lowercase. if (thestring[i] == thestring[i].touppercase()) { thestring[i]= thestring[i].tolowercase(); } else if (thestring[i] == thestring[i].tolowercase()) { thestring[i]= thestring[i].touppercase(); }

java - Difference between ResourceConfig and ServletContextListener for Jersey Rest Service -

i want initialize jersey rest service , introduce global application-wide variable should calculated @ application start up-time , should available in each rest resource , each method (here indicated integer globalappvalue=17, complex object later). in order initialize service , calculate value once @ start found 2 practices: general servletcontextlistener , jersey resourceconfig method. have not understood difference between both of them? both methods fire @ start (both system.out-messages printed). here implementation of servletcontextlistener works fine: public class loadconfigurationlistener implements servletcontextlistener { private int globalappvalue = 17; @override public void contextdestroyed (servletcontextevent event) { } @override public void contextinitialized (servletcontextevent event) { system.out.println ("servletcontext init."); servletcontext context = event.getservletcontext (); context.s...

css - How do I align these boxes using bootstrap? -

Image
here code: <div class="row" > <div id="box1" class="col-lg-4 box"style=""> <img src="images/1.png" style="" class="num-img"> <a href="#" style="text-decoration:none;color:#fff;">box 1 content</a> </div> <div id="box2" class="col-lg-4 box" style=""> <img src="images/2.png" style="" class="num-img"> <a href="#" style="text-decoration:none;color:#fff;">box 2 content</a> </div> <div id="box3" class="col-lg-4 box" style=""> <img src="images/3.png" style="" class="num-img"> ...

1046 No database selected mysql cpanel -

how fix error when import database phpmyadmin cpanel: sql query: -- -- database: `news_letter` -- -- -------------------------------------------------------- -- -- table structure table `banner_tbl` -- create table if not exists `banner_tbl` ( `ban_id` int( 11 ) not null , `banner_img` varchar( 255 ) not null , `date` varchar( 255 ) not null ) engine = innodb auto_increment =158 default charset = latin1; mysql said: documentation #1046 - no database selected add following lines on top of .sql file create database if not exists `news_letter`; use `news_letter`;

java - AlarmManager alternatives for persistent frequent scheduling -

it has come attention android 5.1 no longer accepts recurring alarms time intervals shorter 60 seconds ( source ). i developing application logs information wireless networks. operation of application imperative can perform operations every 1-2 seconds , doesn't killed or suspended operating system if using lot of resources. reliable operation on long periods of time (several hours) important thing. impact on battery life not concern. so far reliable way of achieving functionality has been use recurring alarms. android 5.1 no longer option. best options replacing alarmmanager implementation? as workaround can set 60 alarms flexible solution current implementation. check os version , set many alarms need. but long-term solution suggest implement sticky foreground service work similar music player. simple handler.postdelayed should enough keep alive. reason way alarms not accurate , better have control on process.

python - how can i search a text file of list of words from user input and print the line which contains these words? -

my query here want search words text file , print lines contain words. words given user input. somehow reached till point it's giving output nothing. def sip(x): print("====welcome sip log debugger ==== ") file= input("please enter log file path: ") search = input("enter errors want search for(seperated commas): ") search = [word.strip() word in search.lower().split(",")] open(file,'r') f: lines = f.readlines() line = f.readline() word in line.lower().split(): if word in line: print(line), if word == none: print('') you're reading lines , saving them variable: lines = f.readlines() then try read 1 more line: line = f.readline() but you've read through whole file, there's nothing read anymore, f.readline() returns '' . next try loop through each word in line variable, '...

r - Call to ggplot in a function with NSE -

the idea patch call ggplot in function. the example: library(dplyr) library(ggplot2) library(lazyeval) df <- data.frame(a=letters[1:10], b=2:11, c=3:12)) func <- function(name, dat=df) { output <- dat %>% select_(~a,name) %>% arrange_(interp(~desc(var), var=as.name(name))) plot <- ggplot(output, aes_string(x=reorder(~a,-name), y=b)) + geom_bar(stat='identity') print(plot) return(plot) } result <- func("b") compiling gives: error in -name : invalid argument unary operator. i tried deparse , substitute . not sure got right combo. ideas? reorder data before passing ggplot . following code moves of column names around in ggplot call, because otherwise you’d plotting a against b , regardless of name argument — or intentional? function (dat, name) { var = as.name(name) reord = list(interp(~ reorder(var, -var), var = var)) output = dat %>% select_(~a, name) %>% # n...

Simple Addon: works with jpm run but not after installing the xpi: -

following tutorials made addon working "jpm run" not after installing xpi file. read issue197 thats "icons". addon shown correctly both ways. but clickevent works "jpm run". function of addon: clicking in frame.html runs javascript function frameclick(){ window.parent.postmessage("frame clicked","*"); } the index.js should open panel. my code in index.js: var data = require("sdk/self").data; var mypanel = require("sdk/panel").panel({ contenturl: data.url("panel.html"), contentscriptfile: data.url("panel.js") }); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html"} ); var { toolbar } = require("sdk/ui/toolbar"); var toolbar = toolbar({ name: "toolbar", title: "toolbar", items: [frame] }); frame.on("message",messagefromframe) function...

twitter bootstrap 3 - i want responsive page when i compress my window -

in executed in maximized window think not responsive because when compress window design view vertically 1 one want horizontal view <div class="col-md-12"> <div class="row-fluid"> <div class="col-md-3"> <span class="text-center"><b>sellers</b></span> </div> <div class="col-md-1"> <span class="glyphicon glyphicon-arrow-down">rating</span> </div> <div class="col-md-3"> <span class="glyphicon glyphicon-arrow-up">delivered by</span> </div> <div class="col-md-1"> <span class="text-center">offers</span> </div> <div class=...

Dynamic parameter with git in jenkins -

is there way git parameter dynamically in jenkins? https://mygitaddressnothere:8888/$mygit.git suposing using variable mygit. after time, found out how use parameter. https://mygitaddressnothere:8888/${mygit}.git instead of: http://mygitaddressnothere:8888/$mygit.git

java - How to know what is the real content type of the part in multipart request -

i sending multipart request client server this: filebody file2 = new filebody(new file("./test2.txt")); filebody image1 = new filebody(new file("./dsc_0064.jpg")); and see, 1 of files txt, , 1 if jpg image. on server, receive request , take headers each part, , this: ------------part 1------------ content-disposition=form-data; name="test2"; filename="test2.txt" content-type=application/octet-stream content-transfer-encoding=binary ------------part 2------------ content-disposition=form-data; name="image1"; filename="dsc_0064.jpg" content-type=application/octet-stream content-transfer-encoding=binary as see, content type both of them application/octet-stream . how determine in dynamic environment actual type? image? text? video? i can't depend on file name because user can change example txt png , server think image exception because of that. that's because not setting mime type. can other cons...

angularjs - angular filter on click by 'last week' data -

hi new in angular , making first module. article helpfull. want filter data lastweek records. have found days current date , given date in mysql query, on button click setting value distopic=1 , works fine. may please tell me how can apply filter range day>=1 && day<=7 i using below:- filter:{'topic': distopic,'attachment':attch, 'days':day} please me. solution 1: angular-filter module as stated other users, indeed custom filter. however, if find writing lot of custom filters, i'll advise have @ angular-filter module. module can need pick filter : <div ng-repeat="task in tasks | pick: 'days >= 1 && days <= 7'">{{task.name}}</div> see demo fiddle solution 2: custom filter parameters template: <div ng-repeat="task in tasks | dayfilter: 1 : 7">{{task.name}}</div> javascript: app.filter('dayfilter', function() { return function...

python - Enabling or Disabling Threads in jmeter from cmd using -J option -

i new jmeter , have following query. i working on project involves me testing jmx file containing multiple threads. manually enabling or disabling simple controllers of before running. tried searching online , found following solution enabling or disabling cmd using -j option. link here the problem not working out me. using following command in cmd jmeter.bat -n -t c:\pathtojmx\testfile.jmx -l c:\pathtooutput\jmeter_output.xml -jcondition1=true -jcondition=true the tree structure of jmx file follows: thread 1: (condition 1) thread 2 (child of thread 1) ( condition 2). the output running command <?xml version="1.0" encoding="utf-8"?> <testresults version="1.2"> </testresults> i running jmeter eclipse using subprocess option. earlier when tried without -j options, able output test file specified. any appreciated. update : i have 1 thread group in j...

android - OnActivityResult for 2 different activites -

i trying initialize/ turn on nfc , bt modules in same activity. need them both enabled before continue task. i understand onresultactivity async trying figure out best way achieve it? here's of code: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); initbt(); initnfc(); intent nextintent; if(savesharedpreference.getusername(mainactivity.this).length() == 0) { nextintent = new intent(mainactivity.this, loginactivity.class); } else { nextintent = new intent(mainactivity.this, mainmenuactivity.class); } startactivity(nextintent); finish(); } private void initbt() { if(btmodule.getinstance().initbt().equals(constants.ebluetoothstatus.bt_disabled)){ intent enablebtintent = new intent(btmodule.getadapter().action_request_enable); startactivityforresult(enablebtintent, re...

javascript - Pretty printing an unreadable ClojureScript #js form -

how pretty-print deeply-nested clojurescript #js data structure prints "unreadable form" on (prn (js->clj some-form)) ? the unreadable parts seem object representations "viewport" #<((123, 456), (678, 987))>} . alternatively, how strip out these unreadable forms can visualise data structure? i found an article printing java objects, surely there must simpler way? instead of using printer, use (.log js/console x) , it's way better @ printing/inspecting js objects cljs printer. makes little sense first convert js object cljs data printing.

wpf - Refreshing UI issue when deriving from a UserControl -

i’ve inherited usercontrol add functionality, , works great. myusercontrol in different project, , use in main project, problem anytime open xaml not render until make change , build. after layout refreshes time, if close user control , reopen not display unless build. here xaml <cc:formusercontrol x:class="module.options.views.accounting.views.journalformview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cc="clr-namespace:module.common.controls;assembly=module.common"> <textbox grid.row="1" text=”some text” /> </cc:formusercontrol> here c# public class formusercontrol : usercontrol, iview { public formusercontrol() { setvalue(viewmodellocator.autowireviewmodelproperty, true); } public override void endinit() { ...

c++ - What is the difference between inbuilt qsort function and stable sort function? -

from various sources cited know in-built c function, stable_sort stable qsort unstable. if case why use qsort @ all? isn't redundant? why not use stable_sort instead? the reason choose quick sort on stable sort speed: qsort faster stable_sort , should come no surprise, because stable_sort comes stronger guarantee. o(n·log 2 (n)). if additional memory available, complexity o(n·log(n)). space consideration: qsort done in place, meaning no additional memory allocation required. stable_sort , on other hand, tries temporary allocation of size equal array being sorted. this function attempts allocate temporary buffer equal in size sequence sorted. if allocation fails, less efficient algorithm chosen. note rcgldr 's comment: (the hp / microsoft implementation of std::stable_sort uses temporary buffer 1/2 size of sequence. second half sorted second half of sequence, first half temporary buffer, temporary buffer , second half of sequence merged sequence...

Laravel Javascript Image Swap Dropdown List -

right i'm develop ecommerce shopping site using laravel 5.0 , fyp , there long way go .. anyway . and , make product show page this controller : public function getview($id) { return view('store.show')->with('products', product::find($id))->with('categories',category::all())->with('db',product::all())->with('options', gambar::where('product_id','=',$id)->lists('name', 'img')); } as can see, on end of line have code lists('name', 'img') it list out column name , image values list everything works accept , need make drop down list image change on select . look on code drop down list , imageswap : <div class="form-group"> {!! form::open(array('url' => 'foo/bar')) !!} {!! form::label('link category') !!}<br /> {!! form::select('product_id',(['0' => 'select option...

java - Is there a MySQL JDBC Exception list that describes what each exception gets thrown for? -

i looking list of exception , thrown for. using mysql jdbc driver , writing in jruby, importing jar. i catching need can report errors doing, want able document else error handling might catch. take @ exception present in java.sql package. listed in "exception summary". you should not depend on mysql jdbc specific classes.

javascript - how to convert contour data set with x/y/z to 3d object -

i have set of data x,y,z values of contour. kindly share ideas how make use draw in 3d world webgl( i'm using three.js). if have list of xyz coordinates , want draw contour line, can use three.line via this: // cdata array of [xyz] e.g. [[x0,y0,z0],[x1,y1,z1],...] var g = new three.geometry(); (var i=0; i<cdata.length;i+=1) { g.vertices.push(new three.vector3(cdata[i][0], cdata[i][1], cdata[i][2])); } g.vertices.push(new three.vector3(cdata[0][0], cdata[0][1], cdata[0][2])); var contour = new three.line(g,new three.linebasicmaterial());

r - Creating a dataframe from another one by column values -

i have following dataframe (df1) > df1 var1 var2 var3 df2 1 ac bc bc 0 2 bc bc cc 1 3 dc ec dc 1 4 gc gc gc 0 i new dataframe (df2) contain values of 1 in column df2. df2 followed: > df2 var1 var2 var3 2 bc bc cc 3 dc ec dc how can it? subset should work: df2 <- subset(df1, df2 !=0) df2 <- df2[,1:3] df2 #var1 var2 var3 #2 bc bc cc #3 dc ec dc

java - ParseException: Unparseable date error trying to parse a date from csv (windows) -

i have program parsing csv file , use actions based on csv data each line. the funny thing is, on mac program run , use run on windows well, reason when run on windows error: java.text.parseexception: unparseable date: "27-nov-14" @ java.text.dateformat.parse(unknown source) ~[na:1.8.0_60] @ controllers.purchaseinfo$.controllers$purchaseinfo$$changedateformat( purchaseinfo.scala:44) ~[play-scala.play-scala-1.1%20snapshot-sans-externalized. jar:na] there no different in date format. didnt changes dont have idea why there error. this purchaseinfo func formatting date: private def changedateformat(dateinstring: string): string = { //system.out.println(dateinstring) //val formatter: simpledateformat = new simpledateformat("mmm dd, yyyy") val formatter: simpledateformat = new simpledateformat("dd-mmm-yy") val formatter2: simpledateformat = new simpledateformat("dd/mm/yyyy") val date: date = formatter...

ios - Swift: TableView scroll to position -

maybe wrong way of doing please show me correct way if wrong. have tableview on scrollview. cells have textfield onclick shows keyboard. problem having cells @ bottom of scroll view end getting stuck behind keyboard. // build tableview self.shippingtableview = uitableview(frame: cgrectmake(0, 5, self.view.frame.width, cgfloat(tableviewheight))) self.shippingtableview.delegate = self self.shippingtableview.datasource = self self.shippingtableview.scrollenabled = true self.scrollview.addsubview(self.shippingtableview) // create delegate methods // know i'm not reusing cells yet update later. func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = uitableviewcell() cell.accessorytype = uitableviewcellaccessorytype.none let textfield = uitextfield(frame: cgrectmake(10, 0, cell.frame.width, cell.frame.height)) textfield.delegate = self cell.contentview.addsubview(textfield) return cell } no...

vb.net - Asp.Net UpdatePanel not working -

Image
hi having problems getting update panel function correctly in web page. have text box in user enters id hits return key populate text box address. page work's on chrome , firefox, in ie , safari each time press return key new row added volume amount. have tried overcome problem using update panel update id , address text boxes no matter new row added volume. anyone see going wrong <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <table border="1" width="960px"> <ajaxtoolkit:toolkitscriptmanager id="toolkitscriptmanager1" runat="server"></ajaxtoolkit:toolkitscriptmanager> <asp:updatepanel runat="server" id="updatepanel" updatemode="conditional"> <triggers> <asp:asyncpostbacktrigger controlid="button1" eventname="click" /> </triggers> <contenttemplate> <tr...

How do I mock a SessionContext injected via @Resource in Java-EE? -

i'm getting following nullpointerexception : caused by: java.lang.nullpointerexception @ facadebean.createregistration(facadebean.java:389) under facadebean.java : private sessioncontext context public createregistrationresponse createregistration() { try { // snip } catch (dataaccessexception de){ context.setrollbackonly(); //---------line 389 throw new serviceexception("error"); } } test class @test(expected = serviceexception.class) public void testcreateregistrationerror() throws serviceexception { dothrow(dataaccessexception.class).when(mockregistrationperistenceimpl).create(any(registration.class)); facadebeantest.createregistration(registrationfacademock.getcreateregistrationrequest()); } could tell me how mock below line, can ignore context.setrollbackonly(); public class facadebean { public facadebean() {} @resource private sessioncontext context } easiest way change class use method injection i...

javascript - Keyboard shortcut to Toggle (hide/show) my chrome extension -

i working on extension, want chrome extension toggle (show / hide) via command (mac: "cmd+shift+9" or default: "ctrl+shift+9"); though have defined command in manifest file: { ......... "commands": { "toggle-window": { "suggested_key": { "default": "ctrl+shift+9", "mac": "command+shift+9" }, "description": "toggle feature foo", "global": true }, ........ } now, can in backgroundscript.js that? my backgroundscript.js is: chrome.commands.oncommand.addlistener(function(command) { if(command === "toggle-window") { console.log('command:', command); /* logic show/hide go here..*/ } }); how do that? thanks! sample extension demo have "show/hide" feature implemented: https://chrome.google.com/webstore/detail/meldium-browser-extension/fdocegmnehjgfhfjelhmaobj...

The file database.yml is not been ignored on a rails app. -

i building rails application, on .gitignore trying ignore database.yml /config/database.yml reason not been ignored. i suppose config/database.yml committed, therefor present in repo. , .gitignore tells ignore further changes file. just run command: git rm --cached config/database.yml

How to reverse a number in Java accepted by user and add both reversed number -

i have written code reverse number in java. taking 1 character/displaying it. import java.util.scanner; class helloworld { public static void main(string args[]) { int n,n1, reverse = 0,rev = 0; system.out.println("enter number reverse"); scanner scanner = new scanner(system.in); system.err.println("please enter first number reverse : "); int number = scanner.nextint(); system.out.println("enter second number reverse :"); int num = scanner.nextint(); if( number >0) { reverse = reverse * 10; reverse = reverse + number%10; number = number/10; if(num>0) { rev = rev * 10; rev = rev + num%10; num = num/10; } } system.out.println("reverse of entered number "+reverse); system.out.println("reverse of entered number "+rev); } } input1 -65 output displayed - 5 input2 -34 output displayed - 4 i have reverse user accpeted inputs , add reverse of both boths inputs. you can , @user7 pointed out, use ...

html - Div alignments in CSS -

Image
i have alignment in image based on number of sub divs, using css/html , bootstrap. full width can hold upto 3 divs (i.e. .container) if 2 divs shown should center aligned. as of now, divs align left or right. what easy way achieve css/html? not sure keywords should search on google - there lot of articles talking centering divs. set div inline-block , wrapper text-align: center : .wrapper { text-align: center; } .wrapper div { width: 100px; height: 100px; background: red; display: inline-block; margin: 20px; } <div class ="wrapper"> <div></div> <div></div> <div></div> </div> <div class="wrapper"> <div></div> <div></div> </div>

ssl - IIS Central Cert Store - Outbound Traffic -

i have f5 load-balanced 4-server cluster environment i'm building, i'm looking centralize our certificates prevent needing install them on every server. windows 2012 / iis 8 seems have centralized certificates, secure endpoint in iis inbound traffic. what outbound traffic? initiating tls transactions external entities, need way store these on single server , have each of iis boxes "tap into" cert store private , public keys necessary send tls message. any suggestions? you're looking hsm f5 support , iis supports few major vendors (thales , safe-net both have iis supported hsms). they're not cheap remember that's you're looking for. if don't want go route, can opt dirty solution of using big-ip cert store , rely on self-signed certs on iis pool members. inbound: incoming traffic terminates on big-ip using valid ca-signed cert ssl client profile. big-ip re-encrypts iis using generic ssl server profile. not pretty works. o...