Posts

Showing posts from August, 2012

c# - Loading Xml File Into Section, Key and Value Collection -

we have settings file xml extending pluggable modules writing. want use our existing xml settings allow extension methods written on them. long story short if had xml file so: <settings> <settingsone key1_1="value1" key1_2="value2" /> <settingstwo key2_1="value1" key2_2="value2" /> </settings> how load collection of settingsentry settingsentry looked so: public class settingsentry { public string section { get; set; } public string key { get; set; } public string value { get; set; } } where section "settingsone", key "key1_1" , value "value1". is possible or going down dark path? edit: ok suggestion of linq xml life save, trying xmlserializer! below have far, there way turn single select rather 2 have below: var root = xelement.load(pathtoxml); var sections = el in root.elements() select el.name; l

ios - Detect when a webview video becomes fullscreen on ios8 -

i have app users can open videos uiwebview, including youtube ones. in ios7, able notification when started playing, or when became full screen, vital me show options user , modify interface. i used use this: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoexitfullscreen:) name:@"uimovieplayercontrollerdidexitfullscreennotification" object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoenterfullscreen:) name:@"uimovieplayercontrollerdidenterfullscreennotification" object:nil]; however, since ios8, can't achieve this. notification no longer triggered uiwebview videos. however, still triggered normal videos, non-webview, i've tested. any idea of have changed? this work around found this.. [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(videoexitfullscreen:)

Sqlite database connection with c# -

hi developing windows phone app , using sqlite db , first step created login page. once close application database not persist , end creating db evertime app opens followed adding values. how make persistent , retain values instead of adding them again , again? thanks av save database file in isolated storage . place should save application data need persist next executions

python - How to return the total count of a database entity when one of its rows matches a condition -

i have list of numbers i’m looping through identify if entity in database table matches @ least 1 of these numbers, if so, want count how many times these entities appear in table , return entities along number of time in table. entities may match 1 or more numbers, can duplicate data using pythons set(), unless there’s better way it. so example list = [a, b, c, d] # unknown number of entries column 1 column 2 column3 etc blue blue - blue green - red red b red c red c red - red - so im trying return: blue, 3 red, 6 the closest i've been able below, not yielding desired resutls. for letter in list: c.execute('select colour, count(*) table group colour having letter=?', [(letter)]) i'm not sure how proceed this, advice appreciated. in responce @cl. this kind of data returning. later nest in list contains correct values,

javascript - AngularJS - Sorting ng-repeat on string with numbers in them -

i have list of objects in table-view sort properly. amongst other things, objects contain name-field. name field can contain numbers, example: chairman seat 1 seat 2 seat 3 seat 11 seat 12 seat 23 secretary this sorted this: chairman seat 1 seat 11 seat 12 seat 2 seat 23 seat 3 secretary this doesn't seem natural way of sorting list when sorting name. now i'm using ng-repeat this: seat in seats | orderby:orderfield:orderreverse track seat.id orderfield variable set when clicking table header , orderreverse reversing. i've tried making custom filter makes sure behaves failed. seems javascript won't order unless break string. i'd rather not because data updated polling. way force leading zero's since users entering stuff manually i'm not sure if should. also, not names numbers in them, can't cut them off so, suggestions on how make list show normally? edit: cleared info problem. you can use custom sort function orderby (

ios - UITableView inside UIViewControllerView unexpected margins -

Image
i have normal uiviewcontroller on storyboard standard uiview contains 1 child - uitableview when adding constraints between uiview , uitableview ( equal widths, equla heights, vertical space 0 top layout guide, horizontal space 0 leading margin ) result table view should fill it's parent. instead table view appears have left , top margins (16 , 64). size inspector shows table views alignment rectangle follows x=16,y=64,width=600,height=600 although constraints have constants set 0's. when try edit manually alignment rectangle keep getting misplaced views warnig try restore previous values. any idea might cause of strange behaviour? click view want remove margins. open contraint editor uncheck prefer margin relative :

ruby on rails - Sending arrays of arrays as parameter and then again looping though each array -

i have scenario sending notification mail users.hence need info such useremail,videocount,imagecount,videoids,imageids etc , send usermailer send mail.i want simplify process sending required parameters method , again looping through each array of arrays. example:- ###########the below code in loop of users################ user.signed_in_users.find_in_batches(:batch_size => 100 ) { |users| users.each { |user| vcount=video.where(:users_notified=>f).count icount=image.where(:users_notified=>f).count acount=audio.where(:users_notified=>f).count @count << vcount + icount + acount vcat=###all video categories icat=###all image categories acat=###all audio categories @cats << vcat + icat + acat...and many more ###########now sending these parameter mailer(array of arrays) ####how can simplify call usermailer.notify_user(user.email,@video_cat,@video_count,@image_cat,@image_count,@audio_cat,@audio_count,@

php - Loop through database query -

i show results of 1 database table use of variable fetched database table this: mysql_select_db($database_connection, $connection); $query_recordset_bids = "select * bids bidder = '$username'"; $recordset_bids = mysql_query($query_recordset_bids, $connection) or die(mysql_error()); while ($row_recordset_bids = mysql_fetch_array($recordset_bids)) { $totalrows_recordset_bids = mysql_num_rows($recordset_bids); mysql_select_db($database_connection, $connection); $query_recordset_jobs = "select * jobs userid = '".$row_recordset_bids['jobid']."'"; $recordset_jobs = mysql_query($query_recordset_jobs, $connection) or die(mysql_error()); $row_recordset_jobs = mysql_fetch_assoc($recordset_jobs); $totalrows_recordset_jobs = mysql_num_rows($recordset_jobs); } and want output showed in following table: <?php if($totalrows_recordset_jobs == 0) echo "you have never submitted job offer!"; else { ?> <table width=&quo

c# - How to extract one column from a jagged array? -

i have jagged array matrix m rows , n columns (i know have used normal matrix read matrix multiplication faster using jagged array). i'd extract every row 1 column without using loop. how accomplished. also, please explain code because found answer claims following should work cannot figure out how adapt situation. object[] column = enumerable.range(0, myarray.getlength(0)) .select(rownum => (object)myarray[daily.m, daily.n]) .toarray(); okay following answer doesn't seem give me errors i'm running problem: var selectedarray = myarray.where(o => (o != null && o.count() > daily.dependentvarindex)).select(o => o[daily.dependentvarindex]).toarray(); method1 m1 = new method1(13); (int = 0; < daily.m; i++) { m1.do(selectedarray[i]); //this give me error } how can index object "selectedarray"? note defined method1,

Matlab: Find minimum value from a set of values for each column in an array -

i have 2-d array a=zeros(1000,1024) . want iteratively compute difference between each of value of i-th row (with i=1-999) , values of 1000th row. right think of looping on 1-999 rows, compute differences of current row , 100th row , store in seperaate data structure ( b=zeros(999,1024) ). after, compute minimum of each column using for-loop, iterates on columns of b . do know of more efficient, faster approach? if want minimum of each column, can save many operations doing subtraction @ end: min(a(1:end-1,:),[],1) - a(end,:)

DreamWeaver generates mysql queries instead of mysqli queries -

i working dreamweaver cc , wampserver version 2.5 apache version : 2.4.9 , php version : 5.5.12. when creat connecttion , queries using dreamweaver in deprecated form mysql instead of mysqli. connection string generated dreamweaver is <?php # filename="connection_php_mysql.htm" # type="mysql" # http="true" $hostname_explorecalifornia = "localhost"; $database_explorecalifornia = "explorecalifornia"; $username_explorecalifornia = "root"; $password_explorecalifornia = "pass"; $explorecalifornia = mysql_pconnect($hostname_explorecalifornia, $username_explorecalifornia, $password_explorecalifornia) or trigger_error (mysql_error(),e_user_error); ?> if change mysql_pconnect mysqli_pconnect break string. and message: deprecated: mysql_pconnect(): mysql extension deprecated , removed in future: use mysqli or pdo instead in c:\wamp\www\dwwithphp\connections\explorecalifornia.php on line 9 is there way confi

c++ - Socket Packet Post Data Truncated -

i working c++ socket programming, posting long string webpage processed. program runs ok, however, data sending truncated. webpage not process data successfully. #maxline[4096] ssize_t myclass::send_data(const char *host,const char *page,const char *poststr) { char sendline[maxline+1], recvlin[maxline+1]; size_t n; int c_length = strlen(poststr); snprintf(sendline,maxsub , "post %s http/1.0\r\n" "host: %s\r\n" "content-type: application/x-www-form-urlencoded\r\n" "content-length: %d\r\n\r\n" "%s", page, host, c_length, poststr); int line_length = sizeof(sendline); int sig_status = send(sock, sendline, line_length,0); if (sig_status < 0){ signal(sigpipe,sig_ign); } return n; } how can not truncated data sending?

javascript - Drag, Drop, Sort, Clone and Change Class Not Working -

here's i'm trying accomplish (version 2.0 new code updates) i'm trying create module has 2 columns. left , right. want buttons in left column when dropped right change classes. when buttons on left dropped on right want them call animated class per-defined transitions in larger image. these boxes drag , droppable in right column. again need module drag, drop, clone, sort , change classes. have figured out except changing of classes. i've been working on time insight appreciated. thanks. here's picture , code here's picture of i'm trying accomplish - twitter pic . here's my new fiddle project . suggested code isn't working here's latest effort alter javascript advised on post. script still isn't working. understand i'm trying do, missing. little anyone? $('ui-sortable-handle').droppable({ drop: function(event, ui) { if($(this).attr('id').indexof('music')){

How to search and copy results with file structure? -

i trying find way search directory files name, copy found files output directory. because files have same file name, i'm wondering if can copy folder structure well, or alternatively append filename parent folder name (i.e. folder\file.txt becomes folder-file.txt) the search i'm using basic dir call: dir file.xml /s can i'm trying cmd? ok using in batch script well, though believe syntax same. i robocopy (built in newer versions of windows). should trick... robocopy.exe /s c:\fromdir c:\todir file.xml

javascript - Raw Buffer data play in audio tag -

i making web application streaming users microphone audio node js server using socket io , re broadcasting data. <buffer 59 00 76 00 92 00 a0 00 aa 00 b1 00 aa 00 92 00 7c 00 74 00 75 00 7e 00 8f 00 9d 00 9c 00 98 00 94 00 85 00 7c 00 8a 00 8f 00 6c 00 4f 00 5d 00 67 00 48 ...> this sending , recieving on clients (via log). possible take buffer , put in sort of audio container , play in html audio tag? i tried taking buffer obj , making object url blob did not work. var src = window.url.createobjecturl(stream) should push buffered data array? make sense client play how can take raw data , turn audio? appreciated. i putting finishing touches on project stream audio node.js rendered in browser web audio - nothing out of box i've found - involves setting audio context playback callback getting fed buffers received via web sockets

R: Replace multiple values in multiple columns of dataframes with NA -

i trying achieve similar this question multiple values must replaced na, , in large dataset. df <- data.frame(name = rep(letters[1:3], each = 3), foo=rep(1:9),var1 = rep(1:9), var2 = rep(3:5, each = 3)) which generates dataframe: df name foo var1 var2 1 1 1 3 2 2 2 3 3 3 3 3 4 b 4 4 4 5 b 5 5 4 6 b 6 6 4 7 c 7 7 5 8 c 8 8 5 9 c 9 9 5 i replace occurrences of, say, 3 , 4 na, in columns start "var". i know can use combination of [] operators achieve result want: df[,grep("^var[:alnum:]?",colnames(df))][ df[,grep("^var[:alnum:]?",colnames(df))] == 3 | df[,grep("^var[:alnum:]?",colnames(df))] == 4 ] <- na df name foo var1 var2 1 1 1 na 2 2 2 na 3 3 na na 4 b 4 na na 5 b 5 5 na 6 b 6 6 na 7 c 7 7 5 8 c 8 8 5 9 c 9

javascript - Firefox extension panel doesn't execute html code -

hi i'm trying create panel in firefox extension in html code dinamically inserted javascript code. code: var { togglebutton } = require('sdk/ui/button/toggle'); var panels = require("sdk/panel"); var htmlpage = '<html><head><link href="panel-style.css" type="text/css" rel="stylesheet"></head>' + '<body><form>what name?: <input id="user-real-name" placeholder="insert here name"/><br />' + '<input type="button" value="submit" id="submit-btn"/></form><script src="get-text.js"></script>' + '</body></html>'; var button = togglebutton({ id: "button", label: "tmp button", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.p

java - Set javax.xml.transform.TransformerFactory in Wildfly 8.1 -

i need 2 transformerfactory implementations software. must process xml , xls/fo (formatting object) pdfs. newer versions of our software want use user defined xsl functions use net.sf.saxon.transformerfactoryimpl directly referenced in sourcecode. because of old data in database in need process old ones org.apache.xalan.processor.transformerfactoryimpl, saxon thrown error , not render pdf. when using tomcat set "-djavax.xml.transform.transformerfactory=org.apache.xalan.processor.transformerfactoryimpl" vm argument , no problem. when using wildfly setting vm argument causes wildfly throw following exception: "exception in thread "main" javax.xml.transform.transformerfactoryconfigurationerror: provider org.apache.xalan.processor.transformerfactoryimpl not found" a xalan.jar contained in war file. jboss specific version of xalan part of wildlfy distribution. why none of them found? why wildfly try load factory on startup of wildfly service? how co

image processing - Which is better between Histogram Equalization and Histrogram streching? -

which better between histogram equalization , histogram stretching increasing contrast specially when histograms equal particular range (say 69-192) out of [0,255] , if block gets expand towards 0 , 255. from opinion histogram equalization not idea when histograms equal whatever size of range. histogram stretching should work.

linux - GSSAPI - Windows Active Directory Interoperability - error accepting context: Wrong principal in request -

we writing softwares run on both windows , linux, , plan use windows active directory authentication. struggling issues described below, , appreciate much: domain name: corp.company.com test programming running on 1 linux machine: host1.corp.company.com the test program comes gss-sample krb5-1.11.3 downloaded files. the server named "gssapitest". based on "step-by-step guide kerberos 5(krb5 1.0) interoperability(from microsoft) , first create user "host1" in ad represent host host1.corp.company.com (the linux machine). use ktpass generate keytab (run windows): ktpass /princ host/host1.corp.company.com@corp.company.com /mapuser host1 /pass hostpassword /out file1.keytab now in ad, create domain user "gssapitest" represent test server program, , map user similarly: ktpass /princ gssapitest/host1.corp.company.com@corp.company.com /mapuser gssapitest /pass gssapitestpassword /out file2.keytab copy file1.keytab , file2.keytab linux ma

extjs - Built a JSON from string pieces -

i work line chart in extjs4 now. chart based on data of store. store change data 'loadrawdata()' function. familiar situation, isn't it? ajax sends strings every 10 seconds , need built json pieces of strings. i'm trying: success: function(response) { var requestmassive = json.parse(response.responsetext); var jarray = []; for(var i=0;i<requestmassive.length;i++){ var firstpiece = json.parse(response.responsetext)[i].date; var secondpiece = json.parse(response.responsetext)[i].connectcount; var recording = "{'machinesplayed':"+firstpiece+", 'machinesonline':"+secondpiece+"}"; jarray.push(recording); } jarray = '['+jarray+']'; store.loadrawdata(jarray); } but wrong way. how properly? you use loaddata() function instead of loadrawdata()

web services - How to do multiple of operations in Java Webservice -

i using java/rest/jersey webservice. i have users service, ..../rest/users/get/username ..../rest/users/get/all ... want other things, sports .../rest/sports/get/sport .../rest/sports/play.. i know can map users rest1 servlet , sports rest2 servlet, in fact have now. but, there way both things (users , sports & ...) in 1 servlet? don't fact have rest1,rest2,rest3,rest4 ... ..../rest/users/get/username ..../rest/sports/play ... you can define service endpoints patterns. should review endpoints, 'cause /rest/users/get/username seems make no sence me. if want something, use method. no need have in url / endpoint. examples in code: @path("/{parameter: rest1|rest2|rest.n}/users") public class users { // [rest1|rest2|...]/users/{userid}/username @get @path("/{userid}/username") @produces({mediatype.application_json,...}) public response getuserusername(@pathparam("userid") string userid) {

android - Kill audio after deliberate or accidental exit of dialog -

this part of code in mainactivity. stopwatch1 image button called in mainactivity: stopwatch1 = (imagebutton)findviewbyid(r.id.stopwatch1); i have tried searching clues on how use dialog.setondismisslistener, however, there aren't proper answers me killing of audio after deliberate or accidental exit of dialog. appreciated. stopwatch1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { final dialog mmdialog1 = new dialog(context); mmdialog1.setcontentview(r.layout.countdowntimer); mmdialog1.settitle("stop-watch"); button ddbutton1 = (button) mmdialog1.findviewbyid(r.id.countdown_exit); final button ddbutton2 = (button) mmdialog1.findviewbyid(r.id.countdown_start); final textview timeview = (textview) mmdialog1.f

plot - ploting Gamma(Z) with maple -

Image
how 1 plot absolute value of $|\gamma(z)|$ maple? in wiki figure: http://de.wikipedia.org/wiki/gammafunktion#mediaviewer/file:gamma_abs_3d.png the command plots:-complexplot3d intended convenient way of obtaining such plots (using z instead of plot3d command x+i*y, , putting in labels automatically). p := plots:-complexplot3d( abs(gamma(z)), z=-4-4*i..4+4*i, view=[-4..4,-4..4,0..6], orientation=[-120,75] ): for reason, surface stored in structure p gets blue color overrides shading scheme. p; if remove color substructure underlying shading scheme (which change in original call, using shading option) revealed. subsindets(p,specfunc(anything,color),u->null); i submit bug report heavy-handed blue coloring.

converting query to list (not working) asp.net mvc -

i trying create query results stored in viewmodel. when try assign query variable viewmodel's method, following error: "cannot implicitly convert type 'system.linq.iqueryable' 'system.collections.generic.list'. explicit-conversion exists (are missing cast?)". tried changing viewmodel's methods of type iqueryable instead of list worked couldn't use foreach loop in view loop through model changed list. tried doing tolist() after query didn't work either. suggestions/hints/tips appreciated. below controller code , viewmodel code. viewmodel: using system; using system.collections.generic; using system.linq; using system.web; using ku_plan_dev.models; namespace ku_plan_dev.viewmodels { public class trackviewmodel { public list<string> track_info { get; set; } public list<string> gen_ed_head { get; set; } } } controller method: public actionresult displaytracksheet(string trackbutton) { var db = new

pangram - Need help on Python -

q: pangram sentence contains letters of english alphabet @ least once, example: quick brown fox jumps on lazy dog. task here write function check sentence see if pangram or not. what have is: def ispangram(s): alphabetlist = 'abcdefghijklmnopqrstuvwxyz' alphabetcount = 0 if len(s) < 26: return false else: s = re.sub('[^a-za-z]','',s).lower() in range(len(alphabetlist)): if alphabetlist[i] in s: alphabetcount = alphabetcount + 1 if alphabetcount == 26: return true else: return false however, when try example s=["the quick brown fox jumps on lazy dog"], result false, wrong. should true b/c has contained 26 letters. can me fix code? many thanks!!! the problem you're passing in list of strings instead of list. pass in "the quick brown fox jumps on lazy dog" without brackets , code work. your code unneces

shell - Making a curl to an API and get an specific field from the JSON -

i'm making curl terminal following curl -x "https://api.mercadolibre.com/items/mla511127356" and response json, example one: "id": "mla511127356", "site_id": "mla", "title": "item de testeo, por favor no ofertar --kc:off", "subtitle": null, "seller_id": "160252486", "category_id": "mla4967", "official_store_id": null, "price": 10, "base_price": 10, "original_price": null, "currency_id": "ars", "initial_quantity": 16, is there simple way terminal? thank in advantage. by using jq parse json data instead of text based parsing. curl -x "https://api.mercadolibre.com/items/mla511127356" | jq '.[].id'

android - ImageButton animation not applied to all states -

i have imagebutton image rotates device orientation image/ button horizontal (note rotations handled manually, not through activity life-cycle). this works great, except when user presses button (state pressed), 90' rotation lost temporarily. button animation; <rotate xmlns:android="http://schemas.android.com/apk/res/android" android:fromdegrees="0" android:todegrees="-90" android:pivotx="50%" android:pivoty="50%" android:duration="200" android:fillafter="true"> </rotate> the image button drawable; <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/btn_go_back_pressed" /> <item android:state_enabled="false" android:drawable="@drawable/btn_go_back_disabled" /> <item android:drawable=

php - ZF2 reading mail with attachments?? -

i can't find documentation reading email attachments. can suggest something? i using zend\mail\storage\imap read emails text, cant find methods attachments. ifyou can access attachments using mime/part package. can firstly test message multipart using $message->ismultipart() can iterate messages parts or access specific part using $part = $message->getpart($num); there can access type of part, determine if inline/attachements , on. useful links: see : http://framework.zend.com/manual/2.2/en/modules/zend.mail.attachments.html see : http://framework.zend.com/manual/2.2/en/modules/zend.mime.part.html

R bar graphs with error bars -

Image
i relatively new r , have been trying figure out how can add error bars bar graphs. use simple example, have prevalence data of bacteria 2 years i'm hoping add error bars to. start, create data frame x , y values standard error 95% confidence interval: >df<-data.frame(year=factor(c(2011,2012)),ms_prevalence=c(16.02,7.08),se=c(.20750,.10325)) i set upper , lower limits error bars: >limits<-aes(ymax=ms_prevalence+se,ymin=ms_prevalence-se) next, set graph p: >p<-ggplot(df,aes(y=ms_prevalence,x=year)) now add bars graph: >p+geom_bar(position="dodge",stat="identity") i select width of bars: >dodge<-position_dodge(width=0.9) then, attempt add error bars: >p+geom_bar(position=dodge)+geom_errorbar(limits,position=dodge,width=0.25) when add error bars, graph turns bar line. while include error bars, need bar graph appropriately represent data. appreciated! try: ggplot(df) + geom_bar(aes(x=year, y=ms_pr

IE8 Not Calling Two JavaScript Functions via Onclick Event -

essentially want call 2 functions on onclick event. works fine in firefox , chrome not ie8! the first function should call modal appear (modal indicates form in process of being saved - not appearing) while second function saves form , hide modal. html <a onclick="openmodal();saveform();">click me</a> <!-- modal --> <div id="mymodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div id="modal"> <img id="loader" src="static/images/ajax-loader.gif" /> </div> </div> javascript function openmodal(){ $('#mymodal').modal('show'); } function saveform(){ //--- logic } thank in advance! i don’t listen event adding "onclick" attribute html element. instead, more practical use .addeventlistener. can reco

c - How can I reduce time complexity of the following program? -

question: mark undergraduate student , interested in rotation. conveyor belt competition going on in town mark wants win. in competition, there's conveyor belt can represented strip of 1xn blocks. each block has number written on it. belt keeps rotating in such way after each rotation, each block shifted left of , first block goes last position. there switch near conveyer belt can stop belt. each participant given single chance stop belt , pmean calculated. pmean calculated using sequence there on belt when stops. participant having highest pmean winner. there can multiple winners. mark wants among winners. pmean should try guarantees him winner. pmean=∑i=1ni×a[i] where represents configuration of conveyor belt when stopped. indexing starts 1. input format first line contains n denoting number of elements on belt. second line contains n space separated integers. output format output required pmean constraints 1 ≤ n ≤ 10^6 -10^9 ≤ each number ≤ 10^9

Orange Dot for Sublimetext3 dirty files -

modifying preferences/settings - user , adding: "highlight_modified_tabs":true, gets me highlighted text in tab dirty files, cannot greyed out dot on tab change colors well. what i'm trying accomplish have dirty file dot change orange text on tab modifying above settings, except want dot change color , not text on tab. answering own question may run issue. after lot of fiddling around, figured out within default.sublime-theme file on lines describing close file button start @ line 729 (for me @ least) see bunch of different code blocks this: { "class": "tab_close_button", "parents": [{"class": "tab_control", "attributes": ["dirty", "file_medium_dark"]}], "layer0.opacity": 0.0, "layer1.opacity": 0.0, "layer2.opacity": 0.0, "layer3.texture": "theme - default/dirty_circle_light.png&q

user interface - How to achieve the complex UI using ItemControl in silverlight -

i working on creating complex report looks shown in here image for have create collection store descriptions , corresponding ratings. collection binding itemcontrol. collection fetched database depending on criteria's. problem how fragment or separate single itemcontrol shown in image. should use multiple collections bind different itemcontrol ? can use multiple datagrids? i out of ideas... suggestions / examples appreciated. definitely do-able. treat each block (such mathmatics, arts education etc) item, , you're dealing itemscollection. create style how present each item in collection, , style how present each property in block (which feature collection of something. an example have of similar, blocks consisted of heading, , varied number of checkboxes each description. there varying number of these blocks too. in view, displayed these blocks, xaml looked this: <scrollviewer verticalscrollbarvisibility="visible" maxheight="100"&g

text to speech - How to use Android TTS in Arabic -

my application implements texttospeech.oninitlistener interface, , i'm trying let speak arabic letters, seems doesn't support arabic. what should do? here code sets language, arabic not supported: mtts = new texttospeech (this, this); mtts.setlanguage(locale.us); arabic not supported default google tts engine. need install third-party tts engine supports arabic such espeak or svox arabic .

ios - Issue connect to itunes connect -

i new itunes connect, , have apple developer profile account, when use same credentials pops me error message "your apple id isn't enabled itunes connect" can 1 please suggest how itunes activated, need chcek number of app downloads, app status, review etc app. have @ answer here : publishing ios app, error signing in itc: "your apple id isn't enabled itunes connect." the agent user(for company) should able signup itunes connect , send invitation on behalf.

Python: position text box fixed in corner and correctly aligned -

Image
i'm trying mimic legend method in matplotlib.pyplot 1 can use loc='lower right' position legend box fixed , aligned no matter axis , content of box. using text out since requires manual input of coordinates , i'm after automatic. i've tried using annotate , gets me half way there, still won't work right. this have far: import matplotlib.pyplot plt # define names , variables go in text box. xn, yn, cod = 'r', 'p', 'abc' prec = 2 ccl = [546.35642, 6785.35416] ect = [12.5235, 13.643241] fig = plt.figure() ax = fig.add_subplot(111) plt.xlim(-1., 10.) plt.ylim(-1., 1.) # generate text write. text1 = "${}_{{t}} = {:.{p}f} \pm {:.{p}f}\; {c}$".format(xn, ccl[0], ect[0], c=cod, p=prec) text2 = "${}_{{t}} = {:.{p}f} \pm {:.{p}f}\; {c}$".format(yn, ccl[1], ect[1], c=cod, p=prec) text = text1 + '\n' + text2 ax.annotate(text, xy=(0.75, 0.9), xycoords='axes fraction', fontsize=10, b

Print Matlab figures whose axis ratio the same as in screen -

i'm having problems printing .jpg figure keeps same appearance seen on screen. printed figure looks stretched. helps ? thanks! you need use line: set(gcf,'paperpositionmode','auto') to make sure matlab not resize figure. if not work please show code use.

delphi - How do I get the absolute mouse co-ordinates when mouse is over a control -

i want absolute co-ordinates of mouse when mouse on control has been placed on host control. e.g. host control panel button placed on panel. want mouse co-ordinates relative panel when mouse on button. i have tried obvious see get: procedure tfmworkingscreen.pnlscreenareamousemove(sender: tobject; shift: tshiftstate; x, y: integer); begin statusbar1.simpletext := 'left ' + inttostr(x) + ' right ' + inttostr(y); end; clearly work when mouse on panel control. there way required co-ordinates? add onmousemove event handler child control, button in example. in onmousemove event handler receive x , y cursor coordinates respect child control's client area. if host control immediate parent of control onmousemove event has fired use control's clienttoparent method: var posrelparent: tpoint: .... posrelparent := (sender tcontrol).clienttoparent(point(x, y)); if parent control may further parent/child relationship can pass parent con

php - Wordpress won't let me wrap a div in an a tag -

i'm having strange issue can't figure out. i'm working on custom theme in wordpress , i've got div image , icon image inside. i'm trying make both whole image , icon image within link. the issue when try put link around whole div, wordpress closed link prematurely , adds second link - neither of enclosing div. if change div span, let me wrap in link. why?! going on , how , turn off 'feature'? here selected code in template file: <a href="<?php the_permalink(); ?>"> <div class="img"> <?php if (has_post_thumbnail()): ?> <img style="display: none;" src="<?php echo $image_attributes[0]; ?>" alt="<?php echo strip_tags(get_the_title()); ?>"> <span class="zoom hide-ie"><i class="fa fa-search"></i></span> <?php endif; ?>

ios - Error Uploading Screenshots to new iTunes Connect -

Image
i've been experiencing issue 2 days, since new itunes connect became avaiable. when adding new screenshot, @ first, receiving error: your app information not saved. try again. if problem persists, contact us. inspecting element in browser, in console see got server error: we've got server error... 500 but yesterday, error changed. server responding success , new error appeared when trying upload screenshot: failed create screenshot screenshots 4-inch iphone 5 , ipod touch (5th generation) retina display (error 4-inch upload) i'm sure image types/sizes ok. today, i'm server error... apple responded thread them today, ask additional information such screenshots , source code of page. anyone else having issue? got answers apple? thx ss of inspecting element in safari: i met same problem. solution me avoiding use default name (i.e. ios simulator screen shot ********), rename screenshots "1.png, 2.png..." , s

excel - I am getting the overflow error while trying to change a number into a date -

Image
i trying convert numbers -> specified date format. being done on 1 column (column d). here code - 'changing date format (for uploaddate column) application.screenupdating = false each c in range("d2:d" & cells(rows.count, "d").end(xlup).row) c.value = dateserial(left(c.value, 4), mid(c.value, 5, 2), right(c.value, 2)) c.numberformat = "mm/dd/yyyy" next application.screenupdating = false now, whenever code reaches point - breaks following error being displayed :- run-time error '6': overflow what code does, overall, copy data excel file hidden sheet of excel (where code located). update column date format (as specified in above code) , update pivot tables in file. note - set visibility of hidden sheet true before changing format of column you getting error because cell either has negative value or large value formatted date. may want see explanation ######## see example test code sub sample() dim

How I can fix this issue with a json gem on ruby? -

i tried install json gem gem install json and caused problem. so decide uninstall ruby-on-rails , install again. so want execute project in rails. however, i'm getting following error: c:\users\franco\documents\github\risepay-ruby\risepay>rails s not find json-1.8.1 in of sources run `bundle install` install missing gems. i tried install json again , use bundle install didn't work. c:\users\franco\documents\github\risepay-ruby\risepay>bundle install dl deprecated, please use fiddle fetching gem metadata https://rubygems.org/........... resolving dependencies... using rake 10.3.2 using i18n 0.6.11 gem::installerror: 'json' native gem requires installed build tools. please update path include build tools or download devkit 'http://rubyinstaller.org/downloads' , follow instructions @ 'http://github.com/oneclick/rubyinstaller/wiki/development-kit' error occurred while installing json (1.8.1), , bundler cannot continue. make sure `ge

graph - How to create Adjacency Matrix for dataset in Matlab? -

i new user of matlab , need in creating adjacency matrix data set. dataset in following pattern a=[ 0 1 0 2 0 5 1 2 1 3 1 4 2 3 2 5 3 1 3 4 3 5 4 0 4 2 5 2 5 4 ]; the adjacency matrix above be m= 0 1 1 0 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 0 1 0 1 0 i need code perform above task in matlab you use sparse . please take @ function, give problem try, , check hovering mouse on following rectangle: full(sparse(a(:,1)+1, a(:,2)+1, 1))

c# 4.0 - how to define the order of array element while serializing xml object in c# -

i have following class. [xmlroot("myroot")] public class myroot { [xmlelement("node1")] public node1[] node1 { get; set; } [xmlelement("node2")] public node2[] node2 { get; set; } [xmlelement("node3")] public node3[] node3 { get; set; } } public class node1 { [xmlelement("attrib11")] public string attrib11 { get; set; } [xmlelement("attrib12")] public string attrib12 { get; set; } } public class node2 { [xmlelement("attrib21")] public string attrib21 { get; set; } [xmlelement("attrib22")] public string attrib22 { get; set; } } public class node3 { [xmlelement("attrib31")] public string attrib31 { get; set; } [xmlelement("attrib32")] public string attrib32 { get; set; } } this below code fill data , serialize var abc = new xml834.myroot(); abc.node1 = new xml834.node1[] { new xml834.node1() { attrib11 = &

Font styled with CSS and JQuery corrupted in Google Chrome -

Image
my client notified me today regarding strange issue affects website in google chrome. website, reference, www.circom.co.uk. issue related text displayed in animated image banner @ top of page. when site viewed browser other chrome, site displays perfectly. below screenshot of site taken internet explorer 11: however, i've tried site on google chrome on windows 8.1, , how displays site: i had been meaning update google chrome on debian 7 install, hadn't got round it. however, version of chrome on debian displayed page perfectly, lot ie11 image. version of chrome on debian 36.0.1985.125, version of chrome site broken version 37.0.2062.120 m. i believe bug chrome, , i've reported so. however, in case google think feature, can fix text in chrome? edit: here javascript animation: <script> $(document).ready(function(){ $('#home_banners').each(function() { $(this).cycle({ fx: 'fade',

c# - How to merge two nullable DateTime objects one contaning time other date I need into one object? -

Image
i've got 2 datetime objects. fetchtime contains time hh:mm:ss insterested in, fetchdate contains date: year, month, day. example: debug.writeline("time " + fetchtime); debug.writeline("date " + fetchdate); displays example: time 2014-09-10 23:04:00 date 2014-09-15 00:00:00 and datetime object looks that: 2014-09-15 23:04:00 i merge 2 1 or modify 1 of them. thought easy can't see methods datetime object. achievable or first must convert datetime type convert back? finally, have have datetime object because going added sql database . edit: i refer nullable datetime : datetime? fetchdate, datetime? fetchtime . just use datetime constructor var date = new datetime(fetchdate.year, fetchdate.month, fetchdate.day, fetchtime.hour, fetchtime.minute, fetchtime.second); update: seems using nullable datetime . should underlying datetime value using value property. var fetchdate = fetchdate.value; var fetchtime =

c++ - How to use ifstream to input a file into a 2D array? -

this question has answer here: reading matrix text file 2d integer array c++ 2 answers i'm struggling on overloading ifstream operator input file in matrix form , creating 2d array. 3x3 matrix. small part of assignment without whole assignment quite pointless. file example: 1 2 3 4 5 6 7 8 6 i have done way... #include <iostream> #include <fstream> #include <string> #include <sstream> using namespace std; int main() { int data[3][3]; int = 0; int j = 0; ifstream in(filename); std::string line; std::string temp; while(std::getline(in, line)) { std::istringstream iss(line); // parse each line using input string stream j = 0; while(std::getline(iss,temp,' ')) { data[i][j] = std::stoi(temp); j++; } i++; } return 0; }

checkbox - How do I add a dojo ComboBox to my DataGrid using a formatter? -

how add dojo combobox datagrid using formatter? thought i've been reading should able add dojo combobox datagrid formatter have done dojo checkbox (and dojo button on html page created). cannot find example of this. using dojo 1.10.0. here existing code doesn't load because wrong formattercombobox formatter: <!doctype html> <html > <head> <title>test widget</title> <link rel="stylesheet" type="text/css" href="dojo-release-1.10.0/dijit/themes/claro/claro.css" /> <link rel="stylesheet" type="text/css" href="css/dojomod.css" /> <link rel="stylesheet" href="dojo-release-1.10.0/dojo/resources/dojo.css" /> <link rel="stylesheet" href="dojo-release-1.10.0/dojox/grid/resources/clarogrid.css" /> <script>dojoconfig = {async: true, parseonload: false}</script> <script src="doj