Posts

Showing posts from February, 2015

git - how to reset develop branch to master -

i have develop & master branches, develop branch messy , reset , make copy of master . i'm not sure if merging master develop make both of them identical. after trying merge got many conflicts solved them using: git checkout develop git merge origin/master //got many conflicts git checkout . --theirs is enough develop branch identical copy master ? thanks if want make develop identical master , simplest way recreate pointer: git branch -f develop master or, if have develop checked out: git reset --hard develop master note both of these options rid of history develop had wasn't in master . if isn't okay, preserve instead creating commit mirrored master 's latest state: git checkout develop git merge --no-commit master git checkout --theirs master . git commit

c# - how to restrict child control inside Parent control in Winform application? -

i've created label controls dynamically inside panel control. i'm moving label controls using mouse events. time label control moving outside panel control. how can restrict it? you can take benefit of cursor.clip requirement (although can handle manually in mousemove event handler): point downpoint; //mousedown event handler label1 private void label1_mousedown(object sender, mouseeventargs e){ downpoint = e.location; //this important code make works cursor.clip = yourpanel.rectangletoscreen(new rectangle(e.x, e.y, yourpanel.clientsize.width - label1.width, yourpanel.clientsize.height - label1.height)); } //mousemove event handler label1 private void label1_mousemove(object sender, mouseeventargs e) { if (e.button == mousebuttons.left) { label1.left += e.x - downpoint.x; label1.top += e.y - downpoint.y; } } //mouseup event handler label1 private void label1_mous...

what is a list of android internal broadcast? -

i have android application, when user installs , when app run want able start service if device has internet access. this mainfest.xml content service , broadcast <receiver android:name="com.google.audiancelistening.wifichangedbrodcast" > <intent-filter> <action android:name="android.net.conn.connectivity_change" /> </intent-filter> </receiver> for solution when wifi turned on broadcast executes successfully, want start in first of application added below code in activity: if(isinterneton()){ intent inten = new intent(getapplicationcontext(), connectionservice.class); getapplicationcontext().startservice(inten); writetosdfile(); android.os.process.killprocess(android.os.process.mypid()); } else{ writetosdfile(); android.os.process.killprocess(android.os.process...

Keep form data inside the field after submission using php -

i using below code html form.(it has 2 forms) able keep textarea field after first , second form submission. issue facing here dropdown menu selection. code: <html> <body> <div class="emcsaninfo-symcli-main"> <form id="form1" name="form1" action=" " method="post" > <div class="input">your name</div> <div class="response"><span><input class="textbox" id="myname" name="myname" type="text" value="<?php if(isset($_post['myname'])) { echo htmlentities ($_post['myname']); }?>" /></span> </div> <div class="input">your place</div> <div class="response"><span><input class="textbox" id="myplace" name="myplace" type="text" value="<?php if(isset($...

load view inside view in codeigniter -

actually m using ahref onclick function inside view <a href="<? echo base_url();?>index.php/manager/engineer" onclick=window.open("<? echo base_url();?>index.php/manager/engineer") > it redirecting url correctly http://localhost:8888/ci/index.php/manager/engineer but in page m getting error as the page requested not found. even though have created engineers view file anyone helping me find solution needfull the ci router run external links of controller classes , can't load views externally. instead on can load views internally on controllers , open controller address via browsers. see more : http://ellislab.com/codeigniter/user-guide/general/views.html

java - Endless "Hot swap" with Intellij and JRebel -

i have intellij debugging java web app in tomcat 7 jrebel. also, intellij set "hot deploy on frame deactivation". (all latests versions) most of time configuration works charm , jrebel hot swap fine. however, intellij hang in "hot swap" every time project gets recompiled. any thoughts?

rails nested model forms has_one association -

im using simple_form gem , need nested form im having trouble here code: i have 2 models: apiphones: class apiphone < activerecord::base attr_accessible :key, :phone validates_presence_of :phone belongs_to :store end stores: class store < activerecord::base has_one :apiphone accepts_nested_attributes_for :apiphone end and in view: <%= simple_form_for [@group,@store] |f| %> <%= f.simple_fields_for :apiphone |ph| %> <%= ph.input :phone %> <% end %> <% end %> but nothing showing, ideas? using fields_for in conjunction accepts_nested_attributes assumes records initialized. means that, using models, @store.apiphone should not nil when form generated. way solve issue making sure apiphone initialized , associated @store (both new , edit actions). def new @store = store.new @store.build_apiphone end

java - A* catch if unpossible to reach a point -

i implemented simple a* , noticed infity loop if 4 spots around character filled. current stuck how work start running nearest possible spot. guesses on it? (sorry long code) the a* private node astarsearch(int startx, int starty) { openlist.clear(); closelist.clear(); successor.clear(); node startnode = new node(null, startx, starty, 0, 0); openlist.add(startnode); while (openlist.size() != 0) { // sort list collections.sort(openlist, nodecomperator); node q = openlist.remove(0); // first object int qx = q.x; int qy = q.y; // start adding successors // left node left = createneighbor(q, qx - 1, qy); if (left != null && !closelist.contains(left)) successor.add(left); // right node right = createneighbor(q, qx + 1, qy); if (right != null && !closelist.conta...

regex - Template string parsing in php -

i having issue string parsing in php. trying create own template parser (for learning purpose). have decided put urls in following format {url:abc/def} displayed http://www.domain.com/abc/def . have tried using str_replace in case not work since value after ":" anything. exploding string wont work ":" can present in text of html file. think done via regular expression suggest me regular expression let me know if can achieved via other approach. other things note. since used template parsing , template can have multiple urls. urls not have query strings appreciate if solution supports them. for learning purposes then: preg_replace('/\{url:([^\}]*)\}/', $base_url.'$1', $string); and explanation of regex \{url: <-- find text [^\}]* <-- means 'any character } occuring 0 or more times ([^\}]*) <-- putting inbetween () can later reference (see '$1' ) \} <-- closing } as long you're learn...

map - Android AsyncTask error while adding items to GoogleMap -

i want load coordinates file , add shapes map in async task. getting error, , don't know why. here code: private class shploading extends asynctask<googlemap, void, string> { progressdialog dialog; @override protected string doinbackground(googlemap... params) { shpreader shpread = new shpreader(); googlemap map = params[0]; try { shpread.reading(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (invalidshapefileexception e) { // todo auto-generated catch block e.printstacktrace(); } for(latlng : shpread.points()) map.addmarker(new markeroptions() .position(a) .draggable(false)); int = 0; ...

java - Currency class only one instance per currency? -

from this official oracle java tutorial: note currency class designed there never more 1 currency instance given currency. therefore, there no public constructor. demonstrated in previous code example, obtain currency instance using getinstance methods. what risk of having more 1 instance of currency given currency? in advance. refer link currency representation of currency particular locale. each currency identified iso 4217 code, , 1 instance of class exists per currency. result, instances created via getinstance() methods rather using constructor. as java doc says can supersede java runtime currency data creating properties file named <java_home>/lib/currency.properties . contents of properties file key/value pairs of iso 3166 country codes , iso 4217 currency data respectively. value part consists of 3 iso 4217 values of currency, i.e., alphabetic code, numeric code, , minor unit. 3 iso 4217 values separated commas. lines start ...

http - HTML form post response on same page -

i developed simple portlet liferay contains form submit couple of parameters external webservice. problem when press submit redirected url of webservice. is there way suppress redirection , show webservice response in same portlet made call from? many in advance feedback appreciated. you have use javascript (ajax) send data webservice , directly response without redirecting user. data received javascript, can display them on page. you can jquery , function ajax() . hope, i've helped :)

css - IE & Firefox - custom drop down could not remove native arrows -

i'm trying create custom drop down control , need hide arrows native controls. i'm using following css , working chrome , safari, not in mozilla , ie. select.desktopdropdown { appearance: none; -moz-appearance:none; /* firefox */ -webkit-appearance:none; /* safari , chrome */ } here [jsfiddle][1]. use work ie10+ , ff : your css should this: select.desktopdropdown::-ms-expand { display: none; } more ::ms-expand . then rest : select.desktopdropdown { outline : none; overflow : hidden; text-indent : 0.01px; text-overflow : ''; background : url("../img/assets/arrow.png") no-repeat right #666; -webkit-appearance: none; -moz-appearance: none; -ms-appearance: none; -o-appearance: none; appearance: none; } note : hardcoded path "../img/assets/arrow.png" background. this should work in ie, firefox , opera .

vb.net - namespace of .NET ComboBoxItem -

where comboboxitem class in .net namespace of visual studio 2012? msdn says should in windows.controls there no such namespace or entry of in references list. it's not present in windows.forms . i've encountered listviewitem class, messes label tags , brackets. comboboxitem can found if create wpf project , because namespace system.windows.controls included in presentationframework assembly. if you're creating winforms project , cannot find comboboxitem class! see http://msdn.microsoft.com/en-us/library/system.windows.controls.comboboxitem.aspx

Lot of noise in webrtc audio/video -

i have developed video chat app webrtc api. have fallowed steps given webrtc. video working fine. there lot of noice laptop. sound not clear. but in google developed demo site https://apprtc.appspot.com/ works out noise(better compare us). i fallowed same procedure did. no luck. but in headset echo not hearing. happens when haering sound laptop without headset. please give me suggestion on this. thanks in advance. looking foward response. give @ demo webrtc conferencing supports 4 callers. link describes implentation details architecture

How to avoid for-loops in R -

i guess usual question amongst r user, stills not clear me. want parse elements of column fnl3$aaa , each of them perform lookup in column df$aaa. if match occurs, append numeric value @ end of temp vector. problem process takes long complete. wondering how meke run faster. ideas? cur <- c("") (i in 1:unq21) { prev <- cur (j in 1:unq11) { if (cnt1$aaa[j] == fnl3$aaa[i]) { print('match!!!') print(cnt1$freq[j]) print(fnl3$v1[i]) cur <- append(prev, as.vector(fnl3$v1[i] / cnt1$freq[j]), after = 0) } } } sample dataset: fnl3 row.names aaa v1 1 404 1dc8f216-9138-4151-abd6-36c3c2c75001 3 2 1533 638df397-359e-43a5-a2f7-2c43caba93da 3 3 14 015ee60dbf299f5419eed89214b7409a 2 4 98 08cff963-5565-4b8c-814e-fdfa5d37dcd6 2 5 488 226afbbac8dfd6f3c27cb16f9d7922a2 2 cnt1 aaa ...

c# - Is a library ,created in .net version 4.0, access with in the lower version from its version -

i going create own library containing generic functions. . want make sure if create library in .net framework 4.0 able call in class created in 3.5 or lower version. . want know cautions before start work on library i.e. kind of concepts should cleared before create own library in order use in efficient way. thanks. create library in .net 2.0 framework there no issue higher versions, you can set version project properties ( right click project , select properties in visual studio) select application tab properties window , select target framework combobox select .net framework 2.0

asp.net - Opening a Pdf document in Adobe photoshop -

i have silverlight control upload documents in web page share point. while upload document uploaded. when try open clicking on document pdf document uploaded opens in redirected ie page. want pdf directly opened in adobe reader instead of redirecting open in ie page. can please suggest if browser setting or need code it? thanks yogesh response.clear(); response.contenttype = "application/pdf"; obj.save(response.outputstream, file); response.addheader("content-disposition", "attachment;filename=" + "abcd".tostring()); response.flush(); response.end(); above code downloading it. if saving file in db binary data or if saving in folder within app, give path.

php - login to joomla from wordpress -

i have joomla site in there 1 blog section integration of wordpress(wp subdomain of joomla site). on joomla site there 1 login component.while in blog section have given funcionality of login user blog section of wordpress , login functionality belongs joomla want way check credentials against joomla blog(wp) section. how accomplish this? idea? thanks in advance. this won't possible both cms's use different methods logging user in. for passwords, joomla use md5 , salt methods. wordpress on other hand use portable php password hashing framework . also, api's different. i'm not sure if you're site purely blog, didn't stick wordpress rather integrating wordpress blog joomla. no best idea :/

Create image buttons in jquery mobile -

im trying create button in jquery mobile image , no text, far able add data-icon, have feeling done better. <a onclick="newfunction();" data-icon="plus" data-iconpos="notext" ></a> you can create button images : <img style="height: 40px; width: 40px;" id="newid" data-role="button" src="source\images\greenplus.png" data-iconpos="notext" data-theme="a" />

ruby on rails - Best way to test HTTP queries -

i'm working on gem rails app basic operations on odata service (retrieve info regarding ski resorts). test using rspec, cannot manage write relevant , efficient tests it. can find gem's code on github, it's pretty basic (core code in lib/anmsm_ruby.rb , tests in spec folder) https://github.com/alpinelab/anmsm_ruby what rspec experts think best approach ? when test external web api use advantage of vcr gem. vcr recordes real http response web service , stores in .yml fixture, called cassette . that way can example test if returned array of all_resorts method has expected values/items.

asp.net - Send query string parameter from a non-web application -

ok, i've been bugging long. i need call website rough vb.net app. thing need attach query string parameter calling url, can distinguish pages shown different vb app users. so want click button , launch website, giving parameter. first bugging adding system.web libraries. can't use request/response.querystring well. i tried getting example this post. said before - cannot make use of request.querystring cannot import it. stuck here: process.start("http://localhost:56093/website1?id=") i need attach query string parameter url , open website url. can give me sample code problem. query parameters parsed web server/http handler off url use call page. consist of key , value pairs come @ end of url. code there. needed pass through parameters: id = 1234 page = 2 display = portrait then you'd turn them url this: http://localhost:56093/website1?id=1234&page=2&display=portrait therefore in code you'd have: process.start(...

extjs - How to fix build error com.sencha.exceptions.ExProcess in extjs4.1 -

i getting below exception when building extjs4.1 project. can tell me how avoid it? using sencha command version3.0. using command sencha app build [err] d:\testproduction\.sencha\app\build-impl.xml:213: com.sencha.exc eptions.exprocess: phantomjs process exited code 100 : thanks i got same issue running sencha app build: [...] [inf] loading page .../static/sass/example/theme.html failed render widgets within 30 sec. [err] [err] build failed [err] com.sencha.exceptions.exprocess: phantomjs process exited code 1 [err] [err] total time: 49 seconds [err] following error occurred while executing line: .../static/.sencha/app/build-impl.xml:469: com.sencha.exceptions.exprocess: phantomjs process exited code 1 it seemed project directory missing sass folder. so created new app , copied on sass folder there: $ cd /tmp $ sencha -s ~/develop/js/sencha/ext-4.2.1.883 generate app myapp myapp $ tree myapp/sass myapp/sass ├── config.rb ├── etc ├── example │ ...

android - how to finish all activities except the first activity? -

i google if run code below didnt finish other activities. buttonclick.setonclicklistener(new onclicklistener() { @override public void onclick(view view) { loginmanager.getinstance().ctrl = false; usermanager.getinstance().logincontrol(); ordermanager.getinstance().orderctrl = false; intent intent = new intent(ordercomplete.this, mainactivity.class); intent.addflags(intent.flag_activity_clear_top); intent.addflags(intent.flag_activity_single_top); startactivity(intent); finish(); } }); } update please refer other answers, cannot delete answer because marked accepted as per our discussion in comments your given code fine ! q1. why not finishing activities ? ans. think all activities finished except activities have thread or aysnctask running in background or not finished yet! q2. how can finish them ? ans. make s...

php - Results Fetched from Mysql DB Stay on Page -

i m fetching table mysql using php result displayed array on html page result stays on page if refresh page or if fetch new record adds end of previous result please guide me result removed on page refresh or if new row ordered must replace previous 1 here's code <div id="output"> <form id="suserb" name="output" action="" method="post"> <input type="submit" value="select" name="suser"></form> <div id="suser"> <?php if (isset($_post['suser'])) { $omysql = new mysql('library', 'root', '', 'localhost'); $where = array('bid' => '0'); echo "<pre>"; $result = $omysql->select('user', $where); print_r($result); echo "</pre>"; foreach ($result $key...

php - Drupal 7 node custom template or core display -

i have dozens content types in need display more or less block of same fields. using core display have create many groups , styling them css tricky. alternative use template suggestions render faster normal display method i'm using? easier remove thoose fields display, write templates , render node in template (all other data). how performance? any appreciated thanks although answer not specific printing need in tpl.php files faster hidding them css or php if conditions . should better use tpl.php files each node type. , "core method" talking using tpl.php files! inside root/modules/node folder tpl files of node module. there useful modules display suite , panels , entity_view_modes etc if performance big issue can go without them.

django - python underscore function name -

i reading django article on form validatin here , came across this validationerror(_('invalid value'), code='invalid') my question _('invalid value') does? it's translation purpose you should see @ begining of script from django.utils.translation import ugettext _ you can see complete explanation in doc

c++ - How to fix memory leak while inheriting from QObject? -

i have simple class: class httpclient : public qobject { q_object public: qnetworkaccessmanager* manager; qnetworkreply* reply; httpclient(){ manager = new qnetworkaccessmanager(); reply = nullptr; } ~httpclient(){ delete reply; } public slots: void slotreadyread(){ cout << reply->readall().data() << endl; } void slotnetworkerror(qnetworkreply::networkerror error){ cout << reply->error() << endl; } public: void get(qurl url){ qnetworkrequest request; request.seturl(url); reply = manager->get(request); connect(reply, signal(finished()), this, slot(slotreadyread())); connect(reply, signal(error(qnetworkreply::networkerror)), this, slot(slotnetworkerror(qnetworkreply::networkerror))); } }; int main(int argc, char *argv[]) { qcoreapplication a(argc, argv); httpclient client; ...

python - Register unique callbacks per instance using classmethod -

i wanted make easier register callbacks using decorators when designing library, problem both use same instance of consumer. i trying allow both these examples co-exist in same project. class simpleconsumer(consumer): @consumer.register_callback def callback(self, body) print body class advancedconsumer(consumer): @consumer.register_callback def callback(self, body) print body = advancedconsumer() s = simpleconsumer() what happens here callback implementation of advancedconsumer override 1 of simpleconsumer, defined last. the implementation of decorator class pretty simple. class consumer(object): def start_consumer(self): self.consuming_messages(callback=self._callback) @classmethod def register_callback(cls, function): def callback_function(cls, body): function(cls, body) cls._callback = callback_function return callback_function i happy im...

php - SQL Join Returns null -

Image
i trying return values database what have users user_id (pk) own_events user_id (fk) event_id(pk) attendees user_id (fk) event_id(fk) what need return i need return rows in attendees that's event_id equals value,status not equal 3 , , event_name value of event own_events table , email value users table what have tried have been trying sort of combinations couldnt figure out doing wrong http://www.codeproject.com/articles/33052/visual-representation-of-sql-joins even returns null: $query ="select a1.event_name,a1.start_date attendees a1 inner join own_events a2 on a2.event_id = a1.event_id a1.event_id = $event_id"; or $query ="select a1.event_name,a1.start_date ,a3.email attendees a1 inner join own_events a2 on a2.event_id = a1.event_id inner join users a3 on a3.user_id = a1.user_id a1.eve...

perl - sloppy matching of hash keys? -

i'm comparing 2 lists of genes aim of finding overlapping genes between 2 lists. at moment, store names of gene hash key for both lists (blast1 , blast2) , find keys (genes) exist in both hashes: input 1: xloc_000157_6.21019:12.8196,_change:1.04564,_p:0.04915,_q:0.999592 99.66 gi|475392713|dbj|ab759708.1|_xenopus_laevis_phyhd_mrna_for_phytanoyl-coa_dioxygenase_like_protein,_complete_cds xloc_000159_636.025:343.104,_change:-0.890436,_p:0.00575,_q:0.999592 99.47 gi|9909981|emb|aj278067.1|_xenopus_laevis_mrna_for_putative_xirg_protein xloc_000561_31.1018:14.9273,_change:-1.05905,_p:0.0073,_q:0.999592 91.57 gi|165973401|ref|nm_001113689.1|_xenopus_(silurana)_tropicalis_cytokine_inducible_sh2-containing_protein_(cish),_mrna assign 1st gene list... $input1 = $argv[0]; open $blast1, '<', $input1 or die $!; $results1 = 0; (@blast1id, @blast1_info, @percent_id, @split); while (<$blast1>) { chomp; @split = split('\t'); pu...

ajax - Gridview TemplateField checkbox postback behavior in asp.net -

i have gridview inside updatepanel , updatemode of updatepanel set conditional. gridview contains asp:checkbox templatefield , rest of columns boundfields dynamically created. checbox autopostback set true , update datatable (which inside session) based on checkbox value. here markup: <asp:gridview id="objlist" runat="server" cssclass="objlist" autogeneratecolumns="false" onrowdatabound="objlist_rowdatabound" autogenerateselectbutton="false" allowpaging="false"> <columns> <asp:templatefield headertext="&nbsp"> <headertemplate> <asp:checkbox autopostback="true" id="chkall" runat="server" oncheckedchanged="headerchk_changed" /> <asp:hiddenfield id="linknumindexhead" runat="server" value="-1" /> </headertemplate> ...

c# - Static Int not start at 0 -

public partial class mainbookingform : system.web.ui.page { static int numberofbeachbookinginteger = 0; static int numberofbushbookinginteger = 0; static int totalrevenueinteger = 0; protected void page_load(object sender, eventargs e) { if (!ispostback) { if (session["beachbach"] != null) { numberofbeachbookinginteger += 1; beachbachlabel.text = numberofbeachbookinginteger.tostring(); } if (session["beachbach"] != null) { numberofbushbookinginteger += 1; bushbachlabel.text = numberofbushbookinginteger.tostring(); } } } hi, see these integer start @ "0" when debug program. however, these label assign integers start @ '1' please help! before write numbers label, increment them: numberofbeachbookinginteger += 1; so of course value in labels never...

php - if-check for all array values -

i have form in html , code in php. form contains lot of different <input> things. , want text output in browser if all fields not empty. for example, 2 fields called name , age , following: if($_post['name'] , $_post['age']) { ... } but here have more 2 fields. should do? you try this $allset = true; foreach($_post $key => $value){ if(empty($value)){ $allset = false; break; } }

how to play two mp4 videos through gstreamer pipeline? -

i create gstreamer pipeline play 2 mp4 videos back. possible play using gst-launch? can use multifilesrc purpose ? please show me path play 2 videos back. thanks in advance ! there isn't way using single gst-launch command. video decoder sends end of stream event after first video ends when use multifilesrc. if dead set on using gst-launch, can wrap 2 gst-launch commands in shell script: #!/bin/sh file1=$1 file2=$2 gst-launch filesrc location="$file1" ! decodebin2 ! autovideosink gst-launch filesrc location="$file2" ! decodebin2 ! autovideosink another way write simple gstreamer application in c create pipeline first video, play it, create new pipeline second application, , play that. see gstreamer application developers guide: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/ the section hello world contains functional example pipeline think make starting point you.

c# - ASP.NET machinekey set keys in code -

i want adjust machine keys dynamically in code during runtime, iis hosted asp.net mvc 4 website. the machine keys, encryption , validation keys algorithms use, stored in database. instead of reading values web.config file, want inject values during application startup , let system use instead. is there way accomplish without having change web.config @ (to change in memory configuration)? i have tried accessing configuration section marked readonly , sealed, cannot override isreadonly() . however, there setter indicator, me, there may way potentially remove readonly flag. var configsection = (machinekeysection)configurationmanager.getsection("system.web/machinekey"); if (!configsection.isreadonly()) { configsection.validationkey = _platforminfo.machinekey.validationkey; configsection.decryptionkey = _platforminfo.machinekey.encryptionkey; ... } is there way accomplish this? alternative can see use custom method appharbor, rather stick bui...

xml - How do I use an xdoxslt variable inside xsl code, in BI Publisher? -

i trying create loop increments variable, use variable inside of xsl code. here code using increment counter: <?xdoxslt:set_variable($_xdoctx, ‘counter’, 0)?> <?for-each-group:$g2;./status?> <?sort:current-group()/status;'ascending';data-type='text'?> <?xdoxslt:set_variable($_xdoctx, ‘counter’, xdoxslt:get_variable($_xdoctx, ‘counter’) + count(xdoxslt:distinct_values(current-group()/action)))?> <?end for-each-group?> the following code output number need: <xsl:value-of select="xdoxslt:get_variable($_xdoctx, ‘counter’)"/> so know loop working , variable has correct number. however, need use variable in following code: <xsl:attribute name="number-rows-spanned" xdofo:ctx="block"> <xsl:value-of select="xdoxslt:get_variable($_xdoctx, ‘counter’)"/> </xsl:attribute> when use code following error: java.lang.numberformatexception: input string: "" i...

php - Stuck on include() in a wordpress theme -

i'm going include() php file in wordpress theme file. file header.php, , function like: <?php error_reporting(e_all); $filename = "path/to/file.php"; if (file_exists($filename)){ echo 'ok'; include($filename); } ?> "ok" printed in resulting html, output stops after. used both relative , absolute path same result. missing home themes work? file permissions ok. edit: display_errors set off in wordpress. had enable find error , resolve. fatal. $filename = "file.php"; // first of needs quoted // $filename, not filename. missing $ before variable name if (file_exists($filename)){ echo 'ok'; include($filename); }

.msi compability across Windows versions -

i distribute winforms application several different computers, os between xp , win7. if create .msi installation package (vs2010 - c# 4.0), work in windows xp right of bat? is there specific need change in order make work on older computers? yes, msis work across versions of windows. having said that, windows xp doesn't include .net 4.0 default, you'll need trigger appropriate framework install if needed.

data structures - Google Chrome usage of bloom filter -

i reading wikipedia article on usage of bloom filters . mentioned in article bloom filters used google chrome detect whether url entered malicious. because of presence of false positive google chrome web browser uses bloom filter identify malicious urls. url first checked against local bloom filter , upon hit ,a full check of url performed i guessing full check means google stores harsh table of list of malicious url , url hashed checked if present in table. if case , isent better have hash table instead of hash table + bloom filter?? please enlightened me on , version of full check correct ??? a bloom filter malicous url's small enough kept on computer , in memory. because sites enter not malicous better if wouldn't request them, that's bloom filter comes in. might not feel slow internet connections it's useful.

php - Equals operator not working in sqlite FTS table? -

the fts table: create virtual table t_fts using fts4(p, grp, p_rec, p_time); query: select * t_fts p = ? , grp in(?, ?, ?) , t_fts match ? i no results if run in sqlite manager results should. if remove p = ? clause results, more need. why happen?

javascript - Colorbox html from a function -

i have html code <html> <head> <script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type = "text/javascript" src = "http://www.jacklmoore.com/colorbox/jquery.colorbox.js"></script> <link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" /> </head> <body> <div id="bag">click me</div> </body> </html> <script type="text/javascript"> $("#bag").click(function(){ $.colorbox({html:function(){alert("hello")}}); }); </script> when click on click me, alert pop comes 2 times rather should come once. please tell me any way here problems code: $("#bag").click(function{ $("#bag").click(function(){

sql - Using INNER JOIN and MAX(), to return same row as MAX -

for reason, can't query return result i'm looking for. i'll explain after outlining situation... there 2 tables, 1 players , 1 matches . within each match, player gets rating (float/decimal) based on position played in. rating may improve in 1 position, different/better in others. therefore, want able see max(rating) , pos max obtained in, alongside players details . so, idea following: select * players inner join(select pid, max(rating) a, pos matches group pid) b on b.pid = players.ypid players.ytid = '2010591' , players.status = '1' order ypromdate asc, ydob asc this return of player's details , max rating, if player has played in multiple matches (hence group by) first record returned pos . example, if player1 got rating of 5 defender , 6 forward, query return 6 defender if more information requi...

ios - Launching a different app to open file on server -

the apple docs uidocumentinteractioncontroller "provides in-app support managing user interactions files in local system". there similar setup viewing files on server? tried sending link file nsurl interactioncontrollerwithurl: , didn't work. guess alternative download file, open once has downloaded, delete file. seems lot of coding work though, if there easier way that's available. edit: know name of file want view/download, i'm not looking "file list" aspect of uidocumentinteractioncontroller . on server, there many google earth .kml files. user isn't going directly select file open list - select file open programmatically based on actions taken user in session. as understand it, presentopeninmenufromrect:inview:animated: show popover "would open file 'myfile.kml' in google earth?". if user selects 'yes', uidocumentinteractioncontroller launches google earth , opens myfile.kml. guess i'm not look...

python 2.7 - Django collectstatic command is not able to compile animate.css -

i tried use animate.css in 1 of django project (if interested here's link ). overview: deploy code, run python manage.py collectstatic , always. till don't include animate.css in {% styles css/base-min.css %} tag using django-sekizai , django-compressor of gist . the collectstatic works fine, include in project, same command stucks. for time being use animation.css in project, have directly included of <link href="{{static_url}}/css/animate.min.css" rel="stylesheet" type="text/css" media="screen" /> but, question remains, why collectstatic commands fails in general compile animate.css ?

ios - Expanding TableViewCell using IB -

i want create table has 2 sections. each section(cell) have content includes header, image , label. i set out in ib. i have when app loads, header visible in each cell (say 50 point size). when user clicks cell, cell animates , expands it's full size (say 400 points). when user clicks again, contracts 50 points. i've seen tutorials show how create functionality seems programatically everything. lay out in storyboard , set contracted , expanding sizes via code. could please me this? thanks there reason examples have seen show how accomplish task programatically: can't in ib.

eclipselink - JPA: several relations -

i have trouble jpa , right annotations , tried lot of annotations , combinations @joincolumn, mappedby , on, still errors. use eclipselink (jpa 2.1). i have owner class store: @entity public class store extends baseentity { @notnull private string name; @notnull @onetomany private list<price> listprices; @notnull @onetomany private list<businesshours> listbusinesshours; @notnull @onetoone @joincolumn(name="store_id") private pointcoordinates pointcoordinates; ... } this class pointcoordinates: @entity public class pointcoordinates extends baseentity { @notnull private float long; @notnull private float lat; @onetoone(mappedby="pointcoordinates") private store store; ... } and 1 of "@onetomany" classes of 'store': @entity public class businesshours extends baseentity { private boolean holiday; @manytoone private store store; ...

c - gromacs compilation gives undefined reference error -

i use gromacs on open suse 12.3 platform having trouble it. when trying compile analyzing tool using gmx_template first got error: g++ -l/usr/local/gromacs/lib -o msd msd.o -lmd -lgmx -lfftw3f -lxml2 -lnsl -lm /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: /usr/local /gromacs/lib/libgmx.a(pthreads.c.o): undefined reference symbol 'pthread_getaffinity_np@@glibc_2.3.4' /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'pthread_getaffinity_np@@glibc_2.3.4' defined in dso /lib64/libpthread.so.0 try adding linker command line ...

search - QueryOptionsBuilder Deprecation -

as seen on http://developer.marklogic.com/learn/java/analytics , able faceted searches javaapi. however, examples on page use queryoptionsbuilder , has been deprecated. is there alternative using queryoptionsbuilder in javaapi faceted searches @ time? or stuck using deprecated class until future release? thanks! yes, there alternative. can send or receive query options json or xml instead of using deprecated builder. to expand bit, queryoptionsmanager.writeoptions() method accepts class implements queryoptionswritehandle marker interface. besides queryoptionshandle class, implementing classes include write handles json or xml. similarly, readoptions() method accepts classes implement queryoptionsreadhandle marker interface, include read handles json or xml. http://docs.marklogic.com/javadoc/client/com/marklogic/client/admin/queryoptionsmanager.html http://docs.marklogic.com/javadoc/client/com/marklogic/client/io/marker/queryoptionswritehandle.html http:...

regex - How to move multiple lines to join another in notepad++ -

i have thousands of lines of code in notepad++ looks following: befwwef :efiewmfewfm krtmhrthmrt :ewfowoofowwwwww fwmfemwf :wefiwenweniewnf i need each of 2 lines join this: ewfwfwefew:ewiekdmdm i'd kill space in between lines of lines without space: ewfwefewewf:ffewwefwe fweef:ewfwefwefewf ewfwefwefewfw:wefweffwfewfw ewfwewef:eweewewwe i'm sure easy fix started using find , replace feature in notepad++ today, i'm trying find each line ":" on them i'm not sure how keep colon , backspace line join other. appreciate i've searched simple fix looks complicated me @ moment! thanks you can use regular expression mode of find & replace (you need opt search mode). in find, use: \s*:\s* [ \s matches space, tab, newlines , * means 0 or more times.] and in replace, use: : shouldn't hard.

How do you migrate a Homebrew installation to a new location? -

i have homebrew installation in $home/brew , , historically has worked well. unfortunately, on time homebrew has become less , less tolerant of installations outside of /usr/local . various formulae make hard assumptions installation prefix, , not work (i.e., not tested) non-standard prefix. brew doctor command goes far warn now: warning: homebrew not installed /usr/local can install homebrew anywhere want, brews may build correctly if install in /usr/local. sorry! as such, migrate homebrew installation on /usr/local . however, loath mv files, suspect cause problems. not find instructions on homebrew site or here on migrating existing installation new prefix. of course, uninstall homebrew , reinstall it, prefer not rebuild kegs. is there existing script or documented practice performing such migration? or impossible due hardcoded absolute paths in linked binaries? i wrote script achieve goal migrate homebrew packages new system, applies case (named backup-homeb...

html - Height more than 100% of browser height -

Image
i'm building responsive webiste. don't want set default height in px, want to this. top of layout. e.g. prowly.com . and fiddle: http://jsfiddle.net/qvxw8/1/ html, body { margin: 0; padding:0; } div#handler { width: 100%; height: 110%; display:block; } div#content { width: 100%; height:100%; background: red; } div#content2 { width: 100%; height: 10%; background: blue; } html <body> <div id="handler"> <div id="content">i want 100% height of browser</div> <div id="content2">i want 10% of height browser</div> </div> </body> ps. saw, 100% of height it's buggy on safari iphone , opera mobile don't know should do. of course can use js want know there other way? ...