Posts

css - Text drops down with smaller window -

i've adapted css use in website , can't quite figure out why 1 aspect of page acting way acting. basically, when shrink window below size horizontally, of text "drops down". becomes issue if user viewing website through ipad vertical orientation. can view issue here . i'm hoping make if window gets smaller, placement of text remains intact. the problem area not have enough space put both side navigation , content on 1 line. make automatically adjust page's width when exceeds decrements of width. this code example, , highly unlikely work. if see css more clearly, provide exact code. @media , (max-width:960px) { /* assuming #wrapper 960px across */ #content {width:560px;} /* opposed 720px */ } edit the content drops down @ 980px, have shrink width after there. @media , (max-width:980px) { #container {width:520px;} }

dns - Get domain name from IP address in Go -

i'm trying resolve host name ip address, apparently proving little more challenging thought it'd be. i've tried using couple of functions, including net.lookuphost method, of them seem returning ip address input. here's code using: package main import ( "fmt" "net" ) func main() { // obtained ping -c 1 stackoverflow.com, should print "stackoverflow.com" addr, err := net.lookuphost("198.252.206.16") fmt.println(addr, err) } for example, package main import ( "fmt" "net" ) func main() { // obtained ping -c 1 stackoverflow.com, should print "stackoverflow.com" addr, err := net.lookupaddr("198.252.206.16") fmt.println(addr, err) } output: [stackoverflow.com.] <nil>

Fallback condition in a mysql select statement -

i want put condition mysql statement. if possible? this current mysql select statement select * `validproduct` `visible` = 1 , `typeid` = 2 , `sizeid` = 3 group `productid` so @ moment, selecting products sizeid = 3. want select products size = 1, , if doesn't exist, select sizeid = 3. my validproducts table contains list of products 6 different sizes associated (which in turn have different pricing). want return of products, lowest sizeid (which have lowest price available product). not products have sizeid 1. so return data product (sizeid 1, $x); product b (sizeid 3, $y) etc here way it: select vp1.* validproduct vp1 inner join ( select productid, min(sizeid) minsize validproduct visible = true , typeid = 2 group productid ) vp2 on vp1.productid = vp2.productid , vp1.sizeid = vp2.minsize , vp1.visible = true , vp1.typeid = 2 group vp1.productid; exp...

c# - Loading bar while cmd.exe is running -

what i'm trying do: pass command .cmd, show loading bar while command executes, exit cmd , display message box after progress bar full what's happening: when click button sends command, application hangs, command executed, cmd never exits after it's finished, application remains frozen (until manually close cmd.exe). have no idea how display loading bar while command executes. when loading bar full, that's when i'll display message box. my code: process p = new process(); p.startinfo.filename = "cmd.exe"; p.startinfo.workingdirectory = @"c:\" p.startinfo.windowstyle = processwindowstyle.normal; p.startinfo.useshellexecute = false; p.startinfo.redirectstandardoutput = true; p.startinfo.redirectstandardinput = true; p.startinfo.windowstyle = processwindowstyle.hidden; p.start(); p.standardinput.writeline(command_that's_called); ^ gets executed upon button_click event. things i've tried: p.waitforexit(); // still hangs ...

google maps - How to highlight only one state or a province using Fusion Table Search Query? -

i know how highlight whole country using google's fusion table api. wondering how highlight region within given country. this how works @ country level, looking @ region (state / province) level highlighting only. // javascript code var table_id = 655491; var query = "select 'kml_4326' "+table_id+" 'name_0' = '"+countryname+"';"; var option = { suppressinfowindows: true, query }; layer = new google.maps.fusiontableslayer(table_id, option); layer.setmap(map);

How to comparatively parse through objects inside a dictionary in C# -

so have person class contains info (firstname, lastname, mother, father, siblings, spouse) , want add people of class person dictionary. comparatively parse through dictionary determine relationship of objects (i.e. given person, find cousins, siblings, etc.). question 2 fold: 1) how should set dictionary<...> , 2) how access properties of each person in list? first tried: dictionary<string, object> dictionary = new dictionary<string, object>(); var human = person.addperson(); // person.addperson() returns new instance of person dictionary.add(human.name, human) // setting key full name, value person object. should try dictionary<string, string> <firstname, lastname> , once matches of people same name, start searching dictionary mother, father, etc.??? seems terribly slow , not right way go. edit: here person class , 1 of other classes (bear in mind i'm setting up, i'll handle user inputs, etc l...

python - Selecting incorrect submenu item after hover action -

i'm developing test case in python webdriver click through menu items on http://www.ym.com , , particular 1 meant go through menu item , click on sub-menu item. when running test, looks tries access nested menu items, never clicks on final item. here code go through menu: food = driver.find_element_by_id("menu-item-1654") hov = actionchains(driver).move_to_element(food).move_to_element(driver.find_element_by_xpath("/html/body/div[4]/div/div/ul/li[2]/ul/li/a")).click() hov.perform() the problem here trying click "recipes" submenu "food" menu, happens submenu "france" being clicked under menu "travel" situated right next "recipes. i've tried using find_element_by_id, find_element_by_css_locator, find_element_by_link_text seems select france submenu under travel , not recipes submenu under food. any ideas? edit i using python code run test now: food = driver.find_element_by_xpath("//a[contain...

javascript - Does jquery's $.get(...) ajax success function trigger when the file has completed downloading? -

basically want know if 'success function' of jquery's $.get() method fired when whole file has finished downloading. suspect is, want make sure. i'm using series of $.get() requests load files of page (css, javascript, etc) while display 'loading screen'. on each success callback of request, load next file until they're finished, , remove loading screen. the issue randomly, on slow connections (site designed mobile browsing) loading screen disappear css site has not been applied until ~1-2 seconds later user see non-styled site briefly before css applied buttons, etc. here code i'm using loading resources if(!window.myresourceloader) window.myresourceloader = {}; // list of resources load myresourceloader.myresources = new array( "include/resources/.....css", "include/resources/.....css", "include/modules/.......js", "include/...............js", "include/...............js"); // r...

sql server - Find the exact line number of error in sql script -

i trying insert 1000 records each insert statement in table called zoneplaces. table having index. when try run script insert on table throws error msg 2601, level 14, state 1, line 56 cannot insert duplicate key row in object 'dbo.zoneplaces' unique index 'ix_zoneplaces'. line 56 start of insert statement. know inserting duplicate value there way find exact line number has error? hope clear.

HTML5-how to open more than one cameras -

i have successful video streaming of local camera use getusermedia() in html5.but 1 camera.i have 2 cameras,how video streaming @ same time. unfortunately not appear possible, yet. see here , comments below article here . user decides via browser settings camera primary, , no option secondary, etc, camera exists of yet.

mysql - Search database for specific tags -

i have image table column called tags . typical entry this: id link tags ------------------- 1 [link] funny,not-cool,work i have search page users can enter tags search images. enter amount of tags separated comma search: funny, fall, fail question is, best way search database these tags? simple like it? know may have been more ideal add each tag in different table , not have them comma separated if need change way tags work will. it better have multiple tables here. first table called images , id , link . second table called tags each row being 1 specific tag such columns id , tag . third table join table called imagetags columns id , image , , tag . image column in imagetags foreign key images , tag column foreign key tags . using example search sql like: select images.link images join imagetags on images.id = imagetags.image join tags on tags.id = imagetags.tag tags.tag in ('funny','fall','fail')

unit testing - How to JUnit test for any output in Java -

i'd test 2 methods below, because based on random output go-to assertequals() won't work. i want test ensure methods producing kind of output. ideas? novice programmer, appreciate help. public void comprandomchoice() { double choice = (math.random() * 100 / 100); if (choice > 0 && choice <= 0.34) { computer.setchoice(handthrow.rock); } else if (choice > 0.34 && choice <= 0.67) { computer.setchoice(handthrow.paper); } else { computer.setchoice(handthrow.scissors); } } public string gamewinner() { string gameresult; if (human.getchoice() == computer.getchoice()) { gameresult = "its tie!"; } else if (human.getchoice() == handthrow.rock && computer.getchoice() == handthrow.scissors || human.getchoice() == handthrow.paper && computer.getchoice() == handthrow.rock || human.getchoice() == handthr...

scope - write parent function var in javascript -

how change value of variable in parent function in javascript for example: function parent() { var changeme = 0; function child() { changeme = 1; } } thanks help! the variable changeme within child() referring changeme in parent() . call child() , change it. jsfiddle function parent() { var changeme = 0; function child() { changeme = 1; } child(); alert(changeme); } parent();

javascript - CRM 2011 - Set field's 'requiredlevel' to REQUIRED based on another field's value -

i working on opportunity form in crm 2011. i have 2 fields working with: azdb_payment1type & new_payment1cclast4orcheckgc azdb_payment1type has option set values: visa = 807,370,000 mastercard = 807,370,001 american express = 807,370,002 discover = 807,370,003 check = 807,370,004 cash = 807,370,005 credit rollover = 807,370,006 if value of field (azdb_payment1type) 807,370,004 or less, i'd require new_paymentcclast4orcheckgc field filled out. i created function azdb_payment1type field called "requirecclast_onchange", added below code form's main library: function requirecclast_onchange() { var payment1type = xrm.page.getattribute('azdb_payment1type').getvalue(); alert(payment1type); if (payment1type <= '807,370,004') { xrm.page.getattribute("new_payment1cclast4orcheckgc").setrequiredlevel("required"); } } with code inserted onchange, nothing happens when select cc, tab off field. if chan...

how to plot power trendline showing equation and regression coefficient (like in the image below) in gnuplot? -

Image
i trying recreate plot created in ms excel using gnuplot. can done in gnuplot shows power trendline equation corresponding regression coefficient? data has plotted file:'data.txt' , data 'x' column 10 , 'y' column 11. thanks! i managed produce working version of above excel figure. improvement highly appreciated. thanks. code in gnuplot set terminal svg enhanced fname "times-new-roman,12" set xlabel "x" set ylabel "y" set xrange [0:*] set yrange [0:*] set format x "%0.3f" set format y '%0.3f' set title sprintf("y=f(x)") # plot filename="data.txt" plotfile="out.svg" set output plotfile f(x)=a*x**b fit f(x) filename using 10:11 via a,b set label gpfun_f @ graph .15,.95 set label sprintf("a = %g",a) @ graph .15,.90 set label sprintf("b = %g",b) @ g...

asp.net - How can we open raddatepicker popup window up the Radwindow popup -

Image
i have raddatepicker control in radwindow.the size of radwindow fixed. when open raddatepicker popup shows scroll bar in radwindow due less space. i don't want show scroll bar. question can open datepicker popup upon radwindow . use contenttemplate of radwindow have controls inside on same page, instead of in iframe: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx .

javascript - clearing div content through php and ajax -

echo '<script type="text/javascript" src="../jquery.js" src="../play.js"> $("#txtcreatureinfo").remove(); </script>'; i wondering why id not working. have line in php file , need remove text inside div . using ajax , all. if want remove text inside div, cannot use .remove(). .remove() delete element. instead should use .html(""). clear text , not remove div. so can write way. echo '<script type="text/javascript">$("#txtcreatureinfo").html("");</script>';

checkbox - how to get the sum of selected checkboxes in android? -

i'am newer. problem @ java. in xml, if have 2 checkboxes, o book o pencil total : . . . i want sum of selected checkboxes. if book=10 , pencil=5. how? give each of checkboxes unique id in xml ( android:id="@+id/book" , android:id="@+id/pencil" ) , in code check if checked so: int sum = 0; if (((checkbox)findviewbyid(r.id.book)).ischecked()) sum += 10; if (((checkbox)findviewbyid(r.id.pencil)).ischecked()) sum += 5;

r - How to use facet_grid correctly in ggplot2? -

Image
i'm trying generate 1 chart per profile following code, keep getting "at least 1 layer must contain variables used facetting." errors. spent last few hours trying make work couldn't. i believe anwser must simple, can help? d = structure(list(category = structure(c(2l, 2l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 3l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 3l, 3l, 3l, 3l, 3l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 1l, 2l, 2l, 2l), .label = c("4x4", "hatch", "sedan"), class = "factor"), profile = structure(c(1l, 1l, 1l, 1l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 3l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 1l, 1l, 1l), .label = c("fixed", "free", "mobile"), class = "factor"), value = c(6440.32, 6287.22, 9324, 7532, 7287.63, 6827.27, 6880.48, 7795.1...

php - Force file download PDF 'open with' box says its a Firefox document ?? -

Image
i trying force download pdf file, works fine. problem when show "download box" says "firefox document" should "adobe acrobat document". see images, , below code using 1) force download box gmail, works fine 2) force download box application, says "firefox document" header("pragma: public"); header('expires: mon, 26 jul 1997 05:00:00 gmt'); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("content-type: application/pdf"); header("content-disposition: attachment; filename=\"".basename($file)."\";" ); header("content-transfer-encoding: binary"); header("content-length: ".filesize(getcwd().$file)); readfile(getcwd().$file); for searching same issue. the ts go solution : add exit @ end (for reasons firefox needs this) header("content-type: application/pdf"); echo $pdf; exit; ...