Posts

Showing posts from February, 2013

How to get multiresult with multicondition in Sql Server -

i need solve this. hopefully can giving me advices. for sample, i've got data : proclib.march 1 first 10 rows flight date depart orig dest miles boarded capacity ----------------------------------------------------------------- 114 01mar94 7:10 lga lax 2475 172 210 202 01mar94 10:43 lga ord 740 151 210 219 01mar94 9:31 lga lon 3442 198 250 622 01mar94 12:19 lga fra 3857 207 250 132 01mar94 15:35 lga yyz 366 115 178 271 01mar94 13:17 lga par 3635 138 250 302 01mar94 20:22 lga 229 105 180 114 02mar94 7:10 lga lax 2475 119 210 202 02mar94 10:43 lga ord 740 120 210 219 02mar94 9:31 lga lon 344...

c# - How to maintain consistancy of Header being on page top throughout all Page Sizes? -

i have set page header (using itextsharp library) along margins set a4 page size (according orientation) -because have set document's page size a4 only- , works a4 page , shows on top. can tell me how make header consistant throughout page size whatever user selects? should print header on top of each , every predefined page size a4 because when select pagesize.halfletter, header gets vanished goes out of page boundaries. help? updated question! my code is: using system; using system.collections.generic; using system.linq; using system.text; using itextsharp; using itextsharp.text; using itextsharp.text.pdf; using itextsharp.text.exceptions; using system.windows.forms; using system.io; namespace pdfgeneration { public class events : itextsharp.text.pdf.pdfpageeventhelper { private string header; private itextsharp.text.pdf.pdftemplate total; private pdfcontentbyte cb; private pdftemplate template; protected font foote...

android - how can i add an app widget to home screen automatically? -

i have searched many results google, find use app widget. after learned how write widget, new problem appeared. how can add app widget home screen automatically? why third party app can this? confused it. can me resolve problem? you can't add widgets programatically home screen. can create widget host , let user add widgets that.

rss - How can I get my android app reviews and info Feed into my site from Google play -

how can android app reviews , info. feed site google play... same http://www.appbrain.com , other android play store doing... getting latest app info. directly google play store get reviews google app. https://still-plateau-10039.herokuapp.com/reviews?id=mytown.preschool id={google-app-id} the service return reviews on app or simple host locally source code of service can found @ https://github.com/tohir87/googleplay-reviews

Why this sqlite python 3x code is not compatible with python 27 -

i´m new on python , developing app python 2.7, , got nice code python 3.x doesn´t work in version. i´ve been trying adapt it´s beauty couldn´t see issue causing compatibility problem. message is: attributeerror: database instance has no attribute '_db' in line 9.please me solve issue. #!/usr/bin/python3 import sqlite3 class database: def __init__(self, **kwargs): self.filename = kwargs.get('filename') self.table = kwargs.get('table', 'test') def sql_do(self, sql, *params): self._db.execute(sql, params) self._db.commit() def insert(self, row): self._db.execute('insert {} (t1, i1) values (?, ?)'.format(self._table), (row['t1'], row['i1'])) self._db.commit() def retrieve(self, key): cursor = self._db.execute('select * {} t1 = ?'.format(self._table), (key,)) return dict(cursor.fetchone()) def update(self, row): self._db.exe...

Android: Cache image by android class or manual way? -

when develop android app download , caching image internet, see many app use memorylrucache or disklrucache cache image after download. want know why use them, why don't use way like: download image, save image sd card , after image sd card show it( manual way). i'm newbie in android dev. please me understand it? many many times. well downloading list of images url consume time , fill user memory also....so better dynamically load images url , make cache , preview images cache.. i hope did got point....check example of lazy loading of image

iphone - ios: What is the efficient and recommended way to reverse geocode? -

i reverse geo code latitude , longitude of location , want address of location. have done through google web service takes time. want know if there other , efficient approach. currently calling service, nsstring * getaddress = [nsstring stringwithformat:@"http://maps.googleapis.com/maps/api/geocode/json?latlng=%@,%@&sensor=true",lattitude,longitude]; you can use clgeocoder : [self.geocoder reversegeocodelocation:location completionhandler:^(nsarray *placemarks, nserror *error){ clplacemark *placemark = placemarks[0]; nslog(@"found %@", placemark.name); }]; this still take time though, since both methods use web services convert lat / long place

javascript - Ajax setting 'context' does not affect 'data's location -

the following ajax works function retrieve(el) { var table = this; this.el = el; this.fetchinfo = function () { $.ajax('data.html', { context: table, <!-- question here --> data: { location: table.data('location') }, success: function (response) { this.el.find('.info').html(response).fadein(); }, } } but wondering why cannot replace table.data this.data on denoted line. since set context table variable, this should set whatever table referring right? holds true in context of other members of ajax object (including success ), not members of data . why case? data('name') extracts value tag attribute data-name the context variable you've given applies within success callback, , doesn't change of other parameters passed $.ajax . the answer therefore depends on how call fetchinf...

Objective-c best data structure sortable of string and bool -

i need store list of strings items in tableview , for each string need store bool value .. use nsdictionary how can sort list of strings alphabetically (using selector) , sort @ same time bool values? i know exists methods sortusingselector or usingcomparator, in nsdictionary can sort keys values need reverse.. can me, maybe using data structure ? i recommend following data structure: use nsarray of nsdictionaries (make property): self.array = @[@{@"string": @"zusuuuuu", @"bool": @0}, // not creative ;-) wanted unsorted example @{@"string": @"yourcontent", @"bool": @0}, @{@"string": @"yourothercontent", @"bool": @1}]; you can sort this: self.array = [self.array sortedarrayusingcomparator:^nscomparisonresult(nsdictionary *adictionary, nsdictionary *anotherdictionary) { return [adictionary[@"string"] compare:anotherdictionary...

CSS responsive menu - right padding -

Image
i have responsive menu in middle of div. after resize screen menu moves right of screen. preview example: >>> code here <<< (all html/css/js accessible via web) it looks > question: how align right in picture ... thank in advance. ps: code in example link (html file) add position: relative; .content-menu , , position: absolute; right: 0; .nav (both in mobile-size media query). edit , maybe remove width on .nav , , .nav > li , change them max-width: 280px; min-width: 200px; won't break on screens smaller 300px. hope helps.

jsf - Zooming an image in PrimeFaces -

i'm developing website using primefaces component library. know, there built in component zooming (zoom in , zoom out) image in primefaces? it's not quite same, there 2 primefaces extensions, called imageareaselect , imagerotateandresize give (combined) same functionallity. the second extension lets scale image, can interpreted zoomed. take @ example well.

javascript - jQueryUI - Drag and Drop issue - dragged element goes behind other DOM elements -

i trying implement drag , drop between 2 div's please refer fiddle below : http://jsfiddle.net/sandeepkram/sauca/ this layout replica of application. in fiddle can see if drag element within first div (on left side) keeps moving within div forever - though if motion mouse drag , drop onto right side div, work. here problem indefinite scrolling / dragging of element within left side div. dont know problem here - in application have problem, in when drag item out of left side div, vanishes though can drop cursor on right side div , drop appears have worked correctly. need know why dragged element disappearing. i have looked questions , resources related this, sortables etc on stackoverflow , net - no use. i have tried use "stack" option no use $.each($("ul#secondarykpilist ul > li"), function (index, tlistitem) { $(tlistitem).addclass("secondarykpidraggable"); $(tlistitem).draggable({ revert : 'invalid...

x86 - What is wrong with this assembly code? -

it says invalid combination of opcode , operands section .data name: db "what name?" name_l: equ $-name hello: db "hello" hello_l: equ $-hello section .bss name_v resb 255 section .test global _start: _start: mov eax, 4 mov eax, 1 mov ecx, name mov edx, name_l int 80h mov eax, 3 mov ebx, 0 mov ecx, name_v mov edx, 255 int 80h int eax, 4 mov ebx, 1 mov ecx, hello mov edx, hello_l int 80h mov eax, 4 mov ebx, 1 mov ecx, name_v mov edx, 255 int 80h mov eax, 1 mov eax, 0 int 80h well, normally, assembler tell line offending one, , should examine opcode , operands ensure compatibility (or, @ minimum, let us know line is). in meantime, have either incorrect or superfluous code in program after _start : mov eax, 4 mov eax, 1 ; should ebx if these linux calls, you're lucky didn't assemble. passing random...

Yii: Zend's preDispatch and init analogon -

i have translate applications zend yii framework. since i'm new zend, wonder how implement controllers predispatch() , init() functions in yii. advice. for init there same init function in yii controllers. public function init() { // initialization } for predispatch can use beforeaction , called before action - return true if want action executed, or false cancel execution. protected function beforeaction($action) { // logic before action return true; } when ovveriding custom controller parent methods should called. there usefull filter actions

Android AlertDialog.Builder Custom title bar with Edit text -

here issue, want create custom alert dialog box 4 parts, title bar header part (most of time plan use edittext box searching purpose) list item(single click or multi click) footer part(cancel or ok buttons) i try using separate layout, list view item not showing properly(shrinking). plan use alertdialog , inside have implemented listview , footer button part in single linerlayout , set using setview method, solved list view , footer issue. problem want add header part top of list view. image link : https://dl.dropboxusercontent.com/u/4048078/device-2013-07-31-141546.png you can try this dialog dialog_help = new dialog(getactivity()); dialog_help.setcontentview(r.layout.title_multi_selectitems_dialog); edittext et_1 = (edittext) dialog_help.findviewbyid(r.id.et_help_1); inputmethodmanager imm = (inputmethodmanager) getsystemservice(context.input_method_service); imm.showsoftinput(youredittext, inputmethodmanager.show_implicit); dialog_help.setcancelable(true)...

mapping - php algorithm that collects all coordinates into array from within 2D square -

i have map places on it. coordinates places saved in mysql lat/lon string ("3456,789"). i'm trying write function give me array of coordinates in shape of square coordinates centre-point. hit database see if other places have coordinates in array. i can define corner points of square , can write clunky function fill array coordinates 1 one loop or that, i'm wondering if there clever algorithm can take care of me. example below expected output: function getnearbyplaces($distance = 4){ $radius = $distance / 2; $coords = explode(",",$object->metadata["coordinates"]["value"]); // array("3456","789") $topleft = array($coords[0] - $radius,$coords[1] - $radius); $topright = array($coords[0] + $radius,$coords[1] - $radius); $botleft = array($coords[0] - $radius,$coords[1] + $radius); $topright = array($coords[0] + $radius,$coords[1] + $radius); // calculate coords within square here // expe...

wordpress - Jquery UI Dialog -

i try use jquery ui first time. here show code: (in wordpress index file ) public function enqueue_admin_scripts() { wp_enqueue_script( $this->plugin_slug .'-admin-styles', plugins_url( 'js/jquery-1.9.1.js', __file__ ) ); wp_enqueue_script( $this->plugin_slug .'-admin-styles', plugins_url( 'js/admin.js', __file__ ) ); wp_enqueue_script( $this->plugin_slug .'-admin-styles', plugins_url( 'js/jquery-ui-1.10.3.custom.min.js', __file__ ) ); } here admin.js jquery(document).ready(function(){ jquery("#add_new_gallery").click(function(){ // alert (456); jquery(function() { var name = jquery( "#name" ), email = jquery( "#email" ), password = jquery( "#password" ), allfields = jquery( [] ).add( name ).add( email ).add( password ), tips = jquery( ".validatetips" ); function updatetips( t ) { ...

iphone - How to dismiss UIActionSheet or UIAlertView after the UIViewController popped -

in situation, when uialertview or uiactionsheet showing, due external event, supposed pop view controller, when both alert view or action sheet showing on view not destroying. showing alerts view in many places don't want make member variable , dismiss checking 1 one. how handle case? idea appreciated. thanx. for alertview can use below answer https://stackoverflow.com/a/16915501/1713478 and actionsheet use below code [actionsheet dismisswithclickedbuttonindex:0 animated:yes];

vb.net - Argument 'Expressions' cannot be converted into type "DBNull" -

i badly stuck error. when try call form (frmrecipe) menu.vb gives error on line trying maximum id recipe table, here code below function get_max_id() string try dim cmd new sqlcommand("select max(recipe_id) recipe", conn) cmd.commandtype = commandtype.text dim dr sqldatareader dr = cmd.executereader if dr.read return format(val(dr(0)).tostring + 1, "0000") else return "0001" end if catch ex exception msgbox(ex.message) end try end function recipe_id type of varchar in database try this: return format(val(dr(0).tostring) + 1, "0000")

Difference between $@ and $* in bash scripting -

this question has answer here: parsing/passing command line arguments bash script - difference between “$@” , “$*”? 2 answers i'm new in bash , i'm learning it, , have doubt real difference between use of $@ , s* . i red here bash special parameters i understand both expand positional parameters, difference occurs within double quotes. way "$@" = "$1" "$2"..."$n" different "s*" = "$1$2...$n". i try understand simple script: if [ $# -gt 0 ]; echo "your command line contains $# arguments" else echo "your command line contains no arguments" exit fi echo "params are: " echo $@ echo $* echo "$@" echo "$*" if execute script in terminal ~./my_script par1 par2 par3 the result same: params are: par1 par2 par3 par...

ruby - Sequel gem increment -

i trying use ruby sequel gem db operations. i stuck incrementing , decrementing values. the doc says should work, though seems strange me able add number , symbol. 2.0.0-p247 :019 > require 'sequel' => true 2.0.0-p247 :020 > s = sequel.connect('sqlite://db.sqlite') => #<sequel::sqlite::database: "sqlite://db.sqlite"> 2.0.0-p247 :021 > s[:query_volume].update_sql(:queries => 3) => "update `query_volume` set `queries` = 3" 2.0.0-p247 :022 > s[:query_volume].update_sql(:queries => :queries + 3) nomethoderror: undefined method `+' :queries:symbol (irb):21 /users/avandra/.rvm/rubies/ruby-2.0.0-p247/bin/irb:16:in `<main>' but can see gives undefined method on queries symbol. kindof concurs why strange me. i tried using curly braces, gives error: 2.0.0-p247 :023 > s[:query_volume].update_sql{:queries => :queries + 3} syntaxerror: (irb):23: syntax error, unexpected =>, exp...

Perl:download DBD::AnyData -

can me download link dbd::anydata perl module. installed activeperl , when time export data csv file database using anydata realised dbd::anydata module not found. tried downloading cpan website after several attempts there no success,the browser keeps saying "server down or have been moved". different link enable me download module. why not using package managers ppm or cpan? ppm included in activeperl. ppm install dbd::anydata see manual or faq

Confusion over JavaScript implementations of MessagePack -

the official messagepack page links page: https://github.com/msgpack/msgpack-javascript but last update 3 years ago. on other hand, there other implementations of messagepack in javascript such as: https://github.com/cuzic/messagepack-js https://github.com/creationix/msgpack-js what differences among them? 1 authentic one? 1 should use? technically, https://github.com/msgpack/msgpack-javascript official messagepack implementation of msgpack javascript. developer goes handle "uupaa" wrote implementation of it. hasn't touched code in time. i have outstanding pull request fixes map handling issue hope implements @ point. barring that, though, have had no problems using library. the reason decided not go creationix's solution because adds js-specific extensions msgpack specifiction. extensions did not work other msgpack implementations.

java - The first sort property must be the same as the property to which the inequality filter is applied -

java.lang.illegalargumentexception: first sort property must same property inequality filter applied. in query first sort property vote inequality filter on createddate i error when try run code below. there work around problem? query query = new query("post"); long timeago = - timelimit; filter categoryfilter = new filterpredicate("postcategory", filteroperator.equal, category); filter createddatefilter = new filterpredicate("createddate", filteroperator.greater_than, timeago); filter compositefilter = compositefilteroperator.and(categoryfilter, createddatefilter); query.setfilter(compositefilter); query.addsort("vote", sortdirection.descending); list<entity> postsentitylist = datastore.prepare(query).aslist(fetchoptions.builder.withoffset(offset).limit(limit)); the code above trying reteive list of post entities based on category , created within last 24 hours. sort them how many votes have. has limit , offset pagi...

css - Sencha Touch: green forward button -

ok, here sencha link http://try.sencha.com/touch/2.2.0/demos/ext.button.ui/viewer.html different types of buttons. so, there make button forward, do { xtype: 'button', ui: 'forward',//i'm adding string make right arrow text: 'forward' } nice , perfect. easy. does know how make button green (not button, the arrow well )? actually arrow have used webkit mask whatever background color give arrow using css background color takes that. so, make button green use following code:- .x-button-forward, .x-button-forward:after { background: -webkit-linear-gradient(top, #a2e306,#7eb105 3%,#5b7f03); }

c# - What is the minimum set of types required to compile `async` code? -

out of curiosity, i'm trying simple async / await code compile under .net 3.5 client profile: async void awaitfoo() { await new foo(); } class foo { public ifooawaiter getawaiter() { … } } interface ifooawaiter : system.runtime.compilerservices.inotifycompletion { bool iscompleted { get; } void getresult(); } i'm aware .net 3.5 not support language feature, expressed compilation error: cannot find types required async modifier. targeting wrong framework version, or missing reference assembly? i aware of nuget package microsoft.bcl.async , not have support .net 3.5. question: minimum set of types & type members required async code compile? minimal set officially documented; , if so, where? (note i'm interested in successful compilation, not execution.) what i've got far: i've been trying find minimum set of types experiment, appears possible since compiler reports required, missing types 1 one: predefined type sy...

java - Playing Online Videos one by one -

i have xml file videoview: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/back" android:orientation="vertical" android:screenorientation="landscape"> <videoview android:id="@+id/videoview_concept" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> and java part is: public class playvideos extends activity implements oncompletionlistener{ public integer index_val=0; @override public void oncompletion(mediaplayer mediaplayer) { index_val++; videoview videoview= (videoview)findviewbyid(r.id.videoview_concept); checkdbconn(); videoview.setvide...

c# - MVC Razor view: XML node parsing issue -

i have mvc application querying lucene/solr index. in partial view, displaying metadata on series of xml documents returned query. metadata extracted xml documents using xpath queries , paged, listing 10 documents @ time. view cshtml follows... @model solrmvctest2.models.facet <section> @foreach (system.xml.xmlnode doc in model.searchresult.selectnodes("/response/result/doc")) { <article> <b>document type: @doc.selectsinglenode("//str[@name='doctype']").innertext </b> <br /> <b>nhs number: @doc.selectsinglenode("//str[@name='crn']").innertext </b> <br /> @doc.outerxml.tostring() </article> <p></p> } </section> i have included display of outerxml debugging purposes , partial listing of results highlights serious issue. each group of 10 documents, innertext of selected nodes not updated each successive document, displays values first documen...

.htaccess and PHP caching -

this 1 relatively simple 1 hopefully. launched site , uploaded new server. in uploading .htaccess file, made small mistake , when went correct it, didn't seem update. we deleted .htaccess file altogether , yet reason seems have cached on server... think. have hard refreshed, tried different machines, different browsers , still pulls in dynamic pages. i have never experienced before. does know how force / hard refresh htaccess file>? i'm not understanding describe happenning since deleted file, , you've not said in .htaccess which caused problem, nor resulting impact was. however....you don't need more delete .htaccess file - apache not cache it.

css - positioning Div inside another Div with centered background image? -

Image
i have div has image of world map centered inside it. , there div within div. what trying put texts inside second div , place on top of world map image. can without problem when resize browser, seems second div moves original place! i have demonstrated issue in images bellow: on browser resize this: and here css: #body{ top:0px; } #wrapper{ position:absolute; width:100%; top:0px; left:0px; right:0px; bottom:0px; min-width:100%; } #flagholder a:link, a:active, a:visited{ font-family:verdana, geneva, sans-serif; color:#333; text-decoration:none; margin-left: auto ; margin-right: auto ; } #header{ background-image:url(img/bg-header_footer.jpg); width:100%; height:250px; } #footer{ background-image:url(img/footer.png); width:100%; height:250px; } #content{ } #flagholder{ width:80%; border-radius:15px; border:solid 2px #ecf0f1; } #mapholder{ background-image:url(...

html - Tumblr Static Page, deleting inline CSS -

Image
i trying create couple of static pages on tumblr blog creating. when using html option creating static page, whenever try submit html inline-styling tumblr deletes it, example <div style="margin-top:35px;"> becomes <div> on submitting. is how tumblr set or there missing here? tumblr detele inline styling if you're using standard layout, switch custom layout , you'll able write html want result here: http://dustyprophet.com/test

C# WinForms changing database name in other form -

so here first question , first c# program: i need function permanently change connection string. my program has structure: main form form1 , when click button, options , new - form3 , user can log in (password protects changing options) , if login successfull create new form - form4 . in constructor of form4 , pass sqlconnection object form1 . want change database name clicking on button, here code: var config = configurationmanager .openexeconfiguration(configurationuserlevel.none); var connectionstringssection = (connectionstringssection)config .getsection("connectionstrings"); var x = connectionstringssection .connectionstrings["app.properties.settings.ppsconnectionstring"] .connectionstring; string[] words = x.split(';'); words[1] = "initial catalog="+textboxdb.text; x=string.join(";", words); connectionstringssection .connectionstrings["app.properties.settings.ppsconnectionstring"] .connectionstring = x; //a...

php - TypeError: Value does not implement interface HTMLInputElement -

i'am trying post form using jquery-ajax, , i'am getting error on posting form on click. typeerror: value not implement interface htmlinputelement here javascript code: $('document').ready(function () { $('#update').click(function () { jquery.post("update_category", { c_id: c_id, c_name: c_name, c_description: c_description }, function (data, textstatus) { if (data == 1) { $('#response').html("thank you!!..we soon..!!"); $('#response').css('color', 'green'); } else { $('#response').html("some error occurred"); $('#response').css('color', 'red'); } }); }); }); my form : <div id="form"> <form> <!-- pront drop down here !--> <input type=...

Delete column without deleting merged cells - excel vba -

how can delete left-most column of merged cell without deleting content? for instance, range("a1:c1") merged .value="hi" by doing range("a2").entirecolumn.delete(xlleft) , not lose merged cell (which becomes range("a1:b1") , lose content. why not hold value in temp variable: sub deletecolumnretainmergedcellvalue() 'select merged cells, run subroutine. dim v string v = selection.cells(1, 1).value selection.cells(1, 1).entirecolumn.delete selection.cells(1, 1).value = v end sub is you're looking for? if not, please explain little more.

ios6 - iOS UITableViewController with paging dynamically -

my question - how make uitableviewcontroller with paging ? for example, have send request gives me information count of science articles. on uitableviewcontroller present information in tableview static cells, , if want see information article should swipe left or right , animation transition between controller, see same controller information. basically main complexity uitableviewcontroller , because if uiviewcontroller , can implement huge amount of solutions icarousel , many others, tableviewcontroller can't make same solutions. happy if recommend solution. uitableview think inherits uiscollview, can try saying [tableview setpageenabled:yes]; if doesn't work, try getting subviews of table view [tableview subviews]; and 1 of elements scroll view, read documentation sure allowed manipulate hirearchy of uitableview if else fails, add gesture control tableview , put in vertical gestures , call method scrolltorowatindexpath:atscrollposition:...

sequence - R: How to use output of 'translate' function to write a table? -

i have file ( data.txt ) contains 2 dna sequences (orf): data = readdnastringset(file="data.txt") data # dnastringset instance of length 2 # width seq names #[1] 57 atgacccccacctccatccccacacttctatcccgctgccccgcctctctcccctaa gpg #[2] 54 atgacccatgagcaccatgcagccaaaaccctgggaatcggcaaagccatctag pfk i want convert them aminoacids: t=vector(mode="list", length=length(data)) (i in seq_along(data)) { t[[i]]=translate(data[[i]]) } t #[[1]] #19-letter "aastring" instance #seq: mtptsiptllsrcpaslp* #[[2]] #18-letter "aastring" instance #seq: mthehhaaktlgigkai* then write table , have output using: tt=do.call(rbind,t) write.table(tt,"aa.txt",sep="\t\t") but these commands don't work. couldn't find problem. how can write table? note: translate function [ seqinr ] , readdnastringset function [ biostrings ]. i don't know why need seqinr . bio...

Facebook Ads Api issues with CPC as bid_type parameter when creating ad groups -

does have idea isn't working here , if noticed exception i'm seeing? wanted prepare october changes announced fb , seems when creating ad groups 1 need use cpc/cpm bid types, need define max bid differently etc. here's call: curl -f "campaign_id=xxxxxxxx" -f "bid_type=cpc" -f "bid_info={'clicks':111}" -f "name=test" -f "adgroup_status=1" -f "targeting={'countries':['us']}" -f "creative={'title':'test','body':'test','image_hash':'cf689a9aed4769fc4c8192569fda9f5e','link_url':'http://mylink.com/','type':1}" -f "redownload=1" -f "https://graph.facebook.com/act_xxxxxxxx/adgroups?access_token=token"` and here's response fb api: [error] => stdclass object ( [type] => exception [message] => please specify locations on facebook want show ad impressions. ...

java - How to customize the way JAXB parses xml? -

i working jaxb since 2 days please forgive me if question easy. tried google didn't find interesting. used jaxb generate java classes based on xsd schema. tested, works, when make jaxb parse xml (which satisfies schemas) receive real objects full of data. great. question is, if possible generate kind of dictionary during parsing of xml? somehow possible register handler called during parsing ? how achieve it? for example let's in xml being parsed there line this: <bookedtrip tattoo="2" rph="100" direction="inward" bookstatus="hk"> i able extract bookedtrip.direction = inward . guess can using kind of handlers xml parser.

mysql - How do you manage a large video database? -

i have tried giving id , storing title, path , rest in mysql database. looks simple. there robust way out there that. i'm not sure looking for. but... basically there 2 way deal "binary large objects". the first 1 store them called blob column in db. the second one, is, now, store in db "pointers" actual data on external storage solution. "path" referencing files on file-system.. both solutions have pro , cons. regarding performances, data migration, load balancing, , on. has been discussed elsewhere on so: mysql binary storage using blob vs os file system: large files, large quantities, large problems when using mysql blob recommended?

vb.net - String.Contains not working as expected -

i have 54,000 files each different method of naming , need check whether filename contains particular string. however, can't find ways of getting select statement work correctly. my code fails unexpectedly. please can tell me why string "bar" not found in "baritone"? dim tempcheck string = "1st baritone" dim goodone boolean = false select case tempcheck case tempcheck.contains("corn") goodone = true case tempcheck.contains("horn") goodone = true case tempcheck.contains("bar") goodone = true case tempcheck.contains("trom") goodone = true case tempcheck.contains("eup") goodone = true case else goodone = false end select try this: dim tempcheck string = "1st baritone" dim goodone boolean = false select case true case tempcheck.contains("corn") goodone = true ...

php - stored procedure returns different columns -

we've been running stored procedures on ms sql database though odbc using php. whenever run sp returns same 2 column names, regardless of sp run. if results set has more 2 columns, first 2 returned. it's it's got stuck on results previous query. when run on own, in php file containing sp, every sp returns 2 columns same titles before, regardless of number of columns or column titles should returned. contents of columns matches first 2 columns expect. example: looking contact in address book returns following column names of sp executed morning, contained 2 columns in result set. 01234 567890 | john 01234 567890 | alice when should return 01234 567890 | john | smith | m 01234 567890 | alice | chalk | f with column names 'number' 'fname' 'sname' , 'gender'. code is: $query = "{call dbo.storedproc('functionname', $search, 'id')}"; $resultset = odbc_prepare($connection, $query); odbc_execute($resu...

Django Admin Template Missing after S3 Setup -

i'm running django locally using heroku, static + media files hosted on s3. however, admin templates have gone missing. i've followed config - django template path - template_dirs file follows: project_path = os.path.realpath(os.path.dirname(__file__)) template_dirs = (project_path + '/templates/') template_loaders = ( 'django.template.loaders.filesystem.loader', 'django.template.loaders.app_directories.loader', ) i've noticed browser still looking admin css files on s3 but, first time setting , deploying, i'm bit lost how configure properly.

android - can't set alertdialog size -

i have problem alertdialog has fixed max size perfect square side length of min(parent width, parent height) . creates problem can't alertdialog wide screen. in dialog, have loaded imageview show image. want image shown wide screen , not in square - makes smaller. code alertdialog in acivity: alertdialog.builder alertadd = new alertdialog.builder(mainactivity.this); layoutinflater factory = layoutinflater.from(mainactivity.this); final view view = factory.inflate(r.layout.schematic_image_view, null); alertadd.setview(view); alertadd.show(); code xml file schematic_image_view.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_root" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="0dp"> <imageview android:id="@+id/schematic...

ios - setExclusiveTouch ignored when using UISwipeGestureRecognizer -

Image
i have 2 uiviews (custom scroll views) respond uiswipegesturerecognizer . these 2 uiviews subviews of parent uiview . want allow one of subviews respond recognizer. in other words, 1 should allowed swiped @ time. setting setexclusivetouch = yes on subviews and/or parent view doesn't have effect. how can make sure 1 subview being swiped @ time? here's picture: uiscrollview's default have multipletouchenabled set yes - if not need multiple touch (zooming example requires it), set no.

c# - Exclude starts with but include ends with -

i can't figure out myself, have match string starts asp. , ends _aspx , need exclude start of match (the asp. part). for example, string input = "random stack trace text asp.filename_aspx random text"; regex r = new regex("regular expression needed!!!"); var mc = r.matches(s); foreach (var item in mc) { console.writeline(item.tostring()); } and have needs output this, filename_aspx that's job positive lookbehind assertion : regex r = new regex(@"(?<=\basp\.)\s+_aspx"); (?<=\basp\.) ensures asp. present before starting position of match, doesn't include in match result. \b word boundary anchor asserts don't match wasp , asp . \s+ matches 1 or more non-whitespace characters (this assumes filenames don't contain spaces).

android - Embed Video in DreamweaverCC and Phonegap not working correctly -

hi all. i making dreamweavercc mobile app. have working through phonegap build , can .apk. however html 5 "video" tag dose not seem working correctly. for instance , following works correctly when linked movie on internet, , can play video correctly , without problem on phone. <video poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/teddy_bear_27.jpg/250px-teddy_bear_27.jpg" controls> <source src="http://www.w3schools.com/html/movie.mp4" type="video/mp4"> </video> however local video file display place holder , show "controls" keeps showing spining box if "loading" never dose: <video width="560" height="340" controls> <source src="videos/broken_compas.mp4" type='video/mp4; codecs="avc1.42e01e,mp4a.40.2"'> </video> so question : why android not picking embedded video ? remember , been packed through dre...

c# - System.FormatException of a string -

this question has answer here: how escape braces (curly brackets) in format string in .net 7 answers i'm getting system.formatexception: input string not in correct format when running method. the values of fields: arrayname = "requester"; fieldlist = "\"name\" : \"shimshon\""; // "name" : "shimshon" public override string tostring() { var val = string.format("\"{0}\" : { {1} }", arrayname, fieldlist); return val; } the expect result of method is "requester" : { "name" : "shimshon" } what wrong format? i think want: var val = string.format("\"{0}\" : {{ {1} }}", arrayname, fieldlist); note doubled {{ , }} escape sequence necessary braces literally output.

Python Decimal - engineering notation for mili (10e-3) and micro (10e-6) -

here example bothering me: >>> x = decimal.decimal('0.0001') >>> print x.normalize() >>> print x.normalize().to_eng_string() 0.0001 0.0001 is there way have engineering notation representing mili (10e-3) , micro (10e-6)? here's function things explicitly, , has support using si suffixes exponent: def eng_string( x, format='%s', si=false): ''' returns float/int value <x> formatted in simplified engineering format - using exponent multiple of 3. format: printf-style string used format value before exponent. si: if true, use si suffix exponent, e.g. k instead of e3, n instead of e-9 etc. e.g. format='%.2f': 1.23e-08 => 12.30e-9 123 => 123.00 1230.0 => 1.23e3 -1230000.0 => -1.23e6 , si=true: 1230.0 => 1.23k -1230000.0 => -1.23m ''' sign = '' if x < 0: ...

r - Extracting binary data from a mixed data file -

i trying read binary data mixed data file (ascii , binary) using r, data file constructed in pseudo-xml format. idea had use scan function, read specific lines , convert binary numerical values can't seem in r. have python script this, job in r, python script below. binary section within data file enclosed start , end tags , . the data file proprietary format containing spectroscopic data, link example data file included below. quote user manual: data of bindata elements written binary array of bytes. each 8 bytes of binary array represent 1 double-precision floating-point value. therefore size of binary array numberofpoints * 8 bytes. two-dimensional arrays, data layout follows row-major form used safearrays. means moving next array element increments last index. example, if two-dimensional array (e.g. data(i,j)) written in such one-dimensional binary byte array form, moving next 8 byte element of binary array increments last index of original two-dim...

manipulating the output of itertools.permutations in python -

i want take list, instance list = [1,2,2] , , generate permutations. can with: newlist = [list(itertools.permutations(list))] and output is: [[(1, 2, 2), (1, 2, 2), (2, 1, 2), (2, 2, 1), (2, 1, 2), (2, 2, 1)]] the problem: itertools.permutations returns list of length 1 entry list of permutations of list. is: newlist[0] == [(1,2,2),(1,2,2),(2,1,2),(2,2,1),(2,1,2),(2,2,1)] and newlist[1] not exist. i want output list each entry 1 of permutations. is newlist[0] == (1,2,2) newlist[1] == (1,2,2) newlist[2] == (2,1,2) ... newlist[5] == (2,2,1) the question: there command produce permutations of list in way? failing that, there way access 'individual elements' of [list(itertools.permutations(list))] can things them? >>> itertools import permutations >>> list(permutations([1,2,2])) [(1, 2, 2), (1, 2, 2), (2, 1, 2), (2, 2, 1), (2, 1, 2), (2, 2, 1)] you don't need put in list again. i.e don't [list(permutations(...))] (by ...

jquery - Is building big portions of page in javascript bad? -

on existing project working on, noticed many of developers building big portions of pages javascript. example: $( targetdiv ).append("<div>"); $( targetdiv ).append(" <div class='info'>"); $( targetdiv ).append(" <div id='modes'>"); $( targetdiv ).append(" <table cellspacing='0'>"); $( targetdiv ).append(" <tbody>"); // more... i understand using javascript build certain elements on page. content dynamic , know when page first loads (ajax stuff). however, of code (not shown) not dynamic , build same way every time. no 'if' statements or loops is there reason why 1 build large parts of pages using javascript vs having html part of html doc? think 1 want minimize javascript html generation because more confusing , harder write. also, javascript html generation has hurt performance ( does it? ) i "newer" javascript dev...

Kettle transformation with muli input streams -

i have 2 files single fields. looks like: file file b a1 b1 a2 b2 a3 b3 a4 b4 i have a1,b1; a2,b2 when connect 2 inputs transformation kettle says inputs have different layouts you don't have details of transformation, guess picked 'append streams' step. should use merge join step , 2 'add sequence' step add line nr input (set different counter name both steps). connect 2 'add sequence' steps 'merge join' step configure key fields line number , set join type to: 'full outer'. next can use select values step rid of line number columns.

Android Map Clustering Using Polaris 2 -

i'm making app android , i'm using android map show 15k markers webservice, map gets slow, have searched around , find solution "clustering" can't implement in app, map running lib "polaris 2" , tried "clusterkraf", had no results. if has better way show markers or way make clustering please me. i have been using android map extensions , clusterkraf, decided implement clustering self. clustering written in simple way , more control in how elements showing in map, etc. you can read implementation of clustering in http://arnaldog.wordpress.com/2013/07/31/simple-clustering-with-android-maps-v2/ . i hope helps you.

android - The notification doesn't appear? -

i have notification: private void sendsimplenotification(){ boolean permanent = preferencemanager.getdefaultsharedpreferences(context).getboolean("permanent", false); if(permanent) { notificationcompat.builder notificationbuilder = new notificationcompat.builder(service.this); notificationbuilder.setcontenttitle("title"); notificationbuilder.setcontenttext("context"); notificationbuilder.setticker("tickertext"); notificationbuilder.setwhen(system.currenttimemillis()); notificationbuilder.setsmallicon(r.drawable.ic_stat_icon); intent notificationintent = new intent(this, service.class); pendingintent contentintent = pendingintent.getactivity(this, 0, notificationintent, 0); notificationbuilder.setcontentintent(contentintent); notificationbuilder.setdefaults(notification.default_sound | notification.default_lights | notification.default_vibrate); ...

c++ - IIS 6 Isapi filter - forward or redirect requets to other domain -

a code bellow main part of isapi filter iis 6. need redirect request contains "/some_string" other url, lies on other domain , other server. how it? dword camgnisapifilter::onpreprocheaders(chttpfiltercontext* pctxt, phttp_filter_preproc_headers pheaderinfo) { char buffer[256]; dword buffsize = sizeof(buffer); bool bheader = pheaderinfo->getheader(pctxt->m_pfc, "url", buffer, &buffsize); cstring urlstring(buffer); urlstring.makelower(); if (urlstring.find("/some_string") != -1) //we want redirect file { urlstring.replace("/some_string",""); urlstring = "http://new_domain.cz/something" + urlstring; char * newurlstring= urlstring.getbuffer(urlstring.getlength()); pheaderinfo->setheader(pctxt->m_pfc, "url", newurlstring); return sf_status_req_handled_notification; } //we want leave alone , let iis handle return s...

How to use jQuery on() when a element is "ready" rather than an event received? -

i'm trying build half-transparent menu (and other things), codes this: $(".hover-opaque").on({ load: function () { $(this).addclass("opacity02"); }, mouseenter: function() { $(this).removeclass("opacity02"); $(this).addclass("opacity1"); }, mouseleave: function() { $(this).removeclass("opacity1"); $(this).addclass("opacity02"); } }); when it's loaded (or, "ready"), addclass("opacity02") make half transparent, , when mouse entered, make opaque addclass("opacity1"), , when mouse leave, opposite side again. so far mouseenter , mouseleave work well, "load"(or "ready") not work. of course can this: $(".hover-opaque").addclass("opacity02"); but heard cannot deal ajax-generated contents. so what's problem? by way, tri...

c++ - Gold linker: specify alignment of sections -

i want specify alignment sections. ld 2.20.0 following approach works: create linker script containing sections should aligned, e.g.: sections { .data align(0x40): { *(.data) } .text align(0x40): { *(.text) } .plt align(0x10): { *(.plt) } } then link with: -rpath-link=/path/to/linkerscript.ld /path/to/linkerscript.ld e.g. include script in rpath-link , pass 1 of object files. now, when linking in same way using gold 2.23.1 , script rejected error: linkerscript.ld: sections seen after other input files; try -t/--script so gold wants me specify complete linker script, want change couple attributes. possible? i have tried: passing script -t option. produces broken executable fails start. understand because -t accepts complete linker scripts, while above "annotation" existing script. in same vein, when passing script -t option ld 2.20.0 fails link since sections unspecified. not "complete" linker script use case. so have ...