Posts

Select meta tag using c#? -

this xml want select meta tag <meta charset="utf-8"> <title>gmail: email google</title> <meta name="description" content="10+ gb of storage, less spam, , mobile access. gmail email that&#39;s intuitive, efficient, , useful. , maybe fun."> <link rel="icon" type="image/ico" href="//mail.google.com/favicon.ico"> i doing this string texturl = textbox2.text; string url = "http://" + texturl; htmlweb web = new htmlweb(); htmlagilitypack.htmldocument doc = web.load(url); var spannodes = doc.documentnode.selectnodes("//meta"); if (spannodes != null) { foreach (htmlnode sn in spannodes) { string text = sn.innertext; ...

Laravel 4 Javascript Link using {{Html}} -

is there laravel4 html() function or way add disabled link. of course create <a> tag directly, though i'd prefer consistent. ie: {{ html::link('javascript:;','delete',array('id'=>"deletebt")) }} you must use link_to , example : link_to('link', 'title', array('id' => 'myid'));

jquery - How do I get the Full URL from SPListItem (curren item)? -

this code, don't know field url. can url different way? var f = "<viewfields>"+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ "</viewfields>"; it easy, hard find. var f = "<viewfields>"+ '<fieldref name="id"/>'+ '<fieldref name="title"/>'+ '<fieldref name="linkfilenamenomenu"/>'+ '<fieldref name="created"/>'+ '<fieldref name="encodedabsurl"/>'+ "</viewfields>"; $().spservices({ operation: "getlistitems", async: false, listname: list, camlviewfields: f, camllimit: l, camlquery: q, completefunc: funct...

java - Trouble sorting numbers from smallest to largest in an array -

this 1 of first posts on here not sure if posting correctly. need trying put population of states in order smallest largest comes separate file. program outputting states in alphabetical order. file set below. expected input: alabama,4779736 alaska,710231 arizona,6392017 class attempts sort: public class inorder { /** * @param args * @throws ioexception */ public static void main(string[] args) throws ioexception { // todo auto-generated method stub printwriter prw = new printwriter("outfile.txt"); file f = new file("census2010.txt"); if (!f.exists()) { system.out.println("f not exist "); } scanner infile = new scanner(f); infile.usedelimiter("[\t|,|\n|\r]+"); final int max = 50; int[] myarray = new int[max]; string[] statearray = new string[max]; int fillsize; fillsize = fillarray(myarray, statearray,...

jquery - Combining promises with Q -

in jquery, can combine promises follows: var promise = $.when(func1.execute(), func2.execute()); promise.done(function (data1, data2) { // code here } how rewrite using q? also. benefits of using q in scenario on jquery? simple answer: var promise = q.all([func1.execute(), func2.execute()]); promise.spread(function (data1, data2) { // code here }) .done(); annotated: //make `promise` promise array var promise = q.all([func1.execute(), func2.execute()]); //use spread spread array across arguments of function promise.spread(function (data1, data2) { // code here }) //use done errors thrown .done(); the concepts in q more defined. promise represents single value may not available yet. parallels synchronous code precisely. to represent multiple values then, use array. q.all helper method takes array of promises, , returns promise array containing fulfilled values. if promise in array rejected, resulting promise rejected. because in case know how l...

c# - How to Use a Compare Validator with DateTime.Today against TextBox.Text? -

goal: have 'enddate' textbox updates upon user changing it. want able check/validate date in enddatetextbox.text , make sure less today's date (in format ex: 4/19/2013). i've tried 2 methods: method one <asp:textbox id="hiddentodaydate" visible = "false" runat="server" /> <asp:comparevalidator id="compareendtodayvalidator" operator="greaterthan" type="date" controltovalidate="hiddentodaydate" controltocompare="enddatetextbox" errormessage="'end date' must before today's date" runat="server" /> and following in page_load method: hiddentodaydate.text = datetime.today.toshortdatestring(); method two <asp:hiddenfield id="hiddentodaydate" runat="server" /> <asp:comparevalidator id="compareendtodayvalidator" operator="greaterthan" type="date" controltovalidate...

arrays - Bash: Save and restore trap state? Easy way to manage multiple handlers for traps? -

what way override bash trap handlers don't permanently trample existing ones may or may not set? dynamically managing arbitrary chains of trap routines? is there way save current state of trap handlers can restored later? save , restore trap handler state in bash i submit following stack implementation track , restore trap state. using method, able push trap changes , pop them away when i'm done them. used chain many trap routines together. see following source file (.trap_stack.sh) #!/bin/bash trap_stack_name() { local sig=${1//[^a-za-z0-9]/_} echo "__trap_stack_$sig" } extract_trap() { echo ${@:3:$(($#-3))} } get_trap() { eval echo $(extract_trap `trap -p $1`) } trap_push() { local new_trap=$1 shift local sigs=$* sig in $sigs; local stack_name=`trap_stack_name "$sig"` local old_trap=$(get_trap $sig) eval "${stack_name}"'[${#'"${stack_name}"'[@]}]=$old_trap' trap...