Posts

Showing posts from February, 2011

javascript - Table is not refreshed with knockoutjs -

i using knockoutjs simple 2d array table binding. table gets rendered ok, click function gets fired ok , rightindex getting updated. ui doesnt refresehd. this code: the html: <table> <tbody data-bind="foreach: representation "> <tr data-bind="foreach: $data, click: $parent.clickme"> <td data-bind="text: $data "> </td> </tr> </tbody> </table> the js: $(function () { var viewmodel = function () { var self = this; self.clickme = function (data, event) { var target; if (event.target) target = event.target; else if (event.srcelement) target = event.srcelement; if (target.nodetype == 3) // defeat safari bug target = target.parentnode; self.representation()[target.parentelement.rowindex][target.cellindex] = 1; }; self.representation = ko.

c++ - Calculating the angle between Points -

Image
working c++ , opencv i trying calculate angle between 2 points.....i have 2d plane changing center point of bounding box, if center point in frame 1 has changed location in frame 2 need find angle of these 2 points. here example of trying do: can suggest way of working out.......? kind of mathematical solution or perhaps c++ function. use dot product : v1.v2 = v1.x * v2.x + v1.y * v2.y v1.v2 = |v1| * |v2| * cos(theta) ---------------------------------+ | +--> theta = acos(v1.v2 / |v1|*|v2|) a sample code is: float anglebetween(const point &v1, const point &v2) { float len1 = sqrt(v1.x * v1.x + v1.y * v1.y); float len2 = sqrt(v2.x * v2.x + v2.y * v2.y); float dot = v1.x * v2.x + v1.y * v2.y; float = dot / (len1 * len2); if (a >= 1.0) return 0.0; else if (a <= -1.0) return pi; else return acos(a); // 0..pi } it calculates

c# - need to get a page heading -

this code when displays, has page heading of main form, how can page heading page? <asp:content id="content1" contentplaceholderid="maincontent" runat="server"> <table cellpadding="5" cellspacing="5" border="0"> <tr> <td colspan="2" style="width:100px;"> <dx:aspxlabel id="aspxlabel1" runat="server" text="facility name:"></dx:aspxlabel> </td> <td colspan="9"> <dx:aspxtextbox id="tbfacility" runat="server" width="800px"></dx:aspxtextbox> </td> </tr> <tr> <td colspan="2"> <dx:aspxlabel id="aspxlabel3" runat="server" text="resident name:"></dx:aspxlabel>

component services - Getting a Catalog Error when trying to export a COM+ library -

we've got old vb6 com+ component that's running on 64-bit, windows 2003 r2 server sp2. need install proxy on new pc , found .msi wasn't there, thought i'd component services , export it. tried, got following error message: "catalog error error occurred while processing last operation. error code 8002801d - library not registered. the event log may contain additional troubleshooting information." well, event log didn't contain additional information. anyway, i'm confused error because several applications around site running using com+ service on server, don't know why library isn't registered. more point, see package in component services on server , it's running. why can't export proxy used on new pc?

javascript - Form submission determiend on Ajax response -

there's form users fill out , click submit button. data gets sent server , based on servers server's response form submitted or not (and page redirected or not). problem form submits , page redirects before server's response received. function submitform(name, data1) { var result; var checkresult = function(result) { alert("final value is: "+result) return result } var xmlhttp if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if(xmlhttp.readystate == 4 && xmlhttp.status == 200) { if(xmlhttp.re

asp.net - Publish to folder disappeared after update 2 - visual studio -

Image
as doing right clicking project clicking publish site below screen appears. no regular publish folder option. this happened after visual studio 2012 update 2 how solve problem ? click drop down menu , create new profile settings want.

html - PHP/MySQL Hide file links -

i using php connect mysql database , customers can login website , lists rows form table based on login etc. i need able display <a href="...."></a> link file name in database don't want users able see link file. for example, can download file 1234.pdf , if can view actual link, might think of going same location doing file 5678.pdf meant user download. so want hide link in long string or i'm not sure start - ideas? thanks edit: lets customer logs in, can view rows table1 table1 customer file_link 1234.pdf 5678.pdf b 8765.pdf b 4321.pdf so, dont want customer able view links customer b. i mean, if customer hovers on link , can see main file path can type in web browser , change file name (guess it) else , download customers file(s) if you're planning on not letting others see file links wouldn't want search engines see them well. typical way of forbidding users trying out

mule - Why won't a REST component not receive a call made internal to an app when multiple Global HTTP Connectors are Configured? -

i'm struggling configure , deploy cloudhub app multiple global http connectors , rest component. my application has 2 flows: 1 polls rss feed news , posts json representation of feed http inbound endpoint in same app (endpoint resides on second flow). second flow receives post, magic, including persisting item storage, , notifies via http outbound endpoint external node.js web app push item via web sockets active clients. i have tried feels dozens of different configurations involving variety of http global connectors , http in , outbound endpoints, can't work. have: a polling http connector an http endpoint referencing above polling http connector rss feed one global connector (we'll call http_one) receive messages @ localhost:${http.port} an http oubound endpoint configured referencing http_one , configured post activity /api/v1/activity an http inbound endpoint configured receive messages /api/v1 , jersey controller sitting behind endpoint takes /a

c# - decoupled WMI Provider for Windows Service -

i had wmi provider , because of design constraints, add decoupled provider windows service (ws). following simple steps like: in windows service solution in vs, have added wmi provider project. set hosting model hostingmodel = managementhostingmodel.decoupled change setup project ws such output dll of provider copied c:\prog...\xyz folder during installation i want decoupled provider work before (all class instances same before - no behavior change). both provider , ws written in c#. have not done registration of provider in ws - need (if yes, how?)? however, when try enumerate class through powershell following error: fullyqualifiederrorid : hresult 0x80041016,microsoft.management.infrastructure.cimcmdlets.getciminstancecommand also, when viewing through process explorer, can see provider dll shown in process ws. why getting error?

jquery - Align two elements -

i have following on plugin: $(this).mouseenter(function (e) { var = $(this); var text = "<div class="text">" + options.text + "</div>" $("body").append(text); }) how align "text" "this" before adding body on following positions: topcenter, bottomcenter, rightmiddle or leftmiddle. thank you! $(this).on('mouseenter', function() { var $this = $(this), text = $('<div />', {'class': 'text', text : options.text, style : 'position : relative; margin : 0 auto; text-align : center;' } ); $("body").append(text); }):

c# - How to convert a windows store app into windows phone 8.0 app? -

i need guide convert working windows store app windows phone 8 app please! you can't automatically. although there might decent amount of code can reuse, winrt/winprt similarities, still need work on platform-specific capabilities (e.g. storage). my colleague, rick barraza, put fantastic guide on moving windows phone application windows 8.

Python: Namespaces with Module Imports -

i learning python , still beginner, although have been studying year now. trying write module of functions called within main module. each of functions in called module needs math module run. wondering if there way without importing math module inside called module. here have: main.py : from math import * import module1 def wow(): print pi wow() module1.cool() module1.py : def cool(): print pi when running main.py get: 3.14159265359 traceback (most recent call last): file "z:\python\main.py", line 10, in <module> module1.cool() file "z:\python\module1.py", line 3, in cool print pi nameerror: global name 'pi' not defined what i'm having hard time understanding why name error when running main.py . know variable pi becomes global main module upon import because wow can access it. know cool becomes global main module upon import because can print module1.cool , <function cool @ 0x02b11af0> . since

java - Importing external library into eclipse - Android -

i want use unifiedpreference library in app. i've imported library workspace, added new project existing project adding library under properties -> android. i'm getting following errors when try build project coming unifiedpreference project: console: [2013-04-08 23:06:29 - unified-pref-library] error: in <declare-styleable> preferenceheader, unable find attribute icon [2013-04-08 23:06:29 - unified-pref-library] error: in <declare-styleable> preferenceheader, unable find attribute title the relevent logcat errors seem be: preferenceheader_title cannot resolved or not field unifiedpreferencehelper.java /unified-pref-library/src/net/saik0/android/unifiedpreference line 435 java problem preferenceheader_title cannot resolved or not field unifiedpreferencehelper.java /unified-pref-library/src/net/saik0/android/unifiedpreference line 299 java problem have imported library incorrectly? i've tried cleaning , building both projects wit

entity framework - Loading preexisting navigation properties of new disconnected entities -

i have new disconnected poco (in case aspnet mvc modelbinder). public class offlineentry { public virtual int id { get; set; } public virtual category category { get; set; } public virtual int categoryid { get; set; } } the foreign key property ( categoryid ) set existing database value navigation reference ( category ) null @ first. right way load navigation reference? expect step 1 add new object context. before savechanges , can use lazy loading, or loadproperty , or have set manually? public contentresult save(offlineentry o) { db.offlineentries.add(o); var categoryname = o.category.name; //? db.savechanges(); return content("ok"); } public class category { public virtual int id { get; set; } public virtual string name { get; set; } //optional 2-way nav property } i hoping else jump on expert, 1 issue see you're going have instance of offlineentry not created dbcontext, , lazyloading isn't going work.

JQuery Ajax settings : Timeout -

i'm using jquery ajax method call service rest api. have added timeout value of 5 seconds service call. $.ajax({ timeout:5000, type:"post", url:"serviceurl", data: fooandstuff, error:function(){}, success:function(data){ console.log(data); } }); this function call. testing when service down , don't think timed out after 5 seconds. because took while , when service returned response. so, i'm trying understand how jquery implements timeout. in error callback function try debug if getting timeout this- error: function(x, t, m) { if(t==="timeout") { alert("got timeout"); } else { alert(t); } } error event handler takes 3 arguments (xmlhttprequest, textstatus, , message) when timeout happens, status arg 'timeout' a working timeout demo : fiddle

extjs - save values as a string array instead of comma delimited string in a custom xtype CQ5 -

i have created custom xtype multiselect, not able understand changes need perform save values string array instead of comma delimited string. currently storing values follows property industry type string value government,healthcare instead, want save information follows property industry type string[] value government,healthcare any suggestions, pointers highly appreciated. cq.ext.form.multiselect = cq.ext.extend(cq.ext.form.field, { store:null, storeurl:'', displayfield:'text', valuefield:'value', allowblank:true, minlength:0, blanktext:cq.ext.form.textfield.prototype.blanktext, copy:false, allowdup:false, allowtrash:false, legend:null, focusclass:undefined, delimiter:',', view:null, draggroup:null, dropgroup:null, tbar:null, appendonly:false, sortfield:null, sortdir:'asc', defaultautocreate : {tag: "div"}, initcomponent: function(){ cq.ext.form.multiselect.superclass.initcomponent.call(this)

entity framework - Get Model schema to programmatically create database using a provider that doesn't support CreateDatabase -

i'm using sqlite provider entity framework 5 doesn't support createdatabase , cannot auto create database. (code first) is there way can obtain model schema @ runtime can create sql "create table" command myself? if not @ runtime, other way obtain schema know how create table properly? thanks! a) obtaining model schema @ runtime part (all earlier posts of mine) see 1 how can read ef dbcontext metadata programmatically? and how check unit test properties mark computed in orm model? also 1 custom initializer programmatic data transformation in ef5 code first migration having said that... the problem see , @ point have data available . i'm quite sure won't able @ time. because able extract info need have dbcontext running - db has constructed etc. etc. in initializer maybe - using different ways info - above not available. b) other way go way of implementing provider, generator etc. (e.g. this post ). way should

jquery - Retrieving text from the <title> element from the <head> in an ajax response -

so i'm pretty sure question has been answered , i've figured out how retrieve text out <title> element stated here , when attempting ajax, firebug responds undefined jquery('title', data).text() . //ajax next page function grab_nextpage(){ var nextpgelement = jquery('.swipe_arrow.right'); var nextpage = nextpgelement.find('a').attr('href'); jquery('.swipe_arrow.right').children('a').addclass('hover'); jquery.ajax({ url: nextpage, datatype: "html", success: function(data){ console.log(jquery('title', data).text()); jquery('title').text(jquery('title', data).text()); } }); } update the data variable success: function(data){} seems contain header/title elements, .text() seems inaccessible although jquery('title', data) comes [object object] (so object seems accessible, contents not).

wordpress - How to store user information and allow user to edit, manage and delete it -

i working on website manage rental properties. users able go page, enter information particular property (address, owner, etc.) , "submit" information. problem having cannot find way manage information, give users ability delete information @ will. done on front end can't think of solution without significant sql injection concerns. ideally information displayed small (x) next each row. i apologize may sound convoluted , vague. user submits information 0 many of rental properties. user goes page (or same page) , can view , manage properties user sells property; deletes 1 or more of properties if can point me in right direction thankful! you can use custom post types properties (you'd have custom post type called property) , meta data storing arbitrary info related each property. that's rough outline of how structure things project this. you'll need fair bit of coding front-end forms, validation, storing/updating/listing data. n

c# - Modify Existing HTML Table -

Image
i have html table request webserver in c#. displaying page in aspx webform. how can add prerequisite based on course id last column in table without hard-coding prerequisite? example of table design below. <tr bgcolor="#e1e1cc"> <td width="7%">003597</td> <td width="5%">01</td> <td width="1%">opt</td> <td width="8%">mt h </td> <td width="16%">2:00 pm - 2:50 pm </td> <td width="17%">08/26/13 - 12/12/13</td> <td width="8%"> <a href="http://www.mnsu.edu/registrar/building.html"target = _blank> <b>tr c124</b> </a> </td> <td width="19%">staff</td> <td width="4%">22</td> <td width="4%">6</td> <td width="4%"><font color="#000000&q

node.js - Homebrew does not think XCode is installed with old XCode and current Homebrew -

i trying install node.js still running osx 10.6.8, , stuck xcode 3 (using 3.2). my first issue, cannot homebrew recognize xcode 3.2. when run brew -v doctor following output (after fixing few other issues): homebrew 0.9.4 warning: setting dyld_* vars can break dynamic linking. set variables: dyld_library_path warning: xcode not installed stuff needs xcode build: http://developer.apple.com/xcode/ i have been able find fixes xcode 4.xx , have not worked me. how point homebrew @ xcode? (i don't understand how should set dyld_library_path ...) when run brew install node told xcode not installed (it is), , error: ioerror: [errno 2] no such file or directory: 'out/release/node' the fixes have seen relate xcode (various xcode-select -switch fixes), have not worked me, these fixes have been xcode 4.xx. when run verbose version, error additionally shows up: creating ./config.gypi creating ./config.mk sh: /usr/bin/usr/bin/xcodebuild: no such file or dir

Combining Multiple Views in Android -

in oncreate android app have: drawview = new drawview(this); view view1 = findviewbyid(r.id.rel_layout); viewgroup biggerview = new linearlayout(this); biggerview.addview((view) drawview); biggerview.addview(view1); setcontentview(biggerview); i'm getting null pointer exception. why that? trying here combine 2 views (into biggerview) adding them each biggerview, can pass view setcontentview. ideas?

android - How to create bar and pie chart using titanium studio? -

i'm new titanium, case create bar , pie chart using titanium studio android device. can give me start on how create bar , pie chart? can create bar , pie chart using titanium only? immanuel, please take @ following links, on this titanium , charts titanium android chart rgraph charts library in titanium mobile how draw pie chart in titanium android app

swing - Is it possible to make some items in the menu to fade in with 500 ms onset delay in Java? -

i have jmenu of 16 jmenuitems, of want 3 items displayed upfront , rest 13 items fade in 500 ms delay. there way animation in java? this not easy sounds. basically thought "i'll attach popup listener popup menu menu items added to"...but apparently doesn't work well. menu popup built dynamically on demand. makes sense, it's still pain. so instead, i've found if wait addnotify can start animation engine. the animation engine simple concept. has javax.swing.timer ticks @ regular interval. coupled start time , duration, can calculate progress of animation , generate alpha value required. the thing left notify interested parties animation has changed , voila... import java.awt.alphacomposite; import java.awt.borderlayout; import java.awt.container; import java.awt.dimension; import java.awt.eventqueue; import java.awt.graphics; import java.awt.graphics2d; import java.awt.event.actionevent; import java.awt.event.actionlistener; import ja

c# - Gridview always return a single row -

i using below code display records in gridview specific filter. if parent less 2 means records display in grid. return single row last datatable dt having more 5 rows.how can solve error try { dataview dv = new dataview(); dv = dt.defaultview; dv.rowfilter = "fld_parent=0"; if (dv.count < 2) { dv_pack.visible = true; dt.defaultview.sort = "fld_type"; grd_pack.datasource = dt; grd_pack.databind(); } } catch (exception ex) { throw; }

devtools - do not show function help document in building R package by roxygen2 -

i using devtools build r package, , there functions not designed visible end-users. however, since these functions involve calling c codes .call , have write @usedynlib above function automatic generation of .rd files. in way, when build package, did not include @export functions, nonetheless appear in document... there way suppress functions if have been documented? thanks! according hadley's comments, use @keywords internal make function invisible end-users. details can found here in wiki pages of devtools .

I am not able to add an event listener to a flycontrols.js instance in three.js -

i switched controls in script writing trackball controls fly controls. added event handler trackballcontrols without problem. controls.addeventlistener( 'change', function () { camerachanged = true; signals.camerachanged.dispatch( camera ); render(); } ); however when tried add event listener flycontrols instance received error: object [object object] has no method 'addeventlistener' i assume flycontrols class doesn't have mechanism add event listeners. wondering how go adding it. flycontrols doesn't have eventdispatcher implemented.

C++ static member variable of type enum won't compile -

i'm trying write class public enum, , private static member variable of enum type. can initialise value of static variable, if try access in class member function, code won't link. here's simple working example compile with: g++ -o testclass.o testclass.cpp but fails when try compile/link main source file with: g++ -o test testclass.o testmain.cpp the error is: undefined symbols architecture x86_64: "testclass::_enum", referenced from: testclass::printenum() in testclass.o ld: symbol(s) not found architecture x86_64 i'm using mac running osx 10.7.5, gcc 4.2.1. testclass.h: #ifndef test_class_h #define test_class_h class testclass { public: testclass() {}; void printenum(); typedef enum {a, b, c} myenum; private: static myenum _enum; }; #endif testclass.cpp: #include "testclass.h" #include <iostream> using namespace std; testclass::myenum _enum = testclass::a; void testclass::printenum()

How to parse Json to a JQuery function and get the values inside the function -

i trying create plugin "bg-rotator" takes parameters in json format: $('.selector').bg_rotator({ 'duration':500, 'delay':5000 }); then in jquery function trying json object , split values: (function( $ ){ $.fn.bg_rotator = function(jsonobj) { var cn = $(this).attr('class'); //get class name var obj = json.parse(jsonobj); //get json object var duration = obj.duration; var delay = obj.delay; }; })( jquery ); this giving me errors , can't find way parse , json values. ideas? thanks this worked: (function( $ ){ $.fn.bg_rotator = function(jsonobj) { var cn = $(this).attr('class'); //get class name var duration = jsonobj.duration; //get json object var delay = jsonobj.delay; }; })( jquery ); json javascript object notation. idea regular javascript objects, can use them regular javascript objects. don't need parse objects unle

jquery tabs not firing after content loaded via ajax -

i have index page, in wich have jquery.js , jquery.tabs.js included. page load content via ajax . content set of tabs, contents , @ bottom of loaded content have call tabs(). in ff works when load content after refreshing index page, , if hit link reload content, stops working. in ie it's not working @ all. these tabs: <ul id="horz-tabs"> <li><a href="#tab1">tab1</a></li> <li><a href="#tab2">tab2</a></li> <li><a href="#tab3">tab3</a></li> </ul> then have containers following, , @ end of page loaded via ajax have: <script type="text/javascript"><!-- $('#horz-tabs a').tabs(); //--></script> my ajax function loads page properly. wondering how can fix issue. or advice. the ajax loading function follow <script> function async(target, href) { var loading = '<div class="l

asp.net mvc 3 - MVC3 Razor view not rendering dynamically added controls on postback -

i have upload selected files , display these files links on post back. in view adding each of uploaded files links using @if (model.incidentloginfodetails.attachmentcollection.attachmentitemcollection.any()) { foreach (eml.container.attachment attachmentitem in model.incidentloginfodetails.attachmentcollection.attachmentitemcollection) { @html.actionlink(attachmentitem.filename, "testing") } } this controller action: public actionresult uploadingfiles(httppostedfilebase imagefile) { // converting attachment object attachment fileattachment = new attachment(); fileattachment.filename = "imagefile.filename"; fileattachment.contenttype = imagefile.contenttype; fileattachment.sizeinbytes = imagefile.contentlength; using (memorystream ms = new memorystream()) { imagefile.inputstream.copyto(ms); fileattachment.binarydata = ms.getbuffer();

Get rid of text in between () in PHP -

this question has answer here: remove text between parentheses php 7 answers say have string this: this string (with parenthesis stuff) how change to this string ? replace it: preg_replace('/\(.*?\)/', '', $str);

c# - How to separate authorization logic from controller action? -

given following code: public class backupscontroller : apicontroller { private readonly iapicontext context; private readonly ibackupservice backupservice; public backupscontroller(iapicontext context, ibackupservice backupservice) { this.context = context; this.backupservice = backupservice; } public httpresponsemessage get(guid id) { if (id == guid.empty) { throw new httpresponseexception(httpstatuscode.badrequest); } ibackupview backup = backupservice.get(id); if (backup == null) { return request.createerrorresponse(httpstatuscode.notfound, string.format("backupid '{0}' not found.", id)); } if (!isauthorizedforbackup(backup)) { throw new httpresponseexception(httpstatuscode.forbidden); } return request.createresponse(httpstatuscode.ok, backup); } private bool isauthorizedforbacku

android - On HTC Desire S, soft keyboard not popping up on EditText focus -

i having edittext imeoptions="actionsearch" . when click on edittext, keyboard not pop in of htc devices, htc desire s & htc incredible. edittext xml follow: <com.myapp.utilities.font.droidsansedittext android:id="@+id/txtsearchbyname" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.60" android:background="@drawable/edittext" android:ellipsize="end" android:gravity="left|center_vertical" android:hint="@string/provider_practice" android:imeoptions="actionsearch" android:inputtype="textcapwords" android:paddingleft="10dp" android:paddingright="5dp" and

magento: Status: HTTP/1.1 403 Forbidden when viewing HTTP Request and Response Header -

i used http://web-sniffer.net/ testing site, result below: http request header connect ********** on port 80 ... ok / http/1.1[crlf] host: **********[crlf] connection: close[crlf] user-agent: web-sniffer/1.0.44 (+http://web-sniffer.net/)[crlf] accept-encoding: gzip[crlf] accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[crlf] accept-language: en-us,en;q=0.5[crlf] accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7[crlf] cache-control: no-cache[crlf] referer: http://web-sniffer.net/[crlf] http response header name value delim status: http/1.1 403 forbidden date: tue, 09 apr 2013 04:58:52 gmt server: apache expires: thu, 19 nov 1981 08:52:00 gmt cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 pragma: no-cache set-cookie: frontend=d661c78db51b210814a8196466c81849; expires=tue, 09-apr-2013 05:58:52 gmt; path=/; domain=www.lebunnybleu.com; httponly connection: close transfer-encoding: chunked conten

Full text search using postgresql-8.4 and django -

full text search mysql & django can done using following django api query entry.objects.filter(headline__search="search text") this returns result set properly.but can't used postgresql, while using getting exception shown below full-text search not implemented database backend how can imlement full text search postgresql & django same of django-mysql full text search? you can try entry.objects.filter(headline__contains="search text") or __icontains case-insensitive search. as django doc says __search works mysql now.

backbone.js - Is there a way to tell apart from user based changes to model and ones that came from the database? -

i trigger auto save on model every time changes, if change came ui (i.e. view). mean, if change came database, there no point in saving again, came database... however fetch , save can trigger change events ( fetch because brings potentially different state of model, , save can bring id newly created model) so in change event, i'd know caused change. e.g. call view?: this.model.set("foo", "bar"); //triggers change event foo's value changed or result of sync operation?: model.fetch(); //triggers change event model changed in db model.save(); //triggers change event id empty is there way tell them apart? once solution thought of wrapping view calls model's set setattribute method, , triggering custom changeduetouiaction event, i'm sure has been solved before , i'm sure in better way... or missing altogether , problem ask wrong question? i'd there several custom solutions involving more or less boilerpla

c# - When deletion button of one row is clicking the entire gridview become invisible -

when clicking deletion button corresponding row deleted. remaining rows in gridview become invisibe. displays correctly when click linkbutton again . please me. code here: protected void linkbutton2_click(object sender, eventargs e) { try { sqlconnection con = obj.getcon(); con.open(); gridview1.visible = true; sqldataadapter adapter = new sqldataadapter("select e.student_id,e.student_name,e.student_nric student_details e join student_vs_testsession_details f on e.student_id=f.student_id f.testsession_id='" + lb_testid.text + "' ", con); adapter.fill(ds); gridview1.datasource = ds; gridview1.databind(); } catch (exception ex) { response.write(ex); } } protected void gridview1_rowdeleting(object sender, gridviewdeleteeventargs e) { string id =convert.tostring (gridview1.datakeys[e.rowindex].value); sqlconnection con = obj.getcon(); con.open();

ios - where to create autolayout constraints for subclassed uitableviewcell? -

i trying use autolayout uitableviewcell subclass creating , appreciate advice on method put layout constraint creation code. have been searching around , information find talks adding constraints after adding subviews in viewdidload method. far know viewdidload isn't option uitableviewcell subclass. i using interface builder create custom cell , dynamically allocating in code. nothing special there... subclass uitableviewcell can add custom uiview cell. again, nothing particularly earth shattering... difficulty comes when try position custom uiview respect label added cell in interface builder. this code create custom uiview , add cell's content view: - (id)initwithcoder:(nscoder *)decoder { if ((self = [super initwithcoder:decoder])) { [self initself]; } return self; } - (id)initwithstyle:(uitableviewcellstyle)style reuseidentifier:(nsstring *)reuseidentifier { if ((self = [super initwithstyle:style reuseidentifier:reuseidentifier])

Check the authenticity of given link and store it in a mysql table using php -

how check if user given link link belonging particular website or not? using php. should use preg or there function it? can check if link broken or not? there function it? how can make sure delete malacious links or not possible handle automatically? should following function? $link=mysql_real_escape_string($_get['link']); always use get_headers, helps validate state of website, if available or not. $val = @get_headers(" http://www.google.com "); print_r($val[0]); use following preg_match pattern check broken link. %^((https?://)|(www.))([a-z0-9-].?)+(:[0-9]+)?(/.*)?$%i

.net - How to wait for tasks to finish without blocking the UI -

this first question in forum , since i'm not native english speaker hope you'll go easy on me, in case i'm doing or saying wrong. so, here question: i solve simple problem (so seems), i'm researching on week , tried different things none of worked far, stumbled on same problem. what opening progress form, starting 2 long running tasks (for instance getting data 2 databases). these long running tasks report progress progress form, after they're finished progress form closes , form opens show results of 2 long running tasks. both tasks have complete (or cancel/fail) before progress form closes , program goes on (or closes). so, progress form (form1) contains 2 listboxes (listbox1 , listbox2) , following code: public delegate sub showprogressdelegate(byval message string) public class form1 public sub addmessage1(byval message string) if string.isnullorempty(message) exit sub end if if me.invokerequired me.invoke(new showprogressdelegate(