Posts

Showing posts from August, 2012

php - Wordpress update_user_meta not working -

** solved ** had failed require wordpress in form processor. adding line @ top fixed (always simplest thing, right!?): require_once( explode( "wp-content" , __file__ )[0] . "wp-load.php" ); i've created custom front-end profile client's site, , i'm adding way other users favorite profile. (please don't suggest buddypress or plugin -- i've tried dozen, , none of them have of capabilities need. thanks.) :) anyway.... here overview. hope it's clear. let's user 1 viewing profile of user 10. in database, user 1 has field called favorite_10 can set "yes" or "no" (or null) when clicks "favorite" button in user's profile, run simple script change value "yes" "no" or vice-versa that's it. think it's pretty solution, form processing script breaking @ update_user_meta line. here go. foreach($sitterlist $sitteritem) { $code = 'favorite_'.(esc_html($sitterit...

asp.net web api - How to post a string to web API controller? -

i new web api. using visual studio community 2015. simple testing code. webapiconfig.cs: config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}" ); view: $.ajax({ url: 'api/classingalgorithm/', type: 'post', data: { userweightings: json.stringify('hello') } }); controller: public class classingalgorithmcontroller : apicontroller { [httppost] public classingresult postweightings([frombody]string userweightings) { return null; } } in controller method, "userweightings" null. why? change ajax request below. $.ajax({ url: 'api/classingalgorithm/', type: 'post', contenttype: "application/json", data: json.stringify('hello') });

ios - UILabel doesn't show some Emoji on device -

when use uilabel, need show emoji expression. 😀, has 2 different kind of unicode . u+1f600 and e415 , sb-unicode. if latter 1 , assign uilabel's text, won't show on device. show on simulator. how can solve it?

html - I don't know why my function Flip() in JavaScript isn't returning anything. I want it to return if it is heads or tails -

javascript - don't see obvious wrong function flip() { var probability = math.floor(math.random()); if (probability > 0.5) { document.getelementbyid("message").innerhtml("heads!"); } if (probability < 0.5) { document.getelementbyid("message").innerhtml("tails!"); } html - nothing should wrong in html (besides selectors) <body> <button onclick="flip()" id="submit">flip coin</button> <p id="message"></p> </body> you should assign innerhtml below, not function. check demo - fiddle . function flip() { var probability = math.floor(math.random()); if (probability > 0.5) { document.getelementbyid("message").innerhtml = "heads!"; } if (probability < 0.5) { document.getelementbyid("message").innerhtml = "tails!"; } }

excel - Unmerge merged cell when empty -

i'm trying code right fail @ point: have excel sheet merges cell 1 underneath depending on value that's written in top cell, when value deleted merged cell i'd cells unmerge. try work sub keep code bit clean (don't know proper rules try) : public sub letitmerge(target object) if target.value = empty call unmergecell(target) else if (target.value = vv call mergecell(target) end if end sub sub unmergecell(m object) m.resize(1, 1).unmerge m.borders(xlinsidehorizontal).linestyle = xllinestyle.xlcontinuous end sub sub mergecell(n object) n.resize(2).merge 'merge cells n.verticalalignment = xlcenter 'center text n.horizontalalignment = xlcenter 'center text end sub a few minor tweaks code, appears working me. the worksheet_change event fires time there change on worksheet. based on value of changed cell, run either of unmerge or mer...

algorithm - Splitting 61 into integer partitions -

in program doing, have vector called a = [5, 6, 7] , have split integer 61 additive partitions using integer list. 1 example be 61 = 5 + 6 + 7 + 7 + 6 + 6 + 6 + 6 + 6 + 6 there many ways split this. have programmatically. 1 approach found follows. don't know if give result. first check if 61 divisible number in list. if is, can use number add many times (i.e. quotient) 61. in case, 61 prime number. fail. next step take first number in list (in our case, 5) , subtract 61 , try see if answer divisible member in list. if is, again found way addition. in case, subtracting 5 61 gives 56, divisible 7 , our solution be 61 = 5 + 7 + 7 + 7 + 7 + 7 + 7 + 7 + 7 in manner continue down list until find answer after subtraction divisible member in list. now given list me, [5, 6, 7] such there exists integer partition such that, can 61 additions using integer partition. won't have worry whether solution exists. approach seems crude. wonder if there efficient way using algor...

javascript - How to sort xPage multiline editBox by field converter? -

i have multiline edit box on page. want converter converts entered text list (replaces e.g. comas new line) @unique , sort on save. here code doesn't work: <xp:inputtextarea value="#{document1.members}" id="inputmembers" multipletrim="true" immediate="true"> <xp:this.multipleseparator><![cdata[#{javascript:"\n"}]]></xp:this.multipleseparator> <xp:this.converter> <xp:customconverter> <xp:this.getasobject><![cdata[#{javascript:@unique(value).sort();}]]></xp:this.getasobject> <xp:this.getasstring><![cdata[#{javascript:@replacesubstring(value, ",", "\n");}]]></xp:this.getasstring> </xp:customconverter> </xp:this.converter> it replace comas new line doesn't sort list don't use multipleseparator property. otherwise, getasobject converter executed every entry (=line) separately. that...

Runtime error when reversing string in C -

i don't understand why getting runtime error when use s[j]!='\0' when use *temp!='\0' works fine. can explain? void reversewords(char *s) { char *word_begin = s; char *temp = s; /* temp word boundry */ int i=0,j=0; while( s[j]!='\0' ) { j++; if (s[j] == '\0') { reverse(s, i, j-1); } else if(s[j] == ' ') { reverse(s, i, j-1); = j+1; } } } the error not in function. if check reverse function, never increment i or decrement j run forever. a debugger helpful tool , have shown immediately.

android - Update text in a TextView from a Thread -

i have added textview relativelayout added surfaceview to. can textview display text on surfaceview . rl = new relativelayout(this); tv = new textview(this); tv.settext(integer.tostring(gamescreen.score)); tv.settextsize(50); tv.setpadding(390, 50, 0, 0); tv.settextcolor(color.black); rl.addview(renderview); rl.addview(tv); setcontentview(rl); then in gamescreen class's update method put: game.gettextview().settext(integer.tostring(score)); and gives me error: android.view.viewrootimpl$calledfromwrongthreadexception: original thread created view hierarchy can touch views. what can around ? use following recommended way update widget on uithread game.gettextview().post(new runnable() { @override public void run() { game.gettextview().settext(integer.tostring(score)); } }); hope helps.

php - Update record in database using codeigniter -

hi there iam using codeigniter , have managed post id number , phone number table named "offers" both fields int, when try update phone number corresponding specific id see no changes in database. have listed controller , model , view below newoffer controller <?php if ( ! defined('basepath')) exit('no direct script access allowed'); //insert data db using offer_model model // other option update submit class newoffer extends ci_controller { function addoffer() { //if form submitted $this->load->view("check"); $this->load->model("offer_model"); if ($this->input->post('mysubmit')) { $this->offer_model->entry_insert(); } } function updateoffer (){ $this->load->view("check2"); $this->load->model("offer_model"); if ($this->input->po...

html - Bootstrap 3 - Carousel example not working in IE10 -

Image
i trying use bootstrap 3 carousel example . when loading in internet explorer 10 (10.0.9200.16688 specifically), top of carousel not flush top of page, appears below navigation so: it works fine on firefox , chrome (screenshot - chrome): how can top of carousel flush top of browser in internet explorer? thanks in advance. remove overflow: hidden; , override overflow: none; on .carousel-inner class that's wrapped within #mycarousel carousel container. see below: to further said in comments, css errors in ie result of incorrect <!doctypes> triggers quirks mode or developer defined standards within developer tools.

user interface - Python. GUI(input and output matrices)? -

python 3.3.2 hello.my problem - need create gui input data(matrix or table).and take form data. example: a=[[1.02,-0.25,-0.30,0.515],[-0.41,1.13,-0.15,1.555],[-0.25,-0.14,1.21,2.780]] perfect solution restrictions input form(only float). questions: can use? tkinter haven't table.. wxpython not supported python 3. pyqt4?(mb u have exampel how take data tabel in [[],[],[]] ?) have idea? thnx! using tkinter, don't need special table widget -- create grid of normal entry widgets. if have many need scrollbar it's more difficult (and there examples on site how that), create grid of small it's straightforward. here's example includes input validation: import tkinter tk class simpletableinput(tk.frame): def __init__(self, parent, rows, columns): tk.frame.__init__(self, parent) self._entry = {} self.rows = rows self.columns = columns # register command use validation vcmd = (self.register(sel...

WPF MVVM Determine When Item in Collection On Model Changes -

i have datagrid bound list of job models. job model has jobname property. i can tell when row selected because grid's selecteditem set, when user changes data in grid, i'd things in view model. when user changes jobname on active row in grid, how can view model know it? if there 2 way binding jobname property setter of jobmodel instance invoked. if setter raises propertychanged event can handle event in viewmodel registering , unregistering handler when selected item changes.

ios - How can I maintain relative scrolling position within a UIScrollView during a UISnapBehavior animation? -

i using uidynamicanimator's uisnapbehavior animate these circles between 2 states: http://cl.ly/image/1g3p1b2x2v14/image%202013.09.24%2011%3a35%3a43%20am.png that works great. however, put inside uiscrollview. when scroll before uisnapbehavior animation has "settled" (there seems delay after looks finishes , when finishes), circles lose relative positioning scroll container: http://cl.ly/image/1e0i3l460j1v/image%202013.09.24%2011%3a32%3a10%20am.png when scroll after waiting few seconds after animation has "settled", circles not lose relative positioning i'm assuming because uisnapbehavior animates things fixed positions, , reverts relative positioning after finishes, i'm not sure if that's true. i setting uidynamicanimator on uiview containing uiscrollview. setting uidynamicanimator initwithtarget uiscrollview seems have fixed it.

.net - Float SQLParameters, decimal separator and regional settings -

i use sqldataadapter select/update/insert data from/to table in ms sql server (.net framework 4.0 client framework). updatecommand in sqldataadapter needs 2 float parameters, add this: with _sqlda_prot_points.updatecommand .parameters.add(new sqlparameter("@alm_plus", sqldbtype.float, 1, "alm_plus")) .parameters.add(new sqlparameter("@alm_minus", sqldbtype.float, 1, "alm_minus")) end my regional settings it-it. when dataadapter tries update datatable changed rows server, float parameters in sqlserver profiler show "," instead of "." decimal separator, causing exception. found no way tell dataadapter how convert double string using "." instead of ",". any idea? thank in advance

security - Using HTTPS in the paypal IPN listener -

we integrating our online payment system paypal ipn transaction notification backend , got stucked problem while testing sandbox: when using listener script url http works flawlessly, when specifying secure url stops working. on ipn history page ( https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history ) calls made using secure listener show no http response our server(!). direct access both url work browser. our guess either ipn calls don't work against secure listeners (we couldn't find word in documentation) or paypal sandbox ipn servers don't our ipn listener certificate (which free startssl valid certificate). did find similar or provide advise? i've done https, work. have put 'https' in ipn url of course that's registered @ paypal. check ssl certificate signed recognised ca.

CSS: On Hover - How can I change css attributes of a selector's child? -

i have these smaller banners want change of styling attributes inside of "a" tag. <a href="#"> <h2>heading</h2> <p class="service-sub">some text</p> <img src="path" /> </a> what want change out styling in p.service-hub. here 2 methods i've tried, no avail... method 1: .service-hub *:hover method 2: .service-hub:hover is possible? because hover event first trigged tag, recognize hover on p.service-hub? did try this? a:hover .service-sub

arrays - python-meeting two column criteria in one dataset and outputting to a new list or printing count -

this simple question don't know i'm doing wrong. trying create new list if 2 columns in data have 1 in 1 of columns , listed female in separate column. going count number of observations in new list. can not create new list , check if whether meet 2 conditions count+1. main problem don't think if statement correct because when create list. it's blank. know there matches meet criteria know array shouldn't blank. being stupid? thanks help. >>> data_s=[] in data: if data[0::,1]=="1" , data[0::,4]=="female": data_s.append(i) data_s=numpy.array(data_s) >>> data_s [] >>> look conditional indexing, , try this: data_s = [entry entry in data if entry[1]=="1" , entry[4]=="female"] in code segment, if statement should tested on (not data) since using loop through elements of data

QGraphicsItem Performance with QML -

i have qml file shows simple display. want update text inside qml file every x seconds. works fine. i'm using qgraphicobjects add qgraphicsscene. now heard, qgraphicsobjects slower qgraphicsitems. so want know, if possible, use qml files qgraphicsitem? or there other possibillities use qml object performance of qgraphicsitem? the alternative create displays qgraphicsitem, prefere doing in qml. best regards qml items need qt meta-object system, it's not possible use qgraphicsitem (which not qobject). more slower ? real gain qgraphicsitem ? test before trying lose flexibility of qml. if have performance problems, best solution might move qt quick 2? (qt 5.2 if possible, read: http://blog.qt.digia.com/blog/2013/09/02/new-scene-graph-renderer/ )

elasticsearch - Is it Possible to Use Histogram Facet or Its Curl Response in Kibana -

is possible use manually created histogram facet (or results of curl request) 1 in kibana dashboard: { "query" : { "match_all" : {} }, "facets" : { "histo1" : { "histogram" : { "key_script" : "doc['date'].date.minuteofhour * factor1", "value_script" : "doc['num1'].value + factor2", "params" : { "factor1" : 2, "factor2" : 3 } } } } } thanks it looks supported in kibana4, there doesn't seem more info out there that. for reference: https://github.com/elasticsearch/kibana/issues/1249

javascript - Efficient closure structure in node.js -

i'm starting write server in node.js , wondering whether or not i'm doing things right way... basically structure following pseudocode: function processstatus(file, data, status) { ... } function gotdbinfo(dbinfo) { var myfile = dbinfo.file; function gotfileinfo(fileinfo) { var contents = fileinfo.contents; function sentmessage(status) { processstatus(myfile, contents, status); } sendmessage(myfile.name + contents, sentmessage); } checkfile(myfile, gotfileinfo); } checkdb(query, gotdbinfo); in general, i'm wondering if right way code node.js, , more specifically: 1) vm smart enough run "concurrently" (i.e. switch contexts) between each callback not hung lots of connected clients? 2) when garbage collection run, clear memory if last callback (processstatus) finished? node.js event-based, codes handlers of events. v8 engine execute-to-end synchronous code in handler , process next e...

javascript - Thorax 2.0.1 is throwing `Cannot read property '_thoraxBind' of undefined` when constructing my View -

with following thorax 2.0.1 code: myview = thorax.view.extend({ events: { 'foo': 'bar' }, template: 'hello world' }); foo = new myview(); foo.bar = function() {} i getting following error when attempt create view: uncaught typeerror: cannot read property '_thoraxbind' of undefined [vm] thorax.js (849):1 _.extend._addevent [vm] thorax.js (849):1 (anonymous function) [vm] thorax.js (849):1 j.each.j.foreach underscore.js:79 _.extend.on [vm] thorax.js (849):1 (anonymous function) [vm] thorax.js (849):1 j.each.j.foreach underscore.js:87 h ...

SQLite - executeUpdate exception not caught when database does not exist? (Java) -

so purposely trying break program, , i've succeeded. i deleted sqlite database program uses, while program running, after created connection. attempted update database seen below. statement stmt; try { stmt = foo.con.createstatement(); stmt.executeupdate("insert "+table+" values (\'" + itemtoadd + "\')"); } catch(sqlexception e) { system.out.println("error: " + e.tostring()); } the problem is, didn't catch exception, , continued run if database updated successfully. meanwhile database didn't exist @ point since after deleted it. doesn't check if database still exists when updating? do have check database connection manually, every time update ensure database wasn't corrupted/deleted? is way done, or there simpler/more robust approach? thank you. interestingly, found if delete database when using , attempt update it, updates database in new location (in trash!). cannot permanently ...

javascript - How can I speed up this slow canvas DrawImage operation? WebGL? Webworkers? -

i combining 2 high resolution images html5 canvas element. the first image jpeg , contains color data, , second image alpha mask png file. i combine 2 produce single rgba canvas. the app dealing 2048x2048 resolution images, need maintain alpha channel. therefore using method ooposed using png's, have reduced average filesize around 2-3mb 50-130kb plus 10kb png alpha mask. the method use follows: context.drawimage(alpha_mask_png, 0, 0, w, h); context.globalcompositeoperation = 'source-in'; context.drawimage(main_image_jpeg, 0, 0, w, h); unfortunately operation takes around 100-120ms. , carried out once each pair of images loaded. while wouldn't issue, in case animation being rendered main visible canvas (of these high res images source art for) suffers noticable 100ms judder (mostly perceptible in firefox) whenever new source art streamed in, loaded, , combined. what looking way reduce this. here have tried far: implemented webp google chrome, r...

oracle11g - Why use NUMBER(p,s) instead of NUMBER in Oracle? -

i understand significance of number(p,s) , how differs number, if know column going store decimals (let's assume know max business requirements change), why ever limit using specifying p , s? if number dynamic , store decimal places, why not use it? there performance gain specifying p , s? asking 11g oracle db?

firebird - SQL Force show decimal values -

i'm using firebird database , trying following sql each time returns 0, instead of 0.61538 (etc). select (count(myfield)/26) totalcount mytable now when remove /26, totalcount returns 16 should. when add divided 26 in, result shows 0, should show full decimal value of 0.615384... know why it's not returning full value? i've tried wrapping in cast((count(myfield)/26) double) totalcount still returns 0. thank in advance suggestions!!!! try: select count(myfield/26.0) totalcount mytable or: select count(cast(myfield double)/26) totalcount mytable not familiar firebird, in other implementations have cast/convert either numerator or denominator decimal before division, integer division returns integer value.

php - Converting mysql_* to mysqli_* issue -

i using mysqlconvertertool convert web application, first issue faced code getting big dont understand means? small code before , see big. //old code $ask_id = mysql_real_escape_string($_post['ask_id']); //after convert $ask_id = ((isset($globals["___mysqli_ston"]) && is_object($globals["___mysqli_ston"])) ? mysqli_real_escape_string($globals["___mysqli_ston"], $_post['ask_id']) : ((trigger_error("[mysqlconvertertoo] fix mysql_escape_string() call! code not work.", e_user_error)) ? "" : "")); its working fine want know if correct way of mysqli_* or there issue or bug need fix in line? i want know how can make part secure if (isset($_post['asking-money'])) { $dailybonus = 10000; $update = mysqli_query($globals["___mysqli_ston"], "update users set ask_time='$newtime', bonus='dailybonus' id='$userid'"); // more calculation } ...

java - Android setOnClickListener does not work -

i've little problem toast in android :/ want create little toast when button1 going activated here code: mainactivity.java package com.andruiden.toast; import android.app.activity; import android.content.dialoginterface; import android.content.dialoginterface.onclicklistener; import android.os.bundle; import android.view.*; import android.widget.*; import com.andruiden.toast.r; public class mainactivity extends activity { //klick listener class meinclicklistener implements onclicklistener{ public void onclick(view v){ string text = "es wurde geklickt"; toast t = toast.maketext(v.getcontext(), text, toast.length_short); t.show(); } @override public void onclick(dialoginterface dialog, int which) { // todo auto-generated method stub } } public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r....

android - Javascript is not working in webView when Loaded from asset folder but working from both http server & localhost -

i trying load offline version of python documentation webview asset folder. offline docs work in pc web browser in offline not working in webview (something jquery missing ). @suppresslint("setjavascriptenabled") public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); webview webview = (webview) findviewbyid(r.id.wrapper); webview.getsettings().setjavascriptenabled(true); webview.setwebchromeclient(new webchromeclient()); webview.loadurl("file:///android_asset/python/index.html"); } } and error message shown when tried load home page or navigate page. 09-24 01:03:02.789: e/web console(479): referenceerror: can't find variable: $ @ file:///android_asset/python/index.html:164 and above error jquery code snippet ( think jquery library isn't loading) <scri...

ruby on rails - How does db:schema:load affect future db:migrate actions -

let's i've got app bunch of migration files i'm getting ready deploy production first time. understand, have 2 options db on production server: a - run db:migrate , , have cycle through migrations hasn't yet run b - run db:schema:load , , have build db schema file i know b right choice fresh deployments, explained in schema.rb comments: # if need create application database on # system, should using db:schema:load, not running migrations # scratch. latter flawed , unsustainable approach (the more migrations # you'll amass, slower it'll run , greater likelihood issues). what i'm wondering is, how affect migrations on production server going forward? example, if following in order: run db:schema:load on new production server. change schema in development , push production. run db:migrate on production server what happen? know use migrations more recent db:schema:load action, or try run them all? good question. answer migrati...

CodeIgniter Routing with Slashes -

anyone know of way prevent codeigniter stopping on slash when parsing arguments? example.com/code/master/foo/bar where code , master arguments 1 , 2, , rest argument 3. update : part of routing code separates segments slashes, don't think it's possible way. did find work around using uri->segments. there no way this. according system/libraries/router.php , first thing router split request based on slashes. after split start looking @ contents using regular expressions. you try extending router class, recommendation not use slashes parameters whenever possible.

jquery - CSS Not carrying over to new tab content -

i have app using jquery tab control navigation. of jquery , jquery ui work fine on master page , on first tab, once navigate second tab, theme roller stylings not carry over. when navigate , forth, can see styling gets applied , flashes normal gray button. this button on page in code <td><input type="button" class="button" runat="server" role="button" value="run new claims query"/></td> the way can render how want explicitly state classes used styling <td><input id="open" class="button ui-button ui-widget ui-state-default ui-corner-all" type="button" value="run new claims query" name="open" role="button" aria-disabled="false"/></td> i had similar problem css show on initial load of page if performed postback lose css, particularly jquery ui css. found answer. $(document).ready(function() { // bind jquery e...

python - Django compressor using gzip to serve javascript -

i trying serve gzip files amazon s3. settings.py: aws_is_gzipped = true aws_preload_metadata = true default_file_storage = 'storages.backends.s3boto.s3botostorage' staticfiles_storage = 'storages.backends.s3boto.s3botostorage' aws_storage_bucket_name = 'elasticbeanstalk-eu-west-1-2051565523' static_url = 'https://%s.s3.amazonaws.com/' % aws_storage_bucket_name compress_offline = true compress_enabled = true compress_url = static_url compress_css_filters = [ 'compressor.filters.css_default.cssabsolutefilter', 'compressor.filters.cssmin.cssminfilter' ] compress_js_filters = [ 'compressor.filters.jsmin.jsminfilter', ] compress_storage = 'compressor.storage.gzipcompressorfilestorage' when django creates *.gz files every *.js , *.css compressed strangely *.css files served gzip. can see on aws s3 .css files have content-encoding: gzip , *.js don't. going on here? i had same issue , able resolv...

ios - UICollectionViewLayout when is layoutAttributesForItemAtIndexPath called -

i'm subclassing uicollectionviewlayout, , layoutattributesforitematindexpath: method never called. i know override layoutattributesforelementsinrect: well, i'd rather not have deal rect, lot simpler if deal index path. if layoutattributesforitematindexpath: never called, whats point of it? layoutattributesforitematindexpath: called in different scenarii, when add new cells collection view, when change layout, when reload specific index paths, etc. you need implement it, though won't called in "default" scenario.

How correct way load viewpage in SPA(Asp.net mvc) -

i carry views, not want work @ helper or partialview, gender or anything, want routes pass controler i not know correct way use or not @ helpers? i can use jquery load call controllers alternative @renderbody? you don't need helpers.. should care https://developers.google.com/webmasters/ajax-crawling/# ! while working mvc if youre different world.

c - How to add objects to singly linked list -

information file being read car struct "newcar". need use "sll_add" function below add information single liked list of type carlist named "list". i'm having trouble understanding how starts. thank help. int main (void)//main function { file *fp;//file pointer fp = fopen("car_inventory.txt", "r");//opens car inventory data within program. int num=0;//vairable created keep track of information. int year;//, choice;//variables use user input. char str1[100];//string created ensure program reads information original file correctly. carlist list;//creates string of type "car" named file hold 100 cars. car newcar;//car variable store info file. list *last=num; if (fp) { { while(!feof(fp))//takes input data file. { fgets(str1,50, fp); sscanf(str1,"%d %s %[^\n]s", &newcar.year, newcar.make, newcar.model); fgets(str1,50, fp); ...

ruby remove backslash from string -

how make regular string no slash? i have: "3e265629c7ff56a3a88505062dd526bd\"" i want: "3e265629c7ff56a3a88505062dd526bd" what have: "3e265629c7ff56a3a88505062dd526bd\"" is equivalent to: '3e265629c7ff56a3a88505062dd526bd"' so remove that: string.tr!('"', '') remember special characters prefixed backslash. includes not things newline \n or linefeed \r , quotation mark " or backslash \\ .

Use the default database path to create a filegroup in a script sql server 2008 -

quick question, possible include in sql script this? if filegroup_id('fg') not null alter database [mydb] add file (name=[fg_data], filename='{my default server path}') filegroup [fg] go the idea create script in development when promoted production can used without changing anything. we using apexsql build!! problem solved!

xml - SpreadsheetML file extension changed by IE and FF - wrong Content Type? -

i generating spreadsheetml file in php. when users download file , save it, default file saves report.xml , opens in excel. however, if chooses open file in excel instead of saving it, filename changed report.xml.xls, causing excel display error message. how can stop xls extension being added filename? these headers sending: header('content-type: application/vnd.ms-excel'); header('content-disposition: attachment; filename="' . $filename . '.xml"'); header('cache-control: max-age=0'); header("pragma: must-revalidate"); i tried changing content-type text/xml worked in ie caused file displayed raw xml in other browsers.

Is there any API or JNI wrapper that enables Glass to decode a raw H.264 video stream over a network? -

we wondering if there api or jni wrapper enables glass decode raw h.264 video stream on network? our understanding api 16 has mediacodec api supports en/decoding of h.264 format since glass runs on api 15, complains media class not found. have tried other third party libraries of no avail. appreciated, thanks. it looks research correct. isn't that's available of on glass time. if you'd gdk support, please let google know creating issue in official issue tracker.

java - Designing an item inventory system for a game and having issues -

i've been working on little inventory system practice oo programming. using java 7 in netbeans. the player have inventory (arraylist of base item class), items created child of base item class. no items should of type baseitem, extend off of that, understanding, baseitem class should abstract? public abstract class baseitem { protected goldvalue itemvalue; protected string itemname; //accessors , mutators down here } child item types have different properties, going implement interfaces, such stackable, consumable, etc. the interface looks this public interface stackable { public void stack (stackableitem bi1); } as can see, make reference stackableitem here, 1 of children of baseitem, abstract , specific items build out of. public abstract class stackableitem extends baseitem implements stackable{ protected int quantity; protected int maxstacks; @override public void stack (stackableitem si) { if(this.getquant...

sql server - Programmatically add points to Map Layer on Report Builder 3.0 -

so, have .shp map region of world. have dataset information of several stations want show on map. on dataset have several fields, 2 latitude , longitude. have create 1 point on map each row of dataset, using latitude , longitude provided. far creating new report, inserting map shapefile , adding point layer it, after can't figure out have show points based on coordinates. guys have advice of have now? thanks lot attention. ps: i'm using report builder 3.0 , sql server 2008 r2 database.

Abstract class error in java -

i'm trying figure out why keep getting error class not override abstract method. in teachers uml diagram shows need equals (object o) method in parent radio class. i'm not declaring abstract in abstract class. public abstract class radio implements comparable { double currentstation; radioselectionbar radioselectionbar; public radio() { this.currentstation = getmin_station(); } public abstract double getmax_station(); public abstract double getmin_station(); public abstract double getincrement(); public void up() { } public void down() { } public double getcurrentstaion() { return this.currentstation; } public void setcurrentstation(double freq) { this.currentstation = freq; } public void setstation(int buttonnumber, double station) { } public double getstation(int buttonnumber) { return 0.0; } public string tostring() { string message = ("" + currentstation); return message; } public boolean equals (object o)...

javascript - fadeOut dynamically loaded div using jquery -

im writing small app, , im having problems deleting (as in fading out) dynamically loaded div using jquery. the problem presents when add new content box, if reload page , content box gets rendered not dynamically (as in database query), deletes fine(as in fade out), when div added anew, cant out. $result = '<div class="my-music-item">'. $app['twig']->render('soundcloud-player.twig', array( 'url'=>$mix->geturl(), 'player_type'=>'artwork', 'url'=>$mix->geturl(), 'color'=>'ff0948', 'height'=>'200', 'width'=>'200' )) . '<p class="delete-mix-wrapper"><a class="delete-mix" data-mix-id="'.$mix->getid().'" data-post-to="'.$app['url_generator']->generate('delete-mix-post').'...

c++ - What does constructor do in this line? -

there simple code, found in c++ tutorial. can't understand line: c1 = complex(10.0); in comments written constructor can used convert 1 type another. can explain moment. thank help. #include <iostream> using namespace std; class complex { public: complex() : dreal(0.0), dimag(0.0) { cout << "invoke default constructor" << endl;} /*explicit*/ complex(double _dreal) : dreal(_dreal), dimag(0.0) { cout << "invoke real constructor " << dreal <<endl;} complex(double _dreal, double _dimag) : dreal(_dreal), dimag(_dimag) { cout << "invoke complex constructor " << dreal << ", " << dimag << endl; } double dreal; double dimag; }; int main(int argcs, char* pargs[]) { complex c1, c2(1.0), c3(1.0, 1.0); // constructor can used convert 1 type // c1 = complex(10.0); // following conversion...

types - How to retrieve Lotus Notes attachments? -

i’m trying export of documents , attachments lotus notes database (with designer 7.0). can document data , can attachment, if hard code name. 2 methods, in lotusscript, i’ve found getting filename programmatically aren’t working, shown in lower 2 code blocks. in first, doc.getfirstitem( "body" ) returns nothing, , in second, there’s type mismatch during execution on forall line. on how extract attachments appreciated! i’m not sure whether attachments stored “attachments” or ole, suspect attachments, since they’re pdfs. sub click(source button) dim session new notessession dim db notesdatabase dim query string dim collection notesdocumentcollection dim doc notesdocument dim filecount integer dim attachment notesembeddedobject dim filename string set db = session.currentdatabase ' document has attachment set collection = db.ftsearch( "06/25/2013", 10 ) filenum% = freefile() filename$ = "c:\kcw\lotusexport.txt" open filename$ output filenum...

xml - JAXB binding XPath error -

i attempting fix collision when jaxb generating classes set of xsds. here's xml: <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" ...> ... <xs:simpletype name="list_offerdimensionuom"> ... </xs:simpletype> </xs:schema> and binding.xjb file: <jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema"> <jxb:bindings schemalocation="ota_lists.xsd" node="/xs:schema"> <jxb:bindings node="xs:simpletype[@name='list_offerdistanceuom']"> <jxb:property name="list_offerdistanceuomlist"/> </jxb:bindings> </jxb:bindings> </jxb:bindings> i have tried few different combinations of defining xpath desired element, , keep getting same error: compiler unable honor property customization. attached wron...

ios - how to change height between UITableView and Navigation Bar -

Image
got uitableviewstylegrouped and uitableviewstyleplain changes in storyboard, found that, top edge of plain table view sticks navigation bar, while top gap in grouped style somehow because of header view. but, picture show, gap "a" bigger "b", why? there hidden elements around "a"? how manage gap stuck bar? what's default size of gap "a" , "b"? how make "a" equal "b", "setting" below try-out tried set heightforheaderinsection: , viewforheaderinsection: below - (cgfloat)tableview:(uitableview *)tableview heightforheaderinsection:(nsinteger)section { return 0.0f; } - (uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section { uiview * header = [[uiview alloc] init]; header.backgroundcolor = [uicolor redcolor]; [self.view addsubview:header]; return header; } tried heightforfooterinsection: , viewforfooterinsection: , below - (cgfloat)tableview:...

android - How can I fix a "Type mismatch error: cannot convert from element type to float" in a parcelable? -

i trying pass floatarraylist in parcelable main activity "copyofbargraph" activity when user pushes button. here's code bundle in main activity (sent when user pushes button): public void bargraphhandler (view view) { bundle b = new bundle(); b.putparcelable("fnumbers", floatarray); intent barintent = new intent(this, copyofbargraph.class); barintent.putextras(b); startactivity(barintent); } the code parcelable arraylist is: public class floatarraylist extends arraylist<fnumber> implements parcelable{ private static final long serialversionuid = 663585476779879096l; public floatarraylist(){ } public floatarraylist(parcel in){ readfromparcel(in); } @suppresswarnings("rawtypes") public static final parcelable.creator creator = new parcelable.creator() { public floatarraylist createfromparcel(parcel in) { return new floatarraylist(i...

Java: pre-,postfix operator precedences -

i have 2 similar questions operator precedences in java. first one: int x = 10; system.out.println(x++ * ++x * x++); //it prints 1440 according oracle tutorial : postfix (expr++, expr--) operators have higher precedence prefix (++expr, --expr) so, suppose evaluation order: 1) first postfix operator: x++ 1.a) x++ "replaced" 10 1.b) x incremented one: 10+1=11 @ step should like: system.out.println(10 * ++x * x++), x = 11; 2) second postfix operator: x++ 2.a) x++ "replaced" 11 2.b) x incremented one: 11+1=12 @ step should like: system.out.println(10 * ++x * 11), x = 12; 3) prefix operator: ++x 3.a) x incremented one: 12+1=13 3.b) ++x "replaced" 13 @ step should like: system.out.println(10 * 13 * 11), x = 13; 4) evaluating 10*13 = 130, 130*11 = 1430. but java seems ignore pre/post ordering , puts them on 1 level. real order: x++ -> ++x -> x++ what causes answer (10 * 12 * 12) = 1440. second one...

c# - Image rotation moving resulting image unpredictably -

Image
i've been looking on today , can't work needs. i have web application let's users drag , drop text/images , sends details server draw pdf. i'm trying enable rotation, can't hold of translatetransform stuff. image in testing prints out great, rotated well, not in correct location. i'm missing how intitial translatetransform changes things , mind shot @ end of day. have draw bitmap first using different graphics instance, , draw bitmap background? on great! thanks! code: i image object browser coord x & y of upper corner of image on canvas (990wx1100h) on browser size h & w of element on browser bitmap b = new bitmap(wc.openread(i.img)); if (i.rotation != 0) { g.translatetransform(this.canvasdetails.size.width/2, this.canvasdetails.size.height/2); g.rotatetransform(i.rotation); g.d...

c - What happens if i declared another variable with the same name in another file? -

i have declared int x in file one , mistake declared variable of type char same name x in file two , , wait compiler or linker give me error, there no errors displayed. , when use debugger see int x converted char x , true?! , happens here?! show modification on code: file one #include <stdio.h> int x = 50; /** declare global variable called x **/ int main() { print(); printf(" global in file 1 = %d",x); /** modification here **/ return 0; } file two char x; void print(void) { x = 100; printf("global in file 2 = %d ",x); return; } my expected results = global in file 2 = 100 global in file 1 = 50 but results : global in file 2 = 100 global in file 1 = 100 when use debugger see int x converted char x , true?! , happens here? you're in troublesome territory here. technically program causes undefined behaviour. char x tentative definition, since d...

android - XML drop shadow and different states -

i'm trying define background listview has drop shadow , different colours pressed state. here's have. <?xml version="1.0" encoding="utf-8"?> <!-- drop shadow stack --> <item> <shape> <padding android:bottom="1dp"/> <solid android:color="#00cccccc" /> </shape> </item> <item> <shape> <padding android:bottom="1dp" /> <solid android:color="#10cccccc" /> </shape> </item> <item> <shape> <padding android:bottom="1dp" /> <solid android:color="#20cccccc" /> </shape> </item> <item> <shape> <padding android:bottom="1dp" /> <solid android:color="#30cccccc" /> </shape> </item> <item> <shape> <padding andro...

java - Can't connect to webadmin Console for Neo4j -

i haven't been able connect webadmin console can connect shell , write cypher queries , neo4j db. the errors on log are: java.lang.runtimeexception: java.net.bindexception: address in use @ org.neo4j.server.web.jetty6webserver.startjetty(jetty6webserver.java:334) @ org.neo4j.server.web.jetty6webserver.start(jetty6webserver.java:154) @ org.neo4j.server.abstractneoserver.startwebserver(abstractneoserver.java:348) @ org.neo4j.server.abstractneoserver.start(abstractneoserver.java:183) @ org.neo4j.server.bootstrapper.start(bootstrapper.java:86) @ org.neo4j.server.bootstrapper.main(bootstrapper.java:49) caused by: java.net.bindexception: address in use @ java.net.plainsocketimpl.socketbind(native method) @ java.net.abstractplainsocketimpl.bind(abstractplainsocketimpl.java:376) @ java.net.serversocket.bind(serversocket.java:376) @ java.net.serversocket.<init>(serversocket.java:237) @ javax.net.ssl.sslserversocket.<init>(ssls...