Posts

Showing posts from April, 2010

Counting the frequencies of bases using for loop and substr in perl -

Counting the frequencies of bases using for loop and substr in perl - i'm trying count number of bases using loop , substr function counts off , i'm not sure why! please help! have utilize these functions in assignment. going wrong? here code: use strict; utilize warnings; $user_input = "accgtutf5"; #initalizing lengths $a_base_total = 0; $c_base_total = 0; $g_base_total = 0; $t_base_total = 0; $other_total = 0; ( $position = 0; $position < length $user_input; $position++ ) { $nucleotide = substr( $user_input, $position, 1 ); if ( $nucleotide eq "a" ) { $a_base_total++; } elsif ( $nucleotide eq "c" ) { $c_base_total++; } elsif ( $nucleotide eq "g" ) { $g_base_total++; } elsif ( $nucleotide eq "t" ) { $t_base_total++; } else { $other_total++; } $position++; } print "a = $a_base_total\n"; print "c = $c_base_total\n"; print...

performance - Avoiding Landing Page Redirects with SSL -

performance - Avoiding Landing Page Redirects with SSL - i did google pagespeed analysis of website , received next message: avoid landing page redirects your page has 2 redirects. redirects introduce additional delays before page can loaded. avoid landing page redirects next chain of redirected urls. http://example.net/ https://example.net/ https://www.example.net/ is there can (like modifying htaccess file in way), or unavoidable consequence? here htaccess in case: rewritecond %{https} off # first rewrite https: # don't set www. here. if there included, if not # subsequent rule grab it. rewriterule ^(.*)$ https://%{http_host}%{request_uri} [l,r=301] # now, rewrite request wrong domain utilize www. rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.%{http_host}%{request_uri} [l,r=301] you can combine 2 redirects 1 using or flag rewritecond %{https} off [or] rewritecond %{http_host} !^www\. [nc] rewri...

php - How to clear cache or make the images run the code again in html? -

php - How to clear cache or make the images run the code again in html? - i running code <img src="../graphics/g_builder.php?type=funil&interval=1"/> <img src="../graphics/g_builder.php?type=funil&interval=3"/> <img src="../graphics/g_builder.php?type=conversao&interval=2"/> <img src="../graphics/g_builder.php?type=conversao&interval=3"/> <img src="../graphics/g_builder.php?type=nps&interval=2"/> that generates image in folder rest of code utilize later, works 1 time or pressing ctrl +f5 clears cache if im not wrong... so need way renew images everytime phone call php or somehow clear cache without using headers... can do? you append timestamp property end of src attribute. example: <img src="../graphics/g_builder.php?type=nps&amp;interval=2&amp;time=<?php print time(); ?>"/> this way, every time refresh page, src attribute differ...

c++ - JSON parsing with Qt -

c++ - JSON parsing with Qt - hei , have text in json : ( without returns in 1 line) [ { "error":false, "username":"benutzer", "format":"human", "latitude_min":84, "latitude_max":36, "longitude_min":5, "longitude_max":20, "records":203 }, [ { "mmsi":233434540, "time":"2014-10-09 06:19:06 gmt", "longitude":8.86037, "latitude":54.12666, "cog":347, "sog":0, "heading":236, "navstat":0, "imo":0, "name":"helgoland", "callsign":"dk6068", ...

html - WordPress float in article -

html - WordPress float in article - i made website wordpress , have problem float in article. http://img4.hostingpics.net/thumbs/mini_756574capturedcran20141013181858.png has can see, when sidebar finish, content go left , don't want that. want content in right. want content below other. my code: html (all article on tag: <div id="container"> <aside id="sidebar" role="complementary"> code of sidebar here... </aside> <article id="post-53" class="post-53 post type-post status-publish format-standard hentry category-non-classe">code of article here...</aticle> </div> css: #container { width:100%; margin:0 auto; max-width:1000px; margin-top:-3%; } aside{ width:30%; text-align:left; max-width:280px; padding:2%; float:left; background-color: #fff; -webkit-box-shadow: 1px 1px 0 0 rgba(0,0,0,0.1); box-shadow: 1px 1px 0 0 rgba(0,0,0,0...

Facebook permissions for an app which should tag/mention/post to user feed without friendship -

Facebook permissions for an app which should tag/mention/post to user feed without friendship - we event company offers scheme improving social media performance companies on events. f.e. user registers via net event (f.e. concert, sponsored big brand company). during registration process, user has grant permission our facebook app (so can tag/mention or post on feed name, or has our page), otherwise not allowed visit concert. we want following: after registration finished, post on user wall or mention user in post our app: f.e. "max mustermann: hey, visited concert #brandname" (as post on user feed user himself) or: "max mustermann visited concert of #brandname" (as story or mention) we offer scheme create pictures , pictures associated users (they can select user on photo). after user selects him on photo, photo should shared on facebook, either user himself or tagged our app). is there best practices to these things? implemented workflow alr...

regex - Regular Expression to find whitespaces and replace with a dash -

regex - Regular Expression to find whitespaces and replace with a dash - i thought might work: ^['\s+', '-', "this should connected"\w\s]{1,}$ but wrong it. no of regex place dashes between words while @ same time not placing dashes in front end of first word or behind lastly word? i need maintain in mind don't want dash before first word or after lastly word. and, have 1 word no dashes required. the syntax utilize rather strange. why utilize ^ , $ anyway? one can utilize next regex: s/\s+/-/g s means substitute occurence. g means global: matches should replaced. using tool sed or perl . example sed : sed -r 's/\s+/-/' < file regex

How to optimize this Node.js + q code to prevent callback hell? -

How to optimize this Node.js + q code to prevent callback hell? - i using q prevent callback hell have reached part of code don't know how arrange: i searching scheduled messages delivered. each of them, seek send them 1 1 , if sent, removes database. ugly part have then() within loop. way end having nested promises instead of nested callbacks!!!! suggestions? applog.debug("looking scheduled messages"); var messages = messageservice.findscheduled() .then(function(messages){ applog.debug("found [%d] stored messages",messages.length); for(var = 0; i<messages.length; i++){ messageservice.send(msg.namespace, msg.message, msg.data) .then(function(result) { if (result == constants.event_emit_sent) { applog.debug("message [%s] sent!!!", msg._id); messageservice.remove(msg._id) .then(function(result) { applog.debug("message delet...

c# Xamarin android select from mssql server? -

c# Xamarin android select from mssql server? - c# xamarin studio is possible select , display info mssql database on android phone ? do use: using system.data.sqlclient; and connection string same in c# visual studio: con = new sqlconnection(@"data source=ip,port\\sqlexpress;database=database_name;persist security info=false; uid='user' ; pwd='password"); con.open(); this horrible, horrible idea. not this. exposing database on insecure connection asking trouble. if need access info mobile client (or remote client) should create webservice deed middleman between remote client , precious data. http://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/ android sql-server xamarin connect

python - How to run Catalyst/Paraview code examples? -

python - How to run Catalyst/Paraview code examples? - hi i'm trying figure out catalist , paraview while. tried run these examples on paraview without success. https://github.com/kitware/paraviewcatalystexamplecode imagined @ to the lowest degree python code run python shell. doesn't seem work either. viewed kitware tutorials , others online. still no progress. help appreciated. you should able run of non-python examples ctest (i.e. ctest executable). suggest running ctest -v flag verbose output. show command line used run examples. pythonfullexample, can run pvpython. note many of executables take in paraview catalyst python script command line argument. python catalyst hpc paraview

MVC vs N-tier architecture - Singletons vs Objects (Django/Python) -

MVC vs N-tier architecture - Singletons vs Objects (Django/Python) - i have class in django responsible speaking service via http. in application beingness used singleton. however, each method requires same 2-3 pieces of info (from user's session) run. in addition, each method has create several calls other methods in class, meaning info gets passed arguments frequently class mysingletonclass(): def get_user_group(self, email, token): # request service def get_user_picture(self, email, token, pic_id): # request service def get_user_item(self, email, token, item_id): # request service there 14 methods in , contacted through simple api layer in django. rather passing email , token every time, pass session itself. have either set scoped vars or type lot more characters def get_user_group(self, session): email = session.get("email") token = session.get("token") this seems repetitive. solutio...

php - Yii add text before the value in EColumnsDialog -

php - Yii add text before the value in EColumnsDialog - i have more or less code in "view": 'columns' => array( array( 'header' => 'id', 'name' => 'id', 'value'=>'$data->id', ), i need add together every text id displays august or 1,2,3,4,5 intended "text" ie no display output in august this: | id | some_table | some_table | | text_1 | samplesample | samplesample | | text_2 | samplesample | samplesample | | text_3 | samplesample | samplesample | | text_4 | samplesample | samplesample | | text_5 | samplesample | samplesample | try this: 'columns' => array( array( 'header' => 'id', 'name' => 'id', 'value'=>function($data){ homecoming "txt".$data->id'; } ), it...

html - Slide pages in ionic (images from json request) -

html - Slide pages in ionic (images from json request) - i have json consists of image,title , description.(json of news) want create view shows image,title , description in page. should able slide page view next news item. i'm using angularjs , ionic framework this. the way tried shows images in same page mycode <ion-view title="news" ng-controller="newsctrl"> <ion-content class="has-header" scroll="true" padding="true"> <ion-list> <ion-item ng-repeat="newss in news"> <ion-slide> <img ng-src= http://@@@@@@@@/{{newss.image}}> <b><h4 class="list-group-item-heading">{{newss.title}}</h4></b><br> <h5 class="list-group-item-text">{{newss.description}}</h5> </ion-slide> ...

multithreading - How to see a file download progress without the GUI freezing (python 3.4, pyQt5) using QThread -

multithreading - How to see a file download progress without the GUI freezing (python 3.4, pyQt5) using QThread - so i'm trying create simple file downloader in python 3.4.2 , pyqt5 qthreads seems way there's no tutorials online or examples understand pyqt5. find qt5 reference c/c++ , bunch of pyqt4 tutorials don't work pyqt5 , python 3 here's gui screenshot: http://i.imgur.com/kgjqrrk.png and here's code: #!usr/bin/env python3 pyqt5.qtcore import * pyqt5.qtwidgets import * string import template import urllib.request import sys class form(qwidget): def __init__(self, parent=none): super(form, self).__init__(parent) lblurl= qlabel("file url:") self.txturl = qlineedit() self.bttdl = qpushbutton("&download") self.pbar = qprogressbar() self.pbar.setminimum(0) buttonlayout1 = qvboxlayout() buttonlayout1.addwidget(lblurl) buttonlayout1.addwidget(self.t...

java - I failed at trying to make a random song player -

java - I failed at trying to make a random song player - i tried create scheme click button, , plays random midi file out of 5 possible. plays first song please help. integer i getting randomly selected, url not alter sus2 reason not know, sound staying same. import java.net.url; import java.awt.event.*; import javax.swing.imageicon; import javax.swing.japplet; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jpanel; public class alternative extends jframe implements actionlistener{ /** * */ private static final long serialversionuid = 1l; url image= this.getclass().getresource("/tick.png"); url url = this.getclass().getresource("/sus.mid"); imageicon img = new imageicon(image); jbutton testbut = new jbutton(img); jpanel pnl = new jpanel(); java.applet.audioclip sound = japplet.newaudioclip(url); public option(){ super("swing window"); pnl.add(testbut); add(pnl); setsize( 500,350); setd...

SQL Column Names from a Excel Sheet -

SQL Column Names from a Excel Sheet - im using ssms 2014 , sql server 2014. need alter column names @ end of query result using excel file or table data. after select statements , stuff table info example +---------+---------+------+ | col1 | col2 | col3 | +---------+---------+------+ | value 1 | value 2 | 123 | | value 2 | value 2 | 456 | | value 3 | value 3 | 789 | +---------+---------+------+ and table or excelfile +----+---------+-----------+-----------+ | id | colname | language | add-on | +----+---------+-----------+-----------+ | 1 | col1 | d | 123 | | 2 | col2 | d | 456 | | 3 | col3 | d | 789 | | 4 | col1 | e | 123 | | 5 | col2 | e | 456 | | 6 | col3 | e | 789 | +----+---------+-----------+-----------+ what seek add-on value of each column , add together column name. should add together values specific language. @setlang = 'd'...

recursion - Determinig all leafs nodes in a tree -

recursion - Determinig all leafs nodes in a tree - can guys help me method? had homecoming before didnt work either private string leafnodes(treenode root, string leafs){ if (root.isleaf()) { leafs += integer.tostring(root.getdata()); } else { if(root.getleft() != null) { leafs += leafnodes(root.getleft(), leafs); } if (root.getright() != null) { leafs += leafnodes(root.getright(), leafs); } homecoming leafs; } homecoming leafs; } the problem pass leafs children , add together result current string same leaf can appear several times in returned string. can prepare way: private string leafnodes(treenode root){ string leaves = ""; if (root.isleaf()) { leaves = integer.tostring(root.getdata()); } else { if(root.getleft() != null) { leaves += leafnodes(root.getleft()); } if (root.getright() != n...

git - How do I add a repository to another repository? -

git - How do I add a repository to another repository? - yesterday created github repository , today found out advisor created github repository. best way add together repository repository without massively screwing things up? have massively screwed things in past want create sure. may have screwed things trying follow instructions on stackoverflow post. right seems have 2 branches, , typing "git checkout master" gives me files, while typing "git checkout tmp_branch" gives me files. i'd add together files repository , utilize 1 on, , maybe delete repository. so far i've tried is me@server:~/rootdir$ git remote add together origin https://github.com/him/his_repo.git fatal: remote origin exists. me@server:~/rootdir$ git remote add together his_repo https://github.com/him/his_repo.git me@server:~/rootdir$ git force -u his_repo master username 'https://github.com': me@gmail.com password 'https://me@gmail.com@github.com': h...

Can you disable JavaScript inputs in the omnibar in chrome? -

Can you disable JavaScript inputs in the omnibar in chrome? - i looking way stop users running javascript code in omnibox of chrome. for illustration in omnibox (address bar) loaded page, stop them entering text: javascript:alert('hello world') any suggestions? google-chrome google-chrome-extension

hex - php decode or parsing each nibble of hexadecimal -

hex - php decode or parsing each nibble of hexadecimal - how can decode hex value in php? i have hex value encodes data. for ex: hex value = 0x 1121 0031 here, each nibble of hex value tells me first nibble 1 means product_1 , 2 product_2. , sec nibble 1 means new product, 2 means old product. how can parse each nibble? you can extract each nibble straight string , compare this: $data = '0x 1121 0031'; $data = substr($data, 2); //remove 0x prefix string $data = str_replace(' ', '', $data); //remove spaces string //$data '11210031' echo 'the product number ' . $data[0] . "\n"; if ($data[1] == 1) { echo "this new product\n"; } else if ($data[1] == 2) { echo "this used product\n"; } you can interpret string number , extract bits: $data = '0x 1121 0031'; $data = substr($data, 2); //remove 0x prefix string $data = str_replace(' ', '', $data); //remove spaces st...

ios - Worklight Cordova Application SplashScreen Rotates During Application Launch -

ios - Worklight Cordova Application SplashScreen Rotates During Application Launch - my application supports portrait mode in pages , landscape mode in others, in case of ios version of application have portrait, landscape left , landscape right turned on restricted in view controllers. have noticed during startup of application when splash screen displayed allows rotation. wondering if way around include additional assets landscape version of splash screen image. using worklight 6.2 , cordova 3.4.1 i did not notice application rotating while splash screen displayed, ... anyway, can solve in 2 ways: as wrote - provide "proper" splash images, think still odd looking. or create custom splash screen behavior; implement objective-c code disallow rotation during initialization stage of application. for this, can read next documents: common ui controls training module, starting slide #29 managing splash screen user documentation topic ios cordova wor...

javascript - How can I generate random numbers for demo charts that roughly trend up and to the right? -

javascript - How can I generate random numbers for demo charts that roughly trend up and to the right? - i need generate random numbers several charts go , right. i'm using javascript charting engine require numbers in json, can handle conversion if have easy way outside of javascript. here's simple randomnumber generator in javascript: function randomnumber(minimum, maximum){ homecoming math.round( math.random() * (maximum - minimum) + minimum); } console.log(randomnumber(0,100)); the above work if min , max grew on time. can point me in right direction? here's jsfiddle seek out various solutions, including handy chart: http://jsfiddle.net/9ox4wjrf/ here's rough illustration of sorts of charts need build generated data: something may work: var = 0.05; var b = 10; //play these values liking var y; //loop here 0 whatever y = * x^2 + b * x * math.random(); //or using randommumber function: y = * x^2 + randommumber(- b * x / 2, b * ...

Searching git commits for a particular change -

Searching git commits for a particular change - i'm working on 1 particular branch in git repo , notice piece of code thought changed. perhaps alter on branch hasn't been merged master or current branch on working. how search whole repository, including branches, particular alter 1 source code file? you can seek , utilize pickaxe ( -s ) or regexp ( -g ) options of git log . git log --all -schange -- path/to/change (replace alter keyword know representing particular change) see "how grep (search) committed code in git history?" as mentioned: this looks differences introduce or remove instance of <string> . means "revisions added or removed line ' change '". add --all in order search in branches. to branch(es) commits part on, can use: git branch --contains sha1 (as mentioned in "how list branches contain given commit?") git

cordova - Linking Visual Studio Multi-device Hybrid App support with BB10 WebWorks -

cordova - Linking Visual Studio Multi-device Hybrid App support with BB10 WebWorks - since cordova supports building applications blackberry10. thought combine bb10 webworks sdk visual studio cordova back upwards gain additional platform when writing hybrid applications. so far have managed coerce visual studio building blackberry 10 application target (a fair amount of fiddling vs javascript files) don't know how install/launch on device or matter within emulator. looking info how cordova , device hooks managed or part of framework managed within visual studio vs plugin... you can't visual studio , have drop downwards command line , utilize blackberry tools send app device. asked visual studio developer @ microsoft ignite conference you. cordova visual-studio-2013 blackberry-10 blackberry-webworks multi-device-hybrid-apps

python - Comparing two text files to remove duplication of the longer one -

python - Comparing two text files to remove duplication of the longer one - i have 2 files 1 contains list of info delimited tab , sec 1 includes list of items' id 1 field. compare each first field in larger file (file1) lines/item id in smallest file(file2),then if compared id not exist in sec file want write info related compared item in first file(which line content separated tab). tried below code have problem loops. first loop doesn't increment while sec loops sec file lines. also, want item number written 1 time problem in if statement. for lines in alldata: lines1 in olddata: old_data=lines1.split('\r\n') dataid=old_data[0] data=lines.split('\t') photoid=data[0] if photoid==dataid: break else: #continue #print('matching',lines) #break w=open(head+'......................../1.txt','a') w.write(lines) this sample of files structure: 15463774518 2014-...

c++ - Creating correct D3D11 library file for GCC -

c++ - Creating correct D3D11 library file for GCC - what right way convert files d3d11.lib provided in directx sdk *.a gcc library format? i've tried mutual reimp method converting *.lib files *.a files, doesn't seem work. step 1 involves creating definitions file: bin\reimp -d d3d11.lib let's want utilize d3d11createdevice function should provided in library. if open created definitions file seems ok: library "d3d11.dll" exports (...) d3d11createdevice d3d11createdeviceandswapchain (...) next seek create *.a file using definitions file , original lib file: bin\dlltool -v -d d3d11.def -l libd3d11.a this in fact produce valid library (and no error messages when dlltool set verbose), if seek utilize function d3d11createdevice should implemented in it, error: undefined reference `d3d11createdevice' if inquire nm symbol nowadays in library (and filter using grep), this: d:\tools\lib2a>bin\nm libd3d11.a | grep d3d11creat...

excel - Add a hyperlink to an image in a cell that references another worksheet in the document using EPPlus -

excel - Add a hyperlink to an image in a cell that references another worksheet in the document using EPPlus - need little help on epplus , i've insert image , image hyperlink different sheet ( table of content ). addimage function accepts uri object hyperlink property not take cell value. here's code private static void addimage(excelworksheet ws, int columnindex, int rowindex, string filepath,int offset,string optionalhyperlinkurl = "") { bitmap image = new bitmap(filepath); excelpicture image = null; if (image != null) { if (optionalhyperlinkurl != ""){ // it's crashing here because can't pass in [xxxxx.xlsx]'toc!a1' hyperlink since it's not valid url image = ws.drawings.addpicture("pic00", image, new uri(optionalhyperlinkurl)); } else { image = ws.drawings.addpicture("pic00", image); } picture.from....

javascript - Open Layers 3 Zoom map event handler -

javascript - Open Layers 3 Zoom map event handler - i need handle zoom event in open layers 3. the next code: map_object = new ol.map({ target: 'map', controls: controls_list, interactions: interactions_list, overlays: [overlay], layers: [osm_raster, wfs_layer], view: view }); map_object.on("zoom", function() { console.log('zooming...'); }); this code runs no errors , shows map, there no output console, suggesting function isn't firing. i have tried: map_object.on("drag", function() { console.log('dragging...'); }); and nothing. any help how handle map command events in ol3 much appreciated (particularly zooming!). note have tried 'zoom' 'zoom' type field of on method. try moveend event. (see http://openlayers.org/en/master/apidoc/ol.map.html , & don’t forget uncheck «stable only» in topbar see it). javascript openlayers openlayers-3

php - symfony write process output to file -

php - symfony write process output to file - how write output of asynchronous process file. have next code in phpunit bootstrap file: $command = 'exec php ' . $kernel->getrootdir() . '/console ' . 'xxx:servicebus:start-services --env=' . $kernel->getenvironment(); $servicebuscommand = new symfony\component\process\process($command); $servicebuscommand->start(); obviously code starts servicebus instance listens incoming requests server. 1 time tests ran, requests go servicebus , stuck there. need see output of start servicebus command see went wrong. any thought how write output of process log file? you need phone call $servicebuscommand->getincrementalerroroutput() , $servicebuscommand->getincrementaloutput() regularly. php symfony2 ubuntu phpunit

python - Paypal - We're sorry, we could not send an IPN - Django -

python - Paypal - We're sorry, we could not send an IPN - Django - i'm using paypal django. 2 months ago paypal ipn working fine, fails. , paypal ipn simulator gives me error: we're sorry, not send ipn. i'm using django apache wsgi. here have server configuration: <virtualhost *:80> serveradmin marcos@domain.com servername domain.com serveralias www.domain.com wsgiscriptalias / /var/www/domain/domain.wsgi alias /static/ /var/www/domain/static/ alias /media/ /var/www/domain/media/ <location "/static/"> options -indexes </location> documentroot /var/www <directory /> options followsymlinks allowoverride none </directory> <directory /var/www/> options indexes followsymlinks multiviews allowoverride none order allow,deny allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ ...

c++ - Is this visitor implementation correct? -

c++ - Is this visitor implementation correct? - i implementing visitor in order utilize boost variant library. want know if right specialize boost::static_visitor<> const reference type. note question here following: there problem specializing boost::static_visitor<> boost::static_visitor<const t&> ? template<typename t> struct my_visitor : public boost::static_visitor<const t&> { template<typename u> const t& operator()(u& u) const { // code here ..... homecoming x<u>::get_some_t(); // homecoming t. } }; there no problem long don't homecoming reference local/temporary. also, sure check validity of reference on time (it ends when variant object destructed, when variant destructed, or (!) when reinitialized). background , explanation a variant contains object of "current" element type, , can reference object fine. as long as variant not reinitialized element ...

php - Works on localhost but not on web server....session_start(): Cannot send session cache limiter - headers already sent -

php - Works on localhost but not on web server....session_start(): Cannot send session cache limiter - headers already sent - i newbie php , have tried , tried forum threads seek , prepare after week - sense no nearer. the localhost version works fine - no problem. however, when upload it, presents me next messsage: session_start(): cannot send session cache limiter - headers sent (output started @ /home/idigital123/public_html/index.php:2) in /home/idigital123/public_html/index.php on line 41 here code: <?php require_once('connections/idigitalconn.php'); ?> <?php if (!function_exists("getsqlvaluestring")) { function getsqlvaluestring($thevalue, $thetype, $thedefinedvalue = "", $thenotdefinedvalue = "") { if (php_version < 6) { $thevalue = get_magic_quotes_gpc() ? stripslashes($thevalue) : $thevalue; } $thevalue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($thevalue...

Wrong positioning of Google Maps infoWindow -

Wrong positioning of Google Maps infoWindow - i have website @ http://arquitectospelomundo.com displays several markers, combined markerclusterer function, display, when clicked, infowindow info. when clicking straight on map, info window appears on right spot; when clicking on sidebar (on 1 of pictures), info window goes out of bounds. working correctly , changed; trying figure out far no success. appreciate help pointing me in right direction. give thanks you. as seems issue related markerclusterer. when marker click has been triggered within cluster map-property of marker null , wrong position. possible solution: when marker within cluster utilize hidden marker(hidden via visible ) anchor infowindow: google.maps.event.addlistener(marker, 'click', function() { //create dummy-marker on first click if(!map.get('dummy')){ map.set('dummy',new google.maps.marker({map:map,visible:false})) } var latlng = marker.getposition();...

How should HTML for Java components reference resources? -

How should HTML for Java components reference resources? - resources html (style sheets, images etc.) might not loaded correctly when: a swing app. distributed, or when set jar file. the html generated @ run-time. how can such resources accessed reliably in html? html jar file links resources (e.g. css or images) relative references work fine. e.g. this illustration loads html (that has relative reference image) jar. import javax.swing.*; import java.net.url; class showhtml { public static void main(string[] args) { final string address = "jar:http://pscode.org/jh/hs/object.jar!/popup_contents.html"; swingutilities.invokelater(new runnable() { public void run() { seek { url url = new url(address); jeditorpane jep = new jeditorpane(url); jframe f = new jframe("show html in jar"); f.setdefaultcloseope...

android - Notification addAction creates button with no behavior -

android - Notification addAction creates button with no behavior - i trying add together button notification in android. utilize addaction method in order add together intent supposes open main activity (same clicking entire notification) bundle data. have done far: notificationmanager = (notificationmanager)this.getsystemservice(notification_service); //regular intent view main activity pendingintent contentintent = pendingintent.getactivity(this,constants.main_activity, new intent(this, mainactivity.class), 0); //intent viewing transaction dialog, within main activity using purchase_dialog request code bundle bundle = new bundle(); bundle.putparcelablearraylist(constants.list, (java.util.arraylist<? extends android.os.parcelable>) list); pendingintent purchaseintent = pendingintent.getactivity( this, constants.purchase_dialog, new intent(this, mainactivity.class), 0, bundle...

javascript - How to create Tree with checkboxes using JSON data with Parent Child Relation? -

javascript - How to create Tree with checkboxes using JSON data with Parent Child Relation? - i have json info , json info has parent kid relation . want create tree construction it. found many plugins , libraries can't found requirement . getting json info using php script. here image has tree construction want create . i'm stuck @ it.i know json not displayed in image want show tree should .how create tree in image.all want javascript code handle , create type of construction of tree . working illustration must & much appreciated. you can utilize json format , tree should collapsible.also provide required json format it. and json info follows : { "2": { "5": "wrist watch" }, "5": { "9": "men's" }, "18": { "3": "clothing" }, "28": ...

matlab - Take an array and transform its values to have a new minimum and maximum -

matlab - Take an array and transform its values to have a new minimum and maximum - i have array of info in column length 354717 . values vary between 12.8 (min.) , 64.2 (max.). i want create array of same size values of min.= 2.7 , max.= 27 . any suggestions? you can first normalize info dynamic range falls between [0,1] . 1 time this, can multiply values 27 - 2.7 = 24.3 , offset 2.7 values between [2.7, 27] . in other words, if array called a , this: norma = (a - min(a)) / (max(a) - min(a)); %// normalize [0,1]. out = 24.3*norma + 2.7; %// alter [2.7, 27] in general, if want info within range, first normalize info in first line of code, this: out = (maxd - mind)*norma + mind; remember, norma normalized info falls between [0,1] . mind , maxd minimum , maximum values of desired range want. case, mind = 2.7 , maxd = 27 . good luck! arrays matlab interpolation

android - versionCode is always overwritten to -1 -

android - versionCode is always overwritten to -1 - i created new project in android studio , 1 of first things did move versioncode versionname attributes build.gradle manifest file convenience. weird warning saying: this versioncode value (1) not used; written value specified in gradle build script (-1) it started appearing in older projects too, it's not project specific problem. may happened when updated 0.8.14 , updated build tools, have no ide what. ideas on how prepare this? according official doc, gradle overrides values in androidmanifest. the default value in dsl object versioncode -1. then when gradle builds apk, overrides value in manifest , assign versioncode=-1 android android-studio gradle android-gradle build.gradle

mysql - Combining two SQL queries with multiple tables and left joins -

mysql - Combining two SQL queries with multiple tables and left joins - is there way can combine these 2 queries: first query select top 100 work.pzinskey, work.pyid, party.macid, party.otherpartyid, party.customeremail, account.accountnumber, account.accountname, account.advisercode, account.advisername, account.dealercode, account.dealername, account.primaryaccount, account.productcategory, account.productcode, account.productdescription, account.registeredstate, document.udocid worktable work, partytable party, accounttable account, documenttable document, notestable notes work.pzinskey = party.pxinsindexedkey , work.pzinskey = account.pxinsindexedkey , work.pyid = document.caseid and sec query select top 100 businessareatbl.businessarea, processtbl.process, subprocesstbl.subprocess worktable work left outer bring together (select distinct product_id businessarea_id, product businessarea casetypestable) businessareatbl on work.requestbusinessarea#1 = businessarea...

Check if current user is logged in using any django social auth provider -

Check if current user is logged in using any django social auth provider - i check if user logged in via social authentication or using django default authentication. something if user.social_auth = true? ok after doing research came solution create sure if user authenticated using social provider or default django auth. check here moreinfo.. {% if user.is_authenticated , not backends.associated %} #do or show if user not authenticated social provider default auth {% elif user.is_authenticated , backends.associated %} #do or show if user authenticated social provider {% else %} #do or show if none of both {% endif %} django django-socialauth python-social-auth

php - SQL ORDER BY FIELD() use array -

php - SQL ORDER BY FIELD() use array - hello im wondering if there way me pass array order field() function, have like <?php $array = (5, 8, 7, 10); $query = "select * table order field(id,".$array.")"; ?> is possible? how accomplish this? you can utilize implode create comma separated list: <?php $array = array(5, 8, 7, 10); $query = "select * table order field(id,".implode( $array, ',' ).")"; echo( $query ); ?> outputs: select * table order field(id,5,8,7,10) php sql

c# - Entityframework.extensions error "Sequence contains more than one element" on batch delete -

c# - Entityframework.extensions error "Sequence contains more than one element" on batch delete - i using entityframework.extended library in project, contains code first entity model. receiving error message "sequence contains more 1 element" when execute linq statement , perform batch delete library: var subjlocal = (from subjectlocal in customercontext.rostersummarydata_subject_local ((subjectlocal.fkrostersetid == 0) && (statsinfo.testinstanceidslist.contains(subjectlocal.fktestinstanceid)) && (subjectlocal.fktesttypeid == statsinfo.testtypeid) && (statsinfo.schoolyearidslist.contains(subjectlocal.fkschoolyearid)) && (subjectlocal.fkrostertypeid == 1) && (subjectlocal.fkschoolid == 0) && (subje...

html - Background color of parent tr of table not working if its child cells(td) are invisible, for chrome browser -

html - Background color of parent tr of table not working if its child cells(td) are invisible, for chrome browser - i have case in jsfiddle: http://jsfiddle.net/n5s53v32/6/ html: <table> <tr> <td>td 1</td> <td>td 2</td> <td class="last">td 3</td> </tr> <tr class="bg"> <td>td 1</td> <td class="hide">td 2</td> <td class="last">td 3</td> </tr> <tr> <td>td 1</td> <td>td 2</td> <td class="last">td 3</td> </tr> </table> css: .bg{background: red; } .hide{visibility:hidden; } if kid cells(td) of tr set invisible background color of parent tr on invisible portion not work in chrome browser, working in firefox. edit: js fiddle updated http://jsfiddle.net/n5s53v32/11/ demo - http://jsfiddle.net/n5s53v32/7/ use opacity .hide { opacity:0; } ...

c++ - Way around "first defined here" error? -

c++ - Way around "first defined here" error? - i need have 2 alternate classes same name, can switch between each other changing class included in main. for example; mode_1.h class draw{ private: // private stuff public: void render(int x, char y); }; mode_2.h class draw{ private: // private stuff public: void render(int x, char y); }; main.cpp #include "mode_1.h" int main(){ draw d; int x = 2; char y = 'x'; d.render(x, y); } currently i'm having comment out .h , .cpp files i'm not using avoid "first defined here" error. want have switch between them change #include "mode_1.h" to #include "mode_2.h" you should set them in different namespaces: namespace mode2 { class draw{ private: // private stuff public: draw(int x, char y); }; } in main can select namespace want use: #inc...

javascript - Turn off Touchswipe on Div -

javascript - Turn off Touchswipe on Div - building site each swipe makes site transition between full-screen-sized divs. actual framework built have each full-sized divs take total viewport no overflow. nature of framework. however, have interior div has overflow content can scrolled. however, when site detects touchswipe or down, transitions next screen, versus letting scroll on overflow div. is there way turn off touchswipe on div , allow normal scrolling action? can provide code illustration if needed assuming you're using ramp interactive's touchswipe, looks can add together event handler scrolling div stop propagation of swipe event: $(function() { $("#yourdiv").swipe( { swipestatus:function(event, phase, direction, distance, fingercount) { homecoming false; } }); }); edit: actually, looks like can add together .noswipe class div instead. javascript jquery swipe

php - Codeignitor login doesn not work in IE but work only mozila -

php - Codeignitor login doesn not work in IE but work only mozila - i having login problem in codeignitor. not work in ie. send ajax request in php controller. work in mozila not work in ie , other browser.i debug more time. result got when seek login instant sesison destroy in ie grab sesison mozila. here javascript code: function check_login () { var flag=true; var user_name=$('body').find('#user_name').val(); var user_password=$('body').find('#user_password').val(); if(user_name==''){ $('#username_login_msg').html('email required.'); flag=false; }else{ $('#username_login_msg').html(''); } if(user_password==''){ $('#password_login_msg').html('password required.'); flag=false; }else{ $('#password_login_msg').html(''); } if(flag==true){ //alert(user_name); /*$.post("http://luxhometour.co...

git - How to resolve jbossews on openshift: Failed to execute: 'control restart'? -

git - How to resolve jbossews on openshift: Failed to execute: 'control restart'? - when force app @ openshift upload , final messages are remote: starting jbossews cartridge remote: jbossews process failed start remote: git post-receive result: failure remote: activation status: failure remote: activation failed next gears: remote: 5433a24de0b8cd0dfa----- (error activating gear: client_error: failed execute: 'control start' /var/lib/openshift/5433a24de0b8cd0dfa0000ec/jbossews) remote: deployment completed status: failure remote: postreceive failed also when manually restart application openshift website, showing me "unable finish requested operation" "starting jbossews cartridge jbossews process failed start jbossews cartridge stopped failed execute: 'control restart' /var/lib/openshift/5433a24de0b8cd0dfa-----/jbossews" how troubleshoot error message? the key error message " postreceive failed ": need ...

javascript - Why can't I draw Image? (fabric.js) -

javascript - Why can't I draw Image? (fabric.js) - i'm next fabric.js tutorials can't draw image. can draw rectangle, can't draw image. why code doesn't work??? script here: var canvas = new fabric.canvas('c'); fabric.image.fromurl('pug.jpg', function(img) { img.filters.push(new fabric.image.filters.grayscale()); img.applyfilters(canvas.renderall.bind(canvas)); canvas.add(img); }); javascript html fabricjs

c# - What to do if App crashes or is closed while writing a file? -

c# - What to do if App crashes or is closed while writing a file? - so i've found it's possible app crash or closed while in process of writing file. if happens (especially if it's big file) tends overwrite file existed before , leave new file 0 bytes in it. so, do in case? should writing files temporary files first, using rename phone call overwrite old file? should including waiting function in unhandledexception event? unhandledexception event not help you.. no code can 100% guaranteed run. not unhandledexception event.. first approach have on mind mutual one.. i.e. utilize temp file. c# windows-runtime windows-phone windows-store-apps