Posts

Showing posts from 2011

java - How should I set a HttpURLConnection to be the same as a HttpServletRequest? -

i have server, , want forward requests other server (maybe modifications). i use httpurlconnection connect second server (from first server). can lot of information httpservletrequest, example: getattributenames -> getattribute getheadernames -> getheader getparameternames -> getparameter getquerystring getreader (for body) but httpurlconnection can setrequestproperty(key, value). don't know whats different between attributes, headers, paramteres. how should set httpurlconnection same httpservletrequest? what information need "copy" or "clone" request? should attributes, headers, parameters , querystrings request , set of them setrequestproperty(key, value)?

javascript - On the basis of quantity and product price, total price Update -

my html structure: <div class="pricesection"> <label id="productprice"> <strong> <span id="totalprice"> 129,00</span> <span>$</span> </strong> </label> <input type="text" value="1" name="am" id="quantity"> <button class="submitbtn" type="submit">add cart</button> </div> my js code: $('#quantity').keyup(function(){ $('#quantity').each(function () { var qty = $('#quantity').val(); var price = $('#totalprice').val(); var total = price * qty; }); $('#totalprice').html(total); }); i have found many examples, not suitable. :-( after entering quantity item price automatically updated. if "0", letter, "empty" or after canceling original price must restored. i "0" val...

modeling - How to store molecule data using SMILES when building a toy chemistry model -

i'm building toy chemistry model based around gillespie's algorithm . starting food set of {h,o,n,c} let system evolve, have been storing molecules strings in smiles format. for instance: [o] reacts [h] --> [o] ([h]) [o] ([h]) reacts [h] --> [o] ([h]) ([h]) using square brackets i've been able keep molecules in system consistent smiles interpretation. however system of storage allowing me construct linear molecules. how can create, instance, carbon ring, interpreted in smiles ring of carbon atoms, without hydrogen atoms? for instance c1ccccc1 gives http://www.chemicalize.org/structure/#!mol=c1ccccc1&source=calculate how generate 6 carbon atoms in ring without 12 hydrogen?

c# - Server Error in '/' Application 4 -

this question has answer here: response not available in context 3 answers response not available in context. how can solve problem need please tried solve couldnt website work on local host when upload host doesnt work me please { response not available in context. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.web.httpexception: response not available in context. source error: unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below. stack trace: [httpexception (0x80004005): response not available in context.] system.web.httpcontext.get_response() +8820296 asp.global_asax.application_start(object se...

c# - Update Graph while picking values from the database -

i trying pick values database , keep updating graph there . using how update gui thread in c#? code is: private void button1_click(object sender, eventargs e) { string myconnection = "datasource=localhost;port=3306;username=root;password=root"; mysqlconnection condatabase = new mysqlconnection(myconnection); mysqlcommand cmddatabase = new mysqlcommand(" select * data.test; ", condatabase); mysqldatareader myreader; this.invoke((methodinvoker)delegate { try { condatabase.open(); myreader = cmddatabase.executereader(); while (myreader.read()) { this.chart1.series["series1"].points.addxy(myreader.getstring("datetime"), myreader.getint32("temp")); ...

Can you define your own self-closing tag in HTML5? -

i have read this topic, still have doubts. there way define void tag? i tried this: <icon class="home"/> (know slash isn't obligatory) but, if there text content after tag ff closes them. <icon class="home"/> go home makes <icon class="home">go home</icon> should define somewhere tag void-element? or impossible html5? this not answer because not address question, did not fit comment section. the / in /> ignored browsers if parsed html5 specs (except foreign elements of mathlm , svg , because elements of modules specs has self enclosing element, there needs stay valid) relevant parts of specs: w3c - hmtl5 - elements w3c - hmtl5 - start tags (the relevant part how browsers should handle missing tags , ignore / missing, need up) if element void element no closing tag generated, because not require one. for other elements closing tag created if missing. if write this: <div...

ios - Creating a completely custom UIRefreshControl -

i need create entirely custom uirefresh control. animation, image, pull down amount, etc... my initial thought start scratch, use uiviewcontroller, add own view it, animate accessing uiscrollviewdelegate methods. i can there way less work , easier add multiple uitableview s? is possible subclass uirefreshcontrol , change amount of stuff inside it? answer updated github project update swift 3.1 updated quartzcode version 1.55.0 (changes on generated code) code refactored use new refreshcontrol property (introduced in ios 10) (also more "swifty" now). included @hanny's suggestion (down below) (thanks!) i youtube link posted. :) nice result. for reference: quartzcode pretty creating uirefreshcontrol animation scratch. check out this little project (github). in it, find quartzcode project file example on how integrate uitableview . i think important part in there refresh function: /// called everytime refresh control's valu...

java - MongoDB accessing query for date is not working -

i storing following object in menus collection. make following query , doesn't find records. please help. thanks in advance. >> menu.java private string menuid; private date startdate; private date enddate; >> store.java dbcollection collection = db.getcollection(collectiontype); string jsonstring = new gson().tojson(object); dbobject dbobj = (dbobject) json.parse(jsonstring); collection.save(dbobj); >> string generated {"menuid":"1","startdate":"jul 12, 2013 8:52:48 am","enddate":"jul 22, 2013 8:52:48 am"} >> query defined startdate < currentdate < enddate basicdbobject query = new basicdbobject("startdate", new basicdbobject("$lte", abstractjson.getdate(days))).append("enddate", new basicdbobject("$gte", abstractjson.getdate(days))); { "startdate" : { "$lte" : { "$date" : "2...

if statement - If exists in mysql not working -

if exists (select * pages pages.id = 21) update `pages` set `content`='updated' (`id`='21') else insert `pages` (`subject_id`) values ('102') not working problem try this insert `pages` (`subject_id`) values ('102') on duplicate key update `content`='updated' `id`='21'

graph - How to plot exponential function on barplot R? -

Image
so have barplot in y axis log (frequencies). eyeing it, appears bars decrease exponentially, know sure. want plot exponential on same graph. thus, if bars fall below exponential, know bars decrease either exponentially or faster exponential, , if bars lie on top of exponential, know dont decrease exponentially. how plot exponential on bar graph? here graph if helps: if you're trying fit density of exponential function, should plot density histogram (not frequency). see this question on how plot distributions in r. this how it. x.gen <- rexp(1000, rate = 3) hist(x.gen, prob = true) library(mass) x.est <- fitdistr(x.gen, "exponential")$estimate curve(dexp(x, rate = x.est), add = true, col = "red", lwd = 2)

javascript - Like Button social plug in code not working for browser..! -

hi trying run same code on jsfiddle.net , working abs fine. when run code under body tag in browser shows no result , error in chrome console: in end want same html file in webview on android can page.! failed load resource file://connect.facebook.net/en_us/all.js#xfbml=1&appid=415120148602947 think javascript not running. code goes this: <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/all.js#xfbml=1&appid=415120148602947"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-like" data-href="http://developers.facebook.com/docs/reference/plugins/like" data-send="false" data-width="450" data-show-faces="true"></div>

php - get an error before I go further in the code -

this how download category down database , use opportunity click on 3 of them, example if take 2 of them , click on them , click on last go html code , write in value = "hello", write database though have not entered words in database. the problem how do in have written here: $godkendtekategorier = array("frontend", "backend", "design"); $kategorier = explode(",", $_post["kategori"]); foreach($kategorier $kategori) { if(!in_array($kategori, $godkendtekategorier)) { echo "error"; } } it should such go ahead if these fit code write before, should not proceed second part of code if there errors other! <?php if(isset($_post["opret"])) { if($_post["title"] == "") { echo "husk @ skrive title!"; } elseif($_post["tekst"] == "") { echo "husk @ skrive te...

html - Change color of selected cell in a gridview _RowCommand() -

i have gridview of 10 rows , 3 columns. want change color of cell when clicked. if user clicks again, remove color. by code have row number stored in index . protected sub gridview6_rowcommand(byval sender object, byval e system.web.ui.webcontrols.gridviewcommandeventargs) handles gridview6.rowcommand dim index integer = convert.toint32(e.commandargument) // here want change selected cell color finally found trick. not sure if right way yeah worked me. protected sub gridview6_rowcommand(byval sender object, byval e system.web.ui.webcontrols.gridviewcommandeventargs) handles gridview6.rowcommand dim index integer = convert.toint32(e.commandargument) dim r gridviewrow = gridview6.rows(index) dim cell1 button = r.cells(0).controls(0) dim c1 string = rtrim(cell1.text) dim cell2 button = r.cells(1).controls(0) dim c2 string = rtrim(cell2.text) dim cell3 button = r.cells(2).controls(0) dim c3 string = rtrim(cell3....

javascript - Multiplication of decimal values -

im experiencing weird problem. im trying multiply 2 decimal values, result integer/rounded number. if add decimals (for example tofixed(2), adds zeroes). here script: $(document).ready(function () { $('.txtquantity, .txtrate').change(function () { var txtquantity = $('.txtquantity').val(); var txtrate = $('.txtrate').val(); var total = parsefloat(txtquantity) * parsefloat(txtrate); $('.txttotal').val(total); }); }); and here html: <table> <tr> <td><input type="text" class="txtquantity" /></td> <td><input type="text" value="12,3" class="txtrate" /></td> <td><input type="text" disabled="disabled" class="aspnetdisabled txttotal" /></td> </tr> </table> here fiddle what missing? must trivial. thanks use decimal point . instead of comma ( , ) par...

winapi - infinite loop inside the getmessage (DispatchMessage(& msg ); is not working) -

i creating button application using resource editor. after creating button try this- m_hwndpreview = createdialogparam( g_hinst,makeintresource(idd_maindialog), m_hwndparent,(dlgproc)dialogproc, (lparam)this); if (m_hwndpreview == null) { hr = hresult_from_win32(getlasterror()); } msg msg; bool bret; while ( (bret=getmessage (& msg,0, 0,0)) != 0) {// msg contains data -msg = {msg=0x0000c03e wp=0x0000000000000012//always 12 don't know why ?? lp=0x0000000000000000} if (bret == -1) { bret = hresult_from_win32(getlasterror()); messagebox(null, l"hurr error",l"error",mb_iconerror | mb_ok); } else if (!isdialogmessage (m_hwndpreview, & msg)) { translatemessage (&msg); //on debugging translatemessage = 0x000007feee615480 translatemessage dispatchmessage(&...

backbone.js - How to do multiple models in the same page using backbone and RequireJS -

i developing aplication single page. i'm using backbone.js , requirejs. problem on 1 page use 3 different models not interrelated. loads first. page.html <html><heade></heade><body> <div id="content"> <div id="results"></div> <div id="collectortable"> <!-- container gets populated index --> </div> <div id="collectoredition"> <!-- container gets populated edition --> </div> <div style="margin-top: 10px"> <div id="terms" style="width: 50%; float: left; height: auto !important; min-height: 100px;"> <div id="termtable"><!-- term model index --></div> <div id="termedition"><!-- term model edition --></div> </div> <div id="termscampaign" style="width: 50%; f...

ios - Dependency Analysis Error, XCode 4.6 -

Image
i'm trying run project developed in ios 4 in xcode 4.6. running on iphone 4. i error: check dependencies no architectures compile (archs=armv7 armv7s, valid_archs=armv6 i386). i've updated build settings following: but still same error. suggestions! turns out had 2 targets. needed change build settings 2nd target.

Adding CCS, Javascripts and PHP files into Joomla websites -

i quite new joomla , have come across problem annoys me programmer alot! now ive been watching several tutorials on-line , of them state "its easy non programmers create website joomla" while that's fine , there seem few tutorials show "powers" have if infact have programmering experience. here problem: i want able add php, javascripts css , html site have stumbled across jumi far know allows me add scripts articles , modules. here example of want achieve: i buy , use template @ themeforest want create search bar using html , php, when using search option site run script , load result table using combination of jquery , html. other wish create session when user example tries purches items on site saved , site remembers users choices. now not except guys have answers simple redirect tutorial, paper or other place can learn how make work make me gratefull. question update so think question abit hard understand ive made update: maybe have...

javascript - Chrome uncaught error with no details? -

Image
i error without other info (not type of error is) , cannot figure out it's at, because doesn't line of code has error. firefox doesn't show errors in code. i'm using google maps api , jquery in code. any appreciated! you may have syntax error in codes. can check codes intelligent ide netbeeans. checks codes dynamically , reports errors. please try enable firefox script tab.

python - Scapy problems when importing modules -

i started programming in python , scapy. when use scapy.all import * doesnt work , exception importerror: no module named 'base_classes'. finding folder all, cannot find base_classes. verified base_classes in there. in extend, import scapy.all.base_classes finds there base_classes in there when execute stil error. should do? verified version of scapy , 2.x. thank martinos i ran similar issue once , because wasn't using right version of python , right python path. i solved adding right classes path in beginning of script using import sys sys.path.append("/home/me/mypy") it's bit ugly worked.

Joomla homepage, adding a module as cta -

i have been tasked add 3 images homepage in joomla. the homepage has 3 cta boxes , need add 3 below them, containing images. the existing call actions seem modules, tried creating 1 of same type , assign next available position, didn't work. any ideas of how add them? thank in advance!!

uinavigationcontroller - Adopting a side menu in iOS app. View controllers structure issue -

Image
i'm designing app intended have following navigation structure: need have welcome view "sign up" , "sign in" buttons of apps have: this view not show navigation bar, seems common thing. if "sign in" tapped, login view presented modally: and if "sign up" tapped, welcome view navigates form requesting user input create account: then, once user logs in , enters app, i'd want have side menus similar facebook, youtube or spotify: being central panel uinavigationcontroller . left side panel think 'uiviewcontroller'... the point is, don´t know rootviewcontroller of app should be, , hierarchy of view controllers should have. i've thought couple of possibilities: 1) being rootviewcontroller uinavigationcontroller , push welcome view hidding navigation bar (is possible?), presenting "sign in" view if needed or pushing "sign up" view. once user has logged in, pop these views rootviewcontrolle...

c++ - Is it a good idea to use zlib as database -

i want know whether idea have program option in zlib. well point this: program has lots of configuration files, they're updated concurrently different threads. requirement, files need sort of checksum , of them must encrypted. my idea have compressed folder in way it's more difficult other people discover files for. so idea encrypt , compress them? compression after encryption bad idea. why? because encryption looks pure random numbers - , pure random numbers don't compress. amusingly enough results of compression should pure random numbers - because isn't random is, in theory, compressible. still - idea of encryption prevent unwanted decrypting whereas compression designed uncompressed.

javascript - Jasmine - How to spy on a function call within a function? -

the following in controller: $scope.addrangesandsquare = function() { $scope.addleftrange(); $scope.addcentersquare(); $scope.addrightrange(); } and want spy on $scope.addleftrange() , when $scope.addrangesandsquare called $scope.addleftrange() : it('expect addleftrange called after calling addrangesandsquare', function () { spyon(scope ,'addrangesandsquare'); spyon(scope, 'addleftrange'); scope.addrangesandsquare(); expect(scope.addleftrange).tohavebeencalled(); }); how can done? by default, when use spyon jasmine , mocks function , doesn't execute within it. if want test further function calls within, you'll need call .andcallthrough() , so: spyon($scope, 'addrangesandsquare').andcallthrough(); that should it.

css - Can I stop IE 8 from rendering pages in Quirks Mode when I can’t alter their HTML? -

i designing html website within company website , having serious pain ie 8 enters quirks mode. using several css , javascripts format html. i have googled solutions move quirks mode internet explorer 8 standards mode, involved adding following lines: <!doctype html> @ beginning of html <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> in <head> tag. however, since html embedded within company html, , company html begins line: <html xmlns:o="urn:schemas-microsoft-com:office:office" dir="ltr"> internet explorer automatically launches quirks mode , rearranges formatting despite previous solutions have used. and since not have access/control on company html, unable add <!doctype html> beginning of company html. for circumstance, there can force ie8 not load quirks mode? have thought of writing c# program force reload ie8 standard mode, unsure if efficient. if wrap document ...

volusion - With jquery remove both a span and the next 2 characters -

i trying remove element volusion page don't have access large parts of code. can remove stuff using jquery, there elements outside of span can't rid of. <span class="pagetext_l329n">quantity in stock</span>:6<meta itemprop='availability' content='instock'> i can use $("span.pagetext_l329n").remove(); to rid of "quantity in stock" section, :6 doesn't have own container. parent div sitting in has lot of other stuff in don't want touch. there way remove span , following several characters? or separately select :6 , remove without container? working demo http://jsfiddle.net/tubxc/1 js $(document).ready(function () { var text = $('.pagetext_l329n')[0].nextsibling; $(text).remove(); }); new js user2592238 $(document).ready(function () { $("body:contains('quantity in stock')").each(function () { var text = $(this).text(); te...

Figure out next page in pagebeforehide event - jQuery Mobile -

i have app lists number of objects and, having selected 1 allows various facets edited drilling down detail pages. implemented multiple pages in single html file. if model objects cars page hierarchy might this: carlistpage singlecaroverviewpage carenginedetailspage carcolourdetailspage i'd prompt user save changes car exit singlecaroverviewpage heading back main carlistpage. i've looked @ handling "pagebeforehide" event on singlecaroverviewpage triggers transition forward detail pages. best point hook handler in? thanks in advance help i think should - $('#singlecaroverviewpage').on('pagebeforehide', function(event, data){ if (data.nextpage.attr('id') == 'carlistpage'){ // handle stuffs here } }); you - $('#singlecaroverviewpage').on('pagebeforechange', function(event, data){ if (data.nextpage.attr('id') == 'carlistpage'){ // handle stuffs he...

c# - FirstOrDefault returning Unexpected Value -

when set default value if set empty , call .firstordefault() condition isn't met i'm not getting default value, type's default value: int[] list = { 1, 2, 3, 4, 5 }; console.writeline(list.defaultifempty(1).firstordefault(i => == 4)); // outputs 4, expected console.writeline(list.defaultifempty(1).firstordefault(i => > 5)); // outputs 0, why?? this seems unintuitive since i'm setting .defaultifempty() 1. why doesn't output 1? you appear misunderstand how defaultifempty works. list.defaultifempty(1) returns singleton sequence containing 1 if source collection ( list ) empty. since list not empty, has no effect , source sequence returned. as result, query same as: int result = list.firstordefault(i => > 5); the default of int 0 firstordefault returns 0 if condition not met, not since list contains no elements greater 5. you can behaviour want using: int result = list.cast<int?>().firstordefault(i => >...

android - How to add new layout below this layout? -

how divide screen half?? how add image below layout? capture full screen want add bwlow layout 1 more layout contain textview or images how that? want devie full screen half , add new latout below layout how that?? image http://imgur.com/dlxcocu screen http://imgur.com/4wrxonf <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/db1_root" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#333333" android:orientation="horizontal" > <linearlayout android:layout_width="0dp" android:layout_height="match_parent" android:layout_marginbottom="1dp" android:layout_margintop="1dp" android:layout_weight="1" android:background="#ffffff" android:orientation="vertical" > <imageview android:id="@+id/imageview1" ...

matlab - Undefined function 'squareform' for input arguments of type 'double' -

i have matrix w , in matlab of type double , upon trying run w_sf=squareform(w)'; following error: undefined function 'squareform' input arguments of type 'double'. i tried running squareform after converting w float using single(w) , , still same error squareform . exact type must convert w into, , how?

html - Sticky footer, bootstrap and multi-columns combination -

im using combination of ryan faits sticky footer , twitter bootstrap. can twitter boostrap work sticky footer fine, when have multicolumns, cant set height:100% force panels touch footer. /* style.css */ body { background-color: #eeeeee; } .footer { background-color: #fff; } #left-panel { height: 100%; background-color:#f00; } #center-panel { height: 100%; background-color:#ff0; } #right-panel { height: 100%; background-color:#0ff; } <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>test</title> <!-- start bootstrap css , js --> <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="/bootstrap/css/bootstrap-responsive.min.css" type="text/css" /> <script type="text/javascript" src="/bootstrap/js/bootstrap.min.js...

c# - Path.GetTempPath() always returns %USERPROFILE% -

i've written program calls system.io.path.gettemppath() function. documentation i've read (like one) says function should return first path found list: the path specified tmp environment variable. the path specified temp environment variable. the path specified userprofile environment variable. the windows directory. i have defined both tmp , temp environment variables %userprofile%\appdata\local\temp , call gettemppath() returns %userprofile% directory instead of values i've define tmp , temp . how can function return temporary directory i've defined? that environment setting. http://msdn.microsoft.com/en-us/library/77zkk0b6.aspx var tmp = environment.getenvironmentvariable("tmp"); update: went command prompt , did set tmp=c:\temp then launched visual studio command prompt. environment updated , visual studio sees it. code above (as yours) worked me. displayed updated environment settings. so believe have kill explore...

heroku - Mysql and Nitrious IO -

i created rails box in nitrous io. rails boxes come predefined use sqlite3 want use mysql2. since can't use mysql box because fires error can't connect socket, can connect box free database service in heroku. created account in heroku, , logged in box heroku. having problems linking database (cleardb) rails box in nitrousio, since show procedure link postgres db. my database.yml file has following: development: adapter: mysql2 encoding: utf8 database: testdb_development pool: 5 username: root password: host: localhost did configure development settings within database.yml file? need change host, username, , password fields listed above match settings of cleardb. here post states how retrieve host database url: remote connect cleardb heroku database on top corner click on addons , select cleardb mysql database. once there, click on database , choose 'endpoint information' tab. there see username/password. url database can acquired run...

java - Tomcat Server in Eclipse and Virtual Machines -

i have question concerning tomcat server on 2 modules running @ same time. seperate virtual machine used every module or on one? i haven't had luck searching on web, if answer grateful. thank you only 1 virtual machine run.

TeamCity share build number between multiple build configurations -

i looking way share build number between multiple build configurations. goal have global counter of sort , build configurations incrementing , use in own build number. if 1 of build configurations has snapshot or artifact dependency on build configuration b, can obtain build number b in of dependency parameter: %dep.<b id>.build.number% where <b id> id of build configuration b (see buildtypeid parameter in url).

haskell - Conversion between different eDSLs (different type class constraints) -

i'm trying "compile" simple edsl atom language. problem arises here is, type class constraints on types/functions not match of atom language. one edsl compiles atom copilot , has same problem solves in rather verbose way. follows simplified version of involved datatypes: {-# language gadts #-} data type tfloat :: type float data op1 b neg :: type -> op1 a class nume instance nume float data exp e eneg :: nume => exp -> exp type , op1 part of new edsl, nume , exp belong compilation target. convert between edsls @ point need function op2exp following type: op2exp :: op1 b -> exp -> exp b now way atom handles rather verbose : data numeinst e = nume e => numeinst numeinst :: type -> numeinst numeinst tfloat = numeinst op2exp :: op1 b -> exp -> exp b op2exp op = case op of neg t -> case numeinst t of numeinst -> eneg this works, quite cumbersome , full of repetition. question: is there way,...

Haskell Read (no instance) -

i haskell beginner , have weird question. until has been going great, , have been able use prelude read function normally. have declare it's type in order use it. i have declare or similar in order use it. let r = read::string-> int i have tried restarting ghci thinking have accidentally overloaded read whenever try using such read "456" i following error no instance (read a0) arising use of `read' type variable `a0' ambiguous possible fix: add type signature fixes these type variable(s) note: there several potential instances: instance read () -- defined in `ghc.read' instance (read a, read b) => read (a, b) -- defined in `ghc.read' instance (read a, read b, read c) => read (a, b, c) -- defined in `ghc.read' ...plus 25 others in expression: read "456" in equation `it': = read "456" does have ideas causing , how fix it? first, solve problem, specify result expect read in 1 of few ...

cordova - PhoneGap Meteor iOS Push Notifications -

i have used phonegap , deployed ios app takes url of meteor app , convert "webapp" (not sure if accurate). however, implement remote/push notifications apple's servers apns enable app receive notifications, update badges etc... there other means other urban airship? also, chanced upon objectiveddp, https://github.com/boundsj/objectiveddp#requirements , tutorial not working me , frustrating. thank you! you can use phonegap team push plugin ( on github ) allows sending push notifications android , ios. the plugin can integrated via phonegap build site without having use java or objective-c or using java or objective-c.

python - tcpdump to only print urls -

is there way do tcpdump -i lo -a and have print urls, connections made? i have done: sudo tcpdump -i lo -a | grep host: which works great. wondering if there options same in tcpdump finally, there way in python without using sys command or popen/subprocess you can use scapy sniff function , use regex or grep import scapy tcpdump = sniff(count=5,filter="host 64.233.167.99",prn=lambda x:x.summary()) print tcpdump change filter filter text :) or maybe want save traffic , see in wireshark wrpcap("temp.cap",pkts)

debugging - How to remote debug on chrome mobile on IOS devices -

anyone here knows if it's possible remote debug on chrome mobile on ios devices? have site div 100% width , height , position fixed. reason element stays @ wrong position. i know it's possible debug safari problem happens on chrome , on ios devices. thanks angelo you can use weinre . instructions on how use available @ link below. https://developer.mozilla.org/en-us/firefox_os/platform/gaia/weinre_as_remote_debugger it worked me on mac/iphone/chrome it works on mac/android/chrome , firefox browsers too. if code/files on remote device, make sure run tool (weinre) on remote system.

language agnostic - Text parser and output converter -

i want more efficient , save time when coding. here idea not know solution to: (note: beginner , open programming languages suggest.) let´s assume have text data. have special chars @ beginning , @ end of keyword. firstly need parse text data , insert them text file. for example this: have text $method1$ §text1§ $method2$ §text2§ the text between chars $$(here method1 , method2) , text between §...§(here text1 , text2) found program , inserted template: method1() { print.text1}; method2() { print.text2}; does such program exist? if not have no idea how approach making one. appreciate every hint , help. you can make programming language believe. really, can use language like. prefer ruby this, perl great parsing type of thing. great if give sample of actual file parsing. really, programming language choice you, , whichever choose can google "regular expressions" , name of language figure out how it. if did ruby can this: text.scan(/^\s*$\s/) r...

how can I return values from chained deferreds in jQuery? -

i'm trying trace return value function call: $('#button').on('click', function(){ console.log( getmessage(3) ); // i'm trying "hang" until ajax-related stuff finished below }); the ajaxfetch() below generic ajax handler returns expected ajax deferred object. let's assume it's string value: 'hello' . server response several seconds. function getmessage(id){ ajaxfetch(id).done(function(result){ // ... more stuff happening, not relevant }).then(function(result){ return (result); // thought return click handler }); } how can trace output 'hello' ? i think... ... console.log() needs somehow set promise i'm having hard time understanding jquery documentation . return promise interface , code logic it: $('#button').on('click', function(){ $.when(getmessage(3)).then(function(result){console.log(result)}); }); function getmessage(id){ return ajaxfe...

Horizontal Bullets Showing In jQuery UI Tabs (IE 8 Only) -

Image
i'm getting weird bullet in ie 8 on jquery tabs. it's showing image displays below. bullet disappears if click on tab. can help? thanks. maybe of yours li ? try set list-style-type:none ul

Parse IIS Document root through ASP.NET and get Last Modified date of the files -

i using asp.net my task loop through folders , files of document root c:\inetpub\wwwroot find .aspx files have been modified during last 7 days => grab value of "title" node files => output value of "title" , last modified date. any direction code samples appreciated. thanks hayk. here solution wrote above question: using system.collections; using system.collections.specialized; using system.xml; using system.globalization; using system.io; using system.net; using system.configuration; using system.data; using system.data.sqlclient; using system.web; using system.web.security; using system.web.ui; using system.web.ui.htmlcontrols; using system.web.ui.webcontrols; using system.web.ui.webcontrols.webparts; using system.linq; using system.xml.linq; using system.collections.generic; using system.text.regularexpressions; public partial class directoryiterator : system.web.ui.page { public void generatelinks(string webpath, int linkcoun...

Disable cross domain web security in Firefox -

in firefox, how do equivalent of --disable-web-security in chrome. has been posted lot, never true answer. links add-ons (some of don't work in latest firefox or don't work @ all) , "you need enable support on server". this temporary test. know security implications. i can't turn on cors on server , never able allow localhost or similar. a flag, or setting, or lot better plugin. tried: http://www-jo.se/f.pfleger/forcecors , must wrong since requests come empty, same requests in chrome come fine. again, testing before pushing prod which, then, on allowable domain. almost everywhere look, people refer about:config , security.fileuri.strict_origin_policy. network.http.refere.xoriginpolicy. for me, none of these seem have effect. this comment implies there no built-in way in firefox (as of 2/8/14).

go - smtp won't work in production, Unauthenticated even with credentials -

i having hell of time here. code works on local instance (osx) config: mail.host = smtp.gmail.com mail.port = 25 mail.from = mysite.com mail.username = email@gmail.com but says unauthenticated in production (ubuntu 12.0.1): here code (and can find of @ github.com/tanema/revel_mailer). authentication error thrown @ c.mail(username) line. func (m *mailer) send(mail_args map[string]interface{}) error { m.renderargs = mail_args pc, _, _, _ := runtime.caller(1) names := strings.split(runtime.funcforpc(pc).name(), ".") m.template = names[len(names)-2] + "/" + names[len(names)-1] host, host_ok := revel.config.string("mail.host") if !host_ok { revel.error.println("mail host not set") } port, port_ok := revel.config.int("mail.port") if !port_ok { revel.error.println("mail port not set") } c, err := smtp.dial(fmt.sprintf("%s:%d", host, port)) if err != nil { return err } ...

csv - c++ explore a dataset stored in a std::vector with bilinear interpolation -

i have vector std::vector <int> density; stores set of values imported input.csv file. the values varying between 0 , 2^16, , ordered on regular grid of int c columns , int l lines. now, want use bilinear interpolation compute new set of values std::vector <float> d these new values arranged in regular grid of int x columns , int y lines. . my problem: to perform bilinear interpolation based on squared grid of data have know each position (x,y) local 4 surrounding density values for: d1 (c,l), d2 (c,l), d3 (c,l), d4 (c,l) in other words, each interpolated point of d position (dx,dy) - dx , dy being inferior or equal 1 - located within squared "cell" of original dataset defined 4 density values relative position (c,l) original grid. how can define, arbitrary position (dx,dy) within range of c , l (not outside grid!) 4 surrounding density values d1, d2, d3, d4 ? and how can define, within (d1, d2, d3, d4) cell, positions (u...