Posts

Showing posts from March, 2011

convert string into java.util.date format in java -

am having string this. thu oct 07 11:31:50 ist 2010 i want convert exact date time format store in sql. am familiar many string date conversions following. string datestring = "2001/03/09"; simpledateformat dateformat = new simpledateformat("yyyy/mm/dd"); date converteddate = dateformat.parse(datestring); but need convert string thu oct 07 11:31:50 ist 2010 date format timestamp. can explain proper way of converting java.util.date format.? try this: simpledateformat dateformat = new simpledateformat("eee mmm dd hh:mm:ss z yyyy"); for future reference read on simpledateformat class: http://docs.oracle.com/javase/7/docs/api/java/text/simpledateformat.html

salesforce - How to access a VF page's content during unit tests -

i need test multiple call-outs return xml. storing xml inside unit tests' mock class not great solution. i'm wondering if there's salesforce object type paste xml accessible during unit tests. know pagereference's getcontent() doesn't during unit tests (bummer). of course, of apex allowed line-breaks inside string literals easier cut , paste xml, alas... store xml in static resource, , query staticresource object test code: staticresource sr = [select body staticresource name='test_xml' limit 1]; string xmlstring = string.valueof(sr.body); dom.document doc = new dom.document(); doc.load(testxml);

osx - Getting a window to the top in wxPython for Mac -

i have app lives in tray, , i'm trying show/hide when click menu item in tray menu. code works, window shows behind other windows, instead of on top should. (note, don't want always-on-top, pop top of window stack.) it seems work on windows fine, on mac stays below whatever other windows have been pulled in front of in mean time. the relevant code below. def on_hide_frame(self, event): self.frame.on_iconify(event) def on_restore_frame(self, event): if self.frame.isiconized(): self.frame.iconize(false) if not self.frame.isshown(): self.frame.show(true) self.frame.raise() also note that, when called, self.frame same object app.gettopwindow() , interchanging 2 not fix bug. it seems cause app background app, , needs activate event. may not best way, it's easy send activate event using applescript: subprocess.popen(['osascript', '-e', '''\ tell application "system events" se...

jQuery UI Hover repeating -

i have html: <div> <div id="wrap"> <div id="pop">hello</div> here content <br /> several lines long. <br /> end of it. </div> </div> and javascript: $(function() { $('#wrap').hover(function() { $('#pop', $(this)).show('blind'); }, function() { $('#pop', $(this)).hide('blind'); }); }); jsfiddle link using jquery ui. if move mouse on #wrap div #pop slides down , slides away again when mouse out. if move mouse #wrap above or move #wrap #pop before animation finishes loops forever (if wait till animation finishes, can move between #wrap , #pop freely , nothing animates, want). i've tried combinations of mouseover , mouseenter / mouseleave , filtering .not(':animated') , calling .stop() before each call show / hide , of give same result leads me believe i'm missing...

ruby on rails - Rspec giving false negative whilst testing pagination -

i'm writing request spec, test will_paginate working ok, , i've got few problems. firstly, here's pruned version of spec: require 'spec_helper' describe "articles" subject { page } describe "index page" let(:user) { factorygirl.create(:user) } before { visit news_path } describe "pagination" before(:all) { 31.times { factorygirl.create(:article, user: user) } } after(:all) { article.delete_all; user.delete_all } let(:first_page) { article.paginate(page: 1) } let(:second_page) { article.paginate(page: 2) } "should not list second page of articles" second_page.each |article| page.should_not have_selector('li', text: article.title) end end end end end as can see there test ensure second page of articles not shown when user visits articles index page. test fails: 1) articles index page pagination should not list second ...

c# - Possible to force the use of a specific method signature in an application? -

we have helper assembly assists developers logging information. specific method used logging has 2 signatures: logtouls(string message) logtouls(string message, microsoft.sharepoint.administration.spdiagnosticscategory category) in application have created static class contains instance of spdiagnosticscategory used time application logs something. if first signature used, generic category assigned , harder find logged information specific application. my question if it's possible force people use second signature time logtouls called application or need accomplished through programmer education? if can't remove method codebase, mark deprecated, other programmers compiler warning whenever call (and intellisense warn against usage): [obsolete("use logtouls(string, spdiagnosticscategory) instead."] public void logtouls(string message) { // ... } as per obsoleteattribute documentation , can pass true second parameter constructor cause comp...

cytoscape web - How to add more nodes to a cytoscpae graph -

hi trying convert cytoscape-web 1 application cytoscape-web 2 application. i have trivial example using fixed set of elements created element: portion of initial call cytoscape web. want add more elements existing graph. have tried using add , load. add nothing there no failure no change existing graph load gets , error: [19:29:52.005] json undefined @ http://127.0.0.1:8020/lifescience/jquery.cytoscapeweb.all.js:1918 the code pretty trivial reproduce <!doctype html> <html> <head> <title>test cyto</title> <style> * { margin: 0; padding: 0; font-family: helvetica, arial, verdana, sans-serif; } html, body { height: 100%; width: 100%; padding: 0; margin: 0; } body { line-height: 1.5; color: #000000; font-size: 14px; } /* cytoscape web container must ha...

lisp - How to write to a file in tinyscheme? -

scheme implementation : tinyscheme here try: (with-output-to-file "biophilia.c" (lambda (output-port) (write "hello" output-port))) ceates biophilia.c following content: error: ( : 26) not enough arguments what doing wrong here? how repair it? (define (with-output-to-file s p) (let ((outport (open-output-file s))) (if (eq? outport #f) #f (let ((prev-outport (current-output-port))) (set-output-port outport) (let ((res (p))) (close-output-port outport) (set-output-port prev-outport) res))))) you calling with-output-to-file incorrectly. the second argument thunk, , not procedure expecting port argument. so call like: (with-output-to-file "biophilia.c" (lambda () (write "hello"))) with-output-to-file re-binding of current-port (as tried in recons...

iphone - Remove item at index -

in icarousel, use remove items @ index: nsinteger index2 = carousel2.currentitemindex; [carousel2 removeitematindex:index2 animated:yes]; [items2 removeobjectatindex:index2]; so image in view of specific index remove. but don't know how reduce count in array 1 or reduce index count. how it? sorry bad english. when remove object nsmutablearray length of array automatically reduced 1. can check length of array using [carousel2 count]; and [items2 count];

jquery - Restoring selects after submit doesn't work -

this how trying (no firebug errors) restore each select of form first option value /* $(this) form */ $(this).find('input[type="text"],textarea').val(''); /* works */ $(this).find("select").each(function(){ $(this).val($(this,"option:first").val()); /* doesnt */ }); what doing wroing? -edit- just found out.. works, why not comma? $(this).val($(this).find("option:first").val()); just try this: $(this).find("select").change(); this automatically set first option value default. if use code need: $(this).find("select").each(function(){ $(this).val($("option:first", ).val()); /* doesnt */ ^--- places here }); your $(this, "option:first") not worked because code searching select within option , should search option within search . one format of jquery selector is $(target, context);

android - Sony Xperia Mini Pro have a different behaves differently to the same apk -

in application creating journal. in devices behave correctly, device day repeated, appears twice on same day. the code long exposed here. i understand layout can different between devices, possible level of programming may differ between devices? i had trouble xperia, don't know if i'm right, think xperia used has android 2.1 , rest of devices, @ least have 2.3. are code using webview , images? problem, solve adding images /asset folder, lost hdpi, mdpi, ldpi density. hope helps. regards

jquery - Get attr value of first child -

i have follwing code assigning onclick <tr> row: $("#tbldepartment tr").click(function() { alert($(this).eq(1).attr("field")); }); my html code here: <tr class="treven" id="trdepartment4"> <td field="id" style="display: none;" width="50px">4</td> <td field="dept_nm" width="100%">bid department</td> </tr> what tget first child's innerhtml. how can that? you want this $("#tbldepartment tr").click(function() { alert($(this).children('td').first().html()); }); this show content looking :)

c# - Is there a way to revision all projects in a solution? -

i have solution on 30 projects in it... there quick , easy way of managing build revision of projects rather editing assemblyinfo or properties of each one? in past, i've followed advice in this article create sharedassemblyinfo.cs file @ solution level , linked each of projects. the main point want add sharedassemblyinfo.cs file projects link. in visual studio, choose "add existing item", in dialog, click arrow on add button , select "add link". in sharedassemblyinfo.cs , put assembly attributes want same across projects. article recommends following: assemblycompany assemblyproduct assemblycopyright assemblytrademark assemblyconfiguration assemblydescription clscompliant comvisible assemblyversion assemblyinformationalversion each project still have own assemblyinfo.cs file supplement attribute receives shared file: assemblytitle assemblyculture guid

javascript - Phonegap html input element onclick not firing -

i'm working on phonegap app , have weird case onclick of html input button isn't firing. button appear on page. click button, see shadow on button know it's being clicked, function not fire. code below. took same code , put in jsfiddle works expected. tried setting via jquery instead same result. console.log('making photo button'); var photoinput = document.createelement('input'); photoinput.type = 'button'; photoinput.value = 'add photo'; photoinput.onclick = function () {alert('photo button clicked');}; console.log(photoinput.onclick); form.appendchild(photoinput); both console.logs fire, , output of second 1 onclick set above. add weirdness, create input button below one, same syntax different onclick, , works no issues. difference block inside switch case in loop, building form dynamically, other button created , appended after. since log statements show up, isn't possible code isn't being reached. pre-submission...

.net - Can you get a Char 0x05 into an XDocument that will then throw on XDocument.ToString? -

i have xdocument throwing invalid character (0x05) exception on tostring . to locate allowing 0x05 char in in xdocument api can let in 0x05 character without exception @ point, thrown @ tostring ? specifically, far recall, use new linq xml api, except use xmlserialization through extension method return xelement . just show worthy question before found simple answer: xelement:parse does throw when 0x05 character included. i've found setting .value of xelement not check invalid charaters :-( element.value = "test" & chr(5) & "5" the above doesn't throw, until call xdocument.tostring on containing xml.

Rails: Validation for a simple_form using has_many relationship (e.g. Person, Phone) -

i'm struggling getting desired validation nested models within simple_form . you'll able see models below person can have many phone 's, desired behaviour present edit fields existing numbers plus additional 1 should new number, if new number isn't filled in user it's ignore , not saved in database. want achieve similar email . when landing on /people/:id/edit page blank field being prematurely validated , producing visible errors on form before submitting. doesn't when visiting /people/:id/new page; i'm assuming because new_record? returns true user model on new page? in reading similar post added on: :save parameter validates on phone model although allowed blank records database, perhaps because isn't relevant when user model saving record? class person < activerecord::base belongs_to :company has_many :phones, :as => :phoneable has_many :emails, :as => :emailable has_many :addresses, :as => :addressable attr_access...

objective c - How to upload a file to server stored in my documents folder in ios? -

i want upload files (of different formats) stored in application documents folder. listed files in tableview on selecting row trying upload file in row. here code - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { nsstring *urlstring; if (indexpath.section == 0) { fileurltoupload = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:documents[indexpath.row] oftype:nil]]; } else { fileurltoupload = [self.documenturls objectatindex:indexpath.row]; } [self setupdocumentcontrollerwithurl:fileurltoupload]; urlstring = [[fileurltoupload path] lastpathcomponent]; printf("\n string :%s",[urlstring utf8string]); [self publishtoserver:urlstring]; -(void)publishtoserver:(nsstring *)str { if([str length] > 0) { nsstring *urlpath=@""; urlpath= str; nsstring *urlstring = @"http://162.108.0.8:8080/path/upload_path.jsp?"; nsmutableurlrequest *request =[[[nsmutableurlreq...

activerecord - Rails 3 polymorphic association with Carrierwave and Simple Form -

i'm trying set polymorphic association photo uploads processed using carrierwave. i'm using simple form build forms. feel association correct i'm wondering if problem form or controller. here associations: property.rb: class property < activerecord::base attr_accessible :image ... has_many :image, :as => :attachable ... end unit.rb class unit < activerecord::base attr_accessible :image ... has_many :image, :as => :attachable end image.rb class image < activerecord::base belongs_to :attachable, :polymorphic => true mount_uploader :image, photouploader end properties_controller.rb: def edit @property = property.find params[:id] @property.image.build if @property.image.empty? end def update @property = property.find params[:id] if @property.update_attributes params[:property] redirect_to admin_properties_path, :notice => 'the property has been updated.' else render "e...

c# - Specify assembly for namespace -

is there anyway specify assembly along namespace in c#? for instance, if reference both presentationframework.aero , presentationframework.luna in project might notice both of them share same controls in same namespace different implementation. take buttonchrome example. exists in both assemblies under namespace microsoft.windows.themes . in xaml include assembly along namespace here it's no problem xmlns:aerotheme="clr-namespace:microsoft.windows.themes;assembly=presentationframework.aero" xmlns:lunatheme="clr-namespace:microsoft.windows.themes;assembly=presentationframework.luna" <aerotheme:buttonchrome ../> <lunatheme:buttonchrome ../> but in c# code behind can't find anyway create instance of buttonchrome in presentationframework.aero . the following code gives me error cs0433 when compiling using microsoft.windows.themes; // ... buttonchrome buttonchrome = new buttonchrome(); error cs0433 : type 'microsoft.w...

XCode Storyboard How to access all view controllers inside the storyboard -

in single view application, inside storyboard if i've multiple view controllers different classes assigned them, how can access of them inside appdelegate while still know kind (class) of viewcontroller this? for instance root view controller can access blacktimer *vc = (blacktimer *)_window.rootviewcontroller; how other sibling view controllers? create ivar of sibling uiviewcontrollers inside app delegate , later whenever invoke view controller alloc init ivar inside app delegate. can reference app delegate anywhere using [uiapplication sharedapplication] delegate];

Position UIBarButtonItem on edge of UINavigationBar -

is possible position custom image uibarbutton item on left or right edge of uinavigationbar? way i've created buttons looks best if edge of button touching edge of uinavigationbar. your best bet here subclassing uinavigation bar , overriding layout subviews. in example move button far left edge if has tag of 900. - (void) layoutsubviews { [super layoutsubviews]; //override navigation bar move classes 900 ledge (uiview *view in self.subviews) { if ([view iskindofclass:[uibutton class]]) { if (view.tag == 900) view.frame = cgrectmake(0,0, 88, 44); } } }

ruby - Saving an Element's Index to a Variable -

i'm new ruby (and programming in general) , have been reading ton of docs, how-tos , questions try find answer problem no luck far. i have array of integers , i'm trying save 1 of object's integers variable later delete object array. have far: array = [3, 5, 1, 2, 6, 9] objtodel = array[3] array.delete_at(objtodel) array this deletes "1" in array... want delete "2" instead. know happens because having variable point array[3] points "2" instead of actual third element in array. have tried slice method no avail. so, possible variable equal element's index instead of content? possible without turning array hash? thanks in advance! sure, assign index variable: index = 3 array.delete_at(index) # => 2 array # => [3, 5, 1, 6, 9] you use delete method remove object directly. object_to_delete = 2 array.delete(object_to_delete) # => 2 array # => [3, 5, 1, 6, 9] note deletes instances of object in array, mig...

Spring Security - how can I define intercept-url dynamically using Database? -

i've been working on spring security , need know how can define intercept-url (in spring security) dynamically using database. i've dug deep whole internet , not find unique (and of course useful) tutorial in area. so here did: first implemented filterinvocationsecuritymetadatasource abstract class: public class myfiltersecuritymetadatasource implements filterinvocationsecuritymetadatasource { public list<configattribute> getattributes(object object) { filterinvocation fi = (filterinvocation) object; string url = fi.getrequesturl(); list<configattribute> attributes = new arraylist<configattribute>(); attributes = getattributesbyurl(url); return attributes; } public collection<configattribute> getallconfigattributes() { return null; } public boolean supports(class<?> clazz) { return filterinvocation.class.isassignablefrom(clazz); } public list<c...

MYSQL Table drop after x hours -

is possible write code mysql table creation make drop after x amount of time? temp table, last longer. i need create tables temporary tasks, need them last longer session create event myevt on schedule @ current_timestamp + interval 1 hour drop table if exists mytable;

Using a variable in a function call -

i have tried can think of , me, there's no reason not work. however, asp not native language , need insight. have variable defined request url. want use variable in function call. if pub_id <> "" response.write(pub_id) response.write(pulldownquery("newsletter_publication",pub_id,"live",newsletter_query)) else response.write(pulldownquery("newsletter_publication","","live",newsletter_query)) end if however, not work. work, though, if hard code id value portion of function call. response.write(pulldownquery("newsletter_publication",58,"live",newsletter_query)) when print pub_id returns 58 (or whatever id happens be). missing here causing variable not work function call? a solution found explicitly define pub_id variable integer, not string. pub_id = cint(pub_id) once defined such, everythig worked charm.

css position - absolutely positioned logo not centeredd in iOS -

Image
the logo on friends website working in browsers yet when open iphone or ipad (actual devices) it's wonky. <a href="http://www.averylawoffice.ca/averywordpress"><img class="averylogo" src="<?php bloginfo('template_directory') ?>/img/header-averylawoffice-logo.png" alt="avery law office"></a> it's not placed in containing div. on it's own. css .averylogo { position: absolute; width:360px; left: 50%; margin-left: -180px; z-index: 2; } i'm not quite sure why works everywhere else doesn't center on ipad or iphone properly. this it's looking like, on ios. what doing wrong? give #main-navigation position:relative; otherwise logo positioned relative body, resized on smaller device. chris coyier has article it .

How to print elements of a C++ set in Eclipse debug mode? -

knowing elements of vector might printed in debug mode using command p *(myvector._m_impl._m_start)@myvector.size() i'm looking similar command print element of set (the uniqueness of elements in set pretty useful in code) thanks in advance

jsf 2 - Send a content of datatable via mail -

i'm new in jsf , i'm developping project jsf , hibenate it's data access layer , have datatable primefaces search how send content of datatable via mail can please me thanks you can drop data email. @ code managed bean datatable value, show have data. combine javamail code , can send data out in format choose.

php - Highcharts graph X-axis label for different date ranges -

i have written below code generates area graph selected dates (to , dates). $(document).ready(function() { var options = { "series": [{ "showinlegend": false, "color": "#d0d0d0", "name": "revenue", "data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}], "credits": { "enabled": false }, "chart": { "renderto": "highchart_id", "defaultseriestype": "area", "shadow": true }, "title": { "text": null, "align": "center", "x": 0, "y": 20 }, ...

search - HTMLStripCharFilterFactory apparently not working, still retrieving xml tags -

htmlstripcharfilterfactory shows xml tags striped in query analyser when check in browser using search command not stripping xml tags. its working when analyse query in .../admin/analysis.jsp when try see search results shows xml in. <analyzer type="index"> <charfilter class="solr.htmlstripcharfilterfactory"/> ... and query analyser <analyzer type="query"> <charfilter class="solr.htmlstripcharfilterfactory"/> ... the analysis page shows index time analysis , hence don't see xml tags stripped html strip filter. however, when run search command solr return stored results only. not return indexed data. indexed data used searching.

css - Get browser width and height append divs jQuery -

i'm trying browser width , height , append 2 different div's 2 different positions using jquery. div 1 should absolute positioned, 40px left , 40px bottom of browser window whilst div 2 should 40px right , 40px bottom, no matter device looking @ webpage (so must work on ipad, iphone's etc.). i have content (images, child divs , text) sitting within both div's haven't clue how approach i'm useless jquery. could me out this? you don't need jquery (the positioning, @ least). css has enough tricks. don't use absolute positioning, use fixed: #div-1, #div-2 {position:fixed;} #div-1 {left:40px; bottom;40px;} #div-2 {right:40px; bottom;40px} with position:fixed , left, right, top, , bottom properties refer how far respective edge of fix-positioned object respective edge of viewport. ...so won't matter apped divs. append them body: var mydivshtml = howeveryougetyourdivs(); $('body').append(mydivshtml)

Jquery, calculate html table rows with same class? -

i building invoice grails, , dynamical calculation using jquery. i don't know, may not solution , not fit in javascript. may me, here go: <thead> <tr> <g:sortablecolumn style="width: 20px" property="id" title="${message(code: 'packet.id.label', default: 'id')}" /> <g:sortablecolumn style="width: 10px" property="anzahl" title="${message(code: 'packet.anzahl.label', default: 'anzahl')}" /> <th><g:message style="width: 250px" code="packet.artikel.label" default=" artikel " /></th> <th><g:message code="packet.artikel.label" default=" steuer in % " /></th> <th><g:message code="packet.artikel.label" default=" preis pro stück in € " /></th> <th><g:message code="packet....

javascript - PHP, MySql & JQuery - Filling select box after press add button -

i have several problems, thought should see code :) i have problem fill new select box when user click add button(or link) get-data.php. when user click add button(or link) new form include new select box displayed. when these html element displayed, script can't filling new select box element. when user type text or fill element 1 add new form, previous text gone. please guide me solve problem thanks in advance here html code: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script> <title>insert title here</title> </head> <body> <script type="text/javascript"> $(function(){ var items=""; $.getjson("get-d...

java - Null pointer Exception in Uploading the xml file -

i have following code: l2schemahandler handler = getschemahandler(); // validate xmlformatvalidator validator = new xmlformatvalidator(handler.elements, handler.types, handler.root); inputstream schemainput = new fileinputstream(new file(xmlfilepath)); saxparserfactory spfactory = saxparserfactory.newinstance(); spfactory.setfeature("http://xml.org/sax/features/namespaces", true); saxparser parser = spfactory.newsaxparser(); //this line gives null pointer exception parser.parse(schemainput, validator); report.addall(validator.getreport()); this.objectslist = validator.getobjectlist(); // when know objects valid, duplicate objects db if(report.isempty()) duplicateobjectsmap = validateobjectid(validator.getobjects(),report); // here need check whether object id's exists in db if(report.isempty()){//if no errors have occurred // if(validateobjectid(validator.getobjects(),report)) validateobjectsfromfile(validator.getobject...

Translate SQL to Doctrine DQL -

can me translate sql doctrine 2 dql from understand : doctrine not support sub-queries in clause, despite docs say but there must way... select * ( select m.*,qf, y.name annee pbs_members m left join pbs_qf qf on m.id = qf.member_id left join pbs_years y on qf.year_id=y.id order y.name desc ) m_temp group id edit: i have 3 tables : pbs_members (id, member_type_id, uid, address, birth_date, email) pbs_qf (id, member_id, year_id, qf) pbs_years (id, name) what want : users qf curreny year, , if no qf defined current year, decrement year until find qf, if no qf found, return null/no qf found

javascript - Client Side Script to Display all Images from another website -

i want have form on page take user input, url precise, , once field complete, have script go destination url entered (in background), , display images on page in thumbnail view user select. have been able work using php want client side solution. suggestions? javascript restricted same origin policy . not able read other site unless supports cors . other option use local proxy [serverside langauge] on domain fetch content.

file io - MySQL LOAD DATA INFILE error -

i try load data column table following sql-statement: load data infile 'filelist.txt' table filelist (filepath) lines terminated '#'; the structure of data in each line this: file:://///...path...txt# and following error message: you have error in sql syntax near 'lines terminated '#' i don't know wrong. ideas? try removing 'lines terminated '#' sql-statement. run "load data infile 'filelist.txt' table filelist (filepath)" ... comment

python - mutiple filename in django formset -

all object newmedia saving same name. how can fix this? #view.py if request.method == 'post': formset = mediaformset(request.post, request.files) if formset.is_valid(): page_key = page.objects.get(pk=1) slide = slideshowcomponent(page=page_key, order=0, label="slideshow", x=0, y=0, width=0, height=0, viewport_type="simle_page", keywords="slideshow") slide.save() filename, file in request.files.iteritems(): name = request.files[filename].name form in formset.forms: file_type = file.content_type if file_type == "image/png" or file_type == "image/jpeg" or file_type == "image/gif": newmedia = formset.save(commit=false) newmedia.filename = name newmedia.content_type = "photos" newmedia.save() i guess omitted tabulation : ...

gsm - Communicate my cell phone with my laptops in cell phone frequency? -

every communication made without cable, can listen not can understand. so, when call phone, or send sms cellp phone send information, want pc know (i know both have same frequency). or site or material start it. have android. it's make operator communication, cell phone pc , not cell phone operator please have @ openbts . (experimental) open source implementation of bts (base transceiver station), network node handles radio communication. similar openbsc . what want huge. need special hardware.

java - Autowiring a bean based on a property -

i have 2 beans, beana , beanb , in spring config. both of these beans implement same interface. have class autowired field of interface type (i.e. populated instance of beana or beanb ). initially there 1 bean, used @autowired annotation , field populated. however, there's 2 potential beans autowired. want autowire bean based on existence of property in 1 of .properties resources. there elegant way this? the solution i'm using use @qualifier annotation on autowired field specify beana , make check see if property exists in code. if does, reassign field instance of beanb . it's clunky way of doing it, i'm looking better option. apart newer feature of bean profiles, can take advantage of factorybean instantiate bean @ time of access. idea inject factorybean bean types (e.g. fqcn.beana or fqcn.beanb ). factory bean return bean factory instantiate correct type of bean may need. configuration of factorybean can take advantage of properties coming ...

android - How to make spinner items disable -

i want make spinner item un-selectable or disabled how possible if using arrayadapter: arrayadapter<string> adptr= new arrayadapter<string>(getactivity(),r.layout.custom_spinner_text,list); list.add("select one");// want disable .when click on should not selected list.add("hello"); you can override isenabled(int position ) of arrayadapter , return false disable specific item. example: @override public boolean isenabled(int position) { if (position == 4 ) return false; return true; }

c# - Query which returns results only if all (non-primitive) values from a compared enumerable are contained in the target enumerable -

we have collection of entities of type called unit , collection of entities of type unitprop , collection of entities of type called prop defined (simplified): class unit { int id; icollection<unitprop> unitprops; } class unitprop { int id; int unitid; unit unit; int propid; prop prop; } class prop { int id; string description; } we have list of prop s (called requiredprops ) need query collection with. want return collection of unit s satisfy condition of having prop s specified in requiredprops . i wrote query this: var result = ctx.units .where(x => requiredprops.asenumerable() .except(x.unitprops.select(y => y.prop)) .count() == 0) .tolist(); of course, linq entities query throw exception: unable create constant value of type 'prop'. primitive types ('such int32, string, , guid') supported in context. i tried this: var result = ctx.units .where(x => requiredprops.s...

windows - How to use HTML TestSuite as well as Test Cases on Selenium RC using IE -

Image
i using selenium rc in internet explorer. have written test cases in html. how can write test suite in html including test cases in html? want run html test suite using selenium rc in ie , windows xp / windows 7. how can this? in selenium ide version 1.8, right click in "test case" section , add html test cases selecting "add test case" option. save test suite in html format selecting "file > save test suite" option. after create 1 .bat file following content execute html test suite. java -jar selenium-server.jar -port 4444 -htmlsuite "*chrome" " http://www.google.com/ " "c:\selenium\testsuite.html" "c:\selenium\testsuiteresult.html" pause

javascript - How to disable deeplinking in angularjs? -

i trying implement page angularjs. problem behaviour of anchor element in page seems overrided angularjs. so below anchor element, want present link user go destination. <a href="payment/123">pay!</a> so want direct user page @ payment/123 . if click on link now, try come out new url adding link in href current url. e.g. if current url http://www.example.com/shopping , tries direct me http://www.example.com/shopping/#/payment/123 not want ( http://www.example.com/payment/123 ). any idea how can solve this? that bug rc11 , rc12. try 1.0.0 final.

linux - Downloading using wget in php -

i using wget in php script download images url submitted user. there way me determine size of image before downloading , restricting size of download 1mb? can possibly check url points image , not entire website without downloading? i dont want end filling server malware. before loading can check headers (you'll have download them though). use curl - not wget. here's example: $ curl --head http://img.yandex.net/i/www/logo.png http/1.1 200 ok server: nginx date: sat, 16 jun 2012 09:46:36 gmt content-type: image/png content-length: 3729 last-modified: mon, 26 apr 2010 08:00:35 gmt connection: keep-alive expires: thu, 31 dec 2037 23:55:55 gmt cache-control: max-age=315360000 accept-ranges: bytes content-type , content-length should indicate image ok

file get contents - PHP changes the file_get_contents param url -

i'm using following line page content: $handle = file_get_contents( "http://www.mywebsite.com/index.php?show=users&action=msg&section=send", null, null, 1000, 19000); and then, i'm getting following message: warning: file_get_contents(http://www.mywebsite.com/index.php?show=users&action=msg §ion=send ): failed open stream: http request failed! http/1.0 403 forbidden (please take note @ bolded part). what happened it? why changes url param? i don't think php changing querystring parameters. if reading message in browser, should matter of how output html formatted. so, 403 error getting should not related unwanted url transformation.

blackberry - WebWorks AJAX Cross domain request -

i'm working on playbook app webworks sdk. i'm trying make http request (method: post) sending , recieving data. can response server, server can't $post data, when try display $_post['apikey'], nothing apears, checked code 100 times, checked config.xml uri, can't find error. tl;dr: can't send can receive data. my php server code: echo "passed key is: ".$_post["apikey"]; // nothing apears echo "<br>"; if(md5($_session['private_key'])===$_post["apikey"]){ } else{ echo "invalid api key"; // getting response on client app exit(); } ?> my js client code: function httprequest(){ var key="a984a4474cff54d8468a296edf3af65b"; document.getelementbyid("status").innerhtml="reaching server..."; ////////////////////////////////////// var xdr = getxdomainrequest(); xdr.onload = function() { document.getelementbyid("status").innerhtm...

javascript - How much data / information can we save / store in a QR code? -

i use script https://github.com/jeromeetienne/jquery-qrcode (or there better solution?) what "save" small scripts or programs , files xml formatted files (svg, x3d, ...) qr code images. but how information (in bytes) can save qr code images (using javascript solution)? any experience script , using qr codes files? https://github.com/jeromeetienne/jquery-qrcode qr codes have 3 parameters: datatype, size (number of 'pixels') , error correction level. how many information can stored there depends on these parameters. example lower error correction level, more information can stored, harder code recognize readers. the maximum size , lowest error correction give following values: numeric max. 7,089 characters alphanumeric max. 4,296 characters binary/byte max. 2,953 characters (8-bit bytes)

sql - Divide data from other days by data from one particular day -

i bit stuck on 1 problem few hours now. let`s have table following data: month outstanding 01/05/2012 35 678 956 02/05/2012 33 678 956 03/05/2012 31 678 956 04/05/2012 27 678 956 05/05/2012 24 678 956 i need ratio of say, day 05/05/2012 results first day of month e.g. outstanding of05/05/2012 divided outstanding 01/05/2012 (24 678 956/35 678 956) what function should use? tried doing on partition / result of to_char(trunc(trunc(a.date_,'mm'), 'mm'),'dd-mm-yyyy') didnt seem work me create table temp (month date , outstanding number); insert temp values(to_date('01/05/2012','dd/mm/yyyy'),35678956); insert temp values(to_date('02/05/2012','dd/mm/yyyy'),33678956); insert temp values(to_date('03/05/2012','dd/mm/yyyy'),31678956); insert temp values(to_date('04/05/2012','dd/mm/yyyy'),27678956); insert temp values(to_date('05/05/2012','dd/mm/yy...

javascript - How do you use js to insert json response into <a>xxxx</a> -

i trying implement "most recent" widget tumblr post. far, have been able grab top 5 recent posts using json post (http://stackoverflow.com/questions/5617378/how-to-display-a-link-to-my-latest-tumblr-post-using-javascript). want know how how insert {title} xxx link shows title of recent posts. i thinking need use .append or .html, not sure how it. can me out. javscript: $.getjson('http://brianjsmith.tumblr.com/api/read/json?callback=?', function(response) { $('#mylink').attr('href',response.posts[0].title); }); html: <a id=#mylink>most recent post {title}</a> $('#mylink').attr('href',response.posts[0].url).text(response.posts[0].title); update: after check response, there no title property regular-title . $('#mylink').attr('href',response.posts[0].url).text(response.posts[0]['regular-title']);

Android remote connection to Mysql DB through php - Login authentication -

i developing small application , authentication needed. i'm trying develop connecting mysql db through php. add uname/pw --> loging --> send php --> check db --> ok sends android --> authenticated. / error sends re loging. i have developed far, think how should i'm not sure since i'm new cording. please kind enough me cording. thank you. public class loging extends activity{ textview txt; edittext uname,pwd; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.loging); button b = (button)findviewbyid(r.id.log); uname = (edittext)findviewbyid(r.id.uname); pwd = (edittext)findviewbyid(r.id.pwd); b.setonclicklistener(new view.onclicklistener() { public void onclick(view arg0) { // todo auto-generated method stub arraylist<name...

Android: header in a ListView -

i have header on top of listview , in way if user scrolls down listview, header stack top of view ( right below of action bar ). i created relativelayout include linearlayout header , below it, listview, still when listview scrolled down, header disappears. tried addheaderview no luck yet. can throw light here? edit: layouts this: <include android:id="@+id/includefilterszoekandboek" android:layout_above="@+id/acommodatieslistview" layout="@layout/filters_header_layout" /> <listview android:id="@+id/acommodatieslistview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@+id/loadmoreaccommodaties" android:layout_alignparenttop="true" android:scrollingcache="false" > </listview> <button android:id="@+id/loadmoreaccommodaties" android:layout_width="match_par...