Posts

apache - VirtualHosts not working? -

i can't seem virtualhosts working... think i'm clueless i'm doing. httpd.conf namevirtualhost * <virtualhost *> servername localhost documentroot "/applications/mamp/bin/mamp" <directory "/applications/mamp/bin/mamp"> options indexes followsymlinks includes execcgi allowoverride none order allow,deny allow </directory> </virtualhost> # rev.dev <virtualhost *> servername revcms.dev documentroot "/users/manuel/sites/rev" <directory "/users/manuel/sites/rev"> options indexes followsymlinks includes execcgi allowoverride none order allow,deny allow </directory> </virtualhost> etc/hosts ## # host database # # localhost used configure loopback interface # when system booting. not change entry. ## 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 127.0....

math - transfer the co-ordinates error in function -

i trying transfer coordinates of points new generated system coordinates the original points in original system in top left corner .... i wrote following function transfer coordinates using formal got question pre_question question has 2 photos show mean , sign each part the problem , getting negative value w ! can please check function , let me know problem thanks { cvpoint transfer_coordinate (cvpoint pt1 , cvpoint pt2 , cvpoint pt3 , cvpoint pt4 , cvpoint origin , cvpoint current) { // pt1 , pt2 ==> points in line z // pt3 , pt4 ==> points in line w double a1 , a2 , b1 , b2 , d1 , d2; d1= sqrt(pow((pt1.x - pt2.x),2.0)+ pow((pt1.y - pt2.y),2.0)); d2= sqrt(pow((pt3.x - pt4.x),2.0)+ pow((pt3.y - pt4.y),2.0)); a1 =(pt1.y-pt2.y)/d1; b1 =(pt2.x-pt1.x)/d1; a2 =(pt3.y-pt4.y)/d2; b2 =(pt4.x-pt3.x)/d2; cvpoint new_point; //z = -sqrt(a1^2+b1^2)*(a2*(x-x0)+b2*(y-y0))/(a2*b1-a1*b2) //w = sqrt(a2^2+b2^2)*(a1*(x-x0)+b1*(y-y0))/(a1*b2-a2*b1) //z new_point.x = -r...

c - Creating a two-dimensional array of fixed-length strings (character arrays) -

so i've been trying create object in c 2 columns of empty char arrays. contents resemble char * strings[3][2] { {"thing1", "value1"} {"thing2", "value2"} {"thing3", "value3"} } ...except actual char *s empty arrays fixed length, rather initialized strings, i.e. each string "char string[6]". i've been searching time i'm coming dry. happen know syntax creating such object? maybe this: typedef char sixchars[7]; sixchars strings[3][2] = { { "thing1", "value1" } , { "thing2", "value2" } , { "thing3", "value3" } };

c# - Castle Windsor instance configuration -

i trying implement configuration (from distributed cache) injection using castle windsor message handler. the configuration of single instance straight forward, i'm not sure best way provide different configuration multiple instances, injected same class i have following class hierarchy, , injection working ok, cant create different configurations iadapter instances: public interface iadapter { void send(string message) string receive(); } public interface imsmqadapterconfig { string queuename {get;set;} } public class msmqadapter { private readonly imsmqadapterconfig _config; public imsmqadapter(imsmqadapterconfig config) { _config = config; } public void send(string message) { string queuename = _config.queuename; // queuename } } public class messageprocessor { private readonly iadapter _input; private readonly iadapter _output; public messageprocessor(iadapter input, iadapter output) ...

git - Push commit to 2 different remote branches? -

i have 2 remote branches, branch , branch b. consider case checkout branch a, made commit , pushed. now, want push same commit branch b. these 2 branches pretty different cannot user rebase , can i? because if git rebase rebase changes 1 branch another, need 1 commit. how can that? ps. in stupid way: checkout branch b, cherry pick last commit branch a, , push b (remote). way don't need switch branch b. that git cherry-pick for. since branches different each other , don't want merge or rebase 1 commit, option.

uitableview - Create and use custom prototype table cells in xamarin ios using storyboard -

Image
is possible create , use 'custom' prototype table cells in xamarin ios (monotouch) using storyboard? i find stuart lodge explaining method using xib/nibs: http://www.youtube.com/watch?feature=player_embedded&v=vd1p2gz8jfy let's answer question! looking one. :) 1) open storyboard have viewcontroller tableview: add prototype cell (if there no cell added before): customize cell want (in case there custom uiimage , label): remember set height of cell. select whole tableview , properties window select "layout" tab. on top of properties window should see "row height" - put appropriate value: now select prototype cell once again. in properties window type name of class (it create code-behind class it). in case "friendscustomtableviewcell". after provide "identifier" cell. can see "friendcell". last thing set "style" property set custom. "name" field should empty. once click ...

r - How to include a \perp symbol in a ggplot2 annotation? -

i put annotation : e \perp c using ggplot2 annotate("text", label = ...) . i searched quite thorougly on web managed lone symbol using annotate("text", label = "symbol('\136')", parse = t) . does have solution ? plotting code page: p <- ggplot(df, aes(x = gp, y = y)) + geom_point() + geom_point(data = ds, aes(y = mean), colour = 'red', size = 3) p+geom_text( aes(x="b", y=-0.4, label = "e(y)*symbol('\\136')*b" ), parse = true) after getting work able annotate(text"...) working: p+annotate("text", 1, -0.4, label="e(y)*symbol('\\136')*b", parse=true) the tricks: mix quoting characters did use plotmath syntax i'm guessing might not have used. edit: * not quoting character. if anything, should called linking character. in plotmath syntax every "atom" or function call needs separated (or "linked-to" de...

java - How can I turn off extra logging? -

i have java service uses spring , cxf. code previous developer , i'm providing maintenance, i'm seeing in logs -------------------------------------- apr 16, 2013 1:44:11 pm org.apache.cxf.interceptor.abstractlogginginterceptor log info: inbound message ---------------------------- id: 33 address: /myapplication/endpoint encoding: utf-8 http-method: post content-type: application/x-www-form-urlencoded headers: {content-type=[application/x-www-form-urlencoded], connection=[close], host= [localhost:8080], content-length=[11504], user-agent=[apache-httpclient/4.2.3 (java 1.5)], content-type=[application/x-www-form-urlencoded]} payload: { "events" : [ { event }, { event }, ... ] } and have many events, , log becoming unmanageable. there way can turn off logging? these log calls not created inside app, created kind of interceptor can't find. did find in cxf-context.xml config file: <cxf:bus> <cxf:features> <cxf:logg...

javascript - JQuery Using Cell Data to Reform Cells -

i'm using jquery, csvtotable (plugin here: https://code.google.com/p/jquerycsvtotable/ ) plugin convert large csv files tables can manipulate. need attach links relevant each row. i need convert text in 1 of these rows add link pdf. problem can't seem modify strings. i'm using data found here: http://jsfiddle.net/bstrunk/vacuy/297/ the file names generated system can't edited, i'm stuck using these formats: 423-1.pdf so need convert 2 strings tables formatted so: 4/23/2013 1 to drop year, slashes, , add '-' , digit. i'm able grab table data, can't seem manipulate variables either .replace or .substr $(document).ready(function () { $("tr td:nth-child(5)").each(function () { var $docket = $('td=eq(5)'); var $td = $(this); var $datadate = $td.substr(0, $td.lastindexof("/")); var $newdatadate = $datadate.replace("/", ""); $td.html('...

linux - Difference between a Hard Link and its Program in C -

i'm writing program similar disk usage utility on linux, , i'm having trouble when comes hard links. i have program running, , determines whether program has hard links. use stat() on file determine this. if (st.st_nlink > 1) when run this, both link , program linked return, disk usage utility report program , not hard link. how tell difference between program , hard link(s) in linux using c? first, why handle differently program , data files multiple hard links? then, matters not name or number (notice hard links add name file), inode . "file" (i.e. inode) having more 1 hard links, names pointing same inode of equal rights (there no "main" name, names pointing same inode equivalent). so after calling stat(2) syscall want use both st_dev , st_ino fields. uniquely identify file, inode. hence, files st.st_nlink>1 you'll add ( st_dev , st_ino ) pair hashtable or set container. in c++ use std::set<std::pair<dev_...

foreach - How to pause for-each iterations php beginner -

for reason code not pause in between iterations, expecting pause second between loading thumbnails. doing wrong? foreach ($media->data $data) { echo "<img src=\"{$data->images->thumbnail->url}\">"; sleep(1); } if expecting generated code reach client-side before terminating script, may have force flush it: foreach ($media->data $data) { echo "<img src=\"{$data->images->thumbnail->url}\">"; @ ob_flush(); @ flush(); sleep(1); } but stupid, , cause formatting issues in client-side. why don't else , send whole page @ once? or better client-side control of loaded , in pace, use javascript.

Load a value into a register in LC3 -

is there single lc3 instruction load value register? need write assembly code , come need write single instruction store value 1 in r1. ld r1, value do .fill on "value" whatever value want load r1. don't believe there's way load literal value register single line, can 1 instruction , 1 label.

kml, High Performance KML for Maps and Earth, not working -

i made kml file mimic example " high performance kml maps , earth'-on youtube-link (at 15:11-16:05 or 15:51) this presentation on friday, on rush work, thanks. i error: validation stopped @ line 2, column 45: no decleration found element 'kml' when try run code googl earth crashes. here code: <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <placemark> <gx:track> <when>13:51</when> <gx:coord>-147.871 64.861</gx:coord> <extendeddata> <schemadata schemaurl="#schema"> <gx:simplearraydata name="pm 2.5"> <gx:value>0.0</gx:value> <gx:value>-6.0511e+15</gx:value> <gx:value>180</gx:value> </gx:simplearraydata> </schemadata> </extendeddata> </gx:track> </placemark> <placemar...

python - Nested Django Forms: 'ManagementForm data is missing or has been tampered with' -

so i've looked around , seems nobody has had same problem having cause seemingly common error. rendering forms in html follows: <form method="post" action=""> {{ tags_formset.management_form }} <!-- code displaying formset --> ... <!-- --> <form method="post" action=""> {{ add_all_form.management_form }} {{ add_all_form.addtagstoall }} <input type="submit" value="add displayed applicants" /> </form> <form method="post" action=""> {{ remove_all_form.management_form }} {{ remove_all_form.removetagsfromall }} <input type="submit" value="remove displayed applicants" /> </form> <input type="submit" value="save changes" /> </form> when did not have 2 inner forms formset displayed correctly , submit button works submit form. whe...

string - Getting the remainder of a stringstream c++ -

i have stringstream need first part out , remainder separate string. example have string "this car" , need end 2 strings: a = "this" , b = "is car" . when use stringstream first part using << ,then use .str() convert string of course gave me whole thing " this car" . how can play how want? string str = "this car"; std::stringstream ss; ss << str; string a,b; ss >> a; getline(ss, b); edit: correction @cubbi: ss >> >> ws; edit: this solution can handle newlines in cases (such test cases) fails in others (such @rubenvb's example), , haven't found clean way fix it. i think @tacp's solution better, more robust, , should accepted.

c++ - Dijkstra's algorithm pseudocode -

Image
i'm trying write dijkstra's algorithm in c++, , there countless examples on internet can't seem grasp how examples work. i'd rather in way makes sense me can understand algorithm better. know how algorithm should work, , have written code. wondering if point out flaw in thought process. i'm choosing represent graph edge list. i'll write in pseudocode because actual code huge mess: class node{ vector<node> linkvector; //links other nodes, generated @ random int cost; //randomly generated constructor bool visited = false; } vector<node> edgelist; //contains nodes int main(){ create n nodes add nodes edgelist each node { randomly add weight nodes linkvector } findpath(initialnode) } int findpath(node start, node want, int cost=0){ //returns cost src dest if(start==want) return cost; if(every node has been visited) return 0; //this in case of failure node result = getmi...

php - array_diff not returning what's expected -

i've read tutorials on here none of them return need. have 2 arrays. $arraya = array(1960,1961,1963,1962,1954,1953,1957,1956,1955); $arrayb = array(1949,1960,1961,1963,1962,1954,1953,1957,1956,1955); however, when run array_diff, returns empty array. $diff = array_diff($arraya, $arrayb); but i'd return 1949. what's error in code? edit: since switching variables won't work, did var_dump 3 arrays (a, b, , diff) , here's pastebin http://pastebin.com/tn1dvcs3 array_diff works finding elements in first array aren't in second, per documentation . try inverting call: $diff = array_diff($arrayb, $arraya); to see in action, lets @ more manageable equivalent example: $arraya = array(1960); $arrayb = array(1949,1960); $diff = array_diff($arrayb, $arraya); var_dump($diff); this yields: [mylogin@aserver ~]$ vim test.php [mylogin@aserver ~]$ php test.php array(1) { [0]=> int(1949) } please note uses minimal demonstrative example of ...

Mule not rolling back JMS message after exception -

my flow consumes message based on cron expression , have deliberately added groovy code throw exception testing jms rollback. rollback doesn't return consumed message in queue. missing here ? here mule flow supposed rollback mule message after exception encountered. <jms:activemq-connector name="jmsconnector" specification="1.1" brokerurl="tcp://localhost:61616" /> <jms:endpoint name="testqueue" queue="test.queue" connector-ref="jmsconnector" /> <flow name="quartzbaseddelivery"> <quartz:inbound-endpoint jobname="deliveryjob" cronexpression="0 0/1 * * * ?"> <quartz:endpoint-polling-job> <quartz:job-endpoint ref="testqueue" /> </quartz:endpoint-polling-job> </quartz:inbound-endpoint> <logger message="quartz found message delivery #[payload]" level="info" /> ...

sql - Cannot insert NULL values into database -

we use jpa load/persist our entities in prostges database. in 1 case must persist entity native query. heres code: string sql = "insert recording (id,creationdate,duration,endtime,filemaninfocomplete,lastupdated,packagesdeletetime,rcinfocomplete," + "rcrecordingkept,recordstate,recordingtype,starttime,tenantid,recordingnode_id,transcription_id) " + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; query query = getentitymanager().createnativequery(sql); query.setparameter(1, recording.getid()); query.setparameter(2, new date(), temporaltype.timestamp); query.setparameter(3, recording.getduration()); query.setparameter(4, recording.getendtime(), temporaltype.timestamp); query.setparameter(5, recording.isfilemaninfocomplete()); query.setparameter(6, new date(), temporaltype.timestamp); query.setparameter(7, recording.getpackagesdeletetime(), temporaltype.timestamp); query.setparameter(8, recording.isrcinfocomplete()); query.setp...

Ruby CSV enumeration confusion -

how come not work? csv there , has values, , have 'require "csv" , time @ top, there. problem seems csv.each doing anything. it returns => [] common registration hour => [] common registration day (sunday being 0, mon => 1 ... sat => 7) if there more info can provide, please let me know. @x = csv.open \ 'event_attendees.csv', headers: true, header_converters: :symbol def time_target y = [] @x.each |line| if line[:regdate].to_s.length > 0 y << datetime.strptime(line[:regdate], "%m/%d/%y %h:%m").hour y = y.sort_by {|i| grep(i).length }.last end end puts "#{y} common registration hour" y = [] @x.each |line| if line[:regdate].to_s.length > 0 y << datetime.strptime(line[:regdate], "%m/%d/%y %h:%m").wday y = y.sort_by {|i| grep(i).length }.last end end puts "#{y} common registration day \ (sunday being 0, mon => 1 ... sat => 7)" e...