Posts

Showing posts from September, 2015

android - illegalstateexception did not create a view when screen orientation changes -

i have been trying make app opens listview fragment (gradelistfragment) activity (gradelistactivity). when click item, opens new fragment (gradedetailfragment). if in portrait mode, replaces list fragment in fragment1. if in landscape, replaces empty fragment2. problem app crashes when switch orientation. switching both perspectives gets same error. 04-09 12:10:52.240: e/androidruntime(2221): fatal exception: main 04-09 12:10:52.240: e/androidruntime(2221): process: bcs421.christophergoepfert.hwk.gradeapp.presentation, pid: 2221 04-09 12:10:52.240: e/androidruntime(2221): java.lang.runtimeexception: unable start activity componentinfo{bcs421.christophergoepfert.hwk.gradeapp.presentation/bcs421.christ ophergoepfert.hwk.gradeapp.presentation.gradelistactivity}: android.view.inflateexception: binary xml file line #8: error inflating class fragment 04-09 12:10:52.240: e/androidruntime(2221): @ android.app.activitythread.performlaunchactivity(activitythread.ja

arrays - Pointer to a pointer in C not working as expected -

i learning pointers in c. have 2d array of integers , i'm trying add elements in single row. 2d array name a . know a pointer array rows, pointers integer elements. want loop on entire array a . so, declared pointer **pp equal a , since a pointer pointer. program crashing @ run time. int main(void){ int sum=0; int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}}; int **pp = null; int *p = null; (pp=a;pp<a+3;pp++){ (p=*pp;p<*pp+3;p++) sum += *p; printf("sum = %d\n", sum); sum = 0; } } i know address of first object of 2d array a . address of second object a+1 , on. matrix element i,j example *(*(a+i)+j) . in order words, if set pointer variable pp (a+i) , know i'm in i-th row. address of first integer element of i-th row *(a+i) , why made p=*pp . element (i,0) should *p same *(*(a+i)+0) . so, why isn't code running should ? following code works though needs cast : int main(void){ int sum = 0; int a[3][3] = { {

c# - How can I add a blank line to my StringBuilder? -

it known "issue" doing this: sb.appendline(); ...will not add blank line, 1 expect (as discussed here , instance). however, commonly believed work: sb.appendline(environment.newline); ...but it's not working me. i've got code: for (int = 0; < listoflistitems.count; i++) { sb.appendline(environment.newline); lc = listoflistitems[i]; sb.appendline(string.format(@"<p>request date {0}; payee name {1}; remit address or mail stop {2}; last 4 of ssn or itin {3}; 204 submitted or on file {4}; requester name {5}; dept or div name {6}; phone {7}; email {8}</p>", lc.li_requestdate, lc.li_payeename, lc.li_remitaddressormailstop, lc.li_last4ssndigitsoritin, lc.li_204submittedoronfile, lc.li_requestername, lc.li_deptdivname, lc.li_phone, lc.li_email)); } all data being added stringbuilder, , form gets generated, there no spaces between list items - "sb.appendline(environment.newline)" appending nothing. what

sprite kit - How to stop/cancel playSoundFileNamed in Swift? -

i'm trying make button, when pushed - sound played, , when pushed again - sound stop. i'm using playsoundfilenamed: runaction: withkey: , removeactionforkey , doesn't work. the other question have if there way not stop sound, pause (so start same part paused, not beginning). i've seen similar topic @ stack overflow, yet didn't find answer on question yet. thank in advance. import spritekit import avfoundation var firesoundon = false private var backgroundmusicplayer: avaudioplayer! class gamescene2: skscene { override func didmovetoview(view: skview) { setupscenery() } private func setupscenery() { //background let background = skspritenode(imagenamed: backgroundimage, normalmapped: true) addchild(background) //fire button var firepath = uibezierpath() firepath.movetopoint(cgpointmake(0, 0)) firepath.addcurvetopoint(cgpointmake(115, 215), controlpoint1: cgpointmake(5, 170), controlpoint2: cgpointmake(90, 190)

sqlite - Android Studio - create database with multiple columns -

i want create database 3 columns (name of point of interest, longitude , latitude). since new databases using example found online , try change case. problem works 1 column if add other 2 breaks. code: taskcontract import android.provider.basecolumns; public class taskcontract { public static final string db_name = "com.example.todolist.db.tasks"; public static final int db_version = 1; public static final string poi_names = "tasks"; public static final string longitudes = "longs"; public static final string latitudes = "lats"; public class columns { public static final string poi = "task"; public static final string _id = basecolumns._id; public static final string longitude = "long"; public static final string latitude = "lat"; } } taskdbhelper import android.content.context; import android.database.sqlite.sqlitedatabase; import andr

kohana - Class 'Model_register' not found -

good day ladies , gentlemen, i've upgraded kohana 3.1.x latest 3.3.x version , im getting error: errorexception [ fatal error ]: class 'model_register' not found can me? follow upgrade guides 3.1.x => 3.2.x , 3.2.x => 3.3.x . with 3.2.x kohana changed naming conventions psr-0 compliant. means if class called kohana_core located in classes/kohana/core.php have change classes/kohana/core.php . have either upgrade modules current versions, or fix naming (which lot of work). the issue seeing related change of naming conventions. if isn't, module caues error?

javascript - Dynamically set active menu item using data-toggle -

i have menu included in file , b. don't want of tabs active @ first after clicking on them want set correct list item's class="active". thought code below it. need add or change? <ul id="navbar_menu" class="nav nav-tabs"> <li><a data-toggle="tab" href="#">a</a></li> <li><a data-toggle="tab" href="#">b</a></li> </ul> fyi: have included following html page (do need more this): href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> http://getbootstrap.com/javascript/#tabs according bootstrap's documentation (under title "markup"), still missing html. so right, except need link's href point id of actual tab, , not hash mark # . <ul id="navbar_menu" class="nav nav-tabs"> <li><a data-toggle="tab" hr

asp.net web api - Why is Serilog(.Extras.)Web's ApplicationLifecycleModule.Init() called twice? -

i'm hosting web api in iis (7.5) application under "default web site" , , using several of enrichers serilog.extras.web (i'll upgrading serilogweb.classic package). noticed in logs applicationlifecyclemodule.logrequest() being called twice each request, , i'm trying understand why. what noticed applicationlifecyclemodule.init() being called twice, registering 2 event handlers. the first callstack: serilog.extras.web.dll!serilog.extras.web.applicationlifecyclemodule.init(system.web.httpapplication context) system.web.dll!system.web.httpapplication.registereventsubscriptionswithiis(system.intptr appcontext, system.web.httpcontext context, system.reflection.methodinfo[] handlers) system.web.dll!system.web.httpapplication.initspecial(system.web.httpapplicationstate state, system.reflection.methodinfo[] handlers, system.intptr appcontext, system.web.httpcontext context) system.web.dll!system.web.httpapplicationfactory.getspecialapplicationinstance(system.i

php - How to store an image from memory in MySQL -

i'm trying upload image, change size , write result mysql database. basic code: // load original image $image = imagecreatefromjpeg($file); // load original image // create new image $newimage = imagecreatetruecolor($newwidth, $newheight); // copy original new, changing size imagecopyresampled($newimage, $image, 0, 0, 0, 0, $newwidth, $newheight,$origwidth, $origheight); // save new image in database (in blob field) mysql_query("update mytable set photo='" . mysql_escape_string($newimage) . "' keyfield=2"); but nothing stored. $newimage appears valid image of correct size. failing do? as @wayne said . suggest save image in file system , save file path in database here code copy image filesystem $imagepath="c:/your/file/complete/path"; if(isset($_files["file"])){ move_uploaded_file($_files["file"]["tmp_name"], $imagepath); mysql_query("update mytable set phot

ios - FBSDKLoginManager: undefined symbols for architecture x86_64 + linker command failed with exit code 1 -

i upgraded facebook ios sdk v.4.0.1 , got these errors: undefined symbols architecture x86_64: "_objc_class_$_fbsdkloginmanager", referenced from: objc-class-ref in controller1.o objc-class-ref in appdelegate.o objc-class-ref in controller2.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) i tried change linkers: -all_load same error, while -force_load becomes "ld: file not found: -fobjc-arc". solutions? i ran same problem. if you're adding facebook login app (which presume are) need drag fbsdkloginkit.framework file xcode project in addition fbsdkcorekit.framework file . the current instructions on facebook's sdk getting started page forget mention this. in version < 4 of sdk, there 1 file drag in project.

javascript - jQuery $.post doesn't send data -

i'm trying send data via $.post when i'm check network section of firefox, seems data never sent, yet success event triggered. don't know what's wrong... tried $.post , $.ajax , got same result. html <button id="nuevoadmin">agregar administrador</button> <article id="addadmin"> <form id="newadmin"> <label>nombre</label> <input type="text" name="nomadmin" required/> <label>puesto</label> <select name="puesto" id="jobs"> </select> <label>correo electrónico</label> <input type="email" name="emailadmin" required/> <span class="vacio">campo requerido</span> <span class="malcorreo">introduzca una dirección de correo válida</

I am not able to fetch single record from access database in C#.Net -

i doing project on library management system. want fetch data student using borrower number select query. code not working giving exception type mismatch in criteria expression @ line number 40 dadapter.fill(datatable);. please me. here code. thank :) using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; using system.data.oledb; namespace librarymanagment { public partial class viewstudent : form { private oledbconnection bookconn; private oledbcommand oledbcmd = new oledbcommand(); //parameter mdsaputra.udl private string connparam = @"provider=microsoft.jet.oledb.4.0;data source=e:\mini\database\library.mdb;persist security info=false"; public viewstudent() { bookconn = new oledbconnection(connparam); initializecomponent(); } private void btnview_click(object sender, eventargs e) {

javascript - SharePoint - URL link with user name and password -

my requirement have link site uses read-only user name , password. i tried using https://username:password@server.domain.net:8097/db_id=360&action=1&pm=p&device_id=&bc=0/ still prompted enter password. i tired these 2 scripts , neither 1 worked. have suggestions? <asp:hyperlink id="server_resources" runat="server" navigateurl="https://server.domain.net:8097/db_id=360&action=1&pm=p&device_id=&bc=0">server resources <input type="hidden" id="userid" name="userid" value="username"/> <input type="hidden" id="pwd" name="pwd" value="password"/> </asp:hyperlink> <script> <form id="nadali" name="nadali" runat="server" action="https://server.domain.net:8097/db_id=360&action=1&pm=p&device_id=&bc=0" method="post" > <input type

Carbon app does not receive kEventWindowDrawContent on unhiding -

i noticed old carbon application not receive keventwindowdrawcontent when unhiding application. can solve problem redrawing once keventwindowexpanded event i'm still confused why app doesn't keventwindowdrawcontent event when app brought hidden state. i checked old apple docs , there's no explicit mentioning keventwindowdrawcontent sent when app unhidden, common sense implies should sent because app needs redrawn. i initial keventwindowdrawcontent message when opening window, though, event handler must have been installed correctly. does remember old carbon stuff? keventwindowdrawcontent supposed sent on unhiding or not? this answer received apple engineer: keventwindowdrawcontent sent when window content has been invalidated. don’t invalidate window content default when window expanded minimized state; window buffer kept valid while window minimized (so drawing window reflected in window’s dock tile), it’s assumed unless app explicitly inv

How to get a Python dict into an HTML template using Flask/Jinja2 -

i'm trying use python dict in html file. dictionary passed html template through render_template function in flask. this format of dict: dict1[counter] = { 'title': l.gettitle(), 'url': l.getlink(), 'img': l.getimg() } then in html template in want iterate through dict: {% l in result.iteritems() %} <div class="link"> <a href="{{ l.url }}"> {{l.title}}</a> <img src="{{ l.img }}" width="100" height="100"> </div> {% endfor %} i don't know problem is, since there no error log in flask. the problem you’re iterating on iteritems() , iterator of (key, value) pairs. means l variable tuple, not dictionary. want iterate on itervalues() instead. update template code follows: {% l in result.itervalues() %} <div class="link"> <a href="{{ l.url }}"> {{l.title}}</a> <img src=&q

vb.net - Closing parent form when child form also closes -

aside main form have form, frmaddfixture, can open frmaddreport. i'm trying close frmaddfixture when "no" selected msgbox, closes (successfully) me (frmaddreport). if "yes" selected frmaddfixture should stay open, does. can't close "no". i've tried adding own handler in detect when frmaddreport closing, couldn't working. frmaddreport code (run after "submit" button has been clicked): private sub showmsg() select case msgbox("do want add player report fixture?", msgboxstyle.question + msgboxstyle.yesno, "add further reports") case msgboxresult.yes isnewfixture = false me.close() case msgboxresult.no isnewfixture = true me.close() ''close frmaddfixture 'frmaddfixture.dispose() 'frmaddfixture.close() 'frmaddfixture.hide()

Python read pdf in sections -

i'm trying read pdf file each page divided 3x3 blocks of information of form a | b | c d | e | f g | h | each of entries broken multiple lines. simplified example of 1 entry this card . there similar cards in other 8 slots. i'd able read a, b, c…; however, survive if read first line of a, b, , c, , second line of a, b, , c, etc. i've looked @ pdfminer , pypdf, haven't seen fit i'm looking for. answer here works well, order of columns routinely gets distorted. in second answer here replace self.rows = sorted(self.rows, key = lambda x: (x[0], -x[2])) by self.rows = sorted(self.rows, key = lambda x: (x[0], -x[2], x[1])) very important: see last paragraph of answer.

ios - How to receive an image from cloudkit? -

i using code store image in icloud, code use retrieave , place in uiimageview? i've tried everything, wont work? func saveimageincloud(imagetosave: uiimage) { let newrecord:ckrecord = ckrecord(recordtype: "imagerecord") let nsdocumentdirectory = nssearchpathdirectory.documentdirectory let nsuserdomainmask = nssearchpathdomainmask.userdomainmask if let paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, true) { if paths.count > 0 { if let dirpath = paths[0] as? string { let writepath = dirpath.stringbyappendingpathcomponent("image2.png") uiimagepngrepresentation(imagetosave).writetofile(writepath, atomically: true) var file : ckasset? = ckasset(fileurl: nsurl(fileurlwithpath: writepath)) newrecord.setvalue(file, forkey: "image") } } } if let database = self.privatedatabase {

java - garbage collector does not work -

i have program download stocks data internet , create stock objects contains stock meta data , array of historical prices. at first ran on more 20000 stocks created them , entered them arraylist writing them db(all of them in 1 transaction). wasn't idea , before ended download stocks wanted program died because of outofmemory. then decided after every 500 stocks adding arraylist write them db , clean arraylist(arraylist.clear() gc make it's "magic") , fill arraylist new 500 stocks , go through same proccess on again. that didn't work either, , program died again because of outofmemory exception. i thought problem may in else in code , made experiment , ran same code 1 little difference: after create each stock object not put arraylist , continue , create stock objects on again without adding them arraylist. the result program didn't consume memory @ , make me confused , frustrated. please me find out if wrong program . here lines of code: t

Real time NSTask output to NSTextView with Swift -

i'm using nstask run rsync, , i'd status show in text view of scroll view inside window. right have this: let pipe = nspipe() task2.standardoutput = pipe task2.launch() let data = pipe.filehandleforreading.readdatatoendoffile() let output: string = nsstring(data: data, encoding: nsasciistringencoding)! string textview.string = output and get's me of statistics transfer, i'd output in real time, get's printed out when run app in xcode, , put text view. there way this? you can read asynchronously pipe, using notifications. here simple example demonstrating how works, helps started: let task = nstask() task.launchpath = "/bin/sh" task.arguments = ["-c", "echo 1 ; sleep 1 ; echo 2 ; sleep 1 ; echo 3 ; sleep 1 ; echo 4"] let pipe = nspipe() task.standardoutput = pipe let outhandle = pipe.filehandleforreading outhandle.waitfordatainbackgroundandnotify() var obs1 : nsobjectprotocol! obs1 = nsnotificationcenter.defaultcen

Simplifying assembly code generated from gcc -

i wanted demonstrate how different c functions turned arm assembly code using gcc, tried compiling function int f(int a) { return a+1; } using command: gcc -o3 -s test.c to get: .arch armv6 .eabi_attribute 27, 3 .eabi_attribute 28, 1 .fpu vfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 2 .eabi_attribute 30, 2 .eabi_attribute 18, 4 .file "test.c" .text .align 2 .global f .type f, %function f: @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. add r0, r0, #1 bx lr .size f, .-f .ident "gcc: (debian 4.6.3-14+rpi1) 4.6.3" .section .note.gnu-stack,"",%progbits however, gives whole

c# - Read in from multiple type files all in different locations -

in c# using streamreader, have extract data multiple files. here's code have far. it's not correct , have more specific , add more yet. need select various individual files based on date , time have in common. files common inputted date , time selected extraction. problem files different types e.g. text, xml , html , may possible in different locations. have display extracted data together. appreciated. thank you. private void btnload_click(object sender, routedeventargs e) { try { var files = directory.enumeratefiles("d:\\path", "*.*", searchoption.alldirectories) .where(s => s.endswith(".txt") || s.endswith(".xml")); using (streamreader sr = new streamreader("files")). { string line; while ((line = sr.readline()) != null) { lbdisplay.items.add(line); }

scala - Transform and flatten List of disjunctions -

case class errs(errors: list[err]) case class err(exceptionmessage: string, custommessage: string, statuscode: int, extrainfo: option[string] = none) one of functions returning val result = list[\/[errs, boolean]] in order transform/sequence , flatten result following passes done val finalres: \/[errs, boolean] = result.map(_.swap).sequenceu.map(x => errs(x.map(_.errors).flatten)).swap this looks inelegant , performance intensive (given number of passes has via multiple map calls etc) is there combinator in scalaz can make more elegant less number of passes or demands writing custom function? firstly, use traverseu , suggested travis brown. after that, call map followed call flatten can written flatmap . val finalres: \/[errs, boolean] = result.traverseu(_.swap).map(x => errs(x.flatmap(_.errors))).swap moreover, may consider using type alias errs . type errs = list[err] so, code simpler (less boxing/unboxing) : val finalres: \/[errs, boole

.net - How to remove unused methods in C#? -

this question has answer here: can .net windows application compressed single .exe? 12 answers for example, have 2 projects sharing functions, let's them , b. create library project c, containing public code. put common code in class, in class, not methods used in both projects. of them used in a, used in b , rest used in both of them. now, after compiling, got a.exe, b.exe , c.dll. want is: i don't want dll, want a.exe , b.exe i don't want methods used in a.exe appears in b.exe, , vice versa. merging dll , exe can solve problem 1, how 2? what describing static library, not dll. if c static library, when compile (with compiler set drop unused stuff), a's exe have code required taken static library c , put directly exe. same go b. but that's not how dlls work. with dll, getting "services" of code c, since code liv

AngularJS form gets pristine but still submitted -

according source of angularjs (1.3.15), formcontroller 's method $setpristine() resets forms $submitted status false: form.$setpristine = function() { $animate.setclass(element, pristine_class, dirty_class + ' ' + submitted_class); form.$dirty = false; form.$pristine = true; form.$submitted = false; foreach(controls, function(control) { control.$setpristine(); }); }; the problem after submitting , calling method inside controller , form reverts $submitted = false . expected or bug? the reason seeing behavior reset button not have type="button" or type="reset" attribute , therefore behaves submit button default. ng-click sets form pristine set $submitted false correctly, afterwards, form submitted again. app.js var app = angular.module('plunker', []); app.controller('mainctrl', function() { this.data = { name: '' }; this.reset = function(form) { this.data.name = '';

css - Objects in html not linked -

social media buttons not links though code shows proper linked objects: <li class="facebook" title="" data-placement="bottom" data-toggle="tooltip" data-original-title="facebook"> <a href="https://www.facebook.com/facebookdevelopers"></a> </li> you should read " how ask " page first. ok so, link it's not outputting noting, because didn't specified nothing inside of outputted, @ least 1 letter should inside of it <a href="https://www.facebook.com/facebookdevelopers"> </a> this output letter link. want linked should inside of <a> tag. example using image link: <a href="https://www.facebook.com/facebookdevelopers"> <img src="random-image.png" alt="test" height="50" width="100"> </a> learn more a tag here

Internal NuGet install fails to install -

i setup internal nuget server host internal dll packages. setup went smoothly. spec , nupkg created successfully. however, when launch test project , attempt install manage nuget packages fails. the internal package shows under manage nuget packages install button. hit install nothing. check references folder , saw nothing added. if check manage nuget packages @ solution level, has green check mark indicate it's installed doesn't give me manage option see project installed to. my issue similar post below. difference don't have sub folders library. have 1 dll , i'm putting nupkg file directly under packages folder. nuget package fails install i'm not sure did wrong. suggestions? thanks @mattward mentioned package got installed @ solution level. went official documentation here: https://docs.nuget.org/create/creating-and-publishing-a-package review differences creating solution level package vs project level package , important of nuget naming c

ember.js - Using transitionToRoute, passing a route without a dynamic segment the current model causes error -

i have route defined in router as: ... this.resource('cart', {path: 'my/cart'}); ... myapp.cartroute = ember.route.extend({ model: function(params) { return this.store.find('cart'); } }); in cartcontroller (arraycontroller) have line of code in action (addtocart): this.transitiontoroute('cart', this.get('model')); in other route's template, call action: <button {{action 'addtocart' product target='controllers.cart'}}>add cart</button> when button clicked, error: uncaught error: more context objects passed there dynamic segments route: cart to understanding, ember should have recognized passing model , skipped model hook, want. this can fixed adding random, useless dynamic segment route definition defining serialize in cartroute. however, if there better way, rather that. am going wrong way? in this.transitiontoroute('cart', this.get('model')); yo

PHP: Slim Framework - using different response header per route -

is possible use different response header in every route? you can see sourcecode here: indexfile: https://github.com/damian89/slim-filecaching/blob/master/index.php caching middleware: https://github.com/damian89/slim-filecaching/blob/master/caching.slim.php i have 2 simple routes. use caching in first case, not second 1 - it's not working. if place following code directly above first route works: $app->response->headers->set( pagecaching::slim_page_cacher, pagecaching::cache_enabled); but in case both routes cached. any ideas? thank you! to me looks caching logic in middleware reversed. in /no-cache/ route set slim_page_cacher header cache_disabled value 1 . in middleware compare slim_page_cacher header cache_enabled value 0 . becomes: $this->skip_caching (1 == 0); /* evaluates false */ this means skip_caching false , page cached. in general idea avoid double negatives in code. make code hard read , understand. idea

PHP - dynamic if statement within mysql while loop -

i try list of products products have 1 or more in request send form before. here's code: problem right now, it's including 1 product template there more products quantity >=1 within loop. why 1 , stop? ` $sql="select id, provider products"; $result=mysql_query($sql); while($propdata=mysql_fetch_array($result)) { if ($_request['qty' . $propdata[id]] >= 1) { $mid = $propdata[id]; include('file1.php'); include($propdata[provider] . '-file2-template.php'); } } ` hope can help, that's quite new me. never needed request within if statement , while loop ..... thanks!

Sonarqube server wont start on linux -

i tried setup sonarqube server when tried start started within few seconds stopped. here details : linux version: enterprise linux enterprise linux server release 5.10 (carthage) red hat enterprise linux server release 5.10 (tikanga) console log : running sonarqube... wrapper | --> wrapper started console wrapper | using tick timer. wrapperp | server listening on port 32000. wrapper | command[0] : /utilsoftware/jdk1.7.0_75/bin/java wrapper | command[1] : -djava.awt.headless=true wrapper | command[2] : -xms3m wrapper | command[3] : -xmx32m wrapper | command[4] : -djava.library.path=./lib wrapper | command[5] : -classpath wrapper | command[6] : ../../lib/jsw/wrapper-3.2.3.jar:../../lib/sonar-application-5.1.jar wrapper | command[7] : -dwrapper.key=sds6vyrza_ppwkqc wrapper | command[8] : -dwrapper.port=32000 wrapper | command[9] : -dwrapper.jvm.port.min=31000 wrapper | command[10] : -dwrapper.jvm.port.max=31999 wrapper | command[11] : -dwrapper.debug=true wrappe

terminal - Xterm*selectToClipboard doesn't work when put in Xresources -

i have problem xterm , can't figure out wrong: i need enable option *selecttoclipboard in xterm able copy text in terminal. to firstly tried "manually" start xterm option following command: xterm -xrm 'xterm*selecttoclipboard: true' work well. then enable option each time xterm started put following line xterm*selecttoclipboard: true in ~/.xresources , used command xrdb -merge ~/.xresources update settings doesn't work: xterm starts option isn't enabled , can't copy text terminal whereas other options in xresources enabled , work fine. does have idea of cause problem? short answer: need add line bellow in /etc/x11/app-defaults/xterm file *selecttoclipboard: true long answer: if @ man pages xterm(1): man xterm files actual pathnames given may differ on system. ... /etc/x11/app-defaults/xterm xterm default application resources. /etc/x11/app-defaults/xterm-color xterm color application reso

angularjs form post http interceptor not working -

i new angularjs pardon ignorance. here interceptor have angularjs app .config(function ($routeprovider, $locationprovider, $httpprovider) { $routeprovider .otherwise({ redirectto: '/' }); $locationprovider.html5mode(true); $httpprovider.interceptors.push('authinterceptor'); }) .factory('authinterceptor', function ($rootscope, $q, $cookiestore, $location) { return { // add authorization token headers request: function (config) { config.headers = config.headers || {}; if ($cookiestore.get('token')) { config.headers.authorization = 'bearer ' + $cookiestore.get('token'); } return config; }, // intercept 401s , redirect login responseerror: function(response) { if(response.status === 401) { $location.path('/login'); // remove stale tokens $cookiestore.remove('token');

HTML entity handling in Python 3/BeautifulSoup on Windows -

i'm having trouble handling html containing escaped unicode characters (in chinese range) in python3/beautifulsoup on windows. beautifulsoup seems function correctly, until try print extracted tag, or write out file. have default encoding set utf-8, yet cp1252 codec seems getting selected... to reproduce: soup = beautifulsoup("&#38577;") f = open("out.html", "w") f.write(soup.text) f.close() stack trace attached. traceback (most recent call last): file "scrape.py", line 143, in <module> test_uni() file "scrape.py", line 126, in test_uni f.write(soup.text) file "c:\venv\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] unicodeencodeerror: 'charmap' codec can't encode character '\u96b1' in position 0: character maps <undefined> you trying write non-english (unicode) string file python expec

php - jasperphp error passing parameters -

in jasper report have sql sentence this: select * table $p!{my_where} in php program, i'm calling report way: jasperphp::process( base_path() . '/app/reports/report.jasper', false, array("pdf"), array("my_where" => "where field = value"), \config::get('database.connections.mysql') )->execute(); then, error message: wrong report param format! doing simple way works, mean: in report: select * table $p!{field} = $p{value} in php: jasperphp::process( base_path() . '/app/reports/report.jasper', false, array("pdf"), array("field" => $my_field, "value" => $my_value), \config::get('database.connections.mysql') )->execute(); the thing is, need build clause dynamically several fields, so, passing "where" parameter must. any idea? s

javascript - Angular Translate async timing issue with $translateProvider.useStaticFilesLoader -

i using excellent angular translate ( $translate ) directive/service deal multiple locale languages , since have multiple locale files use convenient $translateprovider.usestaticfilesloader load translation files through structure of localeabbr.json, example en.json , es.json , etc... built plunker show open source project , project uses locale through git raw files (pointing actual github repository, meaning not local plunker demo). project built directive , service, made small plunker show timing issue json file loading. all seems $translateprovider.usestaticfilesloader works asynchronous while need synchronous because time plunker runs, json files not yet parsed while called $translate.instant() on messages. i have plunker showing problem. and here part of quick service demo: app.factory('validationservice', ['$filter', '$translate', function ($filter, $translate) { var service = this; var validationsummary = []; var errormessages = [

sas - Use proc glimmix for bionomial response-Model statement -

usually use following statement model y/n = block variety / dist=binomial solution; however, if have calculate proprtion=y/n excel , directly use "proportion" sas. i.e model proportion = block variety /dist=binomial solution; i same result. however, there wrong second code? you suppose same result have said too. not clear went wrong code!

asp.net - SQL statement error Incorrect syntax near the keyword 'WHERE' -

i getting error when call , sql statement: incorrect syntax near keyword 'where' what doing wrong? public static dscustomer retrievemultiplecustomers(int custid = 0, string custlast = null, string custphone = null, string custemail = null) { dscustomer ds; oledbconnection connection = connection(); oledbdataadapter sqlda; bool blnsubselect = false; string strsubselect = "select * customer"; if (custid != 0) { strsubselect = strsubselect + " custid = " + custid; blnsubselect = true; } else { if (custlast != null) { strsubselect = strsubselect + " custlast ='" + custlast + "'"; blnsubselect = true; } if (custphone !=null && custemail==null && custlast==null) { strsubselect = strsubselect + " custphone ='" + custphone + "'"; } if

Creating a stack in C, getting " error error: expected ')' before '*' token " -

usually lurk forums till can find hint me out, this...i have no idea. so relevant pieces of code is struct com_stack { unsigned el_num; struct command *st; unsigned top; }; void com_push (com_stack* s,command input) //error regarding line { if(s->top == (s->el_num - 1)) { s->el_num+=64; s->stk=(command*)realloc(s->stk,sizeof(struct command)*s->el_num); } s->stk[s->top]=input; s->top++; } i believe created struct correctly stack contain commands. el_num later assigned initial size of stack, , top element number sits @ top. i'm not sure if i'm handling push function correctly. send in pointer of stack , single command i'm trying push in. any or advice appreciated. typedef struct or specify struct in functions type . also, struct called com_stack not have member stk have member st . struct com_stack { unsigned el_num; struct command *st;