Posts

smtp - Understanding MX records with C# -

i missing piece of understanding how mail transfer works in order implement it. i want implement smtp server, receives email message client, looks recipient mx record of domain in order deliver there. what don't understand happens next, connect domain ip? port? the example looking @ gmail, mx server gmail-smtp-in.l.google.com, program need connect domain on port? thank you read: http://www.ietf.org/rfc/rfc5321.txt short answer: when delivering email. mx records of domain name in question. if mxs exist for domain attempt connect them via port 25 , deliver mail per rfc above. connect them in order of preference listed. lower numbers have higher preference. if equi-cost mx's present, free pick 1 @ random. if 1 doesn't answer try same weight mx before going higher in chain. if no mxs answer queue mail , try again.. if no mxs exist try deliver 'a' record on know port of 25 (smtp). but really, read rfcs , become familiar them, out lot...

jquery - Found elements in a string -

say have script $.get('test.html', function(data){ //data }); how can find div specific class inside data ?? use data context argument $(selector, context) , this: $.get('test.html', function(data){ $("div.someclass", data) });

javascript - Button onclick only checkes the first appended checkbox -

with script below append 3 elements when append button clicked. a checkbox input text field delete button for now, when delete button clicked checkbox checked, when append (let's call group) 3 items, script doesn't work. can explain how can link elements in sort of way. every time click append button elements linked elements created @ same time same on click. thank in advance <html> <head> <script language="javascript"> function append() { var cb = document.createelement("input"); cb.type = "checkbox"; cb.id = "id" cb.checked = false; var textfield = document.createelement("input"); var delbtn = document.createelement("input"); delbtn.type = "button"; delbtn.value = "remove"; delbtn.onclick= function(){remove()} document.getelementbyid('append').appendchild(cb); document.getelementby...

Need help getting started on Facebook C# API -

i'm trying create new facebook iframe application using asp.net , c#, , can't find getting started guides. i'm looking extremely basic intro - i.e. .dll files put, code use authorize , userid, etc. once structure started i'll able figure out...but can't make basic connection facebook! a simple sample app extremely helpful. thank much! many people have tried use facebooktoolkit , failed miserably. don't take word it, through forum going months. adoption microsoft didn't add value project imo going die @ point own weight. the sdk provided facebook hackathon project announced 6 months ago , doesn't seem have been updated since. it's tough imagine company of facebook's size , stature being incompetent, let's face it, have political bent microsoft-adverse, it's no wonder haven't put effort helping side of world of development. i helped bit on fbgraph.net project which, while noble effort, has been retired. search in...

Eclipse PDT isn't highlighting PHP syntax in .html files? -

so, i'm doing code maintenance , our php codes embedded in html files. eclipse isn't highlighting of php codes in html file. does have ideas how this? i've tried looking in preferences , google ninja skills fail me. thank in advance. window > preferences > general > content types under "text" find "php content type" add "*.html" close file , reopen again. restart eclipse won't work, since whatever .html file have been open when restart appear again. had close .html file tab viewing , reopen it. thanks again!

.net - c# pointers vs IntPtr -

this 2nd part of 1st question using c# pointers so pointers in c# 'unsafe' , not managed garbage collector while intptr managed object. why use pointers then? , when possible use both approaches interchangeably? the cli distinguishes between managed , unmanaged pointers. managed pointer typed, type of pointed-to value known runtime , type-safe assignments allowed. unmanaged pointers directly usable in language supports them, c++/cli best example. the equivalent of unmanaged pointer in c# language intptr . can freely convert pointer , forth cast. no pointer type associated though name sounds "pointer int", equivalent of void* in c/c++. using such pointer requires pinvoke, marshal class or cast managed pointer type. some code play with: using system; using system.runtime.interopservices; unsafe class program { static void main(string[] args) { int variable = 42; int* p = &variable; console.writeline(*p); ...

entity framework - update foreign key after primary key creation -

i have following scenario (simplified) using linq ef 3.5 var datarepos = new entities(); var query = product in datarepos.products group product product.categoryid agg select new { category = agg.key, sumtotal = agg.sum(x => x.unitprice) }; foreach (var row in query) { var newpos = new summary() { category = row.category, total = row.sumtotal }; } the summary class represents database table , each time row added table’s primary key increments. need update relevant rows in products table newly generated id summary table i.e. update foreign key (which has default value of zero). the number of rows involved significant. best approach here in terms of efficiency?