Posts

Showing posts from April, 2015

css - how to center dropdown navbar, and make it still responsive? -

how center dropdown navbar, , make still responsive? try every method found on site, , internet, still cant fix problem, 1 method fix problem make nav bar not responsive body { color: #ffffff; background-color: #000000; } h1 { color: white; font-family: "orator std"; font-size: 44px; letter-spacing: 0px; line-height: 8px; } h2 { color: white; font-family: "orator std"; font-size: 19px; letter-spacing: 0px; line-height: 1px; } h3 { color: white; font-family: "orator std"; font-size: 14px; letter-spacing: 1px; margin-right: 100px; margin-left: 100px; } h4 { color: white; font-family: "orator std"; font-size: 19px; letter-spacing: 0px; text-align: center; } h5 { color: white; font-family: "orator std"; font-size: 19px; letter-spacing: 0px; } .thumbnail {

java - Tricking the JVM into casting arrays -

i'd know there way cast array of supertype , array of subtype . so: subtype[] subarray = (subtype[])somesupertypearray; i know @ runtime throws classcastexception . way convert array copy array. in case, copying not option. can trick jvm beliving cast valid, , bypass class type checks? creating reference array of supertype , through seen subtype array. (possibly facing dangers of unexplainable errors) if define array like supertype[] array = {element1, element2}; subtype[] array2 = (subtype[]) array; it not work, can this: supertype[] array = new subtype[]{element1, element2}; subtype[] array2 = (subtype[]) array; you have make sure field array has array of subtype when you're casting it.

osx - Undefined symbols for architecture x86_64: "_glBegin" -

i'm trying build source code , after passing/fixing ton of errors, i'm stuck @ point have no idea how fix. i'm novice in building sources tried search error , none of them worked me although i'm not sure if implemented them correctly. i'm on osx 10.8.5 xcode 5.1.1 i'm striving make cmake file @ 75% i'm getting error (brief form): undefined symbols architecture x86_64: "_glbegin", referenced from: alembicholderoverride::draw(mhwrender::mdrawcontext const&, muserdata const*) in alembicholderoverride.cpp.o and portion of cmakelist have: # fix stop crash on osx < 10.9 set(cmake_osx_deployment_target 10.8) # compiler flags if (${cmake_system_name} matches "windows") # disable of bullshit warnings msvc wants barf add_definitions( "-w3 -mp -d_crt_secure_no_warnings -wd4005 -wd4996 -wd4305 -wd4244 -nologo" ) set(cmake_cxx_flags "${cmake_cxx_flags} /mp") endif() if( "${cma

javascript - Manually restarting d3 drag -

i'm trying use 2 separate drag behaviours depending on whether node held on second, or dragged immediately. i'm identifying hold behaviour enough using timer mouseup , mousedown , storing in "nodeheld" variable. run issues applying drag... if use "d3.event.sourceevent.stoppropagation();" on dragstart, enables single node dragged on it's own. if omit stoppropagation line, other drag listener (on canvas) ensures nodes dragged though i'm clicking on 1 specifically. wanted use "nodeheld" variable determine whether or not drag nodes, or specific one... var drag = force.stop().drag() .on("drag", function(d) { if (nodeheld) { d3.event.sourceevent.stoppropagation(); //this doesn't seem unless it's included @ dragstart } }) .on("dragstart", fu

mysql - SESSION variable in while loop not being sent correctly to second .php file -

i'm trying create simple topic , posting system , have 2 tables in mysql database; topics table , posts table. in posts table have post_parentid field links topic_id field in topics table. here how start query selecting (and displaying) topics in topic table. save topic_id field variable: <?php $sql = "select * topics inner join members on topics.topic_by = members.id"; $topics = $mysqli->query($sql); if ($topics->num_rows > 0) { // output data of each topic while($row = $topics->fetch_assoc()) { //saving topicid variable $topic_id = $row["topic_id"]; $_session['topicid'] = $topic_id;?> right after display html each topic, start new while loop display each post within each topic: <?php $sql = "select * posts inner join members on posts.post_by = members.id post_parentid = $topic_id"; $posts = $mysqli->query($sql); if ($posts->num_rows > 0) { // output data of each post while($ro

R shiny data table content with html tags -

i have data table in column a character field. need make strings withing column appear different color(just beginning, need search , replace multiple strings different colors ultimately). i'm attempting following way unsuccessful. below i'm attempting put html tags within column values, i'm not sure how make browser treat html tags while displaying data table. ideas? library(shiny) library(dt) x<-data.table(a=c("srinivas asfsis asdfsadf","vassri asdf asdfasdf","csdasdsriasfasf")) x$a<-as.data.table(sapply(x$a,function(x)gsub("sri",'<strong style="color:red">sri</strong>',x))) shinyapp( ui = datatableoutput("table1"), server = function(input, output) { output$table1<-renderdatatable({ datatable(x) }) } ) you've got conflicting packages each have functions same name. doesn't appear need more shiny package this... library(shiny) x

How to resolve Delphi error: Incompatible types: 'PWideChar' and 'Pointer' -

i have piece of code delphi 7: var lprgndata: prgndata; pc: pchar; pr: prect; ... pc := @(lprgndata^.buffer[0]); in delphi xe4 gives following compile error: incompatible types: 'pwidechar' , 'pointer' how should code updated work correctly in xe4? thanks whether or not compiles depends upon setting of type-checked pointers option . have enabled option excellent decision. doing results in stricter type checking. with type-checked pointers disabled, code compile. type-checked pointers enabled, code not compile, want because code not valid. now, on types in question. defined in windows unit this: type prgndata = ^trgndata; {$externalsym _rgndata} _rgndata = record rdh: trgndataheader; buffer: array[0..0] of byte; reserved: array[0..2] of byte; end; trgndata = _rgndata; {$externalsym rgndata} rgndata = _rgndata; the benefit of using type-checked pointers compiler can tell doing not valid. knows lprgndat

r - Subsetting with multiple conditions in very large data set -

i have matrix approximately 430 x 20,000. each row person, each column project have worked on. each cell has value of either 0 - (not involved), 1 - (project head, 1 per project), 2 - (project helper). trying @ projects single person head of. want @ 1 person @ time. person need r drop columns person's value isn't 1. want retain data other individuals in columns. ex: name project 1 project 2......project 2,000 person 1 0 2 person b 0 1 1 person c 2 2 2 i trying person b drops columns didn't head. name project 2...... project 2,000 person 0 2 person b 1 1 person c 2 2 sorry if obvious, reason have struggled find examples data large (a.k.a can't type in column names because there many). appreciated. so trying select columns of dataframe based on values in 1 of rows

python - Fitting a closed curve to a set of points -

Image
i have set of points pts form loop , looks this: this similar 31243002 , instead of putting points in between pairs of points, fit smooth curve through points (coordinates given @ end of question), tried similar scipy documentation on interpolation : values = pts tck = interpolate.splrep(values[:,0], values[:,1], s=1) xnew = np.arange(2,7,0.01) ynew = interpolate.splev(xnew, tck, der=0) but error: valueerror: error on input data is there way find such fit? coordinates of points: pts = array([[ 6.55525 , 3.05472 ], [ 6.17284 , 2.802609], [ 5.53946 , 2.649209], [ 4.93053 , 2.444444], [ 4.32544 , 2.318749], [ 3.90982 , 2.2875 ], [ 3.51294 , 2.221875], [ 3.09107 , 2.29375 ], [ 2.64013 , 2.4375 ], [ 2.275444, 2.653124], [ 2.137945, 3.26562 ], [ 2.15982 , 3.84375 ], [ 2.20982 , 4.31562 ], [ 2.334704, 4.87873 ], [ 2.314264, 5.5047 ], [ 2.311709, 5.9135 ], [ 2.29638 , 6.42961 ], [ 2.619374, 6

windows - avrdude: stk500_recv(): programmer is not responding When installing GRBL -

i trying install grbl onto arduino uno without luck. every time try upload it, keep getting same error: http://i.stack.imgur.com/nulye.png as can see, have set correct board , port. can write of examples board without issues, , have tried few other cables measure. did loopback test on it, , passed without issues. why can not upload grbl? running windows 7 ultimate 64 bit using latest ide what directly flashing pre-build hex file? just download file: https://github.com/grbl/grbl-builds/blob/master/builds/grbl_v0_9j_atmega328p_16mhz_115200_for_so2.hex (if don't have git, copy complete code make new .txt file, paste code , "save as": grbl_v0_9j_atmega328p_16mhz_115200_for_so2.hex) , uploader (xloader, may have heard that): http://xloader.russemotto.com/ open xloader , navigate hex file you've downloaded. select device dropdown (arduino uno, 328) , set baud rate 115200. select com-port you've attacehd uno (you can take @ device manager , search

ios - Hiding Cancel button on ABPeoplePickerNavigationController in iOS8 -

i attempting hide cancel button of abpeoplepickernavigationcontroller. following code works fine when run in ios 7.1 simulator, correctly hiding button. however, has no effect when run in ios 8.4 simulator. in both cases, log message written debugger, know code executing. besides code, have tried subclassing abpeoplepickernavigationcontroller (even though apple docs not to) , setting button nil in viewdidload method, has no effect on ios 8 either. googling this, there many posts asking how this, answers. however, none of answers appear work in ios 8. have tried solution suggested in following post (along many others) no success. abpeoplepickernavigationcontroller - remove "cancel" button without using private methods/properties? has found way hide cancel button of abpeoplepickernavigationcontroller in ios 8? -(void)showpeoplepickercontroller { abpeoplepickernavigationcontroller *picker = [[abpeoplepickernavigationcontroller alloc] init]; picker.peoplep

TypeError: Cannot set property 'description' of undefined when using angularjs $http get request -

i have controller info user , find perfect fruit him. if in json file there isn't description of fruit, wikipedia (wikimedia api). the issue i'm not able attach promise description variable. i appriciate it take look, thanks app.controller('fruitsctrl', ['$scope', '$http', 'preferences', function ($scope, $http, preferences) { $scope.preferences = preferences; //what kind of fruits preferences user have // local json files has info fruits $http.get("partials/fruits.json").then(function(response) { $scope.data = response.data; // question -> practice??? $scope.fruits = {}; // @ json file fruits correspond preferences (i = 0; < $scope.preferences.length; i++) { (l = 0; l < $scope.data.length; l++) { if($scope.data[l].fruitproperties.indexof($scope.preferences[i]) > -1){ // add fruit details fruits object

java - Why am I getting an error when making a FragmentPageAdapter? -

im working through tutorial can slide through tabs in view. requires me make subclass of fragmentpageadapter - in case: public class pageradapter extends fragmentpageradapter { ... } i have implemented of abstract methods reason getting following error: there no default constructor available in 'android.support.v4.app.fragmentpageadapter' does know how can fix this? highly appreciated. if don't specify constructor in class pageradapter , default constructor no-args used, looks parent class no-args constructor, equivalent to. public pageradapter(){ super(); // looks constructor public fragmentpageradapter (){} } in parent class fragmentpageradapter there below constructor defined public fragmentpageradapter (fragmentmanager fm) now rule in java is, once constructor arguments defined , default no-args constructor not available unless explicitly define it. here public fragmentpageradapter (){} not there. that's why super() call fail

playframework - Play Framework: migrating configuration from 2.3.8 to 2.4.1 -

the migration guide play 2.4.1 says evolutionplugin = disabled can safely omitted if 1 not using evolution... what's dbplugin = disabled , ehcacheplugin = disabled ? same principle apply? they're old, used present follows: play.api.cache.ehcacheplugin#enabled : /** * plugin enabled. * * {{{ * ehcacheplugin.disabled=true * }}} */ override lazy val enabled = { !app.configuration.getstring("ehcacheplugin").filter(_ == "disabled").isdefined } play.api.db.bonecpplugin#isdisabled : /** * plugin disabled if either configuration missing or plugin explicitly disabled */ private lazy val isdisabled = { app.configuration.getstring("dbplugin").filter(_ == "disabled").isdefined || dbconfig.subkeys.isempty } both of have gone. regarding cache, 2.4 documentation says: it possible provide custom implementation of cacheapi either replaces, or sits along side default implementation

javascript - Issue with getting new data from http call and automatic reload -

in ionic app have 2 services studies , collections. studies makes http call json object gets json array object iterate through , display on html page. here studies service: .factory('studies',function($http,$filter,$q){ var deferred = $q.defer(); $http.get("http://localhost/platform/loginsuccess.json").success( function(data){ // angular.copy(data, studies); deferred.resolve(data); } ); return { all: function(){ return deferred.promise; } }; }) and here controller code: $scope.studies = []; studies.all().then(function(data) { $scope.x = angular.fromjson(data.allprojects); $scope.studies = angular.fromjson($scope.x.list); }); this how displayed in html: <div class="feed-item" ng-repeat="study in studies"> <div class="feed-media"> <img src="http://www.spee

How do i make an automatic file writing system? -

i'm making automatic file writing system writes random numbers onto .txt file, need write .bat, problem i'm newbie batch! this common problem, call autosave, code: ( echo %yourvariable% ) > mylittlevariable.sav what do? when script reaches code, writes number %yourvariable% in .sav file, .sav can changed .txt or format. want load variable now! code: < mylittlevariable.sav ( set /p yourvariable= ) well want write random numbers! code random numbers: ( echo %random% echo %random% ) > random#s.txt so how works? batch file, before having command in autosave batch writer have put echo , how echo makes statement in cmd, types after in autosave, too. code basic .bat: ( echo @echo off echo title basic autosave batch echo :loop echo set supervar=15 echo cls echo echo hello, world! echo echo supervar: %%supervar%% echo pause echo goto loop ) > mybasicbatch.bat so, know know does, correct? hope helped you! ps double am

javascript - Rails and React, loading react-typeahead component with require -

i have react working rails using react-rails gem. rendering hellomessage component react front page fine. i used bower install 'react-typeahead' ( react-typeahead github ) var typeahead = require('react-typeahead').typeahead; the problem require not defined. i've looked requirejs-rails , browserify-rails, first requires stop using sprockets, , unable second working. i'm new this, how should getting require work 'react-typeahead' component? currently browserify getting: error: cannot find module 'react-typeahead' '/users/xxx/code/xxx/app/assets/javascripts' @ /users/xxx/code/xxx/node_modules/browserify/node_modules/resolve/lib/async.js:46:17 even though installed in directory bower. i've double checked , matches path. in require statement, need require exact path of library you're looking import if it's not in same folder, example: error: cannot find module 'react-typeahead' '/

css - Google Chrome Audit says "The following resources are explicitly non-cacheable" on JSF resources from library -

i used chrome's auditing feature try find performance bottlenecks in web site. found lot of reports of non-cacheable resources. i did dry run single-page containing stylesheet in library , found same thing: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" > <h:head> <h:outputstylesheet library="default" name="style.css"/> </h:head> <h:body> <div><h:outputtext value="test"/></div> </h:body> </html> here's audit log entry: the following resources explicitly non-cacheable. consider making them cacheable if possible: style.css.jsf the interesting thing is, if remove library, message goes away. so, looks there problem caching resources in libraries. is there way fix this? edit: according 1 of comments in answer, perhaps css not cached if normal refresh performed on page: set http h

angularjs - creating a global variable that is assigned within an ng-repeat -

i trying ng-click assign variable (success) inside ng-repeat , use value outside of ng-repeat(failure) follows: <div class="stocksnav col s1"> <div class="mystocklist" ng-repeat="stocksinportfolio in ctrl.myportfolio.stocksinportfolio"> <ul> <li style="position: relative"><a href ng-click="ctrl.tab = stocksinportfolio.stock._id">{{stocksinportfolio.stock.name | limitto:10}}</a></li> </ul> <div class="mystockview" ng-show="ctrl.tab === stocksinportfolio.stock._id"> <div class="{ active:ctrl.tab === stocksinportfolio.stock._id }"> </div> </div> </div> </div> <div ng-include="'/app/dashboard/partials/myindividualstock.html'"></div> the partial wants call ctrl.tab use it's click event assigned values, such if ng-click on other

How to loop ui and li in selenium in a go to select all the profiles displayed in the dropdown (dropdown will be dynamic)? -

i'm trying select profiles displayed in dropdown in ul , li ,here conflict facing every time select profile dropdown disappears again need click on dropdown button , select profile ,how select profiles in go ( how loop )? here html of above query <ul id="binduserinul" role="menu" class="dropdown-menu"> <li onclick="bindfrofilesmaster('tumblr','kishore3663','kishore3663')"> </li> <li onclick="bindfrofilesmaster('facebook','kishore nk','100002876995628')"> </li> <li onclick="bindfrofilesmaster('tumblr','kishor3663','kishor3663')"> </li> <li onclick="bindfrofilesmaster('twitter','kishunk25','2606831526')"> </li> <li onclick="bindfrofilesmaster('facebook_page','ask ? it','1565847693677378')"&

c++ - VS Community 2013: cannot open include file 'winres.h' -

i trying compile project, looks includes in wrong folder or other reason cant find winres.h . i tried adding path (c:\program files (x86)\windows kits\8.0\include\um) everywhere doesn't work. my vc++ include derictories path looks this: $(vcinstalldir)include;$(vcinstalldir)atlmfc\include;$(windowssdkdir)include;$(frameworksdkdir)\include;c:\program files (x86)\windows kits\8.0\include; my c/c++ additional include directories path looks this: ../../include;../../src/libpocketsphinx;../../../sphinxbase/include;../../../sphinxbase/include/win32;c:\program files (x86)\windows kits\8.0\include;%(additionalincludedirectories) the error is: pocketsphinx.rc(10): fatal error rc1015: cannot open include file 'winres.h'. how change include path? i post images illustrating not have enough reputation points. change includes of project, follow these steps: 1) open visual studio. 2) open projects. 3) open drop down menu right-clicking project in solution

bash - pipe command to mailx and do not send mail if no content -

i have system (rhel5) not support mailx 's -e option (for not sending email if body empty). there 1 liner use simulate feature? eg first send, second wouldn't echo 'hello there' | blah | mailx -s 'test email' me@you.com echo '' | blah | mailx -s 'test email' me@you.com well. "one-liner" sort of relative, since these technically one-liners may not suit you: stuff=$(echo 'hello there') ; [ -n "${stuff}" ] && echo ${stuff} | mailx -s 'test email' me@you.com stuff=$(echo '') ; [ -n "${stuff}" ] && echo ${stuff} | mailx -s 'test email' me@you.com

maven - Spring Boot with JSF2.2 : Error getting customize embedded tomcat -

my spring boot configuration jsf is: import java.util.collections; import javax.faces.webapp.facesservlet; import javax.servlet.dispatchertype; import javax.servlet.servletcontext; import org.primefaces.webapp.filter.fileuploadfilter; import org.springframework.beans.factory.config.customscopeconfigurer; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; import org.springframework.boot.builder.springapplicationbuilder; import org.springframework.boot.context.embedded.configurableembeddedservletcontainer; import org.springframework.boot.context.embedded.embeddedservletcontainercustomizer; import org.springframework.boot.context.embedded.filterregistrationbean; import org.springframework.boot.context.embedded.mimemappings; import org.springframework.boot.context.embedded.servletregistrationbean; import org.springframework.boot.context.web.springbootservletinitializer; import org.springframework.context.annotation.

c# - Apply a dynamically-built expression on non-generic DbSet -

i have following scenario: i have unknown @ compile time dbset, via type like: dbset entities = _repository.context.set(mytype) i have dynamically-built expression of given type, expression myfilter; //built expression of mytype , constructed @ runtime how can apply myfilter on entities , in order filter out entities based on myfilter ? below code might you: creates iqueryable of mytype represents select * yourmappedtable id = 1 of cource, instead of using expression have built demo purpose, use expression. class program { static void main(string[] args) { using (var x = new db01entities ()) { type mytype = typeof(angajati); var setmethod = typeof(db01entities).getmethods(system.reflection.bindingflags.instance | system.reflection.bindingflags.public).where (a => a.name == "set" && a.isgenericmethod).first ().getgenericmethoddefinition (); var myset = setmethod.makegenericme

Does Android SQLite cursor load all records into memory at once? -

does android sqlite cursor load data query memory, or there sort of optimization strategy that's part of implementation? a sqlitecursor fills "window" data navigate through it. recollection window size 1mb, can't point specific code backs recollection. so, small queries, net effect sqlitecursor hold entire result set in memory, once start accessing rows , columns.

python - Find factorial of each element in a list and multiply them -

i have calculate factorial of each element in list, multiply them, , save result in integer variable. have factorial function, don't know how these manipulations list. how about? product = 1 item in some_list: product *= factorial(item)

java - Oracle database not getting updated using jsp.It's showing a blank page -

the problem when enter details in form , enter submit, shows blank .jsp page , database doesn't updated either.i have included odjbc.14 jar file in web-inf/lib folder , using oracle 10g. ide-eclipse. what's wrong in code?? this page connect database(oracle): <body> <% string user = request.getparameter("login_id"); string pwd = request.getparameter("password"); string fname = request.getparameter("first_name"); string lname = request.getparameter("last_name"); string email = request.getparameter("email"); string sql="insert memebers(first_name,last_name,email,user_id,password,reg_date)values('"+fname+"','"+lname+"','"+email+"','"+user+"','"+pwd+"',curdate())"; try{ class.forname("oracle.jdbc.driver.oracledriver"); connection con = drivermanager.getconnection("jdbc:oracle:

xml - How do I filter by attribute and value across multiple elements? -

i'm trying find xml node checking it's type (type attribute). can following code: var xml:xml = describetype(this); var classname:string = getqualifiedclassname(maingroup); var xmllist:xmllist = xml.accessor.(@type==classname); if (xmllist.length()) { trace("found:" + xmllist[0]); } but not know if "accessor" element. "variable" element or possibly else. want search elements in xml have type attribute has value matches value i'm looking for. when use following says it's invalid: // 1084: syntax error: expecting doublecolon before semicolon. var xmllist:xmllist = xml..(@type==classname); what correct syntax information i'm looking for? here xml test with: <type name="myapplication" base="spark.components::windowedapplication" isdynamic="false" isfinal="false" isstatic="false"> <accessor name="explicitminwidth" access="readwrite" type=&q

remedy - What are the possible values for the duplicaterecords attribute in armx files -

i'm looking automate import remedy ars 8.1, , i'm 99.9999% there... need change import duplicate records, else seems working desired. in remedy armx files (mapping file dataimporttool), there <datahandling> node duplicaterecords attribute, the documentation can find on it mentions value gen_new_id , logically map "generate new id duplicate records" option in gui import tool. need value logically map "update old record new record's data" gui option (both of these options , other 3 possible options described on defining data import preferences page in bmc docs. other 1 page (importing in...), , several local versions of exact same paragraph in remedy documentation have, google turns nothing. please tell me has information somewhere! by saving .armx files gui, have found following options , values duplicaterecords attribute in <datahandling> tag. title value in .armx file generate new

osx - Unable to load item prototype in NSCollectionView -

when executing self.colsoundeffects.itemprototype = self.storyboard!.instantiatecontrollerwithidentifier("soundeffect_item") as? nscollectionviewitem in swift application, receive following error messages, , view not load: 2015-07-16 15:01:21.790 soundboardfx[48244:19680526] -[nsibobjectdata initwithcoder:]: corrupt , unarchivable nib file 2015-07-16 15:01:21.791 soundboardfx[48244:19680526] *** assertion failure in -[nsstoryboard instantiatecontrollerwithidentifier:], /sourcecache/appkit/appkit-1348.17/appkit.subproj/storyboarding/nsstoryboard.m:208 2015-07-16 15:01:21.791 soundboardfx[48244:19680526] failed set (contentviewcontroller) user defined inspected property on (nswindow): not load scene view controller identifier 'soundeffect_item' i've double-checked of identifiers, , far can tell, in working order. when remove line, view loads without problem (sans item prototype, of course). why happening, , how can fix it? i'm running os x 10.10.4,

Run CMD Command through PowerShell -

i trying run command in cmd, run in through powershell. invoke-item opens cmd, don't how pass in program.exe argument > file.txt to run cmd.exe powershell, don't need use invoke-item e.g.: cmd /c c:\windows\system32\ipconfig > file.txt however, why not run? ipconfig > file.txt

java - Maven command/plugin to change package structure of generater jar -

package structure of generated jar com/ipc/session/... i need jar in car/com/ipc/session/... format. is there maven command or plugin achieve this? my 0.02$ becoz not sure usecase, having 2 jars means, creating 2 kinds of dep jars used 2 systems/softwares. ideally bad have different packaging , going against our design mechanism , reusability being lost. also, according maven ( https://maven.apache.org/guides/mini/guide-using-one-source-directory.html ), asking not supported. hope helps. -praveen

python - How can I determine if two values are adjacent in a string? -

(in python 3) def melting_temperature(dna_sequence, formula): if formula == 'c': return melting_temperature_count(dna_sequence) else: modern = melting_temperature_count(dna_sequence) in len(range(dna_sequence)): if dna_sequence[i] == 'a' , dna_sequence[i+1] == 't': modern += modern * 0.01 return modern my if statements calculates melting temperature of dna_sequence. in else statement re runs melting_temperature_count (previously defined function) , uses calculated number , adds 1% if 'a' , 't' adjacent in dna_sequence. don't know how compare indices came returning error builtins.typeerror: 'str' object cannot interpreted integer can please tell me how can see if 2 things adjacent? hope explained enough. you can convert string list , iterate through list comparing adjacent values, like temp = "string" lis = list(temp) in range(0, len(lis)-1): if lis[i] == 'n

ios - Separate launch images for iPad? -

i'm working on update bring iphone app ipad. (to make universal app) have following launch images: default.png - 320 x 480 px default@2x.png - 640 x 960 px default-568h@2x.png - 640 x 1136 px default-667h@2x.png - 750 x 1334 px default-736h@3x.png - 1242 x 2208 px do need add separate launch images ipad? app should support devices ios 8 , portrait mode only. yes, need add separate launch images ipad. support portrait mode need add 2 images: 1. default~ipad.png 1024x768 px 2. default@2x~ipad.png 2048x1536 px also can use alternative way launch images: launchscreen.xib (xcode -> file -> new -> file... -> user interface -> launchscreen). it's suitable way when launch screen can built in interface builder. allow avoid storing multiple launch images in project, makes app thinner.

vb.net - Weird behavior of powercfg.exe when I execute it programatically -

to programtically set display brightness had 2 options : use powerwriteacvalueindex , powerwritedcvalueindex api use powercfg.exe now, tried both, , both gave me same (weird) result. here's code i'm using : psiinfo .filename = "powercfg" .useshellexecute = true .windowstyle = processwindowstyle.hidden .arguments = "-setacvalueindex " & guidcurscheme.tostring() & " " & subgroup_guid.guid_video_subgroup & " " & setting_guid.guid_dispbrightness & " " & psvalue.valueac end pproc = process.start(psiinfo) where : public const guid_video_subgroup string = "7516b95f-f776-4464-8c53-06167f40cc99" public const guid_dispbrightness string = "aded5e82-b909-4619-9949-f5d71dac0bcb" public structure powersetting public valueac string public valu

Java Regex: make it find longest match? -

i having regex (for illustratory purposes only): (?<number>[0-9]+)|(?<date>[0-9]+\-[0-9]+\-[0-9]+) applied 2009-11-10 matcher::lookingat yields 2009 . can pass flag in api or in regular expression tell engine consider longest matching match? i know in particular case reorder 2 statements, programmatically assembling regular expression several regular expressions , love have order not play matches , not. i using java 8. the (general) way re-order groups. in case, know longest match second group needs put first. because regex parsed left right find match. alternatively, case, can wrap regex boundary matches marking beginning , end of line: ^(([0-9]+)|([0-9]+\-[0-9]+\-[0-9]+))$ this find longest match if input matches whole line.

internet explorer - How can I get ride of a flicker in my skrollr animation in firefox and IE? -

i have 1 page animation using skrollr. animation looks fine in safari , chrome flickers in ie , ff. in firefox when scrolling , down through animation flickering goes away , animation smooth, ie flickers no matter what. animation has transform: translate3d(0px, 0px, 0px); , backface-visibility: hidden; force hardware acceleration , images preloaded. here link animation: http://total-equipment.com/products/coiled-tubing-unit/ , code structure: html <div class="container" id="arena"> <div id="animate" data-anchor-target="#arena" > <img class="lazy" data-anchor-target="#arena" src="img/animations/ctu_hq_animation_mb_4.0001.png" alt="" data-0-top="display:none;" data--100-top="display:block;" data--125-top="display:none;"> <img class="lazy" data-anchor-target="#arena" src

css - Merge cells in HTML -

Image
i'm trying table in html, , have problem. don't know how i'm going explain: is there possibility convert cell below/adjoined 1 has long vertical text small square format without taking same long vertical text format cell right above it? here's html document: <!doctype html> <html> <head> <meta charset="utf-8"> <title>marge cells</title> <link rel="stylesheet" type="text/css" href="dudas.css"> </head> <body> <table border="1px"> <tr> <td> </td> <td class="rotate-90"> corto </td> <td class="rotate-90"> text&nbsp;muuuuy&nbsp;largo </td> </tr> <tr> <td> cuentas </td> <td> 11.2€ </td> <td> 1€ </td> </t