Posts

Showing posts from June, 2010

java - Sending commands serial port, MVC Application -

i'm developing mvc c# applications, , need send raw commands serial port, , want know best way this, there way c#(i guess not because code running on server side, , hardware in client side)? or need java applet? i've been checking this printing, work? (i haven't tested because terminal want send commands being delivered) i assume you're using asp.net mvc web application , want access client's (browser machine) serial port. isn't possible asp.net mvc without additional client software signed java applet or other software installed on client machine (like service, browser plugin or background application.) this thread may of use: how read serial port in webpage

javascript - How to remove Conflict in a jQuery plugin in a wordpress website? -

thanks in advance , support. have tried every thing i'm bit stumped this: i working on wordpress website. have few filters of jquery in , working fine (i initiate these plugins using): jquery(document).ready(function($){ /*code here*/ }); i using jquery plugin "filter.js" having conflicting issues. when not initiate plugin (only on linking plugin file page) shows jquery conflict , can see in console: uncaught typeerror: cannot read property 'fn' of undefined you can find plugin source here . try wrapping code this: (function($){ $(document).ready(function(){ //document ready code here }); })(jquery); wrap filter.js plugin same wrapper, ie: (function($){ //filter.js code here })(jquery); if that's not working - make sure jquery included on page.

java - Webelement defined by @FindBy annotation returns null pointer -

for reason, when call method spage.editexbutton(int id), error saying webelement first null. why null? have defined using @findby annotation. have explicitly define element using findelement(by.id("xxx")) in order able click on it. why unable call using @findby notation? public class spage extends gpage<spage> { public spage() { super(); } public spage(string pagetype) { super(pagetype); } @findby(id = "xxx") webelement first; public webelement ebutton(int id) { first.click(); string tmp = id + "-edit"; webelement edit = getdriver().findelement(by.id(tmp)); return edit; } public epage cedit(int id) { ebutton(id).click(); return new epage(getbasepagetype()).openpage(epage.class); } } i calling method this: static epage epage; static spage spage; @test public void edit_exception() { epage = spage.cedit(idbefore); }

ruby - determine if an array contains all elements of another array often enough? -

i have array available elements , array required elements. want find out if required elements available. the arrays may contain "duplicates". there must many elements available required. first trial #contains? method fails because include? checks if element available @ least once -- edit: simplified example code -- # first , simple trial # fails on duplicate elements class array def contains?(other) other.all? { |element| include?(element) } end end available = [1, 1, 1, 2, 2, 3] small = [1, 1, 2, 3] big = [1, 1, 2, 3, 3] available.contains?(small) # true intended available.contains?(big) # true should false # because "big" contains more "3s" "available" def contains?(other) other.elements.group_by{|e| e}.all?{|e, a| elements.count(e) >= a.length} end

Java Timer hang issue -

i've been scratching head trying figure out hang issue java timers. wondering if here out. in diagnosing issue highly appreciated. i have simple program 3 timertask classes (a, b, , stopper). , b run repeatedly every 400ms , 500ms respectively. stopper task scheduled run @ 2sec shutdown everything. timers fire expected, , run() methods of tasks execute expected. however, once stopper task executes, expect program terminate, hangs after printing "all tasks , timers canceled, exiting". i've tried using jstack diagnose problem there nothing obvious indicates what, if needs released/stopped/canceled etc. here code: package com.example.experiments; import java.util.date; /** * test timer class check behavior of exit/hang issues */ public class timertest { timertest(){ } class taska extends java.util.timertask { taska(){ } public void run() { system.err.println("a.run() called."); if

iphone - GKVoiceChat not working on GameCenter Match -

i'm trying set voice-chat on game i'm developing ios, creates match, when try set voice-chat nothing, doing wrong? runs without throwing errors. here's code i'm using make voice-chat. - (void)establishvoice { if (![gkvoicechat isvoipallowed]) return; if (![self establishplayandrecordaudiosession]) return; nslog(@"did stablish voice chat"); chat = [match voicechatwithname:@"generalchat"]; [chat start]; // stop [chat end]; chat.active = yes; // disable mic setting no chat.volume = 1.0f; // adjust needed. chat.playerstateupdatehandler = ^(nsstring *playerid, gkvoicechatplayerstate state) { switch (state) { case gkvoicechatplayerspeaking: // highlight player's picture nslog(@"speaking"); break; case gkvoicechatplayersilent: // dim player's picture nslog(@"s

python - How to use BeautifulSoup to parse a table? -

this context-specific question regarding how use beautifulsoup parse html table in python2.7. i extract html table here , place in tab-delim csv, , have tried playing around beautifulsoup. code context: proxies = { "http://": "198.204.231.235:3128", } site = "http://sloanconsortium.org/onlineprogram_listing?page=11&institution=&field_op_delevery_mode_value_many_to_one[0]=100%25%20online" r = requests.get(site, proxies=proxies) print 'r: ', r html_source = r.text print 'src: ', html_source soup = beautifulsoup(html_source) why doesn't code 4th row? soup.find('table','views-table cols-6').tr[4] how print out of elements in first row (not header row)? okey, might able give 1 liner, following should started table = soup.find('table', class_='views-table cols-6')

Android RSA decryption (fails) / server-side encryption (openssl_public_encrypt) -

i trying decrypt string in android application using rsa keys generated on device. encryption done php service, using public rsa key provided application. problem decryption, fails. i doing following : generating keypair on android (with keypairgenerator.getinstance("rsa")) -> ok both keys (public , private) saved files after being "base64" encoded base64.encode(pubkey.getencoded()) , same private key. -> ok when calling webservice, pass public key (in base 64) in post variable -> ok the web service (a php service), uses public key encrypt short string, openssl_public_encrypt function. encrypted string converted base64. -> seems ok, function not return false. the application retrieves result of service, , decodes (base64.decode()) -> ok (i have check, bytes received matches 1 generated openssl_public_encrypt() function) the last thing decrypt string, doing following : -> not ok cipher cipher = cipher.getinstance("rsa");

Using Java.util.scanner with command prompt -

i'm trying program run solely out of command line (command prompt in case) when create .jar keep getting error: expception in thread "main" java.lang.unsupportedclassversionerror: exponentiation: unsupported major.minor version 51.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(unknown source) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ java.net.urlclassloader.defineclass(unknown source) @ java.net.urlclassloader.access$000(unknown source) @ java.net.urlclassloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.misc.launcher$appclassloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) not find main class: exponentiation. program exi

I can not delete product from OpenCart if use Firefox -

i use oc version 1.5.5.1 , have strange probem. when check product in catalog-product list in admin panel , click on delete in other browser firefox shows popup dialog box standard message - sure want delete...etc , 2 buttons - ok , cancel , works fine. but - in firefox browser popup way quick shows , close in metter second, maby less , can not click on ok button , can not delete product. any advice?

Read Registry on Windows 7 with VBA Permission -

i have line of code has worked flawlessly years on 50+ pcs (vista & windows 7 32 & 64 bit) in access 2007 , access 2010. regstr = freturnregkeyvalue(hkey_local_machine, "software\thisapp\app", "activation") on 1 specific pc (windows 7 64bit) access2010/vba module (32 bit) the line of code above not see registry key. when change hkey_local_machine hkey_current_user,it works fine. regstr = freturnregkeyvalue(hkey_current_user, "software\thisapp\app", "activation") one possible cause of issues registry virtualization microsoft added windows starting vista. when uac (user account control) enabled in windows, non-privileged users can still "modify" system-wide settings hkey_local_machine registry values, changes "virtualized" user , other users cannot see them. in case, 1 user may have run application saved settings hkey_local_machine. user able retrieve settings , run application normal, u

jquery - How to remove HTML tags, but preserve text, and then later replace the tags? -

<ruby><rb>自分</rb><rp>(</rp><rt>じぶん</rt><rp>)</rp></ruby> i want remove <ruby> tags, want keep contents. want <ruby> tags on page. i don't know how try, had idea keep html content in variable, remove <ruby> tags hide() , , splash text again, don't know how re-insert in specific section of text. also, i'm struggling each . i'd remember tags removed, can them later click. use unwrap function: $('ruby').unwrap(); http://api.jquery.com/unwrap/ edit: how following tutorial example in above link? ptags = $('ruby'); if ( ptags.parent().is("span") ) { ptags.unwrap(); ptags.wrap("<ruby></ruby>"); } else { ptags.unwrap(); ptags.wrap("<span class='unwrapped_ruby'></span>"); } unwrap <ruby> tag , wrap placeholder <span> tag. update 1: well, previous code had right &quo

AJDT on Eclipse/Maven -

i cloned , imported github project maven project eclipse juno. i getting following error in pom.xml: plugin execution not covered lifecycle configuration: org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (execution: default, phase: process-sources) the property org.aspectj-version:1.6.10 defined in pom.xml. ajdt juno installed on machine. what missing ? i new maven. i saw how use aspectj-maven-plugin , other discussions. note: tried running code invoking maven on tomcat 7. it's getting hung at: jul 23, 2013 12:46:56 pm org.apache.coyote.abstracyprotocol start info: starting protocolhandler ["http-bio-8080"] //============================= edit: starting out dynamic web prj & converting maven one, scratch. nothing else seemed work. //============================= in preferences > maven > templates, seeing "aspectj plugin" description "aspectj plugin configuration" listed "on" under column "auto

shell - unix script, running a command on multiple files -

i have no previous experience writing unix script want seems simple task.. want run command pdf files in folder pdf2txt.py -o naacl06-shinyama.html samples/naacl06-shinyama.pdf if there file called anypdf.pdf command like: pdf2txt.py -o anypdf.html samples/anypdf.pdf so if folder includes 3 pdf files like, abc.pdf aaa.pdf bbb.pdf want end abc.html aaa.html , bbb.html thanks in advance for pdf in samples/*.pdf; html=$(basename "$pdf" .pdf).html pdf2txt.py -o "$html" "$pdf" done if don't have basename try alternative, uses bash's ## , % constructs replacements inline. #!/bin/bash pdf in samples/*.pdf; html=${pdf##*/}; html=${html%.pdf}.html pdf2txt.py -o "$html" "$pdf" done

javascript - Alternative to preloading images -

so i'm trying make jquery slideshow. i've read many tutorials, , pretty of them preload images using variation of code below: imagearray[imagenum++] = new imageitem(imagedir + "02.jpg"); imagearray[imagenum++] = new imageitem(imagedir + "03.jpg"); imagearray[imagenum++] = new imageitem(imagedir + "04.jpg"); imagearray[imagenum++] = new imageitem(imagedir + "05.jpg"); this fine if have 4 slides, if slide show has around 10 or 15 different slides, can greatly decrease speed of website. so question persists, how can of pictures client , not cause such big decrease in functionality? you can try preload image next in slideshow. helpful link: http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript/

ruby on rails - rspec: ignoring format while testing a view? -

i'm writing test views. happen have html , json views 1 action, , didn't figured out how can force rspec use given format. currently minimized code following: # cat spec/views/services/index.json.jbuilder_spec.rb require 'spec_helper' describe "services/index" let(:services) { 3.times.map { factorygirl.create(:service) } } before(:each) { assign(:services, services) } let(:resp) render template: 'services/index', format: :json # note format here json.parse(response.body, simbolize_names: true) end it("should array") { resp.should be_kind_of(array) } end but stills rendering html code. i'm getting error failure/error: json.parse(response.body, simbolize_names: true) json::parsererror: 757: unexpected token @ '<h1>listing services</h1> [cut rest of html] my json view simple # cat app/views/services/index.json.jbuilder json.array! @services, *service.json_attributes and first 5 line

excel - Python CSV module: How can I account for multiple tables within the same file? -

i have excel file converted csv. there several tables each separated empty row. after converting excel file csv, see each empty row represented row of commas, comma every column/field element. can csv module (or other python module) account multiple tables information? if not, option separate tables different files manually in excel before conversion? i know csv module turn each row list. i'd table own list , rows has lists within. each table has first row fields. fields can different table table, , number of fields can different well. sure, it's easy read data in way. have decide constitutes separator row (is sufficient check first column being empty, or have check columns empty?) assuming first row (and being verbose clarity): rdr = csv.reader(open(filename)) tables = [] this_table = [] tables.append(this_table) row in rdr: if row[0] none: this_table = [] tables.append(this_table) this_table.append(row) the result list

ember.js - How to reference to emberJS controller from another view -

i'm using ember tools app. want add textfield trigger search in controller, in this example. controller , view: productscontroller: var productscontroller = ember.arraycontroller.extend({ search: function(query) { console.log(query); } }); module.exports = productscontroller; searchfieldview: var searchfieldview = ember.textfield.extend({ insertnewline: function() { var query = this.get('value'); app.productscontroller.search(query); } }); module.exports = searchfieldview; but whenever textfield changing i've got error app.productscontroller has no method search . i've got feeling not 1 have created generated one. you can use this.get('controller') current controller instance. or if u need controller instance can use this.get('controller').get('controllers.anothercontroller').. jsbin hope helps.

sql server 2008 - Putting an individuals distinct diagnosis into one horizontal row AND excluding a specific diagnosis -

i working same query explained in question: diagnosis in 1 horizontal row . diagnosis data horizontal , want exclude active dementia (diagnosis status indicated each diagnosis). max # of diagnoses per person 50 have search each of 50 icd9 code fields each of 18 different icd9 codes (indicating dementia). have declared each of 18 codes @icd9code49 - @icd9code66, cannot figure out how exclude these data set. have tried following (problemstatus diagnosis status): select * diagnosis ( ([problemstatus_1] = @problemstatus , (icd9code_1 <> @icd9code49 or icd9code_1 <> @icd9code50 or icd9code_1 <> @icd9code51 or icd9code_1 <> @icd9code52 or icd9code_1 <> @icd9code53 or icd9code_1 <> @icd9code54 or icd9code_1 <> @icd9code55 or icd9code_1 <> @icd9code56 or icd9code_1 <> @icd9code57 or icd9code_1 <> @icd9code58 or icd9code_1 <> @icd9code59 or icd9code_1 <> @icd9code60 or icd9code_1 <> @icd9code61 or icd9code_1 <

c# - How to find specific data in XML POST Response? -

i'm tasked retrieving specific data xml post response. here's example of xml reply: <servicehistoryarray> <recordid>xd116067*401529</recordid> <swr> <v idx="1">7932</v><v idx="2">7932</v><v idx="3">7932</v><v idx="4">7932</v> </swr> <comments/> <mileage>6</mileage> <operation> <v idx="1">z7000*wpdip****pre-delivery inspection - base time</v><v idx="2">z911*inc****etch windows</v><v idx="3">b0048*wpbs4****fascia, front bumper - replace 1 piece</v><v idx="4">9997*wpbs4****</v> </operation> <closedate>1998-12-30</closedate> <opendate>1998-10-16</opendate> <partsamount> <v idx="1">0.00</v><v idx="2">0.00</v>

ember.js - How get parent model from Ember-data -

i`m use ember-data 12 have 2 models, sideloads together: app.store = ds.store.extend({ revision: 12, adapter: app.adapter.create() }); app.propose = ds.model.extend({ meeting: ds.belongsto('app.meeting'), time: ds.attr('string'), }); app.meeting = ds.model.extend({ name: ds.attr('string'), proposes: ds.hasmany('app.propose'), }); how me meeting propose model, example calculated field: app.propose = ds.model.extend({ meeting: ds.belongsto('app.meeting'), time: ds.attr('string'), somecalc:function(){ this.get('meeting').get('name') //i want that. not worked } }); the way is: app.propose = ds.model.extend({ meeting: ds.belongsto('app.meeting'), time: ds.attr('string'), somecalc:function(){ return this.get('meeting.name'); // or whatever operation need in here }.prope

testing - AppHarbor Test Execution configuration -

i'm writing specflow tests drive out systems behaviour. working great locally. however, when commit git , appharbor builds fails. @ present it's due lack of transformations identifying appharbor hosted app. however, everytime write new feature accompanying specflow (and selenium) tests, anticipate specflow tests fail because new feature has not yet been deployed. viscious circle. i'd constrain build somehow not run specflow tests. there way appharbor of constraining tests run? nunit categories? you can use appharbor's solution file convention achieve this. if have separate project containing specflow/selenium tests trick make sure project not referenced in solution build. more can create solution name appharbor.sln , reference web, console , test projects want appharbor build , test solution file. appharbor prefer building solution name if it's found in repository. you can maintain separate solution file (likely 1 you're using) development

jdbc - Setting up a datasource with WebSphere Liberty Profile 8.5 -

my web app getting data source jndi with: javax.naming.initialcontext ctx = new javax.naming.initialcontext(); javax.sql.datasource ds = (javax.sql.datasource) ctx.lookup("java:comp/env/jdbc/db"); in app's web-inf/web.xml , have: <resource-ref> <description>datasource</description> <res-ref-name>jdbc/db</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> </resource-ref> in app's web-inf/ibm-web-bnd.xml , have: <web-bnd xmlns="http://websphere.ibm.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd" version="1.0"> <virtual-host name="default_host"/> <resource-ref name="jdbc/db" binding-name="jdbc/db&qu

php - POST array is empty when containing a file -

i have simple html form containing file input. when form submitted without file, printing $_post array shows me of data submitted. when file submitted, however, $_post doesn't print out of submitted data. can tell me why? code: <?php print_r($_post); ?> <form action="test.php" method="post" enctype="multipart/form-data"> <label for="myfile">video file:</label> <input type="file" name="myfile" /> <br /><br /> <label for="mytitle">title:</label><br /> <input type="text" name="mytitle" size="55" maxlength="60" /> <br /><br /> <input type="submit" name="mysubmit" value="submit video approval" /> </form> your script seems fine. please check server configuration. perhaps exceed post limits (set post_max_size in

MySql: select posts where tags do not repeat -

i have 3 tables: post, tag , tag/post i want select give me posts not have of tags repeated. eg: post 1-tags: me, you, them post 2-tags: others, you post 3-tags: people, crowd expected result: post 1, post 3

Joomla:: File image does not exist -

i working on joomla project new joomla. i have problem cannot open site, error :- file images/stories/zamalek/s3201221131442.jpg not exist. my link :- http://zamalekcity.com/zamalek-news/664--3-.html i use joomla 1.5 since website doesn't display anything, guess have problem template. try using ide eclipse searching path tells it's not finding in code. maybe it's typo. your system asking image should go images/stories/zamalek/ , make sure file there. remember if you're working on linux server, distinguishes between lowercase , uppercase letters.

angularjs - How can set a script to run after all photos have loaded? -

i have have spent hours trying of different methods given online nothing works. want load script run after images have loaded. there angular won't allow me this? i'm using $routeprovider : var photos = { name: 'photos', url: '/photos', views: { main: { templateurl: "views/photos/photos.html", controller: function($scope,$http){ $http({ url: 'get/photos', method: "post" }) .success(function (data, status, headers, config) { $scope.data = data; // doesn't work $(window).load(function() { myscript(); }); }) .error(function (data, status, headers, config) { $scope.status = status; }); } } } }; by way, i'

java - Drawing on an Image -

so have program paint made in java , can draw few colours. default background of program white, i'd try load image , able draw on top of image. can load image fro reason wont show lines when try drawing on it. here code. import java.awt.*; import java.awt.event.*; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import javax.swing.*; public class paint { public static void main(string[] args) { paintwindow frame = new paintwindow(); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setresizable(false); frame.setvisible(true); } } class paintwindow extends jframe { public paintwindow() { settitle("javshot edit"); setsize(668, 600); setlocationrelativeto(null); panel = new jpanel(); drawpad = new paddraw(); panel.setpreferredsize(new dimension(75, 68)); //creates new container container content = this.getcontentpane(); content.setlayout(new borderlayout()); //sets

notifications - iOS alert banner/label? -

Image
i apologize if question basic. have been googling around can't seem find api/reference drop down alert banner/label (i not know proper term this ), therefore posting here. this: label/banner has "please enter valid email address" in it. so here questions: what proper term (alert banner? notification? label?) i trying accomplish similar functionality shown in image, if field invalid, "label/banner" expands underneath navigation bar message in it: if uilabel, simplest way of adding expand animation? if built in, since have seen bunch of apps alerting, please let me know called. have here , i'm sure able find suite needs. the basic idea uiview animate down top of screen (at basic). can lot fancier adding gradients, touch recognizers dismiss it, etc. pretty base line functionality this: //create view hold label , add images or whatever, place off screen @ -100 uiview *alertview = [[uiview alloc] initwithframe:cgrectmake(0, -100, cgr

tfs2012 - Best TFS Template for Single Developer -

i'm setting new installation of tfs 2012 express. i'm pretty developer - else adds requirements , manages major database changes. i've read on , tried out agile , scrum templates included tfs installation, can't seem head around best template/workflow solo developer. seem spending more time managing task board , whatnot working on code. which process template best small team? how effort should expend on maintaining list of tasks/requirements? for go scrum template, , track requirements , bugs, not tasks. use built in kanban board display status needs see it. (i choose scrum template here because bug work item type in requirements category default). alternatively, if people need made aware of status of work collocate you, physical kanban board might serve needs better. method prefer.

Consume json data using Jquery -

i have webmethod in .cs page returns list. this returns json this.. { "d": [ "saint clair", "jefferson", "shelby", "tallapoosa", "blount", "talladega", "marshall", "cullman", "bibb", "walker", "chilton", "coosa", "clay", "tuscaloosa", "hale", "pickens", "greene", "sumter", "winston" ] } and jaquery method is $.ajax({ type: "post", contenttype: "application/json; charset=utf-8", url: strurl, data: "{'stateid':'" + stateid + "'}", async: false, success: function (respons

Installing additional packages for Cygwin -

to install additional packages cygwin, need run setup.exe again , choose packages list? also, doing won't harm computer in terms of 2 cygwin instances being installed or problems of kind (i'm kind of noobie these things). last, there no package manager in cygwin can run in command line? similar pip in python. no, doesn't hurt current setup. install program knows what's installed already. having said that, long ago got habit of installing all of cygwin since, despite size, it's still minuscule compared size of modern hard disks. way, won't ever have worry whether package installed or not.

Shared Preferences in Objective C from Android -

is there anyway re-create code objective c? starting out, , need help. string name = #;// vary. sharedpreferences userdata = this.getsharedpreferences(name + "userdata", mode_private); editor edit = userdata.edit(); edit.clear(); edit.putfloat("rating", rating.getrating()); edit.putstring("good", txtgood.gettext().tostring().trim()); edit.putstring("improve", txtimprove.gettext().tostring().trim()); edit.commit(); log.d(tag, "saving data"); the advantage of code is makes new sharedpreference everytime method called. experience using nsuserdefaults, able make 1 batch of data. - (nsstring*)getfilepath:(nsstring*)filename { nserror *error; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); //1 nsstring *documentsdirectory = [paths objectatindex:0]; //2 nsstring* file = [[nsstring alloc]initwithformat:@"%@.plist",filename]

jQuery - check if class exists if no destroy a function -

i trying destroy function depending on existence of css class. i want check class .active , class toggled clicking button. tried using if(jquery(#test).hasclass('.active') but work once, if remove .active still function running whereas want destroy after removal of .active class. i tried .unbind() no use. please tell me how destroy function totally after removal of .active class function destroy_no_active_class(){ jquery('#test.active').mouseover(function (e) { e.stoppropagation();e.preventdefault(); jquery(this).addclass('highlight'); }).mouseout(function () { jquery(this).removeclass('highlight'); }).click(function(e){ e.stoppropagation(); e.preventdefault(); show_data(this); }); }); } assuming 'destroy function' mean want stop highlighting element, can check w

gallery - JQuery Caroufredsel not working, displays all images -

i installed caroufredsel , not working. expecting happen is, 1 images appears, click next or previous next or previous image appear. code below has images display in list. understand doing wrong code seems correct? here jquery: <script type="text/javascript" language="javascript" src="js/jquery.caroufredsel-6.2.1-packed.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.mousewheel.min.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.touchswipe.min.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.transit.min.js"></script> <script type="text/javascript" language="javascript" src="js/jquery.ba-throttle-debounce.min.js"></script> <script

gem - Installing/Running Spork-Rails on Rails 4 -

after installing spork-rails error when running 'spork': andrews-mac-pro-4:lb_final chapmanf16$ spork /users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in load': cannot load such file - - /users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/gems/spork-1.0.0rc3/bin/spork (loaderror) /users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/spork:23:in' /users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in eval' /users/chapmanf16/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in' if run 'sudo spork' none of gems being located. following errors: using rspec, rails preloading rails environment not find actionpack-4.0.0 in of sources it literally can't find gems because if list versions of gem being mentioned , install version asking for, tell me next gem not install. i'm trying figure out why path gemfile not being recognized spark. have started learning ruby/rails past 3 days i'm out of element, not sure do. apprec

php - Getting $_GET variable when using mod_rewrite -

i having issues getting $_get variables mod_rewrite enabled. have following .htaccess: rewriteengine on rewriterule ^/?resource/(.*)$ /$1 [l] rewriterule ^$ /home [redirect] rewriterule ^([a-za-z]+)/?([a-za-z0-9/]*)$ /app.php?page=$1&query=$2 [l] and app.php is: <?php require("controller.php"); $app = new controller(); and controller.php is: <?php require("model.php"); require("router.php"); class controller{ //--------variables------------ private $model; private $router; //--------functions------------ //constructor function __construct(){ //initialize private variables $this->model = new model(); $this->router = new router(); $page = $_get['page']; //handle page load $endpoint = $this->router->lookup($page); if($endpoint === false) { header("http/1.0 404 not found"); }else { $this->$endpoin

Installing Apache on Windows for manual use and multiple users -

i installed apache http server on our windows system, work on home project; it's use "localhost" only. when installed it, 2 options install service, users, using port 80; or install current user, run manually, using port 8080. selected second. however, while i'd prefer use port 8080 , run manually, i'd set wife can run user. (allowing users ok.) don't see httpd.conf entry this. there way either through httpd.conf or command-line option? i'm guessing in registry don't want mess if don't have to. (p.s. there's no need have multiple instances run simultaneously.) there's nothing can within httpd.conf ; settings in there affects server , not how accessed program well, have few options: 1. uninstall software , re-install choosing all users option. best choice. 2. found location of folder installed (or apache.exe located needed file run) , see if can create shortcut link within wife's account. apache server doesn'

iphone - confusion with implementing core data -

i beginner , trying move app core data. following big nerd ranch 3rd edition book, in book have store class holds items in item class. app different. have task class , tasks displayed task arrays declared in tableview controller, , if tap on task details come in detail view controller. thing is, book says need create nsmanagedobjectcontext, nsmanagedobjectmodel, , nspersistentstorecoordinator, in store. declare these in app? tableview controller or detail view controller? here code: tasks.h #import <foundation/foundation.h> #import <coredata/coredata.h> @interface tasks : nsmanagedobject @property (nonatomic) nsdatecomponents *conversioninfo; @property (nonatomic) nstimeinterval datecreated; @property (nonatomic) double orderingvalue; @property (nonatomic, retain) nsstring * taskname; @property (nonatomic) double timeinterval; @property (nonatomic, retain) nsstring * timeintervalstring; @property (nonatomic, retain) nsmanagedobject *assettype; @end tasks.m @i

javascript events - Firefox addon: Why the self.port in the panel's contentscript is undefined? -

i meet strange thing firefox addon development:i write code this(i convert commented code chrome extension firefox addon code ): function sendstoreidentitiesmessage(identities, remember){ console.log("storing identities: "+identities.length); if(remember==null){ remember=false; } //extension.sendmessage({type:"save.identities", identities:identities, remember:remember}, function(response) { // identitiesnum=identities.length; // identitiesdate=new date(); // sendgetpageidsmessage(function(){showcodeimagesuccess();}); //}); self.postmessage({type:"save.identities", identities:identities, remember:remember}); self.port.on("response.save.identities",function(response){ identitiesnum=identities.length; identitiesdate=new date(); sendgetpageidsmessage(function(){showcodeimagesuccess();}); }); } when compile addon builder,it gets " error: ns_error_xpc_not_enoug

entity framework - Is automapper preventing lazy loading with EF? -

i have been using automapper , seems gets me child entities (even if don't specify them in "include()" clause). there way how make lazy loading possible , child properties if specify them. thank you, jakub after mapping have mapped object without references source entity (which holds database context lazy loading). property values copied destination entity. you not able lazy-loading without source entity . actually lazy loading works fine - , it's occur during mapping process. specified mappings lazy-loaded properties of entity, , mapper tries values. results in lazy-loading navigation properties have configured mapping. inefficient. disable lazy-loading during mapping can ignore navigation properties in mapping configuration. e.g. if have customer lazy-loaded orders: mapper.createmap<customer, customerdto>() .formember(s => s.orders, m => m.ignore()); or remove orders property destination entity customerdto . if need have cus

Zbar with Android : Scanner camera viewport remain inactive and black after showing the url in browser -

i need have qr scanner in project. use zbar doing task. did small change on example code given zbar git example job. need show scanned result in browser(if url) or in dialog(if normal information). every thing working code given bellow except if try show url after scan qr code in browser. when come app browser camera viewport turns black , remain inactive. tried camera active scan qr code failed. tried reopen camera in onresume() function causes error , forcefully exited app. please me on issue. package com.myapp; import net.sourceforge.zbar.config; import net.sourceforge.zbar.image; import net.sourceforge.zbar.imagescanner; import net.sourceforge.zbar.symbol; import net.sourceforge.zbar.symbolset; import android.app.activity; import android.app.alertdialog; import android.content.dialoginterface; import android.content.intent; import android.content.pm.activityinfo; import android.hardware.camera; import android.hardwa