Posts

Showing posts from 2011

How to set 1d array to 2d array element in C -

i need this: char font[128][8] = {{0}}; font[0][] = {0, 0b00000000, 0b11111100, 0b00010010, 0b00010010, 0b11111100, 0b00000000, 0}; font[1][] = {...} but in c99 "expected expression before '{' token". please help. you can use initialiser list ( {...} ) when declaring array, that's why you're getting error. can't assign value array, font[0] (a char[] ). you have 3 options: char font[128][8] = { {0, 0b00000000, 0b11111100, 0b00010010, 0b00010010, 0b11111100, 0b00000000, 0}; {...} } assign each value element in array individually: font[0][0] = x , ..., font[127][7] = y (ie. using loop). memcpy blocks @ time uint64_t ( sizeof(font[0]) = 8 ) or wherever else can neatly/efficiently store data. it's worth noting binary constants c extension, and char signed , if you're working unsigned data should explicitly use unsigned char .

java - Spring servlet configuration file throws exception -

i following exception: build path incomplete. cannot find class file com/hexgen/core/ihexgendictionarybased this line above exception: <context:component-scan base-package="com.hexgen.api.facade" /> this complete xml file: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:sec="http://www.springframework.org/schema/security" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframe...

jquery - Hide textarea if user clicks outside it, but keep it visible on mouse leave outside it after selecting the text -

i have textarea should hidden if user clicks outside it, , remains visible if clicks inside textarea. the problem when user selects text of textarea , leaves mouse outside it, textarea gets hidden , cannot copy text anymore. how can fix this? live jsfiddle html: <span>show textarea</span> <div> <textarea>text in textarea</textarea> </div> jquery: $("span").on("click", function () { $("textarea").show(); }); $(document).mouseup(function (e) { var container = $("div"); if (container.has(e.target).length === 0) { $("textarea").hide(); } }); css: textarea { position:absolute; right:10px; bottom:10px; display:none; } just use mousedown() event instead fiddle

objective c - Check which camera is currently in use in iOS Application -

i'm writing app has custom made view taking photos camera, similar apple's avcam. in it, want make button disappear , re-appear flash icon every time camera switched. ie when using front camera, flash button shouldn't there , when using should! my code @ moment is: avcapturedeviceposition position = [[videoinput device] position]; if (position == avcapturedevicepositionback) { self.flashbutton.hidden == yes; } but comes error on videoinput , i'm not sure why... documentation direct me or ideas changes in code appreciated! edit just why come error of 'use of undeclared identifier' code: avcapturedeviceposition position = [[videoinput device] position]; the below code might : avcapturedeviceinput *newvideoinput; avcapturedeviceposition currentcameraposition = [[videoinput device] position]; if (currentcameraposition == avcapturedevicepositionback) { currentcameraposition = avcapturedevicepositionfront; } else { currentc...

javascript - Is path animation possible with SVG.js -

there many examples of svg path animation, both natively http://jsfiddle.net/fvqdq/ and raphael.js http://jsfiddle.net/d7d3z/1/ p.animate({path:"m140 100 l190 60"}, 2000, function() { r.animate({path:"m190 60 l 210 90"}, 2000); }); how possible svg.js library ? no, not yet possible svg.js . have been looking , rather large implementation. try keep library small never part of library itself, might write plugin. although @ moment not have time on hands appreciated.

how to get only the specific content from a file using PHP. -

how specific content file using php. i have file content: reference 1.pdb mobile 4r_1.pdb ignore fit mobile 4r_10.pdb ignore fit mobile 4r_22220.pdb ignore fit now, want take names i.e. (output) 4r_1 4r_10 4r_22220 in array , print it. the program have written in php doesn't work properly, can have look $data = file_get_contents('file.txt'); // read file $convert = explode("\n", $data); // take in array $output4 = preg_grep("/mobile/i",$convert); //take line starts mobile , put in array if ($output4 !="/mobile/i") { print $output4; print "\n"; } please help! extract names try this: $convert = explode("\n", $data); // take in array $filenames = array(); foreach ($convert $item) { if(strstr($item,'mobile')) { array_push($filenames,preg_replace('/mobile[\s]?([a-za-z0-9_]*).pdb/','${1}',$item)); } } now file names (assuming file names) in array $filenam...

How to specify the position in txt file to delete record in C programming -

void deleterecord() { file *fp, *fdel; struct person obj; char number[20]; printf("\n============================"); printf("\n delete"); printf("\n============================\n\n"); fflush(stdin); printf("enter student number delete :"); scanf("%s", number); fp=fopen("d:\\data.txt","r"); fdel=fopen("d:\\del.txt","w"); while(fscanf(fp,"\n%s\n%s %s\n%s\n%s\n%s\n%s\n%s\n%s\n", obj.stdnumb, obj.firstname, obj.lastname, obj.icpass, obj.nationality, obj.gender, obj.dateofbirth, obj.contact, obj.address)==1) if(stricmp(number, obj.stdnumb)!=0) fprintf(fdel, "\n%s\n%s %s\n%s\n%s\n%s\n%s\n%s\n%s\n", obj.stdnumb, obj.firstname, obj.lastname, obj.icpass, obj.nationality, obj.gender, obj.dateofbirth, obj.contact, obj.address); fclose(fp); fclose(fdel); remove("d:\\data...

css - What is minimal XHTML? -

i have question, need write code table minimal xhtml , css. i'm not quite sure minimal xhtml guess it's showing initial xml code without doc type etc. that's site says. but examples of minimal xhtml contain strict, transitional , frameset document types confusing me because wouldn't make normal xml page then? minimal xhtml @ least required w3c recomendations, included in such type of document. can find details here w3c i quote relevant of it... the root element of document must html. root element of document must contain xmlns declaration xhtml namespace [xmlns]. namespace xhtml defined be http://www.w3.org/1999/xhtml . example root element might like: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> there must doctype declaration in document prior root element. public identifier included in doctype declaration must reference 1 of 3 dtds found in dtds using respective formal ...

xml - How to customise a Mybatis generator file for multiple users? -

is possible create mybatis generator file handles differences in project path many users when file shared in team? example <sqlmapgenerator targetpackage="com.x.y.mybatis.mapper" targetproject="mydir/src/java"> so "mydir" varies between users. in fact working on windows, , on linux, path format can differ. there several project path elements sprinkled throughout generator file. seems need way of referencing environment variables or system properties within xml, i'm not aware of way of doing mybatis. got it. in generator file, add following - <generatorconfiguration> <properties resource="mybatisgenprops.properties"></properties> and in mybatisgenprops.properties file add this project=myprojdir then can reference property - <sqlmapgenerator targetpackage="com.x.y.mybatis.mapper" targetproject="${project}/src/java">

How to set django formsets _all_ error from view? -

description : okay, formset set of forms. have number, or form number , compare summed number forms formset. that's why part of validation in view. , if numbers don't match want set error , not specific form in formset, formsets all errors. i have no problem setting ordinary forms error view : form.errors['__all__'] = form.error_class(["here error"]) but how assign all error formset, , possible, or have assign error forms within formset ? formsets have errors attribute works identically form.errors . however, sounds you're trying validation in view. should add custom validation formset using clean method, , raise forms.validationerror when user input invalid. see django formset documentation .

Visual C++ ~ Not inlining simple const function pointer calls -

dear stackoverflowers, i got simple piece of code compiling on microsoft visual studio c++ 2012: int add(int x, int y) { return x + y; } typedef int (*func_t)(int, int); class { public: const static func_t fp; }; const func_t a::fp = &add; int main() { int x = 3; int y = 2; int z = a::fp(x, y); return 0; } the compiler generates following code: int main() { 000000013fba2430 sub rsp,28h int x = 3; int y = 2; int z = a::fp(x, y); 000000013fba2434 mov edx,2 000000013fba2439 lea ecx,[rdx+1] 000000013fba243c call qword ptr [a::fp (013fba45c0h)] return 0; 000000013fba2442 xor eax,eax } i compiled on 'full optimisation' (/obx flag) , 'any suitable' inline function expansion. (/ob2 flag) i wondering why compiler doesn't inline call expecially since it's const. of have idea why not inlined , if it's possible make compiler inline it? christian edit: running tests , msvc fails i...

Rails: Photo uploads (Paperclip) with nesting & strong params -

background: i'm trying add photo uploads advert model using strong params paperclip gem, photo separate model "has_attached_file" :upload, , calling forms_for (actually semantic_forms_for i'm using formtastic) in ads#new view upload image photo instance. params looks ok think i've missed in controller. haven't been able working despite multiple iterations of controller code. need differently working? would appreciate tips or pointers! thank you -- ad model: class ad < activerecord::base belongs_to :user ##edited out irrelevant associations has_many :photos, dependent: :destroy accepts_nested_attributes_for :photos, :allow_destroy => true default_scope { order("created_at desc") } #validates_presence_of :user_id, :make, :model, :km, :year, :location end -- photo model: class photo < activerecord::base belongs_to :ad has_attached_file :upload, :styles => { :main => "600x500>"...

Remove parent array -

i have array generate dynamically. delete de 'wrapper' array. how can it? array ( [0] => array ( [taxonomy] => city [terms] => array ( [0] => boston ) [field] => slug [operator] => not in ) [1] => array ( [taxonomy] => city [terms] => array ( [0] => chicago ) [field] => slug [operator] => not in ) ) how can remove parent array have structure:? [0] => array ( [taxonomy] => city [terms] => array ( [0] => boston ) [field] => slug [operator] => not in ) [1] => array ( [taxonomy] => city ...

Sencha Touch DataView and highlighting a row when selected -

i have dataview list inside container displaying items correctly inside view. however, whenever click on item isn't getting highlighted. i've added view containing dataview list: onitemtap: function (container, target, index, e) { var me = this; me.callparent(arguments); // warning: without call, row not become selected } i've read item won't selected if don't have above. can see event being fired ok too. if debug through sencha touch source code, can see css class x-item-selected being added div wrapping list item, there no highlighting of row. works fine on normal lists missing? updated css seems work. .x-dataview .x-data-item.x-item-selected { border-top-color: #006bb6; background-image: -webkit-linear-gradient(top, #0398ff, #007ad0 3%, #005c9d); color: white; } by default sencha touch dataview doesn't provide highlighting. add background or .x-item-pressed or .x-item-selected class , desired effec...

java - getSystemService started by new TimerTask within a service -

hello community, i'm beginner in programming. tried code snippets out , worked fine. them have problems. what have: android galaxy s handy indigo service release 2 what do: every 2 minutes, handy shall location , send information mysql-database via http. said above, each step works fine putting them problem me. what have done: have created startup screen 2 buttons start , stop service. when close app started service shall continue sending data: package ars.samsung.de; import ars.samsung.de.myservice; import ars.samsung.de.r; import android.os.bundle; import android.app.activity; import android.content.intent; import android.util.log; import android.view.menu; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; public class samsungloc1 extends activity implements onclicklistener { private static final string tag = "servicesdemo"; button buttonstart, buttonstop; @override protected void...

ios - How to Pass NSArray Parameter to Completion Block -

i want pass nsarray parameter , completion block method ,as new concept, can not understand how it.currently passing 1 array, want pass second nsarray , in second array want pass array value can use on there typedef void(^completion)(nsarray *list); -(void) getmoredata:(completion) completion calling method [magento.service getmoredata:^(nsarray *list ) { if(list){ } in above method want pass nsarray , method in different class , calling different . array using in method . you can call c function, example, have declared new class myclass . content of interface file is: typedef void(^completion)(nsarray *list); @interface myclass : nsobject - (void)getmoredata:(completion)completionblock; @end and in implementation - (void)getmoredata:(completion)completionblock { // fullfil array nsarray *array = @[@1, @2, @3]; // call completion block completionblock(array); } and using follow: myclass *myclassinstance = [...

c++ - How to enhance this variable-dumping debug macro to be variadic? -

Image
first working code: #include <iostream> // note: requires compiler has __pretty_function__, gcc or clang #define dump(v) std::cerr << __pretty_function__ << ':' << __line__ << ':' << #v << "='" << (v) << "'\n" int main(int argc) { dump(argc); dump(argc+1); return 0; } which gives stderr output (gcc): int main(int):8:argc='1' int main(int):9:argc+1='2' now i'd have variadic macro number of arguments, example dump(argc, argc+1); work, output like: int main(int):8:argc='1',argc+1='2' but not yet come nice solution. possible macro? if not, how templates, or combination of macros , templates? c++11 , boost ok if needed, , solution can gcc -specific if there's no standard way. looking actual code, makes variadic dump work described above, or @ least show equivalent info. ok. not nice . works, prespecified num...

javascript - Multiple Markers on Google maps -

this question has answer here: google maps js api v3 - simple multiple marker example 11 answers i using following: var samplemarker = new google.maps.marker({ position: new google.maps.latlng(51.379, -113.53), map: map, title: "hello world!" }); to add marker map, how use same iterate on array of latlngs? wish add multiple markers. you can wrap in function , call in loop : function createmarker(latitude, longitude, mytitle){ new google.maps.marker({ position: new google.maps.latlng(latitude, longitude), map: map, title: mytitle }); } have fun.

What & how to version control for text editor (Sublime Text) settings on Github, so that settings are readily available for coding on any machine? -

i lost sublime settings last night . know people store text editor settings vim and/or sublime on github. assume allows quick clone on machine - making machine readily available settings, key bindings, packages etc. how store text editor (sublime text 2) settings on github, can reuse settings on machine? what files/folders need put on git? what procedure of "packaging" these settings on new machine? the easiest way set packages/ directory base repository, settings (except license), package control plugins, themes, etc. in subfolders. have license in gmail can wherever. as warning, make sure don't have sensitive information in of settings, server passwords , like, unless you've paid private github repository @ can see settings.

quickbooks - Set up Sync Manager - Option is missing -

trying test connection on quickbooks api, running strange issue. when testing new created app space, need to: go quickbooks. open company file. choose file > set intuit sync manager. sign in intuit account if haven't done so. come after intuit sync manager done syncing my quickbooks not have : set sync manager : option. scouring quicbooks support docs , quickbooks telephone support, have tried following: re-orderd "lists" in quickbooks, , repaired company file.. no go... made sure company accessed admin account. tried creating fresh company, on local machine, , directly after that, looking option.. no go (did exit , restart quickbooks) verified syncmanager app installed (resides) on pc... c:\program files\common files\intuit\sync\intuitsyncmanager.exe can run sync manager, , appears in taskbar, tells me has no company files sync. obviously, needs configured quickbooks, not have option. platform: windows 7, windows 8, terminal services 2003 (all have op...

durandal - jQuery ui triggers resize event but does't change the div's width -

i have following view: <aside id="key-panel" class="ui-widget-content"> <h3 class="ui-widget-header">resizable</h3> </aside> i'm injecting above view main html file using durandal.js. when view attached, execute following code: $('#key-panel') .resizable({ handles: 'w', animate: true, start: function (e, ui) { }, resize: function (e, ui) { console.log('resizing'); }, stop: function (e, ui) { } }) when trying resize container can see mouse cursor being changed, resize event being fired; however, actual container doesn't change size. below html created durandal , jquery ui <div class="durandal-wrapper" data-view="views/keypanel" data-active-view="true"> <aside id="key...

php - APK download doesn't work on stock Android browser -

i have page button redirects php script starts apk download, ($androidpackage file name , $package contains absolute path): header('content-description: file transfer'); header('content-type: application/vnd.android.package-archive'); header('content-disposition: attachment; filename=' . $androidpackage); header('content-transfer-encoding: binary'); header('expires: 0'); header('cache-control: must-revalidate'); header('pragma: public'); header('content-length: ' . filesize($package)); ob_clean(); flush(); readfile($package); exit; this approach works on chrome several android devices, of major desktop browsers, , on stock browser on android devices. however, on phone (htc rezound) , galaxy tab 2, on stock browser, download not work on short press of button - doesn't start, though works on chrome on devices. long press on button, followed selection of 'open' contex...

java - libgdx & kryonet: threads -

i try develop game android platform, using libgdx library. network, use kryonet library. i want change screen when i'm sure application connected server. network part seems work have problem threads: it's kryonet's thread execute opengl, not libgdx thread: public class mygdxgame extends game { public static int udp_port = 55555, tcp_port = 55556; private client client; @override public void create() { /* * client connection * etc ... */ client.addlistener(new listener() { private int nb = 0; @override public void received(connection connection, object data) { super.received(connection, data); nb++; if (nb == 5) { mygdxgame.this.setsecondscreen(); } } }); setscreen(new first(this, client)); } protected void setsecondscreen() { setscreen(new se...

wordpress - Translation Problems with plugin View Own Post Media Only -

there problems translations this plugin over posts , meda list page, there not translated links: | published | trash | draft | pending i searched in source code, found cause have little problems finding solution. file: class-view-own-posts-media-only.php the incriminated code in various places... code (line 201): if ($type['status'] == null): $class = (empty($wp_query->query_vars['post_status']) || $wp_query->query_vars['post_status'] == null) ? ' class="current"' : ''; $views['all'] = sprintf(__('<a href="%s"' . $class . '>all <span class="count">(%d)</span></a>', 'all'), admin_url('edit.php?post_type=post'), $result->found_posts); elseif ($type['status'] == 'publish'): $class = (!empty($wp_query->query_vars['post_status']) && $wp_query->query_vars['post_status'] == 'pu...

c++ - trouble with Open Cv and GPIO on mini6410 -

i doing simple project on arm based mini6410. have debian package installed on mini. project interface 1 ir motion sensor , usb webcam mini6410. working simple, whenever there motion detected ir sensor, webcam on 30 seconds save images (over write previous) , off. have cross comiled open cv code using arm-linux-gcc for ir using gpe register. here stuck issue unable resolve. , dont know how resolve. opencv code cpp file camera.cpp , file deals i/o ports c file named sensor.c. in c file polling or whatever mechanism check if gpe register 1 or not. if one, should start open cv code start capture images. further more sensor.c file not compiled rather made module , insmod on mini6410. however dont know how write c++ code in c file. can dont know how call opencv thing c file. module , within cant write cpp code using namespace std , using namespace cv doesnot work. i new embedded stuff , linux self. wanted know there possible solutions. attaching codes of both files. this senso...

spring - Mongodb upsert throwing DuplicateKeyException -

i error [2] time time when attempting upsert (increment or insert) document using method [1]. [1] public ngram save(final ngram ngram) { criteria cr = where("_id").is(ngram.getngram()) .and("f3c").is(ngram.getf3c()) .and("tokcount").is(ngram.gettokcount()) .and("first").is(ngram.getfirst()) ; if( ngram.gettokcount() > 1 ) { cr.and("second").is(ngram.getsecond()); } if( ngram.gettokcount() > 2 ) { cr.and("third").is(ngram.getthird()); } final query qry = new query( cr ); final update updt = new update().inc("count", ngram.getcount()); template.upsert(qry, updt, ngram.class); return ngram; } [2] caused by: org.springframework.dao.duplicatekeyexception: e11000 duplicate key error index: sytrue.ngram.$_id_ dup key: { : "page two" }; nested exception com.mongodb.mongoexception$duplicatekey: e110...

c++ - Why does dereferencing nodes break my linked-list? -

so i'm trying implement run of mill linked list in c++ template<class t> class node { private: node *next; t item; public: node(t item) : item(item) { this->next = null; } node<t> add(t item) { this->next = new node(item); return *this->next; } bool hasnext() { return this->next == null; } node<t> getnext() { return *this->next; } t value() { return this->item; } }; void main() { node<int> node(3); node.add(3).add(4); cout << node.value(); cout << node.getnext().value(); cout << node.getnext().getnext().value(); cin.get(); } but can't work. in particular section: node.add(3).add(4); cout << node.value(); cout << node.getnext().value(); cout << node.getnext().getnext().value(); if change add , getnext functions return no...

php - Easy method of including a timestamp (mtime) style/js versioning? -

in kohana, there quick , easy way use html::style() helper automatically include unix timestamp mtime of file after css or js file name in case of script? in cakephp, use html/css helper , in configuration: configure::write('asset.timestamp', 'force'); this way when doing following: echo $this->html->css('styles'); it output: <link rel="stylesheet" type="text/css" href="/css/styles.css?1338350352" /> i use in every project: class html extends kohana_html { /** * given file, i.e. /css/base.css, replaces string containing * file's mtime, i.e. /css/base.1221534296.css. * * @param $file file loaded. must absolute path (i.e. * starting slash). */ public static function auto_version($file) { if (!file_exists($_server['document_root'] . '/' . $file)) return $file; $mtime = filemtime($_serv...

c# - Syntax to execute code block inside Linq query? -

here's code (obviously) doesn't compile: var q = x in myanonymoustypecollection select new { x.id, calcfield = { switch(x.somefield) { case 1: return math.sqrt(x.field1); case 2: return math.pow(x.field2, 2); default: return x.field3; } } }; you picture; i'm trying calculate calcfield in different way, depending on value of somefield is. can't use func<> (or can i?), because input type anonymous. what's right syntax work? first off, prefer method chain syntax on query syntax linq. can easily. var q = myanonymoustypecollection .select(x => { object calcfield; switch(x.somefield) { ...

jquery - Getting a fixed footer to expand height from top to bottom on scroll -

i have page - here fixed footer. main content #mid.stages > .stages scrolls behind footer, , using jquery waypoints when scroll bottom of page footer needs gain height (from top down) , section #topfooter needs expand top down reveal contents. have been trying various solutions no avail, namely due fact when loaded footer has fixed position , 'reveal' part of outside browser window. $(function(){ var position = function () { var w = $(window).height(); //var f = $('footer').height(); var foo = (w-110); console.log(foo); $('footer').css('top', foo); }; $(document).ready(position); $(window).resize(position); $('#mid').waypoint(function(direction) { var stagepos = $('.stage').position(); if (direction === 'down') { //$('footer').animate({height:'600px', top:'...

How to parse XML to Java object with Digester -

i using apache digester parse xml object. have following xml element: <a type="x" xname = "...">..<a> <a type="t" tname = "...">..<a> i have class public class x{ private string xname; public static class t{ private string tname; } } is able if type x create class x, if type t create class t, notice t public inner , child class of x. if yes, how define rule. using digester 2.x, or introduce better design first off, why xml? json way go. check out google's gson lib serializing java objects. great library. otherwise, here's digester tutorial: http://www.javacodegeeks.com/2012/09/apache-digester-example-make-easy.html

visual studio 2012 - Finding builds in Team Explorer's "My Builds" -

i'm writing visual studio 2012 add-in extends build explorer - basically, add context menu option every build (completed or running, not queued). following a blog post doing in vs2010 , managed builds appear in builder explorer - hooray! now, context menu appear in team explorer's builds pages, my builds section. however, when callback, can't find actual builds anywhere! here's beforequerystatus event handler, try find out whether have build show or not: private void opencompletedinbuildexplorerbeforequerystatus(object sender, eventargs e) { var cmd = (olemenucommand)sender; var vstfbuild = (ivsteamfoundationbuild)getservice(typeof(ivsteamfoundationbuild)); // finds builds in build explorer window cmd.enabled = (vstfbuild.buildexplorer.completedview.selectedbuilds.length == 1 && vstfbuild.buildexplorer.queuedview.selectedbuilds.length == 0); // no build _requests_ selected // tries find builds in team explorer...

php - Access newly added key=>value in associative array during loop -

i trying add key=>value pair array while using foreach loop, when value added foreach loop needs process new key=>value pair. $array = array( 'one' => 1, 'two' => 2, 'three' => 3 ); foreach($array $key => $value) { if ($key == 'three') { $array['four'] = 4; } else if ($key == 'four') { $array['five'] = 5; } } if print array after loop, expect see 5 kv's, instead see this: array ( [one] => 1 [two] => 2 [three] => 3 [four] => 4 ) is there way, when add fourth pair, process fifth pair gets added within foreach loop (or kind of loop?) according php documentation, as foreach relies on internal array pointer changing within loop may lead unexpected behavior. you cannot modify array during foreach. however, user posted example of regular while loop need: http://www.php.net/manual/en/control-structures.foreach.php#99...

jquery - Calling other HTML file (hyperlink) on Swipe gesture with TouchSwipe plugin -

i'm looking @ touchswipe plugin - http://labs.rampinteractive.co.uk/touchswipe/demos/ , wondering how can call other html file on swipe gesture? so have 1 div, touchswipe works. on swipe left browser open 1 html file hyperlink , on swipe right, other one. so code this: $("#swipe").swipe({ swipeleft:function(event, direction, distance, duration, fingercount) { } }); thank guys advices , help! i think should it, assuming have id="swipe" in both 1.html, , 2.html. // ------------ // 1.html. // ------------ $("#swipe").bind("swipeleft",function(event) { $("#div").load( "2.html"); }); // ------------ // 2.html. // ------------ $("#swipe").bind("swiperight",function(event) { $("#div").load( "1.html"); });

business objects - Same report, different databases -

i created reports on web intelligence accessing oracle database. now, other people want same reports. each 1 of them has different database (but oracle) same structure own data. what have make same reports available all? reports same, connection or universe changes depending on user running it. i don't want make copy of them each person, because change on 1 report has available everybody. regards, antonio if product sits on server, might able exclude database login , password, user has enter in separate login , password database have log into. perhaps dba sets each database user have read-only access tables.

JavaScript + jQuery Reference -

i find myself using google javascript or jquery method, takes me either jquery's documentation or w3schools javascript reference. prefer rails' documentation . there sites out there make easy browse , search both javascript , jquery core apis? (bonus points if has cross-browser support notes.) i'm not sure if know of this? http://jqapi.com/ for browser support need this: http://caniuse.com/ jquery 1.9 has support browser till ie6, 2.0 ie9+

sql - How to call a stored procedure using asp classic? -

i using sql server , asp classic, , calling queries this: newhiresql = "select * newhire archived = 0 order hireid desc" set rsgethireid = server.createobject("adodb.recordset") rsgethireid.open newhiresql,connectionstring,adopenstatic numofhireid = rsgethireid.recordcount but instead of having query statement here, want call stored procedure called dbo.sp_selectnewhiresql . how can that? thanks edit: i tried this dim conn set conn = server.createobject("adodb.connection") set rsgethireid = server.createobject("adodb.recordset") conn.open connectionstring set rsgethireid=conn.execute("exec sp_selectnewhiresql") numofhireid = rsgethireid.recordcount response.write (numofhireid) but getting -1 value record count. it's use exec or execute statement: set conn = server.createobject("adodb.connection") conn.open connectionstring conn.execute "exec sp_selectnewhiresql" reference: htt...

sql - MySQL DB migration -

good evening, i need combine 2 tables school project in mysql workbench. problem 1 table has pk , other not. the 1 without pk has double id , id's exist in table pk id. (note: id not auto increment) example table a: id | name | ... ---------------- 1 | test | 11 | test2 | 22 | test4 | and one. example table b: (without pk) id | name ----------- 1 | name1 11 | nam2 0 | nam31 0 | na4e1 0 | nam4 334 | n4e1 table b has id's exist in table , table b has double id numbers... i wanted following, seems mysql not last inserted id within transaction. use flyaway; insert staff (`name`, staffnumber, `type`, primaryairport) select flyaway_excel.staff.`name`, flyaway_excel.staff.staffnumber, flyaway_excel.staff.`type`, (select `code` airport `name` = flyaway_excel.staff.primary_airport) flyaway_excel.staff on duplicate key update staffnumber = last_insert_id() + 1; does know how can in mysql? saw other post t...

jquery - Scopes in Javascript AMD pattern -

i'm totally new javascript java, , have had start directly difficult thing me... developing app using asynchronous module definition pattern... i'm using platform weejot , provides framework develop javascript web apps uses amd pattern . documentation here . don't know it, maybe can anyway if know amd pattern... basically have module mycontroller.js looks (note of code automatically generated, wrote commented lines): define([ "js/util", "framework/controller" ], function ( util, controller ){ function mycontroller(environment, connector) { controller.call(this, environment); this.settings = environment.siteapplication.getsettings(); this.connector = connector; //variable have value stored this.myvariable = "hello"; } mycontroller.prototype = object.create(controller.prototype); util.extend(mycontroller.prototype, { //function show map showmap: function (request, ren...

osgi - How to ensure eclipse plugin has required bundles available? -

i'm starting develop new eclipse plugin want web application server running in eclipse. found nice blog, osgi web application server , describes how this. author suggests creating target environment bundle requirements, , of bundles pulled in equinox project sdk (now called equinox target components in juno). notice tutorial project runs fine when target platform platform created in tutorial, fails start when default platform. so, question... if need bundles not part of default, how plugin project access bundles? need deploy them along plugin? how know if user's eclipse or not have required bundles? you not clear kind of application developing. running web server in eclipse ide plugin don't make sense me. kind of server application best running on top of equinox. anyway, right path create "product configuration" file , add categories contains needed bundles (go file/plug-in development/product configuration). with file can run instance of ...

android - How to cancel a PendingIntent when is set to repeating? -

i have this... button = (button) findviewbyid(r.id.start_repeating); button.setonclicklistener(new onclicklistener() { public void onclick(view v) { intent intent = new intent(test.this, repeatingalarm.class); pendingintent sender = pendingintent.getbroadcast(test.this, 0, intent, 0); long firsttime = systemclock.elapsedrealtime(); firsttime += 1 * 1000; alarmmanager = (alarmmanager) getsystemservice(alarm_service); am.setrepeating(alarmmanager.elapsed_realtime_wakeup, firsttime, 1 * 1000, sender); if (mtoast != null) { mtoast.cancel(); } mtoast = toast.maketext(test.this, "repeating_scheduled", toast.length_long).show(); } }); button = (button) findviewbyid(r.id.stop_repeating); button.setonclicklistener(new onclicklistener() { public void onclick(view v) { intent intent = new intent(test.this, repeatingalarm.class); pendingintent sender = pendingintent.getb...

visual studio 2012 - How do I disable the Performance Explorer from opening every time? -

on project you've ran performance analysis, performance explorer tab opens when vs started, if closed before vs exited. how disable , keep opening? this bug since visual studio 2012 that's been open since summer 2012 still no official ms fix. here's workaround annoyance: from windows explorer, go under vs project folder remove following file types if present: file.vsp - (vs performance report) file.vsps - (vs analyzed reports) file.psess - (vs performance session) re-open solution, if error, click ok (the solution still load) close solution re-open solution - performance explorer tab gone! @b. clay shannon - update delete *.vsps

javascript - Access RequireJS path configuration -

i notice in documentation there way pass custom configuration module : requirejs.config({ baseurl: './js', paths: { jquery: 'libs/jquery-1.9.1', jqueryui: 'libs/jquery-ui-1.9.2' }, config: { 'baz': { color: 'blue' } } }); which can access module: define(['module'], function (module) { var color = module.config().color; // 'blue' }); but there way access top-level paths configuration, this? define(['module', 'require'], function (module, require) { console.log( module.paths() ); // no method paths() console.log( require.paths() ); // no method paths() }); fyi, not production site. i'm trying wire odd debug/config code inside qunit test page. want enumerate module names have custom path defined. this question touched on issue lets me query known modules, not enumerate them. i don't believe req...

OpenCV Stereo Calibration (example code questions) -

at moment implementing calibration method(s) stereo vision. using opencv library. there example in sample folder, have questions implementation: where these array's , cvmat variables? // array , vector storage: double m1[3][3], m2[3][3], d1[5], d2[5]; double r[3][3], t[3], e[3][3], f[3][3]; cvmat _m1 = cvmat(3, 3, cv_64f, m1 ); cvmat _m2 = cvmat(3, 3, cv_64f, m2 ); cvmat _d1 = cvmat(1, 5, cv_64f, d1 ); cvmat _d2 = cvmat(1, 5, cv_64f, d2 ); cvmat _r = cvmat(3, 3, cv_64f, r ); cvmat _t = cvmat(3, 1, cv_64f, t ); cvmat _e = cvmat(3, 3, cv_64f, e ); cvmat _f = cvmat(3, 3, cv_64f, f ); in other examples see code: //--------find , draw chessboard-------------------------------------------------- if((frame++ % 20) == 0) { //----------------cam1------------------------------------------------------------------------------------------------------- result1 = cvfindchessboardcorners( frame1, board_sz,&temp1[0], &count1,cv_calib_cb_adaptive_th...