Posts

Showing posts from July, 2013

upload image with username from android to server using multipart post -

i want upload image , username android application server. developped code. in database find image without username ( value 0).i think should use asynctask have no idea how make it. want use method if it's possible. this code: public int uploadfile(string sourcefileuri) { string filename = sourcefileuri; string ref_name = "toto"; httpurlconnection conn = null; dataoutputstream dos = null; string lineend = "\r\n"; string twohyphens = "--"; string boundary = "*****"; int bytesread, bytesavailable, buffersize; byte[] buffer; int maxbuffersize = 1 * 1024 * 1024; file sourcefile = new file(sourcefileuri); if (!sourcefile.isfile()) { dialog.dismiss(); log.e("uploadfile", "source file not exist :" + imagepath); return 0; } else { try { // open url connection servlet fileinputstream fileinputstream = new

sql - Format Query Results using Cross join -

so i'm still new cross joins, use them. able find answer first part of problem, not second. i've got results output in layout want, here results +-----------+-----------+-------------------------+ | full name | cert_type | expiration | +-----------+-----------+-------------------------+ | jane doe | 1 | 2015-09-26 00:00:00.000 | | jane doe | 2 | 2015-04-21 00:00:00.000 | | jane doe | 3 | 2015-12-16 00:00:00.000 | | john doe | 1 | 2016-10-06 00:00:00.000 | | john doe | 2 | 2015-04-19 00:00:00.000 | | john doe | 3 | 2011-04-12 00:00:00.000 | +-----------+-----------+-------------------------+ here query well: select [full name], cert_type = x.which, expiration = case x.which when '1' [license exp date] when '2' [med cert exp date] when '3' [annual mvr review due] end employee_data.dbo.employeedatabase cross join (select '

swift - Missing required module 'CocoaLumberjack' in iOS 8 app / framework -

i'm having problem integrating cocoa pod ( cocoalumberjack in case) ios app , own frameworks. the podfile looks this: source 'https://github.com/cocoapods/specs.git' platform :ios, "8.0" target "commonmodule" use_frameworks! # cocoalumberjack wasn't officially released swift support yet # pod 'cocoalumberjack' pod 'cocoalumberjack', :git => 'git@github.com:cocoalumberjack/cocoalumberjack.git', :commit => '6882fb5f03696247e394e8e75551c0fa8a035328' xcodeproj 'commonmodule/commonmodule.xcodeproj' end i have hierarchy of modules (dynamic frameworks) this: commonmodule modelsmodule (has dependency commonmodule ) and finally, main app: myswiftapp (dependency both modelsmodule , commonmodule ) now, cocoalumberjack used in several files in commonmodule , works expected. however, every time import commonmodule in file in modelsmodule , following compile error:

javascript - How can I go to next item of array in Angularjs expression? -

i have been trying dynamically change array number of expression. initial state: <p class="title text-center">{{data[0].title}}</p> <p class="subtitle text-center">{{data[0].sub_title}}</p> data array returned http request. want when click or swipe element on page jumps second item in data array, e.g.: <p class="title text-center">{{data[1].title}}</p> <p class="subtitle text-center">{{data[1].sub_title}}</p> i have been trying make expression in expression, think that wrong. also, have tried adding variable $scope in controller: $scope.update = function (whateverispassedinfromotherfunction){ var item = whateverispassedinfromotherfunction; return "data["+whateverispassedinfromotherfunction+"].sub_title"; } and in html <p class="subtitle text-center">{{update}}</p> but not make sense angular , me neither :). anyone knows so

ios - ViewController as Overlay on MapView in Swift (like Google Maps Application User Interface) -

Image
i'm building small app swift want achieve following: - mapview several annotations - click on 1 of annotations shows details in overlay moving in bottom , fill approx. half of screen - upper half of display still shows mapview. click on map closes details now i've read lot different possibilities. first i've tried using containerview this: @iboutlet weak var detailscontaineryposition: nslayoutconstraint! func mapview(mapview: mkmapview!, didselectannotationview view: mkannotationview!) { uiview.animatewithduration(0.3, delay: 0.0, options: uiviewanimationoptions.curveeaseout, animations: { self. detailscontaineryposition.constant = 0 self.view.layoutifneeded() }, completion: nil) } the problem was, viewdidload() method fired once , wanted use build details page after passing data controller class. so next i've played around custom segue , cam this: class detailssegue: uistoryboardsegue { override func perform() {

c# - WPF -- Binding Not Working -

i'm having rather frustrating problem here... have wpf page contains tabcontrol, , content of various tabitems wpf page (hosted in frame because page can have frame or window parent). though flowcalibrationsummaryview being displayed, on empty because data binding of summaryviewmodel not working reason. here's part of xaml: <tabcontrol grid.row="0"> <tabitem header="current calibration"> <tabitem.content> <frame> <frame.content> <view:flowcalibrationsummaryview datacontext="{binding summaryviewmodel}"/> </frame.content> </frame> </tabitem.content> </tabitem> </tabcontrol> i have break point on of summaryviewmodel, , getting hit code constructing in parent view model. here's property being bound to: public const string summaryviewmodelpropertyname = "summaryvi

azure - HDInsight query console Job History -

i new microsoft azure. created trial account on azure. installed azure powershell , submitted default wordcount map reduce program , works fine , able see results in powershell. when open query console of cluster in hdinsight tab, job history empty. missing here? can view job results in azure? the query console not display m/r jobs, hive jobs. can see history of jobs using powershell cmdlet get-azurehdinsightjob while return of these.

c - What does it mean to send a message to a thread? -

i learning threads. , need understand how threads communicate between each other, mean when "let thread a send message thread b "? i can think of following: thread b blocking on sort of queue, , thread a places new entry in queue, causes thread b unblock, , retrieve entry. thread b blocking on event (for example, in windows api there event object ), , thread a signals event cause thread b wake (or called notifying thread , not sending message it?) the "threads" world subject of many ambiguity due different nomenclature coming different environments, using same words mean different things. your first assertion makes sense in general terms: "message" makes thread wake-up , "input". depending on os , own api, second assertion makes sense , nothing more way implement first using win32 api. another possible interpretation can thread blocked on message loop (see getmessage ) , other 1 calls postthreadmessage . in more

ruby - How to get curb error stacktrace -

how can display entire stacktrace there error when using curb's curl::easy? i've tried looking @ http://www.rubydoc.info/github/taf2/curb/curl/err information, don't see anything. begin curl.perform rescue curl::err::curlerror => e puts e.backtrace.inspect # or log end update i tried didn't seem give me detailed error message. right i'm getting generic error message , it's hard debug as tin man mentioned "rubydoc.info/github/taf2/curb/curl/err list of possible errors returned if curb has problem." . to catch specific errors need rescue them individually. can see in example above trying rescue curl::err::curlerror . can add more errors follows: rescue curl::err::curlerror => e puts "curlerror: === " + e.backtrace.inspect rescue curl::err::accessdeniederror => e puts "accessdenied: === " + e.backtrace.inspect rescue curl::err::timeouterror => e puts "timeout: === " + e.b

ruby - How do I fix this annoying syntastic rails error -

i have following code in rails <% @post.errors.full_messages.each |msg| %> <li><%= msg %></li> <% end %> syntasticcheck vim plug in keeps displaying error app/views/posts/new.html.erb[syntax: line:12 (1)] 1 app/views/posts/new.html.erb|12 warning| possibly useless use of variable in void context if want not see these messages again: let g:syntastic_eruby_ruby_quiet_messages = \ {'regex': 'possibly useless use of variable in void context'}

When processing IMAP HTML emails, how can I quarantine in-line CSS? -

i'm building imap webmail client. problem html emails may include css affects layout / style of client. the app front-end built on angularjs. one potential solution use frames / iframes. problem these have provide src attribute. content reaching browser json data. potentially set back-end provide url each email means many more requests server. looking @ gmail dom (for example) don't see use of frames, infer there must alternate techniques out there. i worked on smallish project trying you're describing here, though different reasons. lot of hard work, , in end gave up, , went iframe solution. the route tried similar spamassassin: we removed entire <head> extracting innerhtml of <body> . we removed embedded style tags using dom parser. we did regex (argh horror!) on matching <...float:left...> , munged replacing floatxxx:left . did every css property wanted 'quarantine'. the problem that, while able 'quarantine&#

html5 - Are NavigationTiming properties available in UserTiming measure? -

is possible use navigationtiming properties when using measure in usertiming api? in other words, following according spec? window.performance.mark('foo'); window.performance.measure('mymeasurement', 'fetchstart', 'foo'); the usertiming spec states navigationtiming properties reserved when calling mark , , seems behave way when experiment in console. however, can't find in spec states expected behavior. know? nevermind, found answer here : may name of 1 of attributes in performancetiming interface [navigation timing].

Iterating through an array only gets the first value in Swift Playground -

Image
i'm aware pretty basic question has me stumped , figure out why. have array of names , iterate through them them single names, although when using for in loop produce first name, code: var arraya = ["mike", "james", "stacey", "steve"] var str = string() array in arraya { str = array println(str)//just prints steve } the problem prints steve, want able access name singley this seeing: if you're using playground, might need change view in order see results.. you need hover on quick view display in order find "all values" icon. it looks may have changed in xcode 7 - @mikemeyers mentions in comments, need right click on quick view window , select value history option.

Change bootstrap's menu break point -

so, i'm working latest version , don't know how change break point of menu cause tried change queries on bootstrap.css (wherein want break in width:1010px} : @media (min-width: 768px) { .navbar-collapse { width: auto; border-top: 0; -webkit-box-shadow: none; box-shadow: none; } and @media (min-width: 768px) { .navbar > .container .navbar-brand, .navbar > .container-fluid .navbar-brand { margin-left: -15px; } } .navbar-toggle { position: relative; float: right; padding: 9px 10px; margin-top: 8px; margin-right: 15px; margin-bottom: 8px; background-color: transparent; background-image: none; border: 1px solid transparent; border-radius: 4px; } i change 1010px have o results. in i'm wrong? according answers here , here , editing files manually 'a horribly laborious task , not recommended'. your best options either: visit http://getbootstrap.com/customize/ , specify own breakpoints t

php - Facebook Graph API stopped recognizing publish_action scope -

i'm trying upgrade integration facebook graph api version 1 version 2.0, i'm facing problem: permission publish_actions not being shown in dialog granting. i'm doing manually (without js sdk). php code: header('location: https://www.facebook.com/v2.0/dialog/oauth?client_id='.$appid.'&redirect_uri='.urlencode($callbackurl).'&scope=publish_actions,offline_access'); exit(0); does know happening? i've been looking solution hours. said, had working app @ facebook previous version, , facebook api didn't show me alert. i assume configurations correct, or @ least seem be. currently, facebook requests reviewing app when uses non-basic permissions "publish_action". if need use these permissions, need submit app reviewed facebook's team. after permission shown app users. for submit app, access app @ https://developers.facebook.com/apps/ , , after clicking @ app button, click @ button "status & rev

oracle adf - View criteria missing in jdeveloper 12.1.3 -

we having cascading lov -> deaprtment, class(inputcomboboxwithlov). class lov filtered selected value of department. when follow below steps: select department click on down arrow show filtered results, see filtered classes selected department. select class , tab out. clear class field, again click on down arrow show filtered results.(p.s : department field not touched) class field not showing filtered results. when clicked on more... display search , select popup, see filtered results. the combobox dropdown values unfiltered. on debugging, found viewcriteria applied filter using department missing. entire clause missing. this occurring after our latest migration 12.1.3, earlier using jdeveloper 11g , never faced issue. any pointers issue highly appreciated. the lov ui hints "filter combo box using" option unchecked, when checked , tried able see filtered results in dropdown. however did not understand why not picking values existing view criter

ls - How do I list all files but only show the fist N characters of the filenames? -

how list files show fist n characters of filenames? for example if filname abc_2015-01-03-08-00-35.csv in directory , done ls in directory lte_2015-01-03 1st 14 characters. i'm thinking use ls command not sure after that? you can use cut so: ls | cut -c1-14 i'm assuming don't care extensions or like.

weight - R: using bootstrapping and weighted data -

i have 2 variables i'd analyze 2x2 table, easy enough. datatable=table(data$q1data1, data$q1data2) summary(datatable) however, need weight each variable separately using 2 frequency weighting variables have. far, i've found wtd.chi.sq function in weights package, allows weight both variables same weighting variable. in addition, need perform 2x2 chi-square 1000 times using bootstrapping or resampling method, can peek @ distribution of p-values. i've been searching around day no luck. i'm hoping here can point me in right direction.

c++ - How to use QDataStream::readBytes() -

according the documentation readbytes() (in qt 5.4's qdatastream), expect following code copy input_array newly allocated memory , point raw @ copy: qbytearray input_array{"\x01\x02\x03\x04qwertyuiop"}; qdatastream unmarshaller{&input_array, qiodevice::readonly}; char* raw; uint length; unmarshaller.readbytes(raw, length); qdebug() << "raw null? " << (raw == nullptr) << " ; length = " << length << endl; ...but code prints raw null? true ; length = 0 , indicating no bytes read input array. why this? misunderstanding readbytes() ? the documentation not describe enough, qdatastream::readbytes expects data in format: quint32 part data length , data itself. so read data using qdatastream::readbytes should first write using qdatastream::writebytes or write other way using proper format. an example: qbytearray raw_input = "\x01\x02\x03\x04qwertyuiop"; qbytearray ba; qdatastream

vb.net - Visual studio: ERROR: Parameter ?_1 has no default value -

i'm having problems piece of code i'm working on, i've searched around , can't seem find thing can me! public class customercontroller public const connection_string string = _ "provider=microsoft.ace.oledb.12.0;data source=assignment.accdb" public sub insert(byval htdata hashtable) dim oconnection oledbconnection = new oledbconnection(connection_string) try debug.print("connection string: " & oconnection.connectionstring) oconnection.open() dim ocommand oledbcommand = new oledbcommand ocommand.connection = oconnection ocommand.commandtext = _ "insert customer (title, gender, firstname, lastname, phone, address, email, dob) values (?, ?, ?, ?, ?, ?, ?, ?);" ocommand.parameters.add("title", oledbtype.varchar, 255) ocommand.parameters.add("gender", oledbtype.varchar, 255) ocommand.parameters.add("firstname", o

python - Scatterplot without linear fit in seaborn -

Image
i wondering if there way turn of linear fit in seaborn's lmplot or if there equivalent function produces scatterplot. sure, use matplotlib, however, find syntax , aesthetics in seaborn quite appealing. e.g,. want plot following plot import seaborn sns sns.set(style="ticks") df = sns.load_dataset("anscombe") sns.lmplot("x", "y", data=df, hue='dataset') without linear fit so: from itertools import cycle import numpy np import matplotlib.pyplot plt color_gen = cycle(('blue', 'lightgreen', 'red', 'purple', 'gray', 'cyan')) lab in np.unique(df['dataset']): plt.scatter(df.loc[df['dataset'] == lab, 'x'], df.loc[df['dataset'] == lab, 'y'], c=next(color_gen), label=lab) plt.legend(loc='best') set fit_reg argument false : sns.lmplot("x", "y", da

mongodb - Successful CRUD but for lasterror in play reactivemongo 2.3.8 -

have used play (2.3.8) reactive scala sample code connect , create/read mongo instance cannot shake lasterror haunts me misconfigured host name. enabling debugging: logger.reactivemongo=debug shows details: [debug] r.c.a.mongodbsystem - received checked write request [debug] r.api.failover - got error, retrying... (try #1 scheduled in 500 ms) reactivemongo.core.actors.exceptions$primaryunavailableexception$: mongoerror['no primary node available!'] @ reactivemongo.core.actors.exceptions$primaryunavailableexception$.<clinit>(actors.scala) ~[reactivemongo_2.11-0.10.5.0.akka23.jar:0.10.5.0.akka23] @ reactivemongo.core.actors.mongodbsystem$$anonfun$pickchannel$4.apply(actors.scala:508) ~[reactivemongo_2.11-0.10.5.0.akka23.jar:0.10.5.0.akka23] @ reactivemongo.core.actors.mongodbsystem$$anonfun$pickchannel$4.apply(actors.scala:508) ~[reactivemongo_2.11-0.10.5.0.akka23.jar:0.10.5.0.akka23] @ scala.option.g

ios - How to specify a constraint for a UILabel to remain centered beneath each segment of a UISegmentedControl? -

Image
in app ios 8, have uisegmentedcontrol stretches fit width of device's screen. on ipad it's more pixels wide on iphone 6+, more pixels wide iphone 6, etc. centered beneath each segment of uisegmentedcontrol, have uilabel. there 5 segments , 5 uilabels. each uilabel has fixed width (fixed constraint). if display size increases become uncentered. how in interface builder can specify constraint force each uilabel become centered beneath each segment? happy if elements remain proportionally spaced each other display size scales, can't figure out how that, either. all can seemingly center middle uilabel directly under middle segment specifying center x alignment between , uisegmentedcontrol. i specified horizontal space constraint between uilabels, , between outer uilabels , edges of view, , set these "greater or equals". have same priority, strangely, don't scale proportionally each other. the resulting problem amount of horizontal space between each

ios - Custom fonts in Xcode 6 - Swift don't work -

i'm trying use custom font in xcode ios project working on. written in swift , planning change font navigation bar. in app delegate file trying use code: uinavigationbar.appearance().titletextattributes = [nsfontattributename : futura-medium, size: 20,)] has not worked. the font present in p list , build phase being targeted current project. shed light on how may able around this? check following syntax: uinavigationbar.appearance().titletextattributes = [nsfontattributename : uifont(name: "futura-medium", size: 20)!, nsforegroundcolorattributename : uicolor.whitecolor()];

html - Layout of PHP form needs altering -

part of code: echo "<form method ='post' action='nextfile.cgi'>"; echo "<table>"; echo "<tr><td>date: </td></td> <input type='date' name='date' value =".$record['date']." autofocus required='required' /></td></tr>"; echo "<tr><td>time: </td></td> <input type='time' name='time' value=".$record['time']." autofocus required='required' /></td></tr>"; echo "</table>"; echo "<input type='submit' name='submitname' value='save' />"; echo "</form>"; $record related mysql query. when running code in web browser, 2 input boxes displayed side side. below characters /> below 'date:' below 'time:

excel - Identify missing values from array -

i striving create function in vba calculates number of missing values in each column of matrix of nxn dimensions. each column should contain numbers 1 n once. if not case want function state how many values missing. example in column of 4x4 matrix (1,2,1,3) there 1 missing value 4, , function should return value 1, 1 missing value. i new vba , no means master, have done far... function calccost(sol() integer, n integer) integer dim arrayoftruth(1 n) boolean row = 1 n = 1 n if probmatrix(column, row) = arrayoftruth(i) = true cost = 0 = 1 n if arrayoftruth(i) = true cost = cost + 1 assuming requirement of square range of cells supersedes description of 'matrix's' values, i'm not sure why array needed @ all. function calccost(rtopleft range, n long) dim c long, r long c = 1 n if not cbool(application.countif(rtopleft.resize(n, n), c)) _ r = r + 1

javascript - How to keep rows with unique IDs once in d3.js -

i have json dataset following var data= [ {"id":10,"marks":20}, {"id":20,"marks":30}, {"id":10,"marks":40}, {"id":10,"marks":60}, {"id":10,"marks":70} ] i want keep rows unique ids. means should have data following rows only [ {"id":10,"marks":20}, {"id":20,"marks":30} ] in real thi size of file huge. , want show average mark of unique ids. making average using different code. adding different column @ reading json file. i.e. {"id":10,"marks":20,"avg":25} so want keep rows unique ids otherwise in visualization avg coming multiple times same id. how can in d3.js? or there option? there many ways of getting array of unique objects. far aware, there no built-in mechanism in d3 providing functionality. have done having associative array keep track of objects present in output array. adjusted needs

django - Syncdb error when creating CustomUser -

the issue create custom user: class customuser(abstractuser): mobile = models.charfield(max_length=16) address = models.charfield(max_length=100) and in settings.py write this: auth_user_model = 'login.customuser' , when run manage.py syncdb first time(when db doesn't contains tables), throws error: django.db.utils.programmingerror: relation "auth_group" not exist when run manage.py syncdb when db tables exist, it's okay, create additional tables. what's wrong run when db doesn't contain tables? try this create migration directory in directory of app containing custom user model. create empty __init__.py file inside migration directory. execute ./manage.py makemigrations . execute ./manage.py migrate . i think when use custom user model, need create migrations. besides, syncdb deprecated , removed in django 1.9 it's better start using ./manage.py migrate command.

sql - Solr: Properly qualifying PKs of records in delta import -

there similar questions/answers on internet, still can't find solution a problem related way solr combines query statements when doing delta import in combination current database structure (which can't change). problem at first, getting java.lang.illegalargumentexception: deltaquery has no column resolve declared primary key pk='id' following data config: <dataconfig> <datasource type="jdbcdatasource" driver="com.mysql.jdbc.driver" url="..." user="..." password="..." readonly="true" batchsize="2000" usecompression="true" /> <document> <document> <entity name="job" pk="id" query="select j.id, j.employer_id, j.title

php - Redirect the edit profile page of Buddypress -

my client using buddypress on wordpress site, don't want users edit profile in buddypress . also don't want users go /profile/edit page when clicking on adminbar . so i'm looking way change url in de adminbar profile view page,or way redirect profile/edit page profile view page. so from: http://[website-url]/members/[username]/profile/edit/ to: http://[website-url]/members/[username]/ any thoughts on how accomplish this? i solved problem following code: <?php $classes = get_body_class(); if (in_array('profile-edit',$classes)) { wp_redirect( bp_loggedin_user_domain() ); exit; }; ?> this code calls class of body. if body class has 'profile-edit' in wp_redirect function called. function asks url of buddypress loggedin user profile page , sent him page.

javascript - node.js tedious ConnectionError: Failed to connect to sqlserverip:1433 crashing express server -

i not able capture node.js tedious error connectionerror: failed connect sqlserverip:1433 making express server crash unexpectedly. can please suggest me should avoid such crashes? tedious@1.2.2 tedious-connection-pool@0.3.2 node --version v0.10.33 my tedious program here: // mssql.js // mssql.js "use strict"; // import modules var path = require('path'); var async = require('async'); var fs = require('fs'); var connectionpool = require('tedious-connection-pool'); var request = require('tedious').request; var types = require('tedious').types; // export module namespace var swmssqlc = exports; // constants var default_connlimit_max = 30; var default_connlimit_min = 0; var default_useutc = true; var default_requesttimeout = 15000; var default_conntimeout = 15000; /** * mssql class wrapper solarwinds * @param {object} connprop: contains following connection properties * @param {string} connprop.user: user of dat

java - Method has the same erasure as another method in type -

why not legal have 2 methods in same class? class test{ void add(set<integer> ii){} void add(set<string> ss){} } i compilation error method add(set) has same erasure add(set) method in type test. while can work around it, wondering why javac doesn't this. i can see in many cases, logic of 2 methods similar , replaced single public void add(set<?> set){} method, not case. this annoying if want have 2 constructors takes arguments because can't change name of 1 of constructors . this rule intended avoid conflicts in legacy code still uses raw types. here's illustration of why not allowed, drawn jls. suppose, before generics introduced java, wrote code this: class collectionconverter { list tolist(collection c) {...} } you extend class, this: class overrider extends collectionconverter{ list tolist(collection c) {...} } after introduction of generics, decided update library. class collectionconverter {

mysql - SQL: Creating a relation table with 2 different auto_increment -

i have 2 tables, both own auto incremented ids, of course primary keys. when want create 3rd table establish relation between these 2 tables, have error. first 1 can have 1 automatically-incremented column, second 1 occurs when delete auto_increment statement 2, therefore sql doesn't allow me make them foreign keys, because of type matching failure. is there way can create relational table without losing auto increment features? another possible (but not preffered) solution may there primary key in first table, username of user, not auto increment statement, of course. inevitable? thanks in advance. concepts you have misunderstood basic concepts, , difficulties result that. have address concepts first, not problem perceive it, , consequently, problem disappear. auto incremented ids, of course primary keys. no, not. common misconception. , problems guaranteed ensue. an id field cannot primary key in english or technical or relational senses.

javascript - JSON.stringify - Strange behaviour with backslash in array -

i playing js while noticed strange behaviour backslash \ inserted string within array printed using json.stringify() . of course backslash used escaping special chars, happens if need put backslash in string? use backslash escape you're thinking, doesn't work json.stringify this should print 1 backslash array = ['\\']; document.write(json.stringify(array)); this should print 2 backslashes array = ['\\\\']; document.write(json.stringify(array)); am missing something? considered bug of json.stringify? it correct. json.stringify return required string recreate object - string requires escape backslash, return required escape backslash generate string properly. try this: array = ['\\']; var x = json.stringify(array) var y = json.parse(x) if (array[0] == y[0]) alert("it works") or array = ['\\']; if (json.parse(json.stringify(array))[0] == array[0]) alert("it works")

email - How to test my java program? -

i asked write part of program , test in following way: add statements main method create 2 or 3 contact instances, add them address book, , search 1 or 2 of them. display result of each search see if retrieved correctly. remove 1 of them , show list sure removed correctly. i wasn't entirely sure how test this. should write in main class? also, rest of code correct? do contact class: create class in client package. class should have 3 fields (an email address, full name, nick name). of these should strings. provide 2 constructors: 1 full constructor (parameters 3 member variables), , 1 has parameter email address. second constructor leave other 2 fields null. add tostring method (and use @override annotation) works this: contact c1 = new contact("jenny@gmail.com"); c2.tostring() should return "jenny@gmail.com". contact c2 = new contact("jenny@gmail.com", "jennifer abott", "jenny"); c2.tostring() should return &qu

c - Lisp compiler design for embedded systems? -

i researching development of lisp compiler targets embedded devices (16kb or of ram) , low level systems programming (i.e. kernel modules), both of necessitate complexity guarantees , access low level constructs. even though need these constructs, don't want language "low level", in want provide user high level constructs still deliver low level guarantees (i.e. lisp macros, support aspect oriented programming, logic or constraint solving, , functional paradigms, etc.). my current train of thought need to: create thin wrapper of s-expression syntax on c99 write macros define higher levels of abstraction, while still exposing low level structs, pointers, etc. feed resultant c99 code gcc, , binary run i want know if reasoning sound on - code generated such process able operate such small memory footprint? don't intend language have runtime component. dale c (/a c-like language), written lisp's syntax , several high-level compile-time featur

vb.net - Datagridview WHERE SQL Error -

i'm trying automatically fill datagridview upon loading. have far dim connstring string = "provider=microsoft.ace.oledb.12.0; data source=c:\users\administratot\downloads\railwaydatabase2.accdb" dim myconn oledbconnection dim da oledbdataadapter dim ds dataset dim tables datatablecollection dim source1 new bindingsource myconn = new oledbconnection myconn.connectionstring = connstring ds = new dataset tables = ds.tables da = new oledbdataadapter("select * tbl_shifts employeename = '" & employeelogin.usersname & "' , completed = true", myconn) dim view new dataview(tables(0)) source1.datasource = view datagridview2.datasource = view when attempt this, met error reading cannot find table 0. you must fill dataset first. da = new oledbdataadapter("select * tbl_shifts employeename = '" & employeelogin.usersname & "' , completed = tru

How to re-run property evaluation in MSBuild target? -

i have custom msbuild target, partial snippet follows .. <target name="publishhtm"> <propertygroup> <publishhtmtemplatecontents>$([system.io.file]::readalltext($(publishhtmtemplatepath)))</publishhtmtemplatecontents> <publishhtm>$(publishhtmtemplatecontents)</publishhtm> </propertygroup> <writelinestofile lines="$(publishhtm)" file="$(publishdir)\publish.htm" overwrite="true"/> </target> this rework attempt this solution in i'm trying isolate template external file. template contains msbuild property references such $(applicationname) . when doing described in linked solution , works fine, when loading template in string, none of these property expressions evaluated time gets file. <span class="bannertextapplication">$(applicationname)</span> is there msbuild expression/function can use string reevaluated given context target being invoked?