Posts

Showing posts from September, 2010

c++ - OpenAL issue, undefined reference to '_imp__alGenBuffers' -

i decided download openal, , openalut. upon writing first bit of code, came across slight issue. everytime compile, error listed in title. appreciated. code listed below, thanks. ps: using code::blocks. #include <al/al.h> #include <al/alut.h> #define num_buffers 1 int main() { aluint buffers[ num_buffers ]; algenbuffers( num_buffers, buffers ); } i don't expect real result out of this, expect compiles. i'm it's issue installation of openal, although sure did correctly... it fault, didn't link libraries correctly. if having error, make sure have linked them correctly, and/or correct bit type, compared rest of files.

c# - Two Update Statements with One Button Click -

i using sql data adapter in c# windows form , trying run 2 update statements on 2 separate databases 1 button click using same string. keep getting exception error , think second update statement trying use connection first update statement can't figure out. have ideas? string resendacct = textbox_resendvisit.text.trim(); sqlconnection conn1 = new sqlconnection("data source=dbserver1.domain.company.org; initial catalog=db1; user id=username; password=password ;trusted_connection=false"); //open sql connection conn1.open(); //create new sqlcommand sqlcommand cmd = conn1.createcommand(); cmd.commandtext = "update productiondb1.dbo.date_time " + "set productiondb1.dbo.date_time.sent_datetime = null " + "from productiondb1.dbo.date_time " + "in

mysql - Increment PHP variable after x time -

i want make site online currency increments every hour, or other time frame. it's going retrieved mysql database, no matter if user online or not, , amount going added variable , sent server again. i've looked around still struggling head around explanations. any appreciated. thanks in advance! to reduce constant database updates large number of users, keep track of user's creation time , calculate amount of currency should have there. have have modifier additional spent/stolen/earned money. example: user1 created on 1376936553 (the time unix timestamp) an hour now, unix time 1376940153. if want find out how many possible units of currency should have be (currenttime - start time)/3600 = 1 then, if user spends one, keep track of in seperate database field , apply total.

ruby on rails - Color Profile and ColorSpace mismatch using RMagick -

in ruby on rails enviornment, im trying convert jpeg image rgb cmyk , rgb create pdf, , want add icc profiles (from adobe) when converting (i using magick rmagick gem). however, keep getting error "colorspace colorprofile mismatch", pretty self explanatory. don't understand this: 2.0.0p195 :083 > image.colorspace => rgbcolorspace=1 2.0.0p195 :084 > image.add_profile("lib/assets/adobergb1998.icc") magick::imagemagickerror: colorspacecolorprofilemismatch `icc' @error/profile.c/profileimage/582 how there mismatch when colorspace matches profile? "/lib/assets/adobergb1998.icc", not "lib/assets/adobergb1998.icc". typos....

running rails on guest linux virtualbox: a database.yml issue -

a) i'm ruby in rails beginner developer, , use windows 7 machine developement environment... b) virtualbox installed, inside windows 7 "host", linux ubuntu sever "guest", run rails development environment in linux machine. c) configured virtualbox shared folder: let have shared folder on host machine (window): c:\rails\esamianatomia and mounted on linux embedded server: /home/solyaris/host/esamianatomia d) in exptended "developement environment" edit source files preferred visual editor on windows (sublime text) , run rails server on linux. the problem concern database.yml configuration file: /home/solyaris/host/esamianatomia/config/database.yml because on windows have database (postgresql) responding port 5433, specific username/password but in linux database respond port 5432, etc. questions: 1) it's "arcgitectural solution ok ? (i mean: developing/editing windows 7 host, running rails server of linux guest serv

r - Reading multiple csv files as new dataframes and renaming the columns -

i trying read multiple dataframes using loops , trying assign variable names in data frames. want give same column name dataframes. the loop used follows: for (i in 1:15){ assign(paste0("watersurf",i),read.table(paste0("d:/water-surf/","water-surf-",i,".dat"),header=f,skip=1,sep="")) } by using above code able create 15 data frames. how can assign names data frames ? used following code: for (i in 1:15){ assign(paste0("watersurf",i),read.table(paste0("d:/water-surf/","water-surf-",i,".dat"),header=f,skip=1,sep="")) names(paste0("watersurf",i))<- c("x","y","z") } i got error follows: error in names(paste("watersurf", i)) <- c("x", "y", "z") : target of assignment expands non-language object can suggest how can rid of above error or efficient way rename columns in dataframes @

java - Get bundle values in Android -

i'm still confused why i'm having error getting values bundle of main activity. so, here's code snippet: level1.class chronometer chrono; chrono = (chronometer)findviewbyid(r.id.chronometer1); chrono.start(); long timeelapsed = systemclock.elapsedrealtime() - chrono.getbase(); int hours = (int) (timeelapsed / 3600000); int minutes = (int) (timeelapsed - hours * 3600000) / 60000; int seconds = (int) (timeelapsed - hours * 3600000 - minutes * 60000) / 1000; intent lvl1 = new intent(getapplicationcontext(), finish.class); bundle time1 = new bundle(); time1.putint("hour1", hours); time1.putint("minutes1", minutes); time1.putint("seconds1", seconds); lvl1.putextras(time1); and finish.class : (inside oncreate method) textview set1; set1 = (textview) findviewbyid (r.id.time1); bundle time1 = getintent().getextras(); int hrs = time1.getint("hour1"); int min = time1.getint("minutes1"); int sec = time1.getint(&

c++ - Iterate shared_ptr<std::vector<T>> -

let's assume have following: auto vec = std::shared_ptr<std::vector<t>> and want loop through vec entities using c++11 range-based loop. the following works: for (auto entity: *vec) my question there anyway same without using * operator? no. sensible way dereference pointer dereference operator.

Android: Listview don't save a state of checkbox -

i check topic similar problem, stil stay in deadpoint. have listview contact list, when scroll down , scroll listview don't save state of choices. checkboxes setting on false. when debug see, when scrolled listview, onclicklistener thinking checkbox signed , reset this. everything, other array position boolean, etc etc , still don't know :( gratefull help:) @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); readcontacts(); contact_database dbhandler = new contact_database( getapplicationcontext(), null, null, 1); numbers.addall( dbhandler.getallnumbers()); system.out.println("oncreate"); listview lv = getlistview(); registerforcontextmenu(lv); lv.settextfilterenabled(true); lv.clearchoices(); myadapter adapter = (new myadapter(this, r.layout.contact_list_sms, contacts)); adapter.notifydatasetchanged();

jquery ui - Strange scrollbar behaviour when dragging items from draggable to sortable -

if click , drag item draggable list sortable list, browser's scrollbar grow or shrink depending on how far right cursor goes. if drag off end of window, window scroll off right. not sure, why happening! has ideas? specify containment option in element can dragged around

What do I need to install or configure into deployment machine to run an Entitity Framework with Oracle console application ? -

i did whole development under windows 7 + vs 2012 using entity framework 4.1 my application windows console application uses entity framework access oracle database runs in remote server. application has x64 target setting, , windows 7 64bit. all went fine on development machine until started deployment production host. production host: newly installed windows server 2012. installed odac 64-bit , run configure.bat @ odp.net/managed/x64 folder. i´m taking files application genereated @ /bin/debug folder form vs2012 , copying target machine, oracle.dataaccess.dll. my connection string has providername = system.data.entityclient . generated ef model-first wizard. when running, i´m getting following exception: unable find requested .net framework data provider. may not installed. @ system.data.entityclient.entityconnection.getfactory (string providerstring). i´ve checked odca configure.bat , installs oraclemanagedataaccessdtc.dll so, i´m confused. have oracle.dataaces

html - Xpath: extract value from element using text outside of element -

i want extract @name values input elements below. <div style="style info"> <input type="checkbox" name="name1" onchange="dosomething;"/> mobile <br/> <input type="checkbox" name="name2" onchange="dosomething;"/> event <br/> </div> in above example, want extract name ("name1") relates "mobile". i need one-line xpath can retrieve information me. have tried //div[normalize-space(text())='mobile']/preceding-sibling::input/@name //div[normalize-space(text())='mobile']/input/@name //div[normalize-space(.)='mobile']/preceding-sibling::input/name and several other guesses after combing archives here, have not found works (i new xml, can no doubt tell; sorry if guesses seem haphazard). thanks in advance answers, , please let me know if there clarifications or corrections can make assist in solving this. extremely appreciated!

android - How to detect when the device switch from portrait to landscape mode? -

i have app shows fullscreen bitmaps in activity. in order provide fast loading time, load them in memory. when screen changes orientation, clear cache in order fill again bitmaps fit inside new dimensions. problem in order this, need detect when orientation change occurs. know how detect this? see official documentation http://developer.android.com/guide/topics/resources/runtime-changes.html changing create new view , oncreate called again. furthermore can check via @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); // checks orientation of screen if (newconfig.orientation == configuration.orientation_landscape) { toast.maketext(this, "landscape", toast.length_short).show(); } else if (newconfig.orientation == configuration.orientation_portrait){ toast.maketext(this, "portrait", toast.length_short).show(); } }

html - Unintentional Padding in Text Elements -

i'm using tables per client's request design. (read: no other option) all table cells seem applying sort of vertical padding , screwing spacing. i've changed text/background color of 1 of cells on fiddle show mean. have tried setting margin , padding 0 on applicable elements. thanks help! <table width="346" border="0" cellpadding="0" cellspacing="0"> <tr height="66"> <td width="85" style="padding:0;" align="left" valign="top"> <span style="font-size:66px;font-weight:bold;line-height:50ox;">50</span> </td> <td width="50" align="left" valign="middle"> <table border="0" cellpadding="0" cellspacing="0"> <tr height="30"> <td width="50" alig

javascript - Cannot call method 'find' of undefined -

i'm trying use objects within jquery code. i've this: var opts = { ul: $(this).find('.carousel'), li: ul.find('li') } li property gives error cannot call method 'find' of undefined how can fixed? it doesn't matter selector is, can't access property of object declaring, while declaring it. why ul declared? you're making property ul on opts object. ugly: what might want is: var opts = { ul: $(this).find('.carousel') } opts.li = opts.ul.find('li'); but if don't need references both groups then: cleaner: var opts = { li: $(this).find('.carousel li') } is good. cleanest: you do: var $carousel = $(this).find('.carousel'); var options = { carousel: $carousel, carouselitems: $carousel.find('li') } godawful, asked it: var carouseloptions = (function () { var options = function (carousel) { this.carousel = $(carousel);

ruby on rails - How to loop a json object's value using jquery ajax -

how loop through json data value contains html returned ajax call in jquery.example : want count number of li tags in below data specified class. i need count number of li tags have coded_false , itcoded_false together.also, should able count li tags individual counts .as in, count number of itcoded_true, coded_true,coded_false,itcoded_false. please me out . thanks! $.ajax({ url: root_path + "/test_descriptions/get_table_counts/" + id + '.json', type: "get", data: { dataset_id: dataset_id }, success: function (data) { data2 = data.coded_true } }); } below value of json data controller. {"coded_true":"<ul class='tp_info'></ul><ul class='tp_info'><li class='coded_true itcoded_false'>the sldodialogs.responseoptimization.optimizationsection.optimize\n method solves optimization problem using parallel pool if the\n use

c++ - error: 'zmq' has not been declared -

when building/compiling getting error: c:\ethe\main.cpp: in function 'int main()': c:\ethe\main.cpp:11:4: error: 'zmq' has not been declared c:\ethe\main.cpp:11:19: error: expected ';' before 'context' c:\ethe\main.cpp:12:4: error: 'zmq' has not been declared c:\ethe\main.cpp:12:18: error: expected ';' before 'socket' c:\ethe\main.cpp:14:4: error: 'zmq' has not been declared main.cpp: #include <zmq.h> #include <iostream> #include <string> int main() { std::string tip; std::cout << "enter target ip: "; std::cin >> tip; zmq::context_t context (1); zmq::socket_t socket (context, zmq_req); std::cout << "connecting " << tip << std::endl; zmq::socket.connect ("tcp://"+tip+":5555"); return 0; } anyone got ideas on how can fix this? you need add #include <zmq.hpp> include c++ api of libzmq.

mysql - How to validate a selected radio button in a quiz system using php -

i preparing quiz app using php , mysql. having problem validating radio button. when click on check button checks whether first option correct or not should check selected option in radio button correct or not. the code have used here: $singlesql = mysql_query("select * questions id='$question' limit 1"); while($row = mysql_fetch_array($singlesql)){ $id = $row['id']; $thisquestion = $row['question']; $type = $row['type']; $subject =$row['subject']; $exam =$row['exam']; $explan =$row['explan']; $question_id = $row['question_id']; $s ='<strong>'.$subject.'</strong>'; $e ='<small>'.$exam.'</small>'; $q = '<h2>'.$thisquestion.'</h2>'; $ex ='<div id="welcomediv" style="display:none;" class="expl" >'.$explan.'</div>'; $sql

c - Expected expression error on a temperature conversion table -

getting "expected expression error" on line 17 when following c programming book. complete noob here , not sure i'm doing wrong. int main() { float fahr, celsius; int lower, upper, step; lower = 0; /* lower limit of temperature table */ upper = 300; /* upper limit */ step = 20; /*step size */ fahr = lower; while (fahr <= upper ) { celsius = (5.0/9.0) * (fahr - 32.0); printf(“%3.0f %6.1f\n”, fahr, celsius); fahr = fahr + step; } return 0; } you need replace quotes “” in printf(“%3.0f %6.1f\n”, fahr, celsius); with standard double quotes "" printf("%3.0f %6.1f\n", fahr, celsius); as aside, should #include <stdio.h> @ top of file declaration of printf

java - How to write a SVN pre-commit hook script in Windows(Server-side) -

each change made , committed svn developer on team delivers requirement of app , requirement has id written in first line of commit message. i need hook catch id , call external service verify if id status ok. have read lot svn structure , hooks don´t understand how write hook in java. a hook is executable program placed in specific place accepts specific arguments. language in doesn't matter. in case if you're trying write in java , run on windows need write .bat file , install under hooks directory proper name. you'll need pass through arguments batch file receives java program. the reason you'll need batch file here because windows can't start java program , need run java proper arguments. something should work: @echo off java -jar myjavahook.jar %* the %* copies arguments batch file , adds them java program. you may need different or additional arguments depending on java program. since you're writing pre-commit hook , ex

how to get ldap certificate bypass the mutual certification using Java -

i'm writing project ldap certificate remote server. works fine general mode when server not require mutual certification. when try server requires mutual certification, fails. here code: string serverspec = null; boolean enableanonsuites = false; boolean istracing = false; // try , parse command line arguments. try { serverspec = "ldap://10.47.16.60:389"; } catch (exception e) { trace(true,e.tostring()); usage(); return; } try { // create socketfactory given ldap // building ssl sockets mysocketfactory msf = new mysocketfactory(istracing, enableanonsuites); // set environment creating initial context hashtable env = new hashtable(11); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); // must use name of server found in certificate env.put(context.provider_ur

How to make your own properties, eg. "devise :authenticable" in ruby / rails -

i wondering how have various properties in models. eg: property < activerecord::base locatable, saleable ... would these mixins? or there way of implementing this? eg. way devise has: class user < activerecord::base # include default devise modules. others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable end great part open source stuff can take , find out. i've removed non-relevant lines (gems/devise-2.2.3/lib/devise/models.rb:83): def devise(*modules) devise_modules_hook! include devise::models::authenticatable selected_modules.each |m| mod = devise::models.const_get(m.to_s.classify) if mod.const_defined?("classmethods") class_mod = mod.const_get("classmethods") extend class_mod if class_mod.respond_to?

android - Strange distortion when trying out a Phonegap project in Genymotion emulator -

Image
when run phonegap 3.0 project in genymotion emulator, app appears strange distortion. following should display standard helloworld icon, : but when click on tilt-button twice, icon is displayed right. the distortion not happen when run app in standard avd emulator or directly on phone. does recognize this, , maybe has cause or solution? i'm wondering if there's wrong app, or not... update: when try other android image, nexus 1 - 4.1.1, app appear right. i encountered issue regular avd emulator. the 2 comments on question sorted out me, work too?: avd "use host gpu" cause black screen when testing apps @david brown turn android:hardwareaccelerated "false" in androidmanifest.xml solved problem, can't enjoy hardware accelerate features (i use android studio now, , genymotion, have same problem.) – hkinterview aug 26 @ 7:28 @hkinterview thanks! left use host gpu on , set android:hardwareaccelerated="false" i

php - How do I generate a phpdoc for slim framework routes / callbacks -

i'm struggling figure out how can structure code such phpdocumentor make use of code blocks. /** * -- book, either filtered id or full list. * * @param slimapplication $app application object instance. * @param integer $id id of book */ $callbackfunction = function($id) use ($app) { //some functionality here. }; $app->get('/books(/:id)', $callbackfunction ); i should continue use inline use statement can use $app . anyone have suggestions? phpdocumentor has no special syntax document anonymous function that. if want document closure itself, you'd need define first class function, , can document such. if knowing closure exists , details need known documentation reader, presumably it's important enough first class function? again, being closure, it's not available on code's api... need documented?

Batch file increment folder number -

i'm trying create batch file creates folders 1.2.0.1, 1.2.0.2,1.2.0.3, etc. fould code previous question , works needs: @echo off setlocal enabledelayedexpansion set "basename=new_folder" set "n=0" /f "delims=" %%f in ( '2^>nul dir /b /ad "%basename%*."^|findstr /xri "%basename%[0-9]*"' ) ( set "name=%%f" set "name=!name:*%basename%=!" if !name! gtr !n! set "n=!name!" ) set /a n+=1 md "%basename%%n%" so way attempted have 2 variables, 1 holds first 3 digits 2.4.0 , other holds forth one. set version=1.2.0 cd c:\users\build set "lastfolder=0" /f "delims=" %%f in ( '2^>nul dir /b /ad "%version%*."^|findstr /xri "%version%[0-9]*"' ) ( set "name=%%f" set "name=!name:*%version%=!" if !name! gtr !lastfolder! set "lastfolder=!name!" ) set /a nextfolder=lastfolder+1 md "%version%.%n

SERVICE_NOT_AVAILABLE some devices on Android GCM -

i made app using gcm notifications. used tutorial , code pretty identical http://developer.android.com/google/gcm/client.html i'm testing on physical devices , on of devices getting service_not_available error when try register device gcm. i have exponential backoff setup retry on time. it works on half of test devices others service_not_available error. looked on , haven't found solution yet. any appreciated. thank you! service_not_available might mean device can't read response or there 500/503 server. have exponential back-off server side shouldn't problem suppose. see if have "com.google.android.c2dm.intent.registration" gcmbroadcastreceiver in manifest , handling that. check out : gcm service_not_available on android 2.2 detailed solution, if haven't already. comment if works.

Android library project returns incorrect resources -

i'm having trouble resources in android library project. library project consists of it's source compiled in .class files in jars , resources in res folder. classes compiled --non-constant-id aapt option. in library project have: res/drawable/image1.png res/drawable/image3.png in project dependent on library project have: res/drawable/image2.png eclipse creates r.txt , r.java each project. in total there's 2 r.txt's , 2 r.java's. in library project's r.java, resource ids such: image1=0x7f02007c; image3=0x7f02007d; a library project means r.java file merged dependent project's r.java yielding final r.java looks like: image1=0x7f02007c; image2=0x7f02007d; image3=0x7f02007e; as expected, inclusion of image2 shifted memory locations down 1 in final r.java. the problem : when reference resource, r.drawable.image3 , jars in library project, resolves id in non-merged r.java. example: r.drawable.image3 = 0x7f02007d . 0x7f02007d points i

Java: Incompatible Types (int/boolean) -

import java.io.*; public class adamhmwk4 { public static void main(string [] args) throws ioexception { bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); int counter1; int counter2; int counter3; string answer = ""; system.out.println("welcome adam's skip-counting program!"); system.out.println("please input number skip count by."); counter1 = integer.parseint(br.readline()); system.out.println("please input number start at."); counter2 = integer.parseint(br.readline()); system.out.println("please input number stop at."); counter3 = integer.parseint(br.readline()); system.out.println("this skip counting by" + counter1 + ", starting at" + counter2 + "and ending at" + counter3 +":"); while (counter2 = counter3) { counter2 = counter2 +

ios - Ignore UIButton's touch event in a long task time -

i want ignore touch events of button while long task running. - (void)buttonaction{ nslog(@"click!"); button.enabled = no; [self longtask]; } - (void)longtask{ nslog(@"task begin!"); sleep(5); nslog(@"task finished!"); button.enabled = yes; } during longtask time, click button again, nothing happens. but, when longtask finished, automatically respond click events , execute longtask again! how many times clicked when button's enabled value 'no', longtask perform how many times. 2013-08-20 09:24:49.478 appname[2518:c07] click! 2013-08-20 09:24:49.479 appname[2518:c07] task begin! 2013-08-20 09:24:54.481 appname[2518:c07] task finished! 2013-08-20 09:24:54.482 appname[2518:c07] click! 2013-08-20 09:24:54.482 appname[2518:c07] task begin! 2013-08-20 09:24:59.484 appname[2518:c07] task finished! i tried set userinteractionenabled=no got same result. how can make ignores touch events when long task running

java - setBackground and getBackground method for Build.version < 16 -

i have problem getbackground() , setbackground() method. have designed application, found out didn't check version user android system (i beginner android - lesson). my aplication working on build.version > 15, because methods mentioned above introduced in version. i use similar method existed before version 16. ideas? the getbackground() method has been around since api level 1, shouldn't problem. setbackground(drawable background) introduced starting api level 16 , may cause problems on older platforms. your alternatives are: setbackgroundcolor(int color) setbackgrounddrawable(drawable background) setbackgroundresource(int resid) of these methods, second 1 has been deprecated since api level 16, replaced setbackground(drawable background) you're using. however, if @ actual implementation method, you'll see following: public void setbackground(drawable background) { //noinspection deprecation setbackgrounddrawable(background

When I use C# callback function in VBA it shows "entry point not found " -

i want use c# callback function in vba. when call c# function shows "entry point not found " how can fix it? thanks ps:i checked make assembly com-visible , register com inter environment:ms office excel 2007, ms visual studio 2008 vba code: declare function result lib"c:\users\admin\desktop\myprog\new_dll_test\new_dll_test\bin\debug\new_dll_test.dll" alias "msg" (byval p long) integer function disp() msgbox x end function sub addresult(byval p long) dim x long x = result(p) debug.print x end sub sub testnow_click() call addresult(addressof disp) end sub c# code: using system; using system.collections.generic; using system.linq; using system.text; using system.runtime.interopservices; namespace new_dll_test { [guid("f1286974-0f1a-466c-8389-dd1ab7e3eed2"), interfacetype(cominterfacetype.interfaceisdual)] interface msginterface { int msg; } public unsafe class msgprocess {

Converting regex from ruby to PHP -

i have been trying convert regular expression ruby php, have had little luck. this ruby regular expression: quoted_literal = /"[^"\\]*(?:\\.[^"\\]*)*"/ unquoted_literal = /[^\s=,][^\s=,\\]*(?:\\.[^\s=,\\]*|=[^,>])*/ literal = /(#{quoted_literal}|#{unquoted_literal})/ pair = /#{literal}\s*=>\s*#{literal}/ and go in php: const pair = '/("[^"\\]*(?:\\.[^"\\]*)*"|[^\s=,][^\s=,\\]*(?:\\.[^\s=,\\]*|=[^,>])*)\s*=>\s*("[^"\\]*(?:\\.[^"\\]*)*"|[^\s=,][^\s=,\\]*(?:\\.[^\s=,\\]*|=[^,>])*)/'; however when run $result = preg_match_all(self::pair, $input, $matches); i error: preg_match_all(): compilation failed: unmatched parentheses @ offset 62 however when run through, http://www.phpliveregex.com/ test data: "foo" => "bar", "foo" => bar, foo => "bar" it seems work fine. not sure whats going on. the problem lies backslashes. i

Ruby program to retrieve OpenStreetMap data using OSM API -

how can retrieve data openstreetmap (osm) using osm api ( http://wiki.openstreetmap.org/wiki/api ) , ruby? there ruby gem available serves purpose? have been searching solution purpose nothing served me need. example : given country name input, need list of streets of country etc. kind of link/code sample or starting point fine. can explore more find out need exactly. thanks! as question posed off topic stack overflow, answer question of "how find can use" rather give kind of recommendation on tool itself. i not familiar gems openstreetmap. so command terminal: gem list --remote | grep street and terminal answers me this: openstreetmap (0.2.1) and pull trusty browser, , open ruby-toolbox.org , search openstreetmap. this produces page shows 30 results. in there, see mentioned gem, see rosemary seems promising, "openstreetmap api client ruby" , last updated 4 months ago. so, helps in future searches. have lot of tools available started

PyDev Interactive Python Shell in Eclipse -

Image
i've been using wing ide python programming , trying switch eclipse, pydev. when run code in wing ide, after finishing execution console goes right interactive shell , can continue on testing, don't know how in eclipse. i'm not sure if describing problem i'll use example: let's had simple source code looked (e.g. test.py): print("hello") when run in wing ide clicking green arrow, console after execution: python 2.7.5 (default, may 15 2013, 22:43:36) [msc v.1500 32 bit (intel)] type "help", "copyright", "credits" or "license" more information. [evaluate untitled-1.py] hello >>>> and can keep doing whatever on shell , know code (defined functions etc.). when same thing in eclipse, console this: hello and have click "remove terminated launches" button go shell. can done in eclipse? what want use interactive console in pydev (not regular output when run). to use do:

How to apply unit test on DAOs in java -

i don't know how apply unit tests on data access layer. wonder if data access layer should tested. in company, have stable database store unit test data , test data access layer running data access objects , check data stable database. in order pass unit tests, data in stable database can not modified anymore. think there better solution this. if not mistaken, the mock object cannot perform tests on sql statements , resultset mappings. what best way unit test dao? there better way tdd? first, definitions, "unit" tests not depend on external systems database. want create called "functional" or "integration" tests. in practice these types of tests implemented in same way unit tests, using junit, should separate them unit tests, should run fast , not break when database down or data has changed. second, try keep of business logic out of daos , instead put service pojo layer can test biz logic without involving database. next, ideal

iphone - Background location service tracking not stopping when i "OFF" the UISwitch -

am using uiswitch turn "on" , "off" the location services. when switch "on" uiswitch location services start to track teh location. can come out app , location services running good. problem when switch "off" tracking , move view controller location tracking still in "on" state , not stopping tracking. below code. -(void)locationmanager:(cllocationmanager *)manager didupdatelocations:(nsarray *)locations{ cllocation* location = [locations lastobject]; latdeg = location.coordinate.latitude; longdeg = location.coordinate.longitude; } -(ibaction)starttracking:(id)sender{ if(starttrackingbutton.on){ [locationmanager startupdatinglocation]; [[nsuserdefaults standarduserdefaults] setbool:starttrackingbutton.on forkey:@"switchvalue"]; [[nsuserdefaults standarduserdefaults] synchronize]; } else{ [[nsuserdefaults standarduserdefaults] setbool:starttrackingbutton.on forkey:@"switchvalue"]; [[nsuserde

Is it ok to run multiple PHP cURL scripts via windows command line? -

lets 5 different curl scripts each running on different cmd window @ same time on same machine. ok? act same running different tabs on browser? i add of scripts have php simple html dom parser in them. change anything? all thoughts on appreciated. yes, can that. code perspective, same having 5 different users load site @ once. same server perspective. in fact, pretty simplistic way test simulated load on page , see how handles it. not best way far, quick , dirty. just careful when generating these 5 scripts don't end in runaway situation 5 have not finished , exited before run more. overload own server/site if end dozens or hundreds of scripts running. also aware if you're doing heavy processing in scripts, may hit php/mysql/apache timeouts, keep eye on that. make sure these calls thoroughly protected public too, or else send thousands of calls it, crashing site. if need heavy processing it's best command line php script triggered cron job. give

jquery - datatables column width issue -

i have many listing page , 1 js file configuring datatables set up. sending value of aocolumns each listing page common js file datatables logic written. have written function in 1 of listing page like: public function assignedtomehidesort() { return array( "{bsortable: false}", "null", "null", "{bsortable: false}", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "null", "{\"bsortable\": false}" ); } $aocolumn = assignedtomehidesort(); echo '<input type="hidden" name="aocolumn" id="aocolumn" value="' . implode(",", $aocolumn) . '">'; then in common js file have written like: if ($('#aocolumn').val()) { var ao

perl - Using GOST with Crypt::CBC -

i want use gost encryption algorithm in perl. tried using rc4 , blowfish , ok, i'd rather use gost , elijah aren't supported crypt::cbc. how can use crypt::cbc interface encryption , decryption gost? you can pass cipher-object when create crypt::cbc -object. install crypt::gost cpan , use there. this works here: #!/usr/bin/perl use strict; use warnings; use crypt::cbc; $cipher = crypt::cbc->new(-key => 'test', -cipher => 'gost');

asp.net - How to add Header and Subheader in Gridview -

Image
could explain how add header , subheader in gridview shown in below picture!! hi can this <%@ page language="c#" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" %> <!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 runat="server"> <title>untitled page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:gridview id="grvmergeheader" runat="server" backcolor="lightgoldenrodyellow" bordercolor="tan" borderwidth="5px" cellpadding="3" forecolor="black" gridlines="none"

iphone - FBLoginView calling delegate multiple times to Fetch User Info -

i using facebook on many views inside app. have fbloginview instantiated in appdelegate. subview in view-one , load info in view-one. in dealloc remove superview. when move view2 subview there wel. when using sdk on every subview delegates getting called , fetching userinfo display in view2. updated sdk3.7 , delegates not getting called on subview unless button getted clicked logout , re-login again. i want know how userinfo via fbloginview multiple times, without logout , re-login again.

spring - RestTemplate + Jackson -

i want use spring's resttemplate plus jackson consume webservice. have followed several tutorials , have come point of creating daos. method of domain objects: // create rest template resttemplate resttemplate = new resttemplate(); // create list message converters list<httpmessageconverter<?>> messageconverters = new arraylist<httpmessageconverter<?>>(); // add jackson message converter messageconverters.add(new mappingjacksonhttpmessageconverter()); // add message converters resttemplate resttemplate.setmessageconverters(messageconverters); list<station> resultlist = arrays.aslist(resttemplate.getforobject(base_url, station[].class)); return resultlist; but web service not return array of station objects right away, rather more semantic expression in way: {"success":true,"message":"records retrieved successfully","data":{"totalcount":"14","stations":[{"id"

Modify a pictogram element in Eclipse RCP Graphiti -

i tried solution provided here: automatic update of graphiti diagrams in case of changes in datamodel i trying call upadate feature in updateneeded function of class implements abstractupdatefeature: transactionaleditingdomain domain = transactionutils.geteditingdomain(diagram); domain.getcommandstack().execute(new recordingcommand(domain) { public void doexecute() { updatecontext updatecontext = new updatecontext(getdiagram().getchildren().get(0). getgraphicsalgorithm().getpictogramelement( )); iupdatefeature updatefeature = getfeatureprovider().getupdatefeature(updatecontext); updatefeature.update(updatecontext); }}); in update function trying change value of text field of pictogram element: // set name in pictogram model if (pictogramelement instanceof containershape) { containershape cs = (containe

SoundCloud Widget API setVolume Method broken? -

i'm using soundcloud's widget api, except setvolume() method broken :( first, love widget, i'm blown away after amazing work there no volume control available! people "back button" out of site when hear 100% audio , can't alter using setvolume()... have working or pull :( here happening, have instance named "widget" (which loads , plays on page). widget.bind(sc.widget.events.ready, function() { $('#audioindictments').removeclass('remove'); // disables css rule, making soundcloud iframe visible widget.setvolume(10); // should set volume 10% doesn't :( widget.getvolume(function(vol){ console.log(vol); // outputs 0.1 in console :/ console.log(widget); // outputs object in console , don't see out of whack :| }); widget.play(); // fires widget , audio begins playing :) widget.setvolume(10); // see if makes difference, after play() method, ran setvolume again after play() me

python - Django-CMS: Multiple domains on same project -

i'm trying run django-cms on 2 different domains. created 2 domains (django.contrib.sites) , added them django-cms pages. created sitedetectionmiddleware: class sitedetectionmiddleware: def process_request(self, request): settings.site_id = 1 host = request.meta.get('http_host') if host: try: site = site.objects.get(domain=host) settings.site_id = site.id except site.doesnotexist: pass it seems work correctly, when call website in browser first time after restarting apache. changed other site , got noreversematch error. does have idea wrong? i thought should work out of box in django-cms? regards colin why setting site_id statically? should create 2 settings files , use form of inheritance depending on project differentiation, e.g.: local_settings.py (not under version control holds sensitive data database passwords , secret key) secret_key = 'as!sfhagfsa@$1ajfs78787124!897zr81' setting

extjs - Sencha bug tracker url -

can give me sencha bug tracker url. have check 1 bug's status. facing issue found in sencha blog , found added in bug tracker. there no bug tracker. it's internal sencha. can track bugs in bug forum if has been reported. http://www.sencha.com/forum/forumdisplay.php?80-ext-bugs

wso2esb - WSO2 BAM 2.3.0 throws exception during startup after installing SSL certificate -

wso2 bam 2.3.0 not able start agent server running on port 7711. happens when remove default wso2carbon ssl certificate , install public ca certificate. hence, wso2 esb not able interact bam when create bam profile under wso2 esb management console. can me resolve issue. bellow added complete stacktrace. [2013-08-20 07:20:16,802] error {org.wso2.carbon.databridge.receiver.thrift.internal.thriftdatareceiverds} - can not create , start agent server org.wso2.carbon.databridge.core.exception.databridgeexception: cannot start agent server on port 7713 @ org.wso2.carbon.databridge.receiver.thrift.internal.thriftdatareceiver.startsecureeventtransmission(thriftdatareceiver.java:129) @ org.wso2.carbon.databridge.receiver.thrift.internal.thriftdatareceiver.start(thriftdatareceiver.java:101) @ org.wso2.carbon.databridge.receiver.thrift.internal.thriftdatareceiverds.activate(thriftdatareceiverds.java:94) @ sun.reflect.nativemethodaccessorimpl.invoke0(nati

regex - issue with regular expression in java -

i have string in format of xml <?xml version="1.0" encoding="utf-8"?>n <objecta>n <command>existing</command>n <status>ok</status>n <values>a lot of values....</values>n </objecta> i want split array of string value , content [0] objecta = "" [1] command = existing [2] status = ok [3] values = lot of values.... i tried result = result.replaceall(">n<", "><"); //$non-nls-1$ //$non-nls-2$ pattern pattern = pattern.compile("<*?>*?</*?>"); //$non-nls-1$ but is not working me why not use xml parser? element docelem = document.getdocumentelement(); nodelist children = docelem.getchildnodes(); list<string> values = new arraylist<string>(); for(int x = 0; x < children.getlength(); x++) { // want children. came out wrong. }

html - Bootstrap Stylesheet Organization -

i'm utilizing twitter bootstrap framework create personal website. i've found, however, site looks better slight tweaks of css classes; matter (not in terms of functionality, convention) whether make these changes within provided bootstrap.css file or should move them separate file containing solely changes? from maintenance point of view, should put custom tweaks in separated css file, (for example) if you'll upgrade/downgrade bootstrap version changes still in-tact. you should consider, when dealing css frameworks, you'll have dev/debug version , production/minified version. if change library code you'll have take care of formats (unless you're performing minification/bundling yourself).

mysql - SELECT inside SELECT statement returns 0 count -

i have calendar there list of events in every day , use query count events in particular date. in database have start_time , end_time field user have schedule of materials specific. tried select events in day seems there's wrong in query. because user can borrow more 1 material stored in database same start_time , end_time well. want count data of user same start_time , tried group by seems doesn't work either. here database: ----table: schedule---- id | materialid | borrowerid | date_reserve | start_time | end_time| ----------------------------------------------------------------------------------- 9 | 7 | bobi | 2013-08-16 | 07:01:12 | 07:01:12| 10 | 10 | bobi | 2013-08-16 | 07:01:12 | 07:01:12| 11 | 12 | bobi | 2013-08-16 | 07:01:12 | 07:01:12| 12 | 7 | sobi | 2013-08-18 | 07:01:12 | 07:01:12| -------------------