Posts

Showing posts from June, 2014

mysql-python install with Percona -

i have percona server installed on centos. want install mysql-python getting error environmenterror: mysql_config not found there no such file percona server. how can install mysql-python connect percona mysql ? you can mysql_config running: yum install percona-xtradb-cluster-devel once have this, go ahead , install mysql-python: yum install mysql-python i searched lot of google before found here at: http://www.percona.com/forums/questions-discussions/percona-xtradb-cluster/11038-mysql-config-sysbench-percona-xtradb-cluster

autocomplete - Can Eclipse's Content-assist be made more flexible? -

Image
in eclipse auto complete very strict. there way have looser? instance: getdata() setdata() i want type "data", , have 2 functions above found because both functions have "get" or "set" @ start, doesn't suggest these functions, have type get or getd able in auto complete. i wondering if there setting have include 'any' functions have search term within it, not starts with? i have tried doing searches on google, without knowing the terms getting people asking saying 'its not working'. want change "startswith" "contains".. eclipse neon (4.6) now content assist more flexible: the feature described here : content assist supports substring patterns . enter part of desired proposal's text, , content assist find it! example, completing on selection proposes results containing selection substring.

css - Google Fonts 'Rokkitt' not showing on IE11 -

this website failing show google font 'rokkitt' on ie11, works fine on other browsers. is down font developer or down font-face issues in ie11? any massively appreciated. website found here: click here the problem markup specifies ie8 emulation mode: <meta http-equiv="x-ua-compatible" content="ie-emulateie8"></meta> the google font loader, though, has access user-agent string. knows browser ie11, doesn't know site has told browser behave ie8. thinking it's serving regular ie11, google offering font in .woff format. ie8 doesn't support .woff , browser (acting ie8) ignores it.

user interface - Is there a libary for GUI Development ala Simulink -

for university project have develop logic-circuit-builder. the gui supposed work matlab's simulink: select object or-gatter, drag , drop somewhere on drawing-panel, connect other object wire or something. i think used kind feature sometime in life in software hope know have in mind. i know, task lot harder sounds. how know object selected when click panel? what overlapping objects? is there auto-alignment? what wiring when move object? and on , on... but question: these tasks got solved many times many softwares simulink, uml-designers, apple's logic or cubase, microsoft visio, blender... what kind of gui called , there libarys or frameworks kind of gui? ps tried google several hours don't know how articulate looking for... thank time

c# - Unable to load Custom ADO.NET provider for NHibernate -

i using devart postgres driver ado.net provider nhibernate. since nhibernate not support devart postgres driver, wrote custom driver class based on reflectionbaseddriver. here code: namespace postgresdriver.dbdriver { class devartpgdriver : reflectionbaseddriver { public devartpgdriver() : base( "devart.data.postgresql", "devart.data.postgresql.pgsqlconnection", "devart.data.postgresql.pgsqlcommand") { } public override string namedprefix { { return ":"; } } public override bool usenamedprefixinparameter { { return true; } } public override bool usenamedprefixinsql { { return true; } } public override bool supportsmultipleopenreaders { { return false; } } protected override bool supportspreparingcommands

php, mysql and phpmyadmin, MAMP or homebrew -

when got make clean install of system asked myself, again, question. best way tools use local development, install mamp or install stack homebrew? even though 'best' highly relative depending on each , needs , how work, thoughts people tried them both, chose , why. personally, chose time not use mamp , install php, mysql , (not yet) phpmyadmin using homebrew. pros, it's simple , fast install, better update. painfull update mamp. cons, having homebrew.mxcl.mysql daemon running , having manually start-stop processes apache , mysql while there button on mamp. but still, how installing , using both? enjoy best of both worlds or looking troubles , headaches? thanks y'all... i did hundred of times... ! using mamp or wamp fair enough beginners you'll stick configuration(s) , tricks make bit dependent of products. opinion prefer install homebrew configuration. when installing services such mysql, phpmyadmin, apache+php or nginx+php/php-fpm learn mor

php - iOS - Sending authentication to FOSUserBundle Database not working but cURL works -

i have table managed fosuserbundle users in in symfony2 application. able access routes protected firewall curl without problems. let's have route /api/something protected , wanted access curl, used: curl -v -u paul http://example/web/app_dev.php/api/something/ the above works no problem. however, app, returned 401: not authenticatedd when use following snippet below. converted base 64 since afnetworking says has in format. missing?? nsdata *pass = [@"somestring" datausingencoding:nsutf8stringencoding]; nsstring *base64pass = [pass base64encodedstringwithoptions:0]; nsdata *user = [@"anotherstring" datausingencoding:nsutf8stringencoding]; nsstring *base64user = [user1 base64encodedstringwithoptions:0]; [self registerhttpoperationclass:[afjsonrequestoperation class]]; [self setdefaultheader:@"accept" value:@"application/json"]; [self setauthorizationheaderwithusername:base64user password:base64pass];

c# - "Fluent methods may not be invoked on a Query created via CloudTable.CreateQuery<T>()" exception -

what following exception means? system.notsupportedexception unhandled message: unhandled exception of type 'system.notsupportedexception' occurred in mscorlib.dll additional information: fluent methods may not invoked on query created via cloudtable.createquery() it not show code throwing exception don't know how start debugging it. result stacktrace: @ system.web.http.apicontroller.d__1.movenext() --- end of inner exception stack trace --- @ system.threading.tasks.task.throwifexceptional(boolean includetaskcanceledexceptions) @ system.threading.tasks.task`1.getresultcore(boolean waitcompletionnotification) @ system.threading.tasks.task`1.get_result() @ testframework.executerequest(httprequestmessage request) in d:\ @ testframework.post(string uri, object tniobject) in d:\ @ testframework.postcall(string uri, object o) in d:\ @ testframework.mymethod(string one, string two, mystruct three) in d:\ ... (removed privacy)

c# - Refactoring Code to avoid Type Casting -

i have following c# code in .net 4.0. requires type casting of ibusiness iretailbusiness. //type checking if (bus iretailbusiness) { //type casting investmentreturns.add(new retailinvestmentreturn((iretailbusiness)bus)); } if (bus iintellectualrights) { investmentreturns.add(new intellectualrightsinvestmentreturn((iintellectualrights)bus)); } business scenario: i designing software system , investment holding company. company has retail business , intellectualrights business. bookshop , audiocdshop examples of retail business. enginedesignpatent , benzolmedicinepatent examples of intellectualrights business. these 2 business types totally unrelated. the investment company has concept called investmentreturn (but each individual business totally ignorant concept). investmentreturn profit gained each business , calulated using profitelement . each “business type” (retail, intellectualrights ), profitelement used different. question how refactor cl

css - How to adjust position of a div relative to a div above it upon height change? -

i using selectize.js in multiple input fields in form. when adding tags, input field grows in height accordingly. the container below not adjusting vertical position accordingly. in official demo, desired behaviour occuring, can seen going to: http://brianreavis.github.io/selectize.js/ and scrolling down , clicking plugins , , scrolling drag_drop demo. in implementation not: jsfiddle http://jsfiddle.net/rwone/q84vx/4/ i have tried making containing div, .field-row , relative doesn't seem have effect. html <div class="my_form_page_content"> <form id="my_form_name" name="my_form_name"> <div class="my_form_container"> <div class="field-row" > <div class="my_form_left"> <p>field one</p> </div> <div class="my_form_right"> <div class="input_wrapper"> <input

powershell - Upload user profile images from desktop to sharepoint using a windows service -

all, i have question posted on sharepoint.stachexchange.com too. sharepoint newbie , started working on sharepoint 2013. task upload , set user profile images saved in local disk (share folder). images named .jpg. have written windows service check directory , move user images associated account on microsoft exchange server. next challenge move users on sharepoint. possible pull exchange server? or there powershell script can me move same image sharepoint ? highly appreciated. since have no experience not sure start. thank you it looks there changes 2010 2013, better. here blog post on topic: http://richardstk.com/2013/04/12/import-user-photos-from-active-directory-into-sharepoint-2013/

c# - Github not ignoring files under the \bin\ and \obj\ directory -

Image
i interested in github ignoring files, debug binaries under \bin , \obj directory. my .gitignore under \github\grasshopper-tools directory, , inside have snippet theoretically should ignore them: # build results [dd]ebug/ [dd]ebugpublic/ [rr]elease/ x64/ build/ bld/ [bb]in/ [oo]bj/ am missing anything? you need add * after / ignore file inside directory. in case, ignore bin folder bin/* also, use template c# project. see template: https://gist.github.com/kmorcinek/2710267

c++ - Need to call twice a setter to force GUI refresh in MFC -

Image
i'm using mfc combobox control change parameter has constituencies on ip range available ( only/ no broadcast ip example). i need call range modification function twice force refreshing on showed values : why ? behaviour : 1 call range modification 2 calls range modification source code : void cipaddressbugdlg::onchangecombo() { updatedata(true); changeiprange(); //changeiprange(); } void cipaddressbugdlg::changeiprange() { byte nfield0, nfield1, nfield2, nfield3; if ( combo.getcursel() ) { ipaddress.getaddress(nfield0, nfield1, nfield2, nfield3); if ( nfield0 < (byte) 224 ) nfield0 = 224; ipaddress.setaddress(nfield0, nfield1, nfield2, nfield3); ipaddress.setfieldrange(0, 224 , 232 ); } else { ipaddress.getaddress(nfield0, nfield1, nfield2, nfield3); if ( nfield0 >= (byte) 224 ) nfield0 = 223;

html5 - PHP fwrite() not writing anything to file, but no errors given -

i writing contents of html5 text area file on local server using php. have included checks fileexists, fileiswritable , fileisreadble , pass, no text appears in target file. html <form id = "notesform" action = "notes.php" method = "post"> <textarea id = "textarea" name = "text"></textarea> <button type="submit" value="save"> save</button> </form> php $filename = 'file://localhost/library/webserver/documents/notes/test.txt'; $somecontent = $_post["text"]; if (is_readable($filename)) { echo "<br />the file readable...<br />"; } else { echo "<br />the file not readable...<br />"; } if (is_writable($filename)) { echo "the file writable...<br />"; } else { echo "the file not w

asp.net - using a substring on a C# aspx page -

i'm trying use substring in order specific part of date on aspx masterpage. reason need has template downloaded , css behind it. code i've got: <span><%= datetime.today.tostring("m").substring(3), ((int)(datetime.today.tostring("m").length) - 2) %></span> i need pick apart current month first 3 characters in first span , rest of in second span. reason need subtract 2 because adds day of month afterwards. thank in advance help. first should use proper format string. this give month abbreviation (jan, feb, mar, etc) <%= datetime.today.tostring("mmm") %> and give full month name <%= datetime.today.tostring("mmmm") %> then can substrings on these instead , not worry parsing off day. something like: // can create variable here, in code behind, or use repeated // call instead of assigning variable. <% var month = datetime.today.tostring("mmmm"); %> <%= datetime.t

How to post to Facebook with location attached using JavaScript SDK -

i trying post user's facebook wall using javascript sdk phonegap mobile app. able post message user's wall app. want attach location post looks checkin. facebook checkin working fine, since deprecated, want use post suggested facebook. below code: fb.api('/me/feed', 'post', { name: 'somename', message: 'somemessage', place: { 'id': pageid, 'name': name, 'location': { 'latitude': latitude, 'longitude': longitude } } }, function (response) { if(response){ alert("post published!"); } else { alert("post not published. try again.") } }); the place tag needs id, name , location latitude , longitude, provided them above. alert message saying post published!, isn't posted user&#

width - Making form elements responsive -

i've been trying form elements shrink when on mobile screens. i've changed widths 100% text input areas still spill out of screen. what doing wrong exactly? http://jsfiddle.net/vd38a/ html <section id="con" data-type="background" data-speed="10"> <section id="c"> <div class="title">say hello</div> <div id="details"> <p><b>phone:</b> </p> <p><b>email:</b> </p> <p><b>skype:</b> </p> </div> <div id="contactbox"> <form action="contact.php" method="get" id="contactform"> <div id="formleft"> <fieldset> <ul> <li> <label for="first">first name</label>

Using SonarQube Quality profile All PHP CodeSniffer Rules results in 0 issue and 0,0 days of technical debt -

i'm using sonarqube 4.0 , when set project analyzed php codesniffer rules quality profile, result 0 issue , 0,0 days of technical debt. the project analyze php project. the other metrics work cyclomatic complexity, comments, duplications. when use default quality profile named sonarway, work want use other quality profile since contains lot more rules. at first glance there no issues related problem in sonarqube php plugin jira. i add same issue when upgrade sonar 3.5 4.2 quality profile "sonar way" using "merged" new 1 0 rules in quality profile. changed using new "sonar way" 47 rules (in config) , re-run analysis. worked again relevant results. hope help

sql - Is it OK to swallow an exception for DB INSERT -

is ok swallow duplicate key violation exceptions inserts or should check if record exists? so let's have table photo 1 field: photoname. i'm looking through file directory add items photo. in process, it's possible when find photoname, might in database. there 2 ways go this: 1) //look see if exists before adding it. add if not exist. bool photoexists = sqlselectstatementtocheckifthephotoexists(photoname); if(!photoexists) sqlcommandtoinsertphoto(photoname) or 2) //assume doesn't exist. if does, catch , ignore. try { sqlcommandtoinsertphoto(photoname); } catch(duplicatekeyexception ex) { //swallow , continue on if nothing happened. } on 1 hand, don't notion of "swallowing" exception, on other hand, try...catch uses 1 call db. happens in sql server. you should not "swallow" exception. should trying find these duplicates , not insert them if needed. on method checking not exists on key. insert targettable select

unit testing - Why there is no `expectAsync3` in dart's unittest? -

i see there expectasync0 , expectasync1 , expectasync2 provided dart's unittest library, no expectasync3 , expectasync4 , ... what if want test function has 3 parameters? myadd(int x, int y, int z) { return x+y+z; } i expect write: var fun = expectasync3(myadd); but can't find such method. as günter zöchbauer said: there wasn't demand it. in meantime can work around it: var done = expectasync0(() {}); var fun = (x, y, z) { done(); return myadd(x, y, z); };

asp.net - Configure Elmah email settings in code rather than config -

i'm setting elmah emails , don't want put email account credentials in web.config. i'm deploying on azure , therefore credentials azure app settings in code on app startup. is there way configure elmah emails declaratively in code rather using <errormail> tag? the best way overriding sendmail method of elmah's errormailmodule , suggested atif aziz in this discussion on google groups. i've given more details in this answer .

java - URL special character Code conversion with blowfish encryption? -

i working on problem client sending email thru url in encrypted format. have use blowfish encryption @ client end , decryption @ out end. blowfish code below--- //encrypted jaottv22bfktkvrhtn/rhq== public string encrypt(string username,string code) throws exception { try { byte[] keydata = (username).getbytes(); secretkeyspec secretkeyspec = new secretkeyspec(keydata, "blowfish"); cipher cipher = cipher.getinstance("blowfish"); cipher.init(cipher.encrypt_mode, secretkeyspec); byte[] hasil1 = cipher.dofinal(username.getbytes()); byte[] hasil2 = cipher.dofinal(code.getbytes()); return new base64encoder().encode(hasil1); } catch (exception e) { system.out.println(e); return null; } } //decrypt --doug@gmail.com public string decrypt(string email,string code) throws exception { try { byte[] keydata = (code).getbytes(); secretkeyspec secretkeyspec = new secretkeyspec(keydata, "blowfish"); cipher ci

ios - NSFetchedResultController and NSSortDescriptor with comparison block -

i've tried implement nsfetchedresultcontroller giving nssortdescriptor comparison block, raises exception saying doesn't support it. nssortdescriptor *sortdescriptor = [[nssortdescriptor alloc] initwithkey:@"alarmtime" ascending:yes comparator:^nscomparisonresult(id obj1, id obj2) { nsdate * obj1date = [weakself returnclosestvaliddate:(nsdate*) obj1]; nsdate * obj2date = [weakself returnclosestvaliddate:(nsdate*) obj2]; return [obj2date compare:obj1date]; }]; i need that, because i'm sorting alarms repeat in time , property alarmtime date there fire time , date corresponding creation date. since need show them in cronological order other alarms, if not correct date on top (or bottom) of list. there way achieve this? thought resort them after sort descriptor mandatory fetched controller.

scala - Why is this Map not populating when I'm evaluating this code in Eclipse? -

below code should populate map when val test = userdatamap.get("test").get value null. whis occuring ? seems correct way of populating map ? var userdatamap = map.empty[string, list[string]] userdatamap += ("test" -> list("test"))

jsf - p:remoteCommand destroys @ViewScoped managed bean -

i having trouble adding p:remotecommand form. looks like: <?xml version="1.0" encoding="utf-8"?> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:util="http://java.sun.com/jsf/composite/components/util" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:p="http://primefaces.org/ui"> <h:head> <title>reset test</title> <link type="text/css" rel="stylesheet" href="/treetable-sscce/css/example.css" /> <h:outputscript library="primefaces" name="jquery/jquery.j

How to iterate with PHP through HTML DOM with xPath -

i'm looking way step in , out domnodelist. when search hit specific element next element located @ level. in detail: <tr> <td> <div class="category"> <a>headline:</a> </div> </td> </tr> <tr> <td> <div class="cdata"> <span>article title</span> </div> </td> </tr> my work far: $xpath = new domxpath($dom); $nodes = $xpath->query("//tr/td/div[@class='category']/a"); header("content-type: text/plain"); foreach ($nodes $i => $node) { echo "node($i): " . ltrim($node->nodevalue) . "\n"; if (ltrim($node->nodevalue) == 'headline:') { // how can fetch nodevalue in next tr echo "parent: " . $node->parentnode->parentnode->parentnode->nodevalue . "\n"; } } so until haven't figured out how iterate 3 times next "

java - Can you create a JPanel that is rotated? -

i wondering if there might way using java swing create rotated jpanel? i'd read other questions/answers on topic didn't understand if create 1 rotated or not. not need rotate once it's created, created tilted on x/y axis. thanks. thanks, quite helpful! you can't behavior default. however, extend jpanel , desired rotation behavior if little linear algebra: override paint(graphics g) method. have first paint instance of bufferedimage , use rotation matrix rotate image before drawing on underlying panel. override methods handle mouse input , apply reverse rotation coordinates passed in associated listeners. way, underlying layout manager still 'thinks' panel hasn't been rotated, you've rotated drawing , event notification things still "line up" properly. i'll caveat of saying i've never done before, , run unexpected issues not outlined here, have 10 years of experience java swing , how i'd if had to.

c# - Finding Best Matches in Two Lists -

i have 2 lists of string, need locate 1 string 1 of them , 1 string other list, best match each other among matches between 2 lists. i create list <tuple<string, string, int>> holds strings of both lists , distance, costly in memory. would not if easier more object-oriented? public class match { public string value1 { get; set; } public string value2 { get; set; } public int distance { get; set;} } and have list<match>

javascript - Sending JSON as a parameter value for post -

here's i'm trying accomplish: user enters json in textarea element. { "test":[ {"a":"b"} ] } client side javascript parses json. myobject = $.parsejson($("#my-textarea").val()); json sent on ajax post request server with datatype: json, data: {"my_object": myobject} post parameters checked on server side in sinatra , json looks now. { "test": { "0": { "a": "b" } } } i'm wondering why test array changed hash , if there's can avoid that. i'm thinking original json improperly formatted, i'm unsure. edit: here stripped down version of ajax request , controller action. function test() { return $.ajax({ url: "/test", type: "post", datatype: "json", data: {"test":[{"a":"b"}]}, success: function(r

java - URLEncoder troubles -

i've got string ruby on rails , should converted ruby%20on%20rails , urlencoder says ruby+on+rails . try: string encoded = urlencoder.encode("ruby on rails"); system.out.println(encoded); is happening because encode() method deprecated? urlencoder doesn't uri encoding, application/x-www-form-urlencoded , converts spaces + signs. if want them converting %20 need uri encoding instead, such spring's uriutils .

What does the Haskell function forall do and where is it defined? -

i'm reading a little lens starter tutorial , use seemingly magical function forall this: >>> forall $ \tuple -> view _1 tuple == fst tuple true what function , more importantly package from. can't find using hoogle , etc. haha, embarrassed author here. i invented forall mime quickcheck , make intuitive sense, not executable. in defense, took inspiration little schemer happily introduces syntax , semantics far before they're executable in order build intuition practice. except, of course, forall not executable @ , has lead lot of confusion. so, suggestion curious investigate quickcheck stand-in forall . suggestion myself, now carried out , edit tutorial note artistic license there. sorry trouble.

Retrieving distinct documents from Solr -

i've had hard time explaining , finding need please put self in shoes moment. my requirement comes relational database background. may using solr wasn't designed do, or may can need, still need confirm that. can assist me. after indexing numerous documents solr. need retrieve distinct documents based on filter. think retrieving distinct rows while applying condition. for example, in relational database, may have following columns (country) (city) (whatever) egypt cairo hospitals egypt alex schools egypt mansoura hospitals egypt cairo schools if perform query: select distinct country, city mytable i should following rows (country) (city) egypt alex egypt mansoura egypt cairo now after indexing original table ( select * mytable ), how can achieve same output solr ? how can retrieve documents saying need these documents distinct based on fields ? need apply not null filter specific field. i

opencv - TrainCascade stuck on getting new negatives -

i'm working opencv 2.4.7 on windows. i'm using traincascade train new haar cascade eyeglasses using following command: opencv_traincascade -data traincascade20 -vec vector3.vec -bg infofile3.txt -numstages 40 -minhitrate 0.999 maxfalsealarmrate 0.5 -numpos 170 -numneg 1000 -w 20 -h 20 -mode -precalcvalbufsize 1024 -precalcidxbufsize 1024 it's stuck (or progressing slow) on stage 24 on phase of getting new negatives. negative images file "infofile3.txt" contains 12k negative image. can please explain why it's progressing , can make progress (a lot) faster? thanks in advance, gil. around 24 hours sounds normal me. haar training can take days depending on size , number of samples. , of course on computer well. longest training took approximately week hand detection. if worried, check whether haar training still on-going, can try generate intermediate haar cascade xml file, data available. if able generate xml file, show it's still ru

image processing - visualising l*a*b space values in matlab or any software -

i have table of l,a,b values , want visualise these colors in matlab (or other suitable software). there quick way series of rectangles filled color values table? there several versions of lab color space , presumably you're referring common, cielab . can use imwrite in matlab create tiff image 'cielab' specified 'colorspace' option. wouldn't trust matlab viewer resultant images though. photoshop in lab mode (from menu bar: image > mode > lab color) choice if want work , see closest thing actual cielab space. other viewers/editors may convert rgb or cmyk before rendering screen (likely without warning you), maybe don't mind. if want convert cielab rgb, might find these functions useful.

javascript - Internet explorer 11 Angularjs + NodeJS + Mongoose issue -

i'm developping website angularjs framework in front end , nodejs backend , mongoose persist data mongodb database. in firefox rs v.24 , chrome ok, when add user database, new user displayed automatically list grid. but in ie 11 doesn't until close browser , open . when add new profile, following in controller: $scope.addprofil = function() { $http.post('/ajouterprofils', $scope.profil) .success(function(data) { $scope.profilflag = data; /*unit tests*/ $scope.lastdocid = data._id; $scope.ajouterprofiltag($scope.lastdocid); $scope.profil = {}; $scope.tagstyles.length = 0; $scope.tagstyles = []; $scope.colorlist = {}; angular.element($('.shown-text-add').text($('.shown-text-add').text())); angular.element($('.shown-text-add').css('font-family', '')); angular.element($('.shown-text-

c# - Form.cs file is opening in text box with unreadable form -

i working on desktop app in vs2012. suudenly there power failure, when restarted computer , opened mainform.cs file in textbox see unreadable data in it. looks following. , $ h l h $ € d €Ã¬ $ ¼ ì , € p t d Ô ° backup not set , file main form app. have idea how recover file? check recovering file visual studio document cache? , different cause indicated location might have backup need. if not , don't have backup or using sort of source control afraid you'll have redo code.

inner join - Translate Value to Name SQL -

Image
i have 2 tables instead of currency1id , currency2id , want show currencyshortcut make better in case managed join 1 of fields : please me convert both of them values currency table thanks !! i think need this select c1.currencyshortcut [currency1], c2.currencyshortcut [currency2] /*, other columns need*/ spot s join currencies c1 on s.currencyid = c1.currencyid join currencies c2 on s.currencyid = c2.currencyid

java - How do I return values from certain type of array list? -

is program doable getters or print statements, or should consider doing differently? if i'm doing using getter no constructor, doesn't make sense me. so, believe make more sense standpoint of print statement. i'm assuming don't need make new class. i think if easy, exercise have been earlier in textbook: exercise 129: in program fragment below, each of employees in employee database stored in arraylist. complete program names of employees output. public class mainclass { public static void main( string[] args ) { arraylist<employee> employees = new arraylist<employee>(); employees.add( new teacher( "fred thompkins", 55, 525 ) ); employees.add( new salesassistant( "eric washington", 7, 72 ) ); employees.add( new military( "albert costa", 236237, "navy", "seaman" ) ); employees.add( new teacher( "jane austin", 724, 92 ) ); employees.add( new salesassistant( "jane black&qu

javascript - setting a select option by another select selected option -

i trying built 3 selects when u set month select, days in day select change according month html: <select id="day" name="day"> </select> <select id="month" name="month" onchange="monthselected()"> </select> <select id="year" name="year"> </select> and on pageload: <body onload ="adddate()"> the script: ondate(): function adddate() { addmonth(); addyear(); addday(1); } //adddate the adds functions: function addyear() { var currentyear = new date().getfullyear(); var legalworkingage = currentyear - 16; var select = document.getelementbyid("year"); (var = legalworkingage; >= 1900; i--) { var option = document.createelement('option'); option.text = option.value = i; select.add(option, 0); }//for } //addyear function addmonth() { var select = documen

pdo - how can I add a value to the current with SQL UPDATE -

i creating access log on website, whenever person entering site, set date , time whenever in same registry in database. however, instead of deleting last visit, added other. exemple: this current value: 2014-01-31 17:18:27 this new value: 2014-02-01 17:18:27 if use update method, replace current value new. , stay follows: 2014-01-31 17:18:27, 2014-02-01 17:18:27 let's little closer i'm doing. this function i'm creating: function functionind() { $this = 'this'; $conn = db(); $prepare = $conn->prepare(' update table set dates=:date this=:this'); $prepare->bindparam(':date',date("y-m-d h:i:s")); $prepare->bindparam(':this', $this, pdo::param_str); $prepare->execute(); disconnectbase($conn); } what need do? you don't want this. storing lists in sql not right approach using database. need table stores dates in separate table, 1 row per this per date .

variables - Passing javascript via browser URL field -

like title states... there way pass javascript via browser url field. for example, if had function opened or closed tabs wanted type in browser url + function on page load tabs opened (or closed) mydomain.com?windows.open=true (something that) possible. thank in advanced time , responses, appreciated. there 2 approaches can use: pass parameters in query string, next page reads query string , based on it use 1 of many javascript libraries or frameworks allow map hash in url function in javascript (e.g. backbonejs router, example). the #2 solution more modern approach. http://mydomain.com/some/page#tabs/open and on page javascript allows bind function pattern in hash. sammy.js 1 comes mind. $.sammy(function() { this.get("#/tabs/open", function() { // jquery make sure tabs open }); });

vba - Send Email from different email accounts -

when send emails go out personal inbox @ work, need them go out mailbox have access to. have both mailboxes in outlook. can send emails specific mailbox? here code using. not find 2nd item in account. sub mail_small_text_change_account() dim cel range dim outapp outlook.application dim outmail outlook.mailitem dim strbody string set outapp = createobject("outlook.application") set outmail = outapp.createitem(olmailitem) strbody = "hi there" & vbnewline & vbnewline & _ "this line 1" & vbnewline & _ "this line 2" & vbnewline & _ "this line 3" & vbnewline & _ "this line 4" on error resume next each cel in range(("c2"), range("c2").end(xldown)) outmail .to = cel.value '.cc = cel.offset(0, 3).value .subject = "benefits refund"

delphi - Translation check from C++ to ObjectPascal which is better -

i translating c++ code objectpascal (first time), , c++ still new me. the c++ header file looks this: class renumfd { public: renumfd(int length); ~renumfd(); void compfd(double *buff); //...other public functions cut space private: void rmfd(int n, int isgn, double *a, int *ap, double *kw); //...other private functions cut space int _length; int *_ap; double *_kw; } i have translated them way: type trenumfd = class private _length: integer; _ap: pinteger; _kw: pdouble; procedure rmfd(n:integer; isgn:integer; var a:double; var ap:integer; var kw:double); //... other procedures cut space public constructor create(const length:integer); destructor destroy(); override; procedure compfd(var buff:double); end; i read pointers used parameters in c++ should set var parameters in object pascal. correct, or should stick more literal translation (worried being bitten later). also in c++ constructor there following code, un

angularjs - Scope creation and batarang -

Image
consider following: html <!doctype html> <html ng-app="myapp"> <head> <script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"></script> <meta charset=utf-8 /> <title>exploring directives</title> </head> <body> <my-directive> text </my-directive> {{info.version}} <script type="text/ng-template" id='my-directive.html'> <div>hello, {{info.version}}</div> </script> </body> </html> js var app = angular.module('myapp', []); app.run(function($rootscope) { $rootscope.info = {}; $rootscope.info.name = 'rootscope'; $rootscope.info.version = '1.0.0.1'; }); app.directive('mydirective', function() { return { restrict: 'e', templateurl: 'my-directive.html', scope: false }; }); batarang from have seen, $rootscope never

SSH connect to github fail -

Image
i typed command have connection test github : ssh -t git@github.com but outputs: ssh: not resolve hostname github.com: nodename nor servname provided, or not known why ssh not resolve github.com? want know , how solve it? check network or dns config (as in this question ). " git , ssh: not resolve hostname, ping works " mentions: this sounds dns issue. try switching dns server , see if works. opendns 208.67.222.222 208.67.220.220 googledns 8.8.8.8 8.8.4.4 if ssh still gives hard time, try switching https. the op edlin confirms in comments switching dns works, , recommend mac os x users how-to geek article " how switch mac os x use opendns or google dns ": system preferences… click on network icon… select network card on left , select advanced button near bottom right corner. switch on dns tab, , can start adding in dns entries list. click + symbol @ bottom add new ones:

windows phone 8 - Saved files deleted after creating a new build -

i have level editor in game, saves generated levels single file. works should when used normally, whenever build phone (wp8, nokia lumia 620), existing files deleted. save options (currently vibrate on/off , sound volume) , high scores in similar way, causes them reset every time build. i'm saving file .txt @ application.persistentdatapath. i have checked , confirmed application.persistentdatapath remains same after building new version. when publish app, , later decide release update, files removed well? or when i'm building? there way prevent files getting deleted? i have tested on android works perfectly.

html - Creating Countdown with Javascript -

this question has answer here: javascript / jquery countdown 6 answers i need create countdown runs daily 8am 8pm monday-friday , 8am-6pm saturday , sunday , when it's finished, says 'we open tomorrow @ 8am!' how can achieve this? website: (you can see countdown be.) http://www.securemyhome.com/test-pulse3 html <div class="wereopen"><span class="blue">we'll call you!</span><br />only <span class="countdown"> <!-- countdown banner --> 7 hours 35 minutes </span> left!</div> here's few i've tried. var count=30; var counter=setinterval(timer, 1000); //1000 run every 1 second function timer() { count=count-1; if (count <= 0) { clearinterval(counter); //counter ended, here return; } //do code showing number of seconds here

How to search for a string in Java source code and identify in which method it is in -

what need map classes , methods of java source code have inside implementations specific string. translating in real example: need build java application scans java source file searching specific string (a database field example). after finding string need have output in class/method find. so, if have following code: public class exampleclass{ public static void main(string args[]) { string url = "hello1"; } public void function1(){ string hello2 = "aaaaaa"; } } in case, if search "hello1" should return like: exampleclass.main. , if search hello2 should return me: exampleclass.function1 thanks lot in advance! from description first sounds use tool grep scan files. solution, scan files looking occurrence of "hello1" if sufficient needs. output quite customizable. using grep command line: $ grep -r "hello1" /home/user/workspace/project/src given /home/user/workspace/project/src project source c

android - Keyboard Issue With Framelayout -

Image
i've edittext on layout framelayout, problem when finish entering data in edittext press button on mobile hide keypad, keeps showing shadow of keypad until press on activity. how can solve problem. here happen after press button hide keypad, have press again on activity make black shadow disappears.(check black shadow in bottom) androidmanifest.xml <activity android:name="com.example.mainactivity" android:configchanges="keyboardhidden|orientation|screensize|screenlayout" android:label="@string/app_name" android:screenorientation="portrait" android:windowsoftinputmode="adjustpan" > </activity> activty_main.xml <com.example.layout.mainlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <framelayout android:id="@+id/act