Posts

c# - Cannot add any control on the workspace [Catastrophic failure] -

Image
there problem developer machine when created project on silverlight. @ moment add control on grid shows exception , layout destroyed. here steps replicate problem. create new silverlight application uncheck host silverlight application in new web site choose silverlight version: silverlight 5 and creates blank project file when tried add code inside grid <button content="button" horizontalalignment="left" margin="67,125,0,0" verticalalignment="top" width="75"/> it generates exception: see below >> click here see full screen image << the 2 stacktraces generated: at ms.internal.xcpimports.methodex(intptr ptr, string name, cvalue[] cvdata) @ ms.internal.xcpimports.methodex(dependencyobject obj, string name) @ ms.internal.xcpimports.uielement_updatelayout(uielement element) and at ms.internal.xcpimports.checkhresult(uint32 hr) @ ms.internal.xcpimports.frameworkel...

wmi - How to know if IEEE 1394 (FireWire) is connected to my Windows 7? -

my computer has ieee 1394 (firewire) input. how programmatically know if 1394 connected windows 7? you can use win32_1394controllerdevice wmi class.

c++ - cin in a while-loop -

#include <iostream> using namespace std; int main() { string previous; string current; while (cin >> current) { if(current == previous) { cout << "repeated word"; } previous=current; } return 0; } my questions are: when states while(cin>>current) , why entire entered string of text not assigned current? don't understand how compares words individually. how word previous. how know 2 of same words adjacent? edit: think understood why. tell me if wrong think because compiler stops cin assignment @ space , first word assigned current, compares previous word, since first word, not have previous word assigned first word previous , compares next word in sentence until there no more words left. i'm how works going leave in case ever wondering similar. the default behavior stop on whitespace when reading strings doing. can change read whitespace saying std...

Not a constructor error within jQuery.on -

given following code: var test; this.test = function() { //... }; $(document).ready(function() { $(this).on('click', function(e) { test = new test(); //... i test not constructor. why? @edit: constructor , adding variable test type: function test(){ this.something = 'hello'; } $(document).ready(function() { $(this).on('click', function(e) { var test = new test(); alert(test.something); }); }); this result in alert 'hello' text. adapting code, can do: var test = { something: "hello" }; $(document).ready(function() { $(this).on('click', function(e) { var test = new object(); alert(test.something); }); });

java - JCombobox Listener how to enable it when item is selected? -

i have jcombobox displays name database patients_details public void comboitem() { chooser.removeallitems(); chooser.additem("please select..."); try { string sql="select * patients_details"; pst = conn.preparestatement(sql); rs=pst.executequery(); while (rs.next()) { string id = rs.getstring("patient_id"); // id string name = rs.getstring("name"); // name comboitem comboitem = new comboitem(id, name); // create new comboitem chooser.additem(comboitem); // put combobox string tmp=comboitem.getid(); } } catch (sqlexception sqle) { system.out.println(sqle); } } this comboitem class returns name , not id public string tostring() { return this.name ; } my question how selecteditem action can performed have no clue how have been trying bunch of code 2 hours appreciated nb java beginner private void ch...

How to single sign on into gmail, yahoo mail & facebook from Spring based Web application with ldap as Authentication provider -

we have spring mvc & jsf based web application uses spring security user authentication using ldap provider & after successful authentication user profile fetched oracle database. now need integrate facebook, gmail & yahoo mail application. the expected behavior after doing login web application user should automatically logged in facebook , gmail & yahoo mail well. user profile in oracle database contain login id of gmail, facebook & yahoo mail. the menu in application contain links gmail, yahoo mail l & facebook & while user click on menu corresponding site open logged in user in iframe without asking user id & password of website. if password of gmail, yahoo mail & facebook account of users not needed keep database. please let me know if there way achieve this. i started thinking use oauth2 , don't know whether right way go forward or not. please me relevant single sign on solution solve this. [note: web application uses java ...

jquery - Caching AJAX results with PHP -

i have ajax call retrieves lines file via json. have 3m rows in database , want show result cannot see anything. the results retrieved via json wanted cache, if data requested more once, not send request again. best practices caching in jquery? i use php in server side. suggestions appreciated. my javascript code: function getsearchresult(char,company,category,country,page) { $.ajax({ type: "post", url: "companyresult.php", data: { mysearchchar : char, mysearchcompany : company, mysearchcategory : category, mysearchcountry : country, mypage : page }, cache: false, datatype : "html", beforesend: function(){ $("#loading").show(); //show image loading $('html, body').animate({scrolltop:$('#insid_body_web').offset().top}, 'slow'); $("#resultcompany1").hide(); ...