Posts

Showing posts from January, 2015

php - How to make the featured image without a fixed position? -

i know how style featured image , give class, don't want have fixed position. instead, want have custom position every post (i set position manually every post). how possibly can achieve ? add code in post loop, make way want : <?php if ( has_post_thumbnail() ) the_post_thumbnail(); else echo '<img src="' . trailingslashit( get_stylesheet_directory_uri() ) . 'images/default- thumbnail.png' . '" alt="" />'; ?>

c# - How to get the value of dropdownlist on selection changed inside the repeater. -

i have 4 column inside repeater, expected , accpet , ddl & 1 panel not visible on page load if expect column value , dropdown selection value same want visible panel otherwise not. please me not getting value of dropdownlist beacuse on selection change whole repeater refilling not single value able get. can me this. any possible way me. css <style> .main { width: 100%; } .inner { width: 90%; } .fst { width: 20%; float: left; } .scnd { width: 20%; float: left; } .thrd { width: 20%; float: left; } .frth { width: 20%; float: left; } .reset-this { clear:both; } </style> html <div class="main"> <div class="inner">

r - Wrap around subtraction -

i have these numbers: login.day$wday [1] 5 6 7 1 2 3 4 and want map them to: login.day$wday [1] 4 5 6 7 1 2 3 each number subtracted 1, , if answer 0, wrap around 7. embarrassingly simple can't figure out. attempt keeps giving me zero: > (login.day$wday + 6) %% 7 [1] 4 5 6 0 1 2 3 prefer solution in r. possible modulo arithmetic or must use if statement ? mathematically equivalent other solution, , explanation. (login.day$wday - 1 - 1) %% 7 + 1 the problem is hard modular arithmetic numbers starting @ 1 . we start doing -1 shift down 1 , have zero-based numbers ranging [0,6] . we subtract 1 , because trying begin with. next, take modulus, , add 1 shift range [1,7] .

android - Project not building in Titanium -

i made project in titanium, table. when tried run project on phone, failed saying "[error] application installer abnormal process termination. process exit value 1". it seems have error in processing of javascript. this got debug: traceback (most recent call last): file "c:\users\prodigy sml\appdata\roaming\titanium\mobilesdk\win32\3.2.2.ga\android\builder.py", line 2497, in <module> launch_logcat() file "c:\users\prodigy sml\appdata\roaming\titanium\mobilesdk\win32\3.2.2.ga\android\builder.py", line 124, in launch_logcat adb_location = androidsdk(android_sdk_location).get_adb() file "c:\users\prodigy sml\appdata\roaming\titanium\mobilesdk\win32\3.2.2.ga\android\androidsdk.py", line 49, in __init__ self.set_api_level(api_level) file "c:\users\prodigy sml\appdata\roaming\titanium\mobilesdk\win32\3.2.2.ga\android\androidsdk.py", line 53, in set_api_level self.find_platform_dir() file "c:\user

database - SQL UPDATE Error in C# Console Application -

Image
using ms visual studio 2010, ms access 2010(database converted .mdb) , program based on c# console application. i'm new c# , on following: 1.i'm struggling following error: syntax error in update statement. i've tried can't seem find problem. i've looked @ possible error outside update statement still no luck. online not seem me problem , of regarding connection database server. for (int w = 0; w <= 9; w++) { string pn = names[w]; int lvl = convert.toint32(level[w]), dmg = convert.toint32(damage[w]), plek = w+1; connectionstring = @"provider=microsoft.jet.oledb.4.0;" + @"data source=c:\users\home\desktop\game\game.mdb"; //tried 1 // querystring = "update scores set playername=\""+pn+"\", level=\"" +lvl+"\", damagereceived=\""+dmg+"\" pos="+ plek; //ended 1 querystring = "update scores set playername= @ppn, leve

asp.net - Passing dynamic variable in meta tag -

i trying declare dynamic meta content , try 2 different ways not working. kindly me. in advance. i using code this <meta name="description" content='<%#desc%>'/> and <meta name="description" content="<%=desc%>"/> both code not working, declaring desc variable public in c# code that won't work asp.net won't understand word you're providing variable or else , leave unused. in asp.net variables used using @ at rate of sign . can use this: @{ var desc = "this description"; } /* , in body part, use variable */ <meta name="description" content="@desc"/> now @desc rendered variable. , you'll result. you're new asp.net, need learn syntax of language first. please refer following link: http://www.asp.net/web-pages

javascript - how can I add a post identifier to my ajax -

i want add post identifier ajax. right way identify post checking if 1 of inputs present. here code: <input name="id" id="id" type="text"> if input name id present posted execute php code. here code: if(isset($_post['id'])){ the issue having want put multiple id posts in same page need sort them know post doing. want add post identifier. if(isset($_post['addlogin'])){ how can add post identifier ajax function. here code: $(function() { $("button#loginsubmit").click(function(){ $.ajax({ type: "post", url: "", data: $('form.loginform').serialize(), i wanted add {last_time:last_time} how can add post identifier? like this: data: { last_time : "test"}

ruby - Can't run sudo pod install after updating to cocoapods 0.32.1 with error "You cannot run CocoaPods as root. (CLAide::Help)" -

i found issue when running sudo pod install command after updating latest version 0.32.1. earlier working fine. when tried pod install older cocoapods, asked me update latest cocoapods version i.e. 0.32.1. after updated cocoapods gem, can't sudo pod install in xcode project. gives me following error. ± sudo pod install ruby-1.9.3-p0 password: /users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/claide-0.5.0/lib/claide/command.rb:328:in `help!': [!] cannot run cocoapods root. (claide::help) cocoapods, objective-c library package manager. commands:.... any suggestion overcome issue helpful. in advance. i had update permission on cocoapods sudo chown -r $user ~/library/caches/cocoapods sudo chown -r $user ~/.cocoapods since seems fix problem people, might want try running "pod install" , see if fixed problem point. ho

php - How to send more than one image to server -

my code working 1 image when upload more 1 image show error me . can me in getting out problem? using below code able upload single image , want upload more 1 image please how can upload images. thanks here code string image_path=imageurl1; getdata(myfiles); } }); } public void getdata(string myfiles) { string image_retrive_url="http://tradewale.com/open/tradedata.php?submittype=postad"; pdialog = new progressdialog(postaddactivity.this); pdialog.setmessage(" sending..."); pdialog.setindeterminate(false); pdialog.setcancelable(false); pdialog.show(); bitmap bitmap = bitmapfactory.decodefile(myfiles); bytearrayoutputstream stream = new bytearrayoutputstream(); bitmap.compress(bitmap.compressformat.jpeg, 30, stream); byte [] byte_arr = stream.tobytearray(); string image_str = base64.encodebytes(byte_arr); final arraylist<namevaluepair> namev

java - Read textfile with repeating entries into list (similar to properties) -

is there proper way read textfile this picture = germany correctanswer = germany otherletters = klbcdop picture = italy correctanswer = italy otherletters = ouilmnkds picture = egypt correctanswer = egypt otherletters = ywmpsadch picture = usa correctanswer = usa otherletters = klpomnagsyw and store data in - example - list? access data calling string picture = list.get(0).get("picture"); string otherletters = list.get(0).get("otherletters"); ... sure, manually, there not better way this? as far concern question, can create arraylist of hashmap below.. replace d:\file_to_read.txt file path.. try { file file = new file("d:\\file_to_read.txt"); filereader filereader = new filereader(file); bufferedreader bufferedreader = new bufferedreader(filereader); string line; hashmap<string, string> map = new hashmap<string, string>(); string arry[] = null; arraylist<ha

android - Failed Binder Transaction error on listview image click -

i have listview getting news images json. when image clicked new activity runs , shows news details. works fine in small screens. created layout-large , layout-xlarge folder , put list.xml folders. editted image dimensions large screen. when run application on small screen device, image click (listview item) works fine gives failed binder transaction on 10 inches virtual device. how can fix it?

sql server - t-sql: What is the best way to compare against decimals -

in query need records percentage less 50%. the field stores percentage values defined char(3) . example, see data defined '.35' in query used condition where mypercentagevalue < '.50' , not work noticed field has values such '85', '95', '90' , etc would can use compare against cases thank you i agree @eugene.it , @jnk if reason (and can't think of one) can't fix data use below. where .5 > case when cast(mypercentagevalue decimal (6,2)) >= 1 cast(mypercentagevalue decimal (6,2))/100 else cast(mypercentagevalue decimal (6,2)) end i following though. update #temp set mypercentagevalue = case when cast(mypercentagevalue decimal (6,2)) >= 1 cast(mypercentagevalue decimal (6,2))/100 else cast(mypercentagevalue decimal (6,2)) end

c# - Win 8 App: Bing Maps Binding Location -

i want bind longitude , latidute value bing map. doesn't work. if code values in xaml works fine. binding map not center. here example: <maps:map zoomlevel="7" x:name="mymap" credentials="my_code"> <maps:map.center> <maps:location latitude="{binding maps.latitude}" longitude="{binding maps.longitude}" /> </maps:map.center> <maps:map.children> <maps:pushpin> <maps:maplayer.position> <maps:location latitude="{binding maps.latitude}" longitude="{binding maps.longitude}" /> </maps:maplayer.position> </maps:pushpin> </maps:map.children> </maps:map> the position marked in map map not cen

compile jsp using maven -

in our company have integrated jenkins sonar. have pom.xml file compile java files when build project in jenkins. similarily looking plugin compiles jsp pages. found "jspc-maven-plugin" in combination "maven-war-plugin" can job. i have inserted piece of code in pom.xml dosent seem give me output: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>jspc-maven-plugin</artifactid> <version>1.4.6</version> <executions> <execution> <id>jspc</id> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid&

javascript - type=number formatting, jquery validate -

i have gotten requirement customer wants numbers seperated space thousands. ex: 1000000 becomes 1 000 000. my application built .net mvc5 , using jquery validate front end validation. i tried format inputs user types, validation wouldn't work. example interprated "8 000" "8". i tried change type=number inputs type=text, numeric validation jquery validate stopped working, html5 features of input=number min/max validation etc. does have idea on how solve this? can imagine solution hidden fields containing actual data, , other fields displaying formatted data, feel hacky, hard maintain , not reliable.

matlab - how to dlmwrite a file from array -

Image
how write cell below in text file(my_data.out)? http_only = cell2mat(http_only) dlmwrite('my_data.out',http_only) i error below:(i have tried solve still return me error) here full code: want generate text file each of data store 'http_only' check meet word in split_url. %data = importdata('data/url/training_url') data = importdata('data/url/testing_url') domain_url = regexp(data,'\w*://[^/]*','match','once') no_http_url = regexp(domain_url,'https?://(?:www\.)?(.*)','tokens','once'); no_http_url = vertcat(no_http_url{:}); split_url = regexp(no_http_url,'[:/.]*','split') [sizedata b] = size(split_url); = 1:100 a7_data = split_url{i}; data2=fopen(strcat('data\webpage_source\testing_data\',int2str(i),'.htm'),'r') chardata = fread(data2, '*char')'; %read text file , store data in chardata fclose(data2); img_only = regex

Unable to Undo Hijack with IBM Clear Case Eclipse Plugin 7.6.2 and Clear Case 8.0.0.6 -

i have problem, team->undo hijack function doesn't work ibm clear case eclipse plugin 7.6.2 , clear case 8.0.0.6. icon of file changes normal, file still hijacked. in clear case explorer, file still marked hijacked, it's possible undo hijack file clear case explorer. last clear case version 7.x, function worked perfectly. did know problem? thanks , greetings the first check need cleartool ls in parent folder of hijacked file. that confirm status (hijacked, after "undo hijacked") then, recommend closing many apps, , files within eclipse workspace, before attempting again "undo hijacked". possible eclipse keeps handle on resource (file) attempt "undo hijack".

subdomain - Auto login web app through url in Lotus Domino 6.5.4? -

in domino 6.5.4, possible assign newly registered account user new subdomain under our domain (eg. accountid.abc.net) , related database(eg. accountid.nsf); once user opens url(accountid.abc.net) through our email notification, automatically login server , database accountid.nsf opened? yes, possible. unfortunately redirection- documents need applied after http restart, might not best solution you. might find iwaredir- template useful without subdomain, depends on want achieve. but: stackoverflow not there "consulting" best solution quite "generic" topic, concrete questions concrete code issues. so might not best platform question.

java - Decript Jasypt encrypted information -

i encrypting object below entry using spring , hibernate. have salt , password possible decryption information plain text? <bean id="hibernatestringencryptor" class="org.jasypt.hibernate.encryptor.hibernatepbestringencryptor"> <property name="registeredname" value="hibernatestringencryptor" /> <property name="password" value="1234" /> <property name="saltgenerator"> <bean class="org.jasypt.salt.fixedstringsaltgenerator"> <property name="salt" value="1" /> </bean> </property> </bean> @entity @table(name = "bride") @typedef(name = "encryptedstring", typeclass = org.jasypt.hibernate.type.encryptedstringtype.class, parameters = { @parameter(name = "encryptorregisteredname", value = "hibernatestringencryptor") }) public class bridedetails { /

c# - SharePoint 2010 Web Part Error - Exception from HRESULT: 0x80131904 -

a client of ours encountered problem web part wrote while back. web part advanced search returns results based on information entered text box , criteria selected drop down. web part has been functional on other customer sites , error encountered 1 client not replicated, after extensive testing on our development environment. error appears when search column lookup field , works expected on other field type. have looked around web find resolution specific problem, majority of cases refer sql error of content database being out of space, don't believe case in instance. below full stack trace message receive. resolve problem appreciated! exception hresult: 0x80131904 @ microsoft.sharepoint.spglobal.handlecomexception(comexception comex) @ microsoft.sharepoint.library.sprequest.getlistitemdatawithcallback2(ilistitemsqlclient psqlclient, string bstrurl, string bstrlistname, string bstrviewname, string bstrviewxml, safearrayflags fsafearrayflags, isp2dsafearraywrite

javascript - tinymce 4 init button -

question tinymce 4-th version. when add button editor.addbutton('cut_tag', { type: 'button', text: '<cut>', name: 'cut_tag', id: 'cut_tag', icon: false, tooltip: 'Вставить cut', onclick: function(e){ editor.insertcontent('[cut]'); this.disabled(true); editor.cut_tag_button = this; // hack - store object in var object var later } }); and want execute code when initializing button, tried 'oninit', 'oncreate', 'setup', etc. no effect. please advice, thank you. you need move onclick event outside add button object. editor.addbutton(...); editor.on('click', function(e) { alert('insert logic here'); }); the syntax has changed little. tinymce migration guide might expla

html - CSS issues with different browsers -

below mentioned code works on google chrome whenever use ie7/8 output weird , entire page goes haywire. please me correct code, tell me resource or book should follow learn css. <html> <head> <style> .wrapper { width:1000px; height:auto; margin-left:auto; margin-right:auto; } .header { height:250px; width:1000px; background-color:red; } .menu_bar { height:40px; width:1000px; background-color:blue; margin-left:auto; margin-right:auto; } .menu_item { height:40px; width:300px; float:left; text-align:center; color:white; } .page { width:1000px; height:500px; background-color:yellow; margin-left:167px; } .page_left { width:150px; height:500px; background-color:green; float:left; } .page_right { background-color:black; height:500px; width:250px; float:right; } .footer { height:200px; width:1000px; background-color:orange; margin-left:167px; } </style> <head> <body&g

writing XSD from XML -

i writing xsd xml.i strucked @ point.can please me out. please mderators delete this <xsd:element name="aaa"> <xsd:complextype> , <xsd:element name="cvccodeswitch " type="xsd:integer" nillable="true"/> in above 1 how can make assumptions integer? the <xsd:element name="cvccodeswitch " type="xsd:integer" nillable="true"/> should fine (only integer allowed); you're confused because <cvccodeswitch /> is not nil; nil xml element looks like <cvccodeswitch xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nil="true" /> (you can omit xmlns:xsi if you've declared @ higher level) if have no control on xml (i.e. have write xsd according xml have) have declare type union of integer , empty string: <xsd:element name="cvccodeswitch"> <xsd:simpletype> <xsd:union> <xsd:si

java - When we use Referrence type and Object Type -

this question has answer here: what mean “program interface”? 29 answers i having doubt regarding arraylist , list. in case should use arrarylist like: arraylist obj = new arraylist(); and in case should use list interface. list obj = new arraylist(); after googling , study found nothing... please let me know difference between them. thanks in advance :-) if need call method specific implementation, use implementation. when write : list obj = new ... //arraylist() or linkedlist() the compiler knows obj list . hence, cannot use methods specific 1 implementation. for example, if need access last element of linkedlist , need declare : linkedlist = obj = new linkedlist(); now, obj linkedlist . hence, can use obj.last() .

php - Redirect site from https to http using htaccess or any other way -

i tried answers mentioned on search engine redirecting site https http these not working me. i tried: how redirect https http? , http://wp-mix.com/htaccess-redirect-http-to-https/ methods here let me explain little more here: before site (combustiondepot.com) separate site , having ssl installed there. working fine time. after deleted main combustiondepot.com site , make addon domain our main domain industrialstores.com. now site working fine except https. whatever changes making in htaccess or php these of no use. the examples above work if have .htaccess allowed in config. allow override if want using code assuming using php. <?php if ( $_server['https'] ) { $host = $_server['http_host']; $request_uri = $_server['request_uri']; $good_url = "http://" . $host . $request_uri; header( "http/1.1 301 moved permanently" ); header( "location: $good

c# - Validate Credentials and Redirect to given page -

i sending email external user link. this how url looks. "www.details.aspx?id=1234". when user clicks on url, want him go login page first, validate credentials , redirect given page. how can using windows authentication ? how give url ? thanks, if use windows authentication, don't need login page. you need put in web.config (inside system.web): <authentication mode="windows"/> if website in iis, need configure site uses windows authentication.

Using OR condition + function in join appears to confuse SQL Server's query optimizer -

i struggling debug performance on particular query. query this: select count(*) dbo.user d inner join dbo.distinct_first_name dfn on ( [dbo].jw(dfn.first_name, 'john') > 0.8 , (d.first_name = dfn.first_name or d.nick_name = dfn.first_name or d.middle_name = dfn.first_name) ) the query runs jaro winkler filter on distinct first name table (containing approx 15k rows) , inner joins against user table produce result set. defined, takes around 1 minute run approx 500k rows in user table. here's know: 1) jaro winkler filter instant (0.1s itself) 2) if change user clause include 1 of columns (i.e. remove ors) takes 0.4s 3) if change 3 queries, , run them back, takes approx 2s 4) if change jaro winkler filter 0.99 (so there's 1 result) makes no substantive difference in query execution time 5) if replace jaro winkler filter equality operation (dfn.first_name = 'john') total query time reduced 4s

beautifulsoup - Is there a shorter syntax than soup.select("#visitor_stats")[0]? -

i'm using beautifulsoup ( import bs4 ) read information web page. several lines in script like stats = soup.select("#visitor_stats")[0] is there shorter syntax this? select() lets select bunch of html tag elements based on css properties (like id , class ). in case looking html tag elements css id property set visitor_stats . , selecting first element returned list. the beautifulsoup method find() returns first occurrence of search criteria. list index [0] can gotten rid of using find() stats = soup.find(attrs={'id':'visitor_stats'}) but not sure if shorter :)

Run Go scripts in local vagrant machine -

i want run go scripts vagrant. when vagrant up, , run command 'go version' not see go installed , told the program 'go' not installed. can install typing: sudo apt-get install golang-go ` did install , it's running simple scripts fmt.println() then question is... i have repository lot of code in go. , need run in virtual machine vagrant. then best way run scripts worked on outside of vagrant vm because when vagrant up not see had install go. you don't want deploy via source , go run . run command connivence wrapper builds , executes binary in 1 step. there's lot can't do. compile code, , run binary. if deployment target different os/architecture, there's nothing wrong building executable in vm, make sure it's has go. can cross-compile code if don't have dependency on cgo, may easier.

c# - Read XML node from certain element forward? -

i know there bunch of ways of doing this, i'm looking easiest way of doing without having use streamreader or more manual force me loop through whole file , compare endless strings. possibility use streamreader find specific text, , use xml library retrieve node. here's xml. need do: 1) find first instance of tag npid text text find 2) extract node nodetoextract , store in data object. there several nodes called nodetoextract want first 1 after initial search of text text find <?xml version="1.0" encoding="iso-8859-1"?> <mdc> <ne> <neun>adb</neun> <nn>subnetwork=context</nn> <nw>r33</nw> <mi> <nut>20140101</nut> <hq>000</hq> <nw> <npid>text find</npid> <r>0</r> </nw> </mi> </ne> <ofid> <ofun>abc</ofun> <ofdn>blah</ofdn&g

artificial intelligence - Neural Network and Temporal Difference Learning -

i have read few papers , lectures on temporal difference learning (some pertain neural nets, such sutton tutorial on td-gammon) having difficult time understanding equations, leads me questions. -where prediction value v_t come from? , subsequently, how v_(t+1)? -what getting propagated when td used neural net? is, error gets propagated come when using td? the backward , forward views can confusing, when dealing simple game-playing program, things pretty simple in practice. i'm not looking @ reference you're using, let me provide general overview. suppose have function approximator neural network, , has 2 functions, train , predict training on particular output , predicting outcome of state. (or outcome of taking action in given state.) suppose have trace of play playing game, used predict method tell me move make @ each point , suppose lose @ end of game (v=0). suppose states s_1, s_2, s_3...s_n. the monte-carlo approach says train function approximat

php - alpha number 0-255 equivalent in 0-127 range -

i have rgba color in alpha value in 0-255 range. using function imagecolorallocatealpha in php accept alpha value in 0-127 range.how can convert alpha value in 0-255 0-127 for example alpha = 255 equivalent in 0-127 = 127 alpha = 0 equivelent in 0-127 = 0 use code imagecolorallocatealpha($image, $red, $green, $blue, $alpha/2); instead of imagecolorallocatealpha($image, $red, $green, $blue, $alpha); example alpha = 255 equivalent in 0-127 = 127 (255/2 = 127.5) alpha = 0 equivelent in 0-127 = 0 (0/2 = 0)

javascript - how to make layout work in grails when link has id (or not) -

the following code in land.gsp page. <table style="padding: 10 "> <thead> <tr style="color: blue"> <td>gname</td> <td>gowner</td> <td>device number</td> <td>edit </td> <td>delete </td> </tr> </thead> <tbody> <g:each in="${groups.list()}" status="i" var="groupsinstance"> <g:set var="myid" value="${groupsinstance.id}"></g:set> <tr class="${(i % 2) == 0 ? 'even' : 'odd'}"> <td>${fieldvalue(bean: groupsinstance, field: "gname")}</td> <td>

javascript - Dynamically Generated FileUpload and Image Preview -

Image
i dynamically generated table rows fileupload , default image using jquery. i want when image picked using fileupload on particular row default no-image pictured should replaced selected image. i tried using below jquery, seems work single fileupload , image. function readurl(input) { if (input.files && input.files[0]) { var reader = new filereader(); reader.onload = function (e) { $('#img-tag').attr('src', e.target.result); } reader.readasdataurl(input.files[0]); } } $("#file").change(function () { readurl(this); }); html: <table id="image" class="list"> <thead> <tr> <td class="left">image</td> <td class="right">sort order</td> &

Javascript - Delegate click event and detect the position of child element(compare with first-child) -

<div class="parent"> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> </div> i find appropriate way using javascript when click on 1 of child element. figure out element's position( not coordinate ) such element third children of parent element. asking same detect child node number <script> $(document).ready(function () { $('.child').click(function () { alert("position is" + ($(this).index() + 1)) }); }); </script> <div class="parent" > <div class="child">1</div> <div class="child">2</div> <div class="child">3</div> <div

android - Probleme of Preferences in class extends Fragment -

sharedpreferences prefs1 = getsharedpreferences("monfichierdeprefs",mode_private); the same syntax works on class extend activity not in extends fragment added context syntax error has disappeared when press button "demande" application stops error come preferance sure may not find solution me please!!!!! public class pagegauchefragment extends fragment { private static string key_success = "success"; private static string key_error = "error"; final string para_nom = "parametre2"; final string para_nom1 = "parametre3"; context context; public string fname,lname,ftype; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.page_gauche, container, false); /** * action sur bouton demande * **/ button button = (button) view.findviewbyid(r.id.button1); button.setonclicklistener(new view.onclickli

c# - unable to save log into windows azure table storage? -

i have used following code save trace log table storage. i'm using windows azure skd version 2.2 system.diagnostics.trace.traceerror("start log"); also added listener in web.config <system.diagnostics> <trace> <listeners> <add type="microsoft.windowsazure.diagnostics.diagnosticmonitortracelistener, microsoft.windowsazure.diagnostics, version=2.2.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" name="azurediagnostics"> <filter type="" /> </add> </listeners> </trace> </system.diagnostics> also added code in webrole.cs public override bool onstart() { startdiagnostics(); return base.onstart(); } private void startdiagnostics() { diagnosticmonitorconfiguration dmc = diagnosticmonitor.getdefaultinitialconfiguration(); timespan tsoneminute = time

c# - Improving Generic List Comparator -

i need generic class compare 2 list instances. have code below, quite messy , inefficient. how can make better , faster? callbyname extension uses reflection property. public class listobjectcomparator { #region proprietes public list<object> newlist {get; private set;} public list<object> removedlist { get; private set; } public list<object> communlist { get; private set; } #endregion #region methodes publics public bool run<t>(string icommuntextpropertyname, list<t> ioriginallist, list<t> inewlist) { return run(icommuntextpropertyname, ioriginallist, icommuntextpropertyname, inewlist); } public bool run<t>(string ioriginalpropertyname, list<t> ioriginallist,string inewpropertyname, list<t> inewlist) { if (ioriginalpropertyname.isnotnull() && inewpropertyname.isnotnull() && ioriginallist != null &&

iis 7 - IIS Security and Wordpress -

we self hosting wordpress on iis 7, 2008 server. to allow automatic updates wordpress code base, had set following permissions on wordpress root installation folder: iusr - modify my app pool - full control is secure configuration? thanks in advance, chris no, first - you should remove inheritance @ wwwroot , add system (full control) , administrators (full control) second - create administrator account application path website , use instead of basic pass through authentication (basic settings) third - change app pool use applicationpoolidentity , add permissions iis apppool\my app pool root of website , give read permission.

django - Fetch data from DB on every pageload -

i need make db query on every view within app, in order pass data templates. since views not classes, simple functions, can't have construct, can query. so, structurally speaking, best practice on put kind of logic? create template tag , queries there, seems not organized me. firstly, views can classes: django has offered class based views since version 1.3. however, best way pass data every template use context processor .

r - Check if one sample exists in the sample space (From PCA or other cluster analysis) -

i have 200 50 matrix, here 200 means 200 compounds (row) , 50 means 50 independent varialbes (column), , use 200 * 50 matrix cluster analysis (e.g. k-mean etc.), can plot show distributions these 2000 compounds. my question when have new compound, have same 50 independent variable 200 * 50 matrix, how can test if new compound located in cluster space? thanks. edit: plz note not need find element in data.frame. think first step cluster data (for example, using pca , plot(pca1, pca2)), test if new record located in plot or out. like picture , (2) belongs cluster , (1) not belong cluster space, this. here simple solution: step1: setup data set.seed(1) refdata <- data.frame(matrix(runif(200*50),nrow=200)) newrec01 <- refdata[11,] # record exists in data newrec02 <- runif(50) # record not exist in data step2: testing: true %in% sapply(1:nrow(refdata),function(i) all(newrec01 == refdata[i,])) true %in% sapply(1:nrow(refdata),function(i) all(newr

actionscript 3 - Why is StrobeMediaPlayer.swf 253k in the "for Flash Player X" folder but 433k when compiled or in player/bin folder? -

i have been trying compile strobemediaplayback source; i've managed compile project using ant flex 4.5.1 or flex 6 sdk , compiled using flash builder 4.5 (as recommended project). in cases, compiling smp project results in 433k strobemediaplayback.swf. also, strobemediaplayback.swf located in src/player/strobemediaplayback/bin/strobemediaplayback.swf ships 433k. question then, how on earth compile strobemediaplayback.swf 253k exists in for flash player 10.1 folder? appears there external osmf.swc file in folder 233k - typically gets bundled build... however, can drop 253k strobemediaplayback.swf new project without osmf.swc file , works fine. so, if turns out need compile strobemediaplayback without bundling osmf.swc, can point me in right direction on how this? relevant installation documentation impossible find: http://osmf.org/dev/osmf/specpdfs/building-osmf.pdf so, if turns out need compile strobemediaplayback without bundling osmf.swc, can point me i

javascript - How to use jquery Cookie? -

i have simple code: <html> <head> <script src="lib/jquery-1.11.0.min.js"></script> <script> $(document).ready(function () { $('.close_i').click(function(){ $('.adsbox').hide(); $('.open_i').show(); }); $('.open_i').click(function(){ $('.adsbox').show(); $('.open_i').hide(); }); }); </script> </head> <body> <div class="adsbox"> <img src="as1.jpg"> <img src="as2.jpg"> <img src="as3.jpg"> <img src="as4.jpg"> <img src="as5.jpg"> <img src="as6.jpg"> <a class="close

Trace Statements in PHP -

in c#/.net, can use trace.write or debug.write output application specific diagnostics. equivalent in php? echo outputting web page don't want. you write data error_log using error_log() via second argument can select type of logging want, such file logging, system logging or email.

java - instanceof vs equals on defined string that identifies the Class -

i can test class type in program i'm working both instanceof or getting field identifies class appartenency. choice between if(myobjec instanceof something){ } and if(myobjec.geclasstype().equals("something")){ } what best in terms of efficency? geclasstype() method present in object of program i'm working(not standard java method) , method returns string wih name of class. name passed field when object created edit field in second sample in code doesn't identify class category , used different routines, can use purpose since use specific object each category. have reported getclasstype make question more clear. you mean what's difference if verifying if object reference belongs specific class using instanceof vs comparing name of class. instanceof works object references class or subclass of class being compared. in case of interfaces, returns true if class (or super class) of object reference implements interface. getcla

c++ - What abstraction level should the servo transitions have? -

i think i'm using many methods because of poor abstraction design. that's why i'm asking question, different this one , similar ones, focus on number of methods per se. long story short, i'm doing hexapod. i'm saying because there unusual design considerations: cannot change going forward going backwards in no time; there's transition time. also, there's idle time, that's when there's no action. i'm refactoring code, achieve find i'm creating many methods should not in top-level abstraction, below: void loop() { // potentiometer string action = controller.action(); serial.println(action); // set spider forward start position if (action == "toforward") { spidey.toforward(); } // move spider forward else if (action == "forward") { spidey.forward(); } // standby position else if (action == "fromforward") { spidey.fromforward(); } // many more m

Can't Install Several Python Packages -

i have easy_install , pip installed on system. have tried installing number of different packages such twisted , scrapy , keep getting following error message: command python setup.py egg_info failed error code 1 in /tmp/pip_build_vagrant/cryptography i running os x 10.9 , have tried on local machine ubuntu virtual machine in vagrant. regardless of keep getting variation of above error. oddly enough, can install packages flask, django , few others. i have tried using virtualenv , no avail. here 1 example of error: command /users/meblumen/desktop/virtual_environments/scraper/bin/python -c "import setuptools, tokenize;__file__='/users/user1/desktop/virtual_environments/scraper/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bs/lkq_06gs33s1s_56zywwds2w0000gn/t/pip-wk9wd5-record/install-record.txt --single-version-extern

Case insensitivity in "if" statement (Python) -

this question has answer here: how test 1 variable against multiple values? 16 answers why `a == b or c or d` evaluate true? [duplicate] 1 answer i working on project @ 1 point ask user yes/no question. use code handle such questions: def yn(): global finalchoice choice=str(raw_input("y/n: ")) if choice == "y": finalchoice="true" elif choice == "y": finalchoice="true" elif choice == "n": finalchoice="false" elif choice == "n": finalchoice="false" else: yn() pass but seems quite inefficient, have check both "y" , "y" or "n" , "n" separately. i've tried: if choice == &quo