Posts

Showing posts from January, 2013

html - How do I control the spacing of the bottom border? -

i want accomplish 2 thing here: 1) i'd control spacing of bottom border. there way have bottom border show 5 pixels down below type? 2) also, word "enhance" in bold. first word in example should bold. here's jsfiddle: http://jsfiddle.net/m9zlj27j/6/ here's code: h1 { font-family:helvetica, arial; font-size:1.6em; text-transform:uppercase; font-weight:normal; margin-bottom:-5px; } h1.section-title { font-family: helvetica, arial; font-size:32px; font-weight: normal; margin: 50px 0; border-bottom: 1px dotted #f66511; } h1.section-title-bold { font-weight: bold; } .rtecenter { text-align: center; } .blue { color: #2251a4; } <h1 class="section-title rtecenter blue"> <span class="section-title-bold">enhance</span> search</h1> try it, 1) can control spacing using padding. 2) , bold done make space between class h1 .section-title-bold h1...

elisp - Open file from Emacs terminal without find-file -

if i'm in term-mode buffer , there file path displayed, how go making path "clickable", opening file in new buffer? doesn't have mouse-clickable, in fact i'd prefer key binding works when point on file path. other common case of using ls , function used when viewing log file. debug info contains file path , line number. lib/library.rb:34 example. ideally, emacs open new buffer , move cursor line 34 . the short answer is: don't work against emacs. let emacs work you. while can use find-file-at-point or put yourself, better off running make , grep , other stuff prints "dir/file:pos" using m-x compile or m-x grep . if need interact program prints "dir/file:pos" , can pass prefix argument compile , compilation buffer interactive. if have arbitrary program output starts "dir/file:pos" , e.g., rails server , need run (grep "rails server") .

bash - Strange results using Linux find -

i trying set backup shell script shall run once per week on server , keep weekly backups ten weeks , works well, except 1 thing... i have folder contains many rather large files, ten weekly backups of folder take quite large amount of disk space , many of larger files in folder change, thought split backup of folder in two: 1 smaller files included in 'normal' weekly backup (and kept ten weeks) , 1 file larger files updated every week, without older weekly versions being kept. i have used following command larger files: /usr/bin/find /other/projects -size +100m -print0 | /usr/bin/xargs -0 /bin/tar -rvpf /backup/prj-files_large.tar that works expected. tar -v option there debugging. however, when archiving smaller files, use similar command: /usr/bin/find /other/projects -size -100m -print0 | /usr/bin/xargs -0 /bin/tar -rvpf /backup/prj-files_$file_end.tar where $file_end weekly number. line above not work. had script run other day , took hours , produced file 70...

Removing multiple entries from ArrayList in Java by date -

so have arraylist called inpeople, has class stored in named peoplein. data stored in class peoplein( int scannernum, date date, int empnum){ so basically, program system reads through logs of punch clock find out who's in building. problem is, if person punches in number of times, never punches out, end duplicates in list. basically, need keep recent punch in. can done? you can use map<key,value> , if put value same key . previous value replace current value. eg: map<string,string> map=new hashmap<>(); map.put("emp1", "val1"); map.put("emp2","val2"); system.out.println(map); // putting emp1, val3 map.put("emp1","val3"); system.out.println(map); out put: {emp2=val2, emp1=val1} {emp2=val2, emp1=val3}

sql server - Get current user while using SQL Authentication -

we using sql login vehicle issuing permissions, once authenticated through sql, we'd still know active directory name of connected user? we've tried: select suser_name() select suser_sname() select suser_sid() select user_name() select user_id() select system_user select session_user select original_login() is information still available somewhere? it appears not possible . according andrew barber's comment on "get windows user login name sql server" : if logged in sql server user, not logged in windows user; no windows credentials passed @ all; can't information directly

c++ - Linking issue with OpenCV Lib after changing to x64 (Visual Studio 2010) -

i wanted compile c++ program x64. i didn't change else, following error: link : fatal error lnk1181: cannot open input file 'opencv_calib3d249d.lib' win32 still works fine though. (i used http://msdn.microsoft.com/en-us/library/9yb4317s.aspx )

c# - Different URL required when hosting a WCF service on Windows 7 -

i have wcf service defined follows: <service name="myservice"> <host> <baseaddresses> <add baseaddress="http://localhost:8080/servicecontainer" /> </baseaddresses> </host> <endpoint address="service" binding="webhttpbinding" contract="iservice" /> </service> my service implements following contract: [servicecontract] public interface iservice { [operationcontract] [webinvoke(method = "post", uritemplate = "dowork")] void mymethod(); } i host wcf service windows service, using webservicehost . hosting on xp call operation on uri: http://myhost:8080/servicecontainer/dowork (i.e. base address / uri template) hosting on windows 7 , same uri fails (with 404 error). however, following uri succeeds: http://myhost:8080/servicecontainer/service/dowork (i.e. base address / endpoint address / uri template) th...

Excel VBA - Batch find and replace of formula -

trying determine correct way complete batch find , replace of formulas, i.e. worksheet 1 has columns a , b . a find column , b replace column. worksheet 2 has lots of rows , columns lots of formulas. worksheet want find , replace occur on. i want excel in formulas on worksheet 2 , not values. the values in worksheet 1 1 not whole contents of formulas in worksheet 2 , parts (i think need use xlpart ) somewhere. anyone know how write script through worksheet 2 formulas listed values in worksheet 1 , column a , , replace value on same row of worksheet 1 in column b ? anyone know how write script well easiest way through vba editor. if intend target whole of sheet 2, you're going need make use of usedrange property. after that, it's not difficult write formula loops through range (that obtained using usedrange property). in loop, you're going need its' formula, use replace function replace instances of search string replacement st...

sql - Javascript ADO command object records affected -

i want change existing javascript adodb.command.execute() return number of records affected command. here initial attempt: var lngrecs = 0; cmdtemp.execute(lngrecs, , ); this code did not interpreted/compiled successfully. having trouble finding javascript examples using records affected property ado command object. also, command text sql currently. looking change use stored procedure. previous post states records affected property may returned in record set. prefer not working recordset.

java - not getting exact result in closed itemsets -

in variable total(instance of array list class) have list of frequent item sets. while finding closed frequent item sets displaying wrong result. in intersection method going find whether 2 array lists same or not. arraylist close=new arraylist(); system.out.println("total: "+total); for(int i1=0;i1<total.size();i1++) { list list1=(list)total.get(i1); if(close.size()==0) close.add(list1); else { list tp=intersection(list1,close); if(tp.size()!=0) close.add(list1); } } system.out.println("close: "+close); for(int i2=0;i2<total.size();i2++) { list list1=(list)total.get(i2); if(close.size()!=0) { for(int i1=0;i1<close.size();i1++) { list list2=(list)c...

jquery - how to goto 2 slides -

i have 3 "main" slides. there "intermediate" slide in between each of "main" slides , hoping can achieve following effect click on appropriate buttons ("go slide 1", "go slide 2","go slide 3") when user click button1 ("go slide 1") 1) $('.cycle-slideshow').cycle('goto', intermediate slide); 2) perform task (i need intermediate slide image create zoom in effect) 2) $('.cycle-slideshow').cycle('goto', 1); ans on... thank in advance help. maybe try this. haven't tested it. want use advanced cycle2 api write own goto (jump) handler, per page: http://jquery.malsup.com/cycle2/api/advanced.php . here's default jump function (search jump: function): https://github.com/malsup/cycle2/blob/45fde557e8fb4c2d59a9667ba744b63a0da9916c/build/jquery.cycle2.js so here's modified version of function (again not tested!): $('.cycle-slideshow').on('c...

php - My Login won't work -

i can register user when try log on it, i'm having 2 issues: 1: can log-in using username can type whatever want in password input section , still logged in (it not check real password in database) 2: when try use combination email , password can't log-in, error msg. i'm thinking problem lies within $query select members bla bla... i'm not sure. sorry being such noob. this register.php <form method="post" action=""> <input type="text" name="username" placeholder="username"> <input type="password" name="password1" placeholder="password"> <input type="password" name="password2" placeholder="confirm password"> <input type="text" name="email" placeholder="e-mail"> <input type="date" name="age" id="age" > <input type="radio" value=...

javascript - Show hide available content -

i have content in post. want hide until click link in post. have yet build site, idea. the first heading the second heading the third heading the fourth heading /* content following hidden until clicked link above. / / content available wrapped in div tag, not loaded site. */ content 1 show click "1. first heading" content 2 show click "2. second heading" content 3 show click "3. third heading" content 4 show click "4. fourth heading" can use css or ajax / jquery create effect? you using following jquery code: $(document).ready(function(){ $("#hide").click(function(){ $("p").hide(); }); $("#show").click(function(){ $("p").show(); }); }); here complete demo how can hide , show element click event.

Migration from SQL Server 2000 to 2012 without Outage -

i working on project migrating legacy sql server 2000 instances sql server 2012. read word legacy, these databases used vb based desktop applications. has around 4000+ users , application rated gold (means has 24x7) summary again desktop exe installed vb applications -> sql server 2000 target state desktop exe installed vb applications -> sql server 2012 application uses config file contains sql server details connects to. once data move new sql server, config file needs changed new server details. i have been told sql server 2000 can't migrate directly. should first go sql server 2008 , sql server 2012. please correct if not right understanding? my problem around implementation plan task in production. can't move users in 1 go means migrating 100 users first , few other hundreds , left. means users might start using sql server 2012 while other still working sql server 2000. reason don't want in 1 go because it's risky in case of glitch , bec...

twitter bootstrap - Prevent WYSIWYG from stripping html classes -

i using bootstrap 3 wysiwyg editor , , whenever paste html code after selecting html source button in editor. <div class="col-sm-6"> element </div> <div class="col-sm-3"> element </div> <div class="col-sm-3"> <img src="somesource" class="img-resposnsive" /> </div> it strip down class on client side itself, while copy pasting, , pastes code :- <div> element </div> <div> element </div> <div > <img src="somesource" /> </div> how can prevent doing so. this wysiwyg editor, referencing here :- https://github.com/xing/wysihtml5 it looks this issue still open , proprosed solution hasn't been merged master author jakcarlton explains: this change allows classes carried on using "*" in classes hash "classes": { "*":1 }` allow classes carried over, otheriwse whitelisted you manually...

java - Create index on column in one-to-many relationship -

i have one-to-many relationship between 2 classes this: class parent { list<child> children; } class child { string name; } i'm using .hbm.xml file define mapping java classes tables. this: <class name="parent" table="parent"> <list name="children"> <key column="parent_id" /> <list-index column="idx" /> <one-to-many class="child" /> </list> </class> <class name="child" table="child"> <property name="name" type="string" /> </class> that works fine. now want create column index (not list index) on child.parent_id column. seems <one-to-many> tag doesn't allow nested <column> tags, tried adding bidirectional association child mapping this: <many-to-one name="parent" insert="false" update="false"> <c...

controller - Understand JSF action -

i start jsf 2, create xhtml page index.xhtml , page have button: <h:commandbutton value="submit" action="welcome" /> and create page welcome.xhtml . but when view source of index.xhtml , don't see "link" index.xhtml file welcome.xhtml file, how jsf can pass index welcome? when view source, source page is: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head></head><body lang="en"> <form id="j_idt5" name="j_idt5" method="post" action="/test/index.xhtml" enctype="application/x-www-form-urlencoded"> <input type="hidden" name="j_idt5" value="j_idt5" /> <input type="submit" name="j_idt5:j_idt6" value="submit" /><input type...

.net - Using enums with objects c# -

sorry i'm quite new @ enums , i'm trying implement in logical context. in employee class i've created employee objects. i've created enum employee objects assignment status. aim create list of employees , give each employee assignment status , iterrate through list printing out employee data , employee assignment status. i'm wondering: 1 - case use enums? 2 - how can assign each employee assignment status? example, if want emp1 have assignmentstatus.assigned how should apply syntax-wise? public class employee { public int id { get; set; } public string firstname { get; set; } public string lastname { get; set; } public bool iscurrentlyemployed { get; set; } enum assignmentstatus { assigned, idle, trainee, notdefined } public employee(int id, string firstname, string lastname, bool iscurrentlyemployed) { id = id; ...

algorithm - Google codejam APAC Test practice round: Parentheses Order -

i spent 1 day solving this problem , couldn't find solution pass large dataset. problem an n parentheses sequence consists of n "("s , n ")"s. now, have valid n parentheses sequences. find k-th smallest sequence in lexicographical order. for example, here valid 3 parentheses sequences in lexicographical order: ((())) (()()) (())() ()(()) ()()() given n , k, write algorithm give k-th smallest sequence in lexicographical order. for large data set: 1 ≤ n ≤ 100 , 1 ≤ k ≤ 10^18 this problem can solved using dynamic programming let dp[n][m] = number of valid parentheses can created if have n open brackets , m close brackets. base case: dp[0][a] = 1 (a >=0) fill in matrix using base case: dp[n][m] = dp[n - 1][m] + (n < m ? dp[n][m - 1]:0 ); then, can build kth parentheses. start a = n open brackets , b = n close brackets , current result empty while(k not 0): if number dp[a][b] >= k: ...

java - how to deploy an EJB module from Netbeans to Glassfish -

how netbeans @stateless , @remote ejb deployed glassfish ejb module ? netbeans able so, how accomplished outside of ide? server log: thufir@dur:~$ thufir@dur:~$ tail glassfish-4.1/glassfish/domains/domain1/logs/server.log -n 34 @ java.lang.thread.run(thread.java:744) ]] [2014-09-22t01:41:57.266-0700] [glassfish 4.1] [severe] [] [javax.enterprise.system.core] [tid: _threadid=42 _threadname=admin-listener(5)] [timemillis: 1411375317266] [levelvalue: 1000] [[ exception while deploying app [helloejb] : invalid ejb jar [helloejb]: contains 0 ejb. note: 1. valid ejb jar requires @ least 1 session, entity (1.x/2.x style), or message-driven bean. 2. ejb3+ entity beans (@entity) pojos , please package them library jar. 3. if jar file contains valid ejbs annotated ejb component level annotations (@stateless, @stateful, @messagedriven, @singleton), please check server.log see whether annotations processed properly.]] [2014-09-22t03:52:08.027-0700] [glassfish 4.1] [info] [...

sql - Error when inserting Description Column -

below code have add description column in spotfire. works in microsoft sql.how supposed write in spotfire? select v1."datetime" "discretelivedatetime", v1."tagname" "discretelivetagname", v1."value" "discretelivevalue", v2.description "description" "runtime"."dbo"."v_discretelive" v1 inner join [runtime].[dbo].tag v2 on v1.tagname = v2.tagname the above code made giving me error below. error message: failed execute data source query. importexception @ spotfire.dxp.data: failed execute data source query. (hresult: 80131500) stack trace: @ spotfire.dxp.data.datasourceconnection.executequery2() @ spotfire.dxp.data.dataflow.execute() @ spotfire.dxp.data.dataflow.dataflowconnection.executequerycore2() @ spotfire.dxp.data.datasourceconnection.executequery2() @ spotfire.dxp.data.producers.sourcecolumnproducer.<>c__displayclass11.<getcolumnsan...

installation - How to install gitolite? -

how install gitolitev3 in ubuntu 14.04 , once installation done how verify? description: already tried sudo apt-get install gitolite command sure installed. how verify it? a better way follow doc : su - git mkdir -p ~/bin git clone git://github.com/sitaramc/gitolite gitolite/install -ln ~/bin # please use absolute path here gitolite setup -pk yourname.pub by cloning gitolite repo , ensure install latest version of gitolite (3.6.1+)

node.js - Installing nvm on Ubuntu 14.04 -

i'm trying install nvm on ubuntu 14.04 doesn't seem use version specify. installed following tutorial here https://github.com/creationix/nvm , i've tried 1 here https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps . there 2 node installations on system already. which node # => /usr/local/bin/node node --version # => v0.11.13-pre nodejs # => /usr/bin/nodejs nodejs --version # => v0.10.26 when install nvm using curl 1 liner give you, , use nvm install 0.10.32 it creates empty folder inside .nvm/v0.10.32 , .nvm/current symlinks it. in addition bin folder empty. problem occurs if install other versions of node. suppose clone version of node folder supposed go in idk if that's have do. in addition, i'm not sure know how make system use nvm current (symlink /usr/local/bin/node .nvm/current ?) without doing myself , following tutorial, node --version , nodejs --version never uses version s...

python - Healpy map2alm and alm2map inconsistency? -

i'm starting work healpy , have noticed if use map alm's , use alm's generate new map, not map started with. here's i'm looking at: import numpy np import healpy hp nside = 2 # healpix nside parameter m = np.arange(hp.nside2npix(nside)) # create map test alm = hp.map2alm(m) # compute alm's new_map = hp.alm2map(alm, nside) # create new map computed alm's # let's @ 2 maps print(m) [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47] # expected print(new_map) [-23.30522233 -22.54434515 -21.50906755 -20.09203749 -19.48841773 -18.66392484 -16.99593867 -16.789984 -15.14587061 -14.57960049 -13.4403252 -13.35992138 -10.51368725 -10.49793946 -10.1262039 -8.6340571 -7.41789272 -6.87712224 -5.75765487 -3.75121764 -4.35825512 -1.6221964 -1.03902923 -0.41478954 0.52480646 2.34629955 2.1511705 2.40325268 5.39576497 5.38390848 5.78324832 7.24...

ojs - How can I display the Author's bio on the Author's View page? -

i'm new tpl (smarty) have been using php years. is there roadmap/guide customising ojs? as far understand involve php script retrieve/assign information , tpl script display information. thanks petras for references, have @ ojs quick reference , ojs technical reference, both available here: https://pkp.sfu.ca/wiki/index.php?title=ojs_documentation by "author's view page", i'm assuming mean pages urls http://.../index.php/[journalpath]/authors/view . modifying these include author biography may difficult because of way ojs stores author records. each article may have several authors, , author records not disambiguated -- 2 articles "joe smith" author, there 2 different entries in authors table. on author listing disambiguation done matching same first name, last name, affiliation, , country. (see pages/search/searchhandler.inc.php in authors function code this.) many author records may match set of data, each potentially own biog...

Flesch Index program Java -

i writing program calculates flesch index of passage in java. few things: can't figure out how make can input many words while hitting enter , not calculate (something d tells no more input coming). having trouble boolean expression. have tried & , && , still doesn't work. keep getting message says, "syntax error on token "&&", throw expected" import java.util.scanner; public class flesch { public static void main (string [] args) { scanner input = new scanner (system.in); // declare variables syllables , words int totalwords = 0; int totalsyllables = 0; // prompt user passage of text system.out.println ("please enter text:"); string passage = input.nextline(); // words (int = 0; < passage.length(); i++) { if (passage.charat(i) == ' ') { totalwords++; } else if (passage.charat(i) == '.') { totalwords++; } else i...

java - Jsoup parsing after Authentication -

i trying parse webpage using jsoup, problem page needs authentication. the approach want take use selenium webdriver authentication, , parse data on page using jsoup. not sure how implement this, cause might need cookies or headers request authenticated page. any thought on how implement ? know abstract, still trying figure out how moving. edit : starting off using jsoup, don't know if such authentication possible using jsoup without use of selenium webdriver or not. you can use httpclient or httpurlconnection submit details directly page authentication,after next page response. give response jsoup,parse , access data. check link: http://www.mkyong.com/java/how-to-send-http-request-getpost-in-java/

android - google app engine - Portion of expression could not be parsed -

i want fetch category data google app engine data store except 1 particular category. for query in apimethod goes : query query = mgr .createquery("select c iconcategorymaster c c.categoryispurchased = :ispurchased , c.categoryname != :catname order c.categoryname,c.categorytype desc"); query.setparameter("ispurchased", true); query.setparameter("catname", "templateicons"); when try execute api, getting exception below : com.google.api.server.spi.systemservice invokeservicemethod: portion of expression not parsed: != :catname portion of expression not parsed: != :catname org.datanucleus.store.query.querycompilersyntaxexception: portion of expression not parsed: != :catname @ org.datanucleus.query.compiler.jpqlparser.parse(jpqlparser.java:77) @ org.datanucleus.query.compiler.javaquerycompiler.compilefilter(javaquerycompiler.java:466) @ org.datanucleus.query.compiler.jpqlcompiler.compile(jpqlc...

android - addToBackStack() didn't work. Back to home not previous fragment -

i'm pretty new android. when try use addtobackstack() , encountered problem. when press button in fragment 2, didn't go fragment 1 home. why? there wrong in code? thanks! maiinactivity.java public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); fragmentmanager mfragmentmanager = getfragmentmanager(); fragmenttransaction mfragmenttransaction = mfragmentmanager.begintransaction(); mfragmenttransaction.add(r.id.id_frame, new firstfrag(), "firstfrag"); mfragmenttransaction.commit(); } } activity_main.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" and...

c++ - View AIS- Data with QT? -

anyone know how can data ais site , view in qt gui? can save them in sql database ? have data site : http://www.aishub.net/ ais : automatic identification system (ais) automatic tracking system used on ships , vessel traffic services (vts) identifying , locating vessels electronically exchanging data other nearby ships, ais base stations, , satellites. when satellites used detect ais signatures term satellite-ais (s-ais) used. ais information supplements marine radar, continues primary method of collision avoidance water transport. you should register account @ http://www.aishub.net/ , subscribe access api described here . @ desktop side should build qt application, not every minute call api url credentials using qnetworkrequest, retrieve qnetworkreply result output (this xml or json). , parse xml or json qt build-in classes processing xml or json documents. after parsing should display processed data in preferred way, example, sortable table view, or save in databas...

forms - jQuery trigger reset button click -

i need reset radio buttons , checkboxes within form via code when needed. i using indirect approach, have placed reset button , hidden using css. <form class="form-horizontal form form-existing" role="form" id="form-existing" action=""> <input type="reset" name="reset-form-new" id="resetformnew" value="" /> <div class="radio"> <label> <input type="radio" name="new-turnover" id="new-turnover" value="€1 000 - €5 000"/> €1 000 - €5 000 </label> </div> <div class="radio"> <label> <input type="radio" name="new-turnover" id="new-turnover" value="€50 000 - €20 0000"/> €50 000 - €20 0000 </label> </div> <div class="checkbox"> <label> <input type="checkbox" name="new-prefe...

url rewriting - Cleaning up URL's for an existing Website -

quick question, there way clean url's existing website? mean lets have existing link http://www.webawwards.com/website?id=320 want make http://www.webawwards.com/terna is there way clean url if there existing links current url link still go through? could please direct me right way? thank you if want hard-code urls .htaccess file can set static redirects: <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{query_string} ^id=320(.*)$ rewriterule /website$ /terna [l,nc] rewritecond %{query_string} ^id=321(.*)$ rewriterule /website$ /somewhere-else [l,nc] </ifmodule> however if want make more flexible (maybe let people change own redirects, or similar) you'd need store in database ( redirects table, columns of website_id, redirect_url ) when queries, (pseudo-code): if (isset( querystring['id'] )) query( select redirect_url redirects website_id = querystring['id'] ) redirectto( redirect_url )...

sql - Oracle merge and third party tables -

i work merge operation in example: http://docs.oracle.com/cd/e11882_01/server.112/e26088/statements_9016.htm how can make insert third party table inside "when matched" , "when not matched" clauses? update: may possible set flags inside clauses? using @ next procedure steps - execute insert ... considering want benefit merge clause update table, suggestion flags pretty idea imo. suppose want merge tab_a , tab_b tab_c , 1st need alter table tab_a add (flag varchar2(1)); . then merge consists in setting flags: merge tab_a using (tab_b) b on (...) when matched update set a.flag = 'u' when not matched insert (..., flag) values (..., 'i') ; you can update tab_c like: insert tab_c select ... tab_a a.flag = 'i'; and same kind of update lines 'u' flag. don't forget reset flag in tab_a when you're finished !

c++ - Getting AccessViolationException while Assigning Delegate from C# to FunctionPointer in NativeCode -

from c# code i'm trying call api *.c file. i'm getting accessviolationexception . earlier getting badimageformatexception , solved putting both exe , dll in 1 location. i suspect has callingconvention of cdecl or stdcall or platformtype=x86 or x64 . in c#. exe i've set cpu x86 , in nativecode.dll calling convention mentioned cdecl only. i'm not able understand how solve issue,there many posts on web explaining problem somehow i'm not able find concrete solution issue. in case of more details please let me know. below mentioned code files can highlight problem: header.h file typedef int bool; #ifndef false #define false 0 #endif #ifndef true #define true 1 #endif typedef bool regfunction( char *pregkey, char *pbuffer, int ibufsize ); implementation.c file #ifdef swscancode_exports #define swscancode_api __declspec(dllexport) #else #define swscancode_api __declspec(dllimport) #endif #...

sublimetext2 - Setting environment variables for Sublime Text on OSX desktop -

i'd able access java_home variable has been set in .bash_profile within sublime text build. when build following error. error: java_home not defined correctly. cannot execute .... this because st2 doesn't read in bash profile. there hack around this? thanks! on unix child processes inherit environment of parent process. in case, sublime text not launched through process chain include bash shell in turn reading profile file. .bash_profile executed on shell login. depending on operating system not executed when enter desktop environment. thus, environment variables not avaiable. workarounds put environment variables file read on computer boot (no idea file unless tell operating system) (e.g. lanchd.conf osx gui applications or /etc/profile on linux) modify dekstop launcher icon put hardcoded paths build file launch sublime text using subl alias bash shell instead of desktop icon more .bash_profile , .bashrc

arrays - filling the gaps in a table -

i have 2 tables. 1 has info 2012 till 2014 period of 3 hours. looks this: 1 01.06.2012 00:00 10 0 2 01.06.2012 03:00 10 0 3 01.06.2012 06:00 10 6 4 01.06.2012 09:00 7,5 0 5 01.06.2012 12:00 6 2,5 6 01.06.2012 15:00 6 0 7 01.06.2012 18:00 4 0 8 01.06.2012 21:00 4 0 9 02.06.2012 00:00 0 0 10 02.06.2012 03:00 0 0 the other table same time period of 1 minute , has no data. 1 01.06.2012 00:00 3 1 2 01.06.2012 00:01 3 1 3 01.06.2012 00:01 3 1 4 01.06.2012 00:03 3 1 5 01.06.2012 00:03 3 1 6 01.06.2012 00:05 3 1 7 01.06.2012 00:05 3 1 8 01.06.2012 00:07 3 1 9 01.06.2012 00:08 3 1 10 01.06.2012 00:09 3 1 11 01.06.2012 00:10 3 1 now, need values of 2nd , 3rd rows of second table correlate first, if timestamp second table between timestamp(i) , timestamp(i+1) of first table take b(i) , c(...

header - Working with .h and .lib files in c++ -

i have problem, have few header.h files , 1 library.lib file , nothing more. possible execute functions header files in new project? thanks answers :) "is possible execute functions header files in new project?" yes it's possible. you'll need put #include "xxx.h" statements, need function declarations call them, , link executable .lib file.

Compile libIEC61850 with mingw and eclipse fails -

hy have installed mingw , eclipse-cdt. trying compile project libiec61850: http://libiec61850.com/.. i installed cmake here after extracted libiec61850 created new folder build-mingw , started following command: cmake .. -g"eclipse cdt4 - mingw makefiles" command ends with: -- generating done -- build files have been written to: e:/libiec61850-0.8.0/build-mingw after imported folder build-mingw eclipse(with out copy files workspace) when start make target : fails can 1 tell me did wrong? here error line cdt: 17:33:43 **** build of project libiec61850@build-mingw **** "c:\\mingw\\bin\\mingw32-make.exe" "c:\program files (x86)\cmake\bin\cmake.exe" -he:\libiec61850-0.8.0 -be:\libiec61850-0.8.0\build-mingw --check-build-system cmakefiles\makefile.cmake 0 "c:\program files (x86)\cmake\bin\cmake.exe" -e cmake_progress_start e:\libiec61850-0.8.0\build-mingw\cmakefiles e:\libiec61850-0.8.0\build-mingw\cmakefiles\progress.marks c:/mingw/...

javascript - Python slimit and d3.js -

i developed code data visualisation using d3. works fine encountered problem trying integrate project. it's python/django-based application in javascript files minified using slimit library. problem minimalization fail when trying minimize d3.js script. did try minimize both d3.js , d3.min.js no luck. did find can encoding problem according this thread. tried apply fixes suggested there nothing has changed. suppose slimit differently makes no difference put in javascript tag, if has worked without problems standalone script. obvious solution provide d3.js script different encoding, expected slimit. problem there isn't 1 since script contain invalid characters different encoding. any appreciated! thanks!

php - Warning: mysqli_connect(): (HY000/1045): Access denied for user -

this question has answer here: php mysql (1045) access denied user 4 answers i'm new php. trying connect mysql php. error: warning: mysqli_connect(): (hy000/1045): access denied user 'mike'@'localhost' (using password: yes) in c:\abyss web server\connect_db.php on line 5 access denied user 'mike'@'localhost' (using password: yes) what's wrong connection script? #set encoding match php script encoding mysqli_set_charset($dbc,'utf8'); ?> try this: <?php $con = mysqli_connect("localhost","my_user","my_password","my_db"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } ?>

Google Sheets Spreadsheet Formatting -

i'm using google sheets , have sheet ecommerce store's products. there columns description, features, common uses, etc. need take features, common uses, etc , merge them new cell, , format them using html, can copy , paste them webpage. i want wrap html around these echoed values. any suggestions? thanks. i found answer myself, in case know: =concatenate("<p>",concatenate(e10),"</p>")

ios - Swift - Checking unmanaged address book single value property for nil -

i'm relative new ios-development , swift. point able myself research on stackoverflow , several documentations , tutorials. however, there problem couldn't find solution yet. i want data users addressbook (for example single value property kabpersonfirstnameproperty ). because .takeretainedvalue() function throws error if contact doesn't have firstname value in addressbook, need make sure abrecordcopyvalue() function return value. tried check in closure: let contactfirstname: string = { if (abrecordcopyvalue(self.contactreference, kabpersonfirstnameproperty) != nil) { return abrecordcopyvalue(self.contactreference, kabpersonfirstnameproperty).takeretainedvalue() string } else { return "" } }() contactreference variable of type abrecordref! when addressbook contact provides firstname value, works fine. if there no firstname, application crashes .takeretainedvalue() function. seems, if statement doesn't because unmanaged retu...

performance - TouchesMoved lags more in iOS8? -

i'm battling ios 8 performance problems. updating ios 8 has literally made application near unusable on ipad 2's. there fundamental performance issues i'm trying iron out see if can avoid them or @ least lessen effect of them on application. 1 problem dragging uiimageviews. there's different how touchesmoved function gets called uiimageviews. please see video below full description , here current findings. i'm using touchesmoved function in uiimageviews drag objects across screen when user drags finger across screen. public override void touchesmoved (nsset touches, uievent evt) { base.touchesmoved (touches, evt); uitouch touch = touches.anyobject uitouch; pointf touchlocation_old = touchlocation; touchlocation = touch.locationinview (this.superview); // console.writeline("touchlocation = " + touchlocation); float offsetx = touchlocation.x - touchlocation_old.x; float offsety = t...

java - Guessing game play again trouble -

ok i've tried 1 method kept showing "do want play again" every time entered number reason. here have far. else after user guesses correct answer asks if he/she wants play again? import java.util.random; import java.util.scanner; public class guessnumber { public static void main(string[] args) { scanner scan = new scanner(system.in); random rand = new random(); int number = rand.nextint(100) + 1; int guess; system.out.println("guess number between 1 , 100\n"); guess = scan.nextint(); while (true) { if(guess < number) system.out.println("higher!"); else if(guess > number) system.out.println("lower!"); else if (guess == number){ system.out.println("correct!"); } guess = scan.nextint(); } } } you need exit while when correc...

osx - morbo slows down and hangs after a while -

when developing app, have running morbo several hours check impacts of changes - far, think morbo has been developed for. but after while (aprox. 2 hours) app starts unresponsive , hangs. if happens can not stop morbo anymore ctrl+c . way kill 2 morbo-processes ( ps -ax | grep morbo , kill -9 <id1> <id2> . unfortunately not cure system in sustainable way - after few minutes app hangs again. way restart whole machine, quiet uncommon unix based os. system: os x, perl v5.12.3 darwin-2level, mojolicious (5.44, tiger face) any idea?

php - How to create dynamic business listings in wordpress -

i have created business listings in wordpress using html , css. want make dynamic. how can it? there has business listings plugin in wordpress customize , use it? or there has specific code make dynamic? thank you. to see design, please visit link: https://dl.dropboxusercontent.com/u/211935016/images/non_surgical.png solution 1: custom post type surgical , separate 1 non-surgical custom taxonomies categories. resources: creating custom post types: http://codex.wordpress.org/post_types creating custom taxonomies: http://codex.wordpress.org/function_reference/register_taxonomy solution 2: create 1 custom post type, , 1 custom taxonomy , split them categories , sub-categories. e.g. category 1: surgical sub-category: surgical sub-category category 2: non-surgical sub-category: non-surgical sub-category.

Ruby Combine Hash Key As Hash + Key and return as array -

suppose have hash hash = {"123"=>"abc", "124"=>"def"} i'm expecting output [["123 - abc", "123"], ["124 - def", "124"]] pass select tag display "123 - abc" , submit id when selected i came solution hash.map{|key,value| ["#{key} - #{value}",key]} but there better way other this?