Posts

Showing posts from January, 2015

.net - Shared but Secure Memory between 3 Different Apps (Windows) -

we writing set of application windows contains ie toolbar, firefox toolbar , windows desktop client. before using of these components user provides secret code , says need save code 1hr or whatever option chooses. now challenge have use same secret code decrypt data while uses in 3 component, writing secret key in plain file aes encryption specific key buried in source code , 3 component access key file. now please suggest me better way in light of following limitations/requirement. all 3 components fully/partially written in .net. ie uses protected mode no high privileged resource can accessed the data of user encrypted own security key hence must have key decrypt data. , when quits loose key ensure security. all 3 components runs in low privileged processes. can 1 me in this. regards have tried dpapi? http://msdn.microsoft.com/en-us/library/system.security.cryptography.protecteddata.aspx http://msdn.microsoft.com/en-us/library/ms229741(v=vs.85).aspx ...

Is there a easy way to extract a interface from a Java class, including public methods of super classes? -

is there easy way extract interface java class such includes public methods of super classes. class im trying extract interface has several layers of super classes, each 1 lots of methods. don't need interface each of parent classes. currently i'm using intelij idea ide. extracts public methods of current class, when extracting interface. if u guys can tell me tool or easy way extract interface, great help. eclipse doesn't offer superclass methods in "extract interface" refactoring. , correct, because shouldnt implement interface , implement methods in superclass! you want this: public interface interfaceforb { void b(); void a(); } public class { public void a(){} } public class b extends implements interfaceforb{ public void b(){} } yes, compiles. it's awful style, because says, b implements interface, not true, because a() method implemented in class a . my strong advice: use refactorings offered intellij, extract method...

c++ - Sharepoint server 2010 Central Administrationa and other settings -

i want read following setting configured on sharepoint server 2010: file types blocked" web application anti-virus setting configured scan documents on upload is error report collection enabled (central administration > operations > logging , reporting > error reports > ) etc. my question is, these setting stored on sharepoint server machine? in config file or in database? i know programmatic way read these settings (got sharepoint 2010 sdk sample code in c#), application in c++ (vs 2003 .net) , api/interfaces available in .net (managed code). please let me know if api/interfaces access these setting available in unmanaged code also? any appreciated. regards, krishnakant you cannot directly call sharepoint api in unmanaged code. the settings stored in sharepoint configuration database , must called in sdk. need create .net class library assembly need call managed code com dll.

how to control the buttons or tabs in the launch application using python -

i launched application using following code i.e. import os cmd = r'start c:\windowsmediaplayer\wmplayer.exe' os.system(cmd) say launched win media player.. want control buttons/the menus open file . or audio settings.. thing related media player using python script.. please on can me this.... maybe should use framework such pywinauto using this, can launch windows applications , control them. check this out

android - How to "push" audio stream through the phone to the caller without using the phone's speaker -

i new android , know libraries / classes / api, if any, can used stream audio caller without using phone's speaker. thanks in advance. i think might difficult answered here need play audio caller

sql server - Is there any way to achieve the following code? -

i have sql statement like.. select res1, res2, res3, res4 tbl1 res1=1 group res2 having res4>0 i wanna hav final column column based on res1 , res3 . individual statement be select res5 tbl1 res1=1 , max(res3) group res2 having res4>0 i wanna merge res5 first statement. res3 total value can b got executing first statement. i wanna like.. select res1, res2, res3, res4 (select res5 tbl1 res1=1 , max(res3) group res2 having res4>0) tbl1 res1=1 group res2 having res4>0 but apperantly not correct. how achieve that? the exact code be declare @noshow int, @target int; set @noshow=20; set @target=1200; select convert(varchar(10), visit.regdate, 103) 'date', datename(weekday, visit.regdate) 'day', count(queueno) 'total_served', sum(case when datediff(second, starttime, nexttime)<= @target 1 else 0 end) 'less_target', isnull((sum(case when datediff(second, starttime, nexttime)<= @target 1 else 0 end)*100)/count(queu...

hibernate - Rewriting HQL to convert right join to left join -

i have following object model: account accounttransaction has many-to-one account paymentschedulepayment has many-to-one accounttransaction paymentscheduleperiod has many-to-one account and want hql find me paymentscheduleperiod active on given date , each 1 find latest paymentschedulepayment linked same account. there may no payments hence outer join. i have query works fine: select p.id, a.id, max( pay.accounttransaction.dttm ) paymentschedulepayment pay right join pay.accounttransaction.account a, paymentscheduleperiod p p.account = , p.fromdttm <= :date , p.todttm > :date group p.id, a.id however this question having trouble because of ordering precedence of joins explained in accepted answer. 1 of comments avoid issues should use left outer join instead of right i'm not sure how rewrite hql of form from account left join ... paymentschedulepayment my, possibly incomplete, understanding in hql can outer joins via object model. can sugge...

iphone - String constant ... best practise? -

i'm looking best practise of setting code-wide used string constant option 1 extern const nsstring *cdownloadcompletenotification; (.h file) const nsstring *cdownloadcompletenotification = @"downloadcompletenotification"; (.m file) option 2 define knotificationdownloadcomplete @"notificationdownloadcomplete" .... (common.h) is there benefit, 1 way or other ? ... or case of personal preference ? personally, go former though there's not choose between them. memory usage same in both cases. there's few things watch out in #define - e.g. if include .h file twice. if use define , change constant's value of files might compiled old value , new - find tricky work out why notification handlers not being called! you'd have clean before building make sure changed everything. won't happen if use extern nsstring.* hope that's helpful. nb wouldn't declare const - compiler warning when passing postnot...

c# - FileNotFoundException and file path -

exception: could not load file or assembly 'file:///c:\program%20files\microsoft%20visual%20studio%209.0\common7\ide\projects\sourcecode_tradeprocessor_branch\bin\fxgate\loaderservice\plugins\fixexchangeprovider\fixexchangeprovider.dll' or 1 of dependencies. system cannot find file specified. code: parserplugin = assembly.loadfrom(_transport.path); the filepath exists. because of path format or what? "...or 1 of dependencies". check if dll's assembly references in same folder.

Cannot connect to an instance of SQL Server 2008 -

i trying connect sql server 2008 server instance via nhibernate using c#. unable so. i have been successful in connecting to same instance via hibernate using java. kinda sure there nothing wrong sql server 2008 configuration settings. have managed connect sql server 2008 express. here hibernate.cfg.xml <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.driver_class">nhibernate.driver.sqlclientdriver</property> <property name="connection.connection_string">server=(local)\sunil,3067;initial catalog=nhibernate101;user id=sunil;password=mypassword;</property> <property name="show_sql">true</property> <property name="dialect">nhibernate.dialect.mssql2008dialect</property> <property name="cache.use_query_cache">false</property> <property name="adonet.batch_...

php - Weird MySQL encoding issue -

i have column in pages table arabic data. if this... @mysql_query( "select title pages web_id = '$id'" ); i correct data, in arabic. but if call same function again, in fact, it's in loop, second time brings me garbage data. looking this "تنظيم اÙ„أوقاÙ اÙ„عامة اÙ‚رØ£ قطاع also, if before query, either of this: @mysql_query("set names 'utf8'"); @mysql_set_charset( 'utf8' ); mysql_query("set character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'" ); i garbage data, on first call. what's happening here? note database, table , field collations set utf8_bin some random hints: try not use @ operator. suppress error message. you need escape input parameters properly: mysql_query("select title pages web_id = '" ...

asp.net - panel visibility java script -

<asp:panel id="filterpanel" runat="server" cssclass="filterborder" visible="false"> <table width="100%" cellspacing="4"> <tr> <td class="filterpanelfiltercontrolwidth"> <uc:filter id="filter" runat="server" /> </td> <td class="centerincell"> <controls:brbutton id="gobutton" runat="server" text="go" causesvalidation="true" skinid="verysmallbutton" onclick="gobutton_click" /> </td> </tr> </table> </asp:panel> i setting visibilty of filter panel false.. default.. on click of show/hide filter want change visible = true . doing javascript..like this function showhidefilter() { if (document.getelementbyid('ctl00_contentplaceholder...

sockets - Android TCP Client in phone has problems in communicating with external server -

i have tcp client in android (java program in eclipse). server java app running in eclipse. works fine in situation. when tried receive message colleague's app (developed in rhapsody , think c++), receive message after app closed , not while app running , sending messages. have idea why happens? thank time , effort on this. cheers, madhu the java server this: public class tcpsendserver implements runnable{ public static final string serverip = "192.168.178.24"; public static final int serverport = 1200; //static category cat = category.getinstance(tcpsendserver.class.getname()); //cat.debug("start of main()"); public void run() { try { system.out.println("s: connecting..."); serversocket serversocket = new serversocket(serverport); string msg = "<msg><n>shiftdirection</n><v>1</v></msg>"; string msg1 ...

c# - Regex to get NUMBER only from String -

i recieve "7+" or "5+" or "+5" xml , wants extract number string using regex. e.g regex.match() function stringthathavecharacters = stringthathavecharacters.trim(); match m = regex.match(stringthathavecharacters, "what use here"); int number = convert.toint32(m.value); return number; \d+ \d represents digit, + 1 or more. if want catch negative numbers can use -?\d+ . note string, should represented in c# "\\d+" , or @"\d+"

android - Multiple MapActivitys in the stack -

i understand topic has been covered few times, , proposed solution having 'multiple' mapactivity classes run 1 in different processes. don't want this, i've got 3. i've instead refactored 1 mapactivity subclass operate in 3 different modes. package com.rossgreenhalf.maptest.activity; import android.os.bundle; import com.google.android.maps.mapactivity; public class mymapactivity extends mapactivity { @override protected void oncreate(bundle icicle) { super.oncreate(icicle); /* inflate xml view, set zoom etc */ } @override protected void onresume() { super.onresume(); int mode = getintent().getextras().getint("map_mode"); switch(mode){ case 1: /* markers show */ break; case 2: /* 1 marker */ break; case 3: /* showing location */ break; } } @override protected boolean isrout...

On demand image display using JQuery sample needed -

today visit site , saw when scroll down images getting fetch server , being visible. site url http://www.ajaxshake.com/en/js/12611/list-of-pagination-scripts.html . please have @ site , scroll down u see effect load images @ run time when user scroll down. please tell me how this. need site url exact sample using jquery. please let me know if have knowledge effect. thanks here's working example (not mine): http://www.dustindiaz.com/element-scroll-into-view/ it's not jquery javascript ok too, guess.

matlab - Simulink: Bit extraction from 1-Byte Hex -

i'm relatively new simulink , looking possibility extract 1-3 specific bits 1 byte. far know input format (bin, dec, hex) of constant irrelevant following!? how can constant "1234" hex , not dec? in model use "constant block" source (will parametrised matlab variable comes m-file). further processing "extract bits block" causes error on incompatible data types. can me deal issue? greets, poeschlorn you should conversion hex->dec in .m initialization file , use value in simulink.

android - How to make a QR code reader -

i want make qr code reader android app. if have information create please share me. this popular lib it. allows using barcode scanner intent doesnt require work either. https://github.com/zxing/zxing/wiki/getting-started-developing

ruby - Prawn templates not working -

i´m trying simple script: require 'prawn' template_file_name = file.join(file.dirname(__file__), 'template.pdf') pdf_file = prawn::document.new(:template => template_file_name) pdf_file.text('hello world') pdf_file.render_file('output.pdf') there template.pdf file in same dir script output.pdf comes hello wordl is there else should concerned of? thanks if want stamp pdf file another, , using ubuntu, try installing pdftk . go terminal , type this: sudo apt-get install pdftk then go pdf directory , type: pdftk content.pdf stamp template.pdf output final.pdf if want within ruby, can learn about: calling shell commands ruby i read solution in link: http://numbers.brighterplanet.com/2011/10/06/stamp-pdfs-with-prawn-and-pdftk/

swing - Java JOptionPane.showConfirmDialog hot key -

i displaying confirmation dialog in java using joptionpane.showconfirmdialog. dialog shows yes no confirmation user. called follows: int result = joptionpane.showconfirmdialog(sessionobjects.getactivecomponent(), "are sure want exit?", "my app", joptionpane.yes_no_option); the question simple confirmation, can user press y yes , n no? @ present user has click on buttons? thanks, andez you have "hotkeys" (mnemonics) buttons: alt + y "yes" , alt + n "no". you can hit tab toggle between them , space press.

sockets - Java Login Username on Remote Machine -

i'm working on simple file sharing program in lan networks using java. software uses socket ans serversocket classes send , receive to/from machines user knows ip addresses of. want improve software in way user can enter other's machine username instead of ip, example if user of other machine trying connect machine specific username, connection allowed. a solution maintaining form of username -> ip (or hostname) mapping. done dhcp server, that's bit of overkill (or impossible if cannot set dhcp server), recommend program maintains mapping itself. to build mapping, try this: when host goes up, send lan broadcast message username notify presence. upon receiving notifications, other hosts register sender host's ip , username, answer respective user names , ip addresses.

Which one is simpler between Ninject and StructureMap? -

i wondering 1 simpler between ninject , structuremap ? there should aware when using them ? thanks. imho, ninject easier started if you've never done di before, i've found structuremap more extensible. whichever container opt-for, try , follow usual advice, , wrap behind interfaces (not little 'i') own. embedding 3rd party component deep code asking trouble. at end of day, it's down personal taste.

c# - Deserialise XML File to .Net Object -

i'm trying deserialize xml file .net object doing like: carcollection mycarcollection = null; string path = "carcollection.xml"; xmlserializer serializer = new xmlserializer(typeof(carcollection)); streamreader reader = new streamreader(path); mycarcollection= (carcollection)serializer.deserialize(reader); reader.close(); here xml file i'm using: <?xml version="1.0" encoding="utf-8" ?> <carcollection> <car id="a"> <cartype make="ford" model="focus" /> <carowner name="tom"> <report type="service"> <reportlist> <date>20-08-2010</date> </reportlist> </report> </carowner> </car> <car id="b"> <cartype make="vauxhall " model="corsa" /> <carowner name="joe"> <report type="service...

running oracle code on asp.net website causes "driver missing" error -

running asp.net mvc website has code connects oracle. works fine on 1 machine on another, following error: system.data.oracleclient requires oracle client software version 8.1.7 or greater. here line of code breaks on: oraclecommand command = connection.createcommand(); this machine failing have 10.2 version of oracle driver installed on machine. suggestions on wrong? found same problem (and possible solutions) on asp.net

linux - Possible cause for "Can't resolve symbol"? -

the cross-compiling of lua, test module, , real-life module went ok, when load real-life module on appliance running uclinux , error: appliance::/var/tmp> ./lua -l dummy hello dummy bye dummy lua 5.1.4 copyright (c) 1994-2008 lua.org, puc-rio appliance::/var/tmp> ./lua -l luasql.sqlite3 ./lua: can't resolve symbol '_lual_ref' i don't have enough experience know cause is, although google seems point issues shared libraries. maybe module expects library, or specific version of library , it's not there? has seen type of error before? how investigate? thank you. edit: here config/makefiles used build lua, sqlite3, , luasql sqlite3: # cat /var/tmp/lua-5.1.4/src/makefile mycflags= myldflags= mylibs= export path:=$(path):/usr/src/baps/opt/uclinux/bfin-linux-uclibc/bin target_cross=bfin-linux-uclibc- export cc=$(target_cross)gcc export strip=$(target_cross)strip export ar=$(target_cross)ar rcu export ranlib=$(target_cross)ranlib export staging_di...

optimization - Testing user bandwidth and tailoring page layout/functionality to match -

i'm interested know if has worked on website need cater users vastly different bandwidths? i'd tailor site different user groups 1) low bandwidth ( <56kbps dial up) low res images - no javascript framework, no background images 2) medium bandwidth ( ~256kbps dial up) medium res images, smaller background images, small amount of jquery 3) high bandwidth ( > 1mbps) full site are there techniques use test bandwidth speed, maybe set cookie remember (to stop page running test every single time), , tailor included css/javascript , image urls depending on result? at previous company (a wimax isp), wrote speed test customers test speed of connection our network. ended custom web server hacked in perl, served static pages in sub-domain. the speed test javascript tool sent randomly created(*) string special address on server, made mark when transmission began, when string received, , sent equally random string client, marking end of operation. server had 3 time...

jQuery URL actions -

hy, i have menu this: <a href=home>home</a> - <a href=home/sub1>home sub 1</a> - <a href=home/sub2>home sub 2</a> - <a href=home/sub3>home sub 3</a> <a href=garden>garden</a> - <a href=garden/sub1>garden sub 1</a> - <a href=garden/sub2>garden sub 2</a> - <a href=garden/sub3>garden sub 3</a> now set link url: $.address.init(function(event) { $('a').address(function() {return $(this).attr('href').replace(location.pathname, '');});}).change(function(event) { var text = (event.value == '') ? 'home' : event.pathnames[0].substr(0, 1).touppercase() + event.pathnames[0].substr(1); $('a').each(function() { $(this).toggleclass('selected', $(this).text() == text); }); }) so if click "home" url --> www.web.com/#/home , on home sub 1 --> www.web.com/#/home/sub1. how replace unwanted "/#/"?...

multithreading - How processor deals with instruction upon interrupt -

what happen if in middle of long instruction cpu recieves interruption? cpu execute whole instruction or part of it? from programmer's point of view, either specific instruction retired, , side effects committed registers/memory or isn't (and it's if instruction wasn't executed @ all). whole point of instruction retirement guarantee coherent view of program state @ point of external events, such interrupts. that's notably why instructions retire in order, external observers can still @ architectural state of cpu if executing sequentially instructions. there exceptions this, notably rep-string class of instructions. i believe asked about, if not, let me ask you: how observe instruction "partially" executed anywhere ?

php - how to return array for mysql_query? -

// make empty array $sqlarray=array(); $jsonarray=array(); // start need fast working alternatÄ°ves ----------------------------------------------------- // first 20 vistors $query = "select user_id vistors limit 20"; $result = mysql_query ($query) or die ($query); // make vistors user query array while ($vstr_line = mysql_fetch_array($result)){ array_push($sqlarray, $vstr_line['user_id']); } // implode vistors user array $sqlarray_impl = implode("', '", $sqlarray); // end need fast working alternatÄ°ves ----------------------------------------------------- // vistors information $query = "select id, username, picture users id in ('$sqlarray_impl')"; $qry_result = mysql_query($query) or die($query); while ($usr_line = mysql_fetch_array($qry_result)){ array_push($jsonarray, $usr_line['id'].' - '.$usr_line['username'].' - '.$usr_line['picture'...

c# - WMI retrieve groups that a user is member of? -

this code retrieving local computer info : managementobjectsearcher usersearcher = new managementobjectsearcher("select * win32_computersystem"); managementobjectcollection usercollection = usersearcher.get(); string[] sep = { "\\" }; string[] username = usercollection.cast<managementbaseobject>().first()["username"].tostring().split(sep, stringsplitoptions.none); managementobjectsearcher searcher = new managementobjectsearcher("select * win32_useraccount domain = 'mydomain' , name= '" + username[1] + "'"); managementobjectcollection collection = searcher.get(); writeonlistbox("username: " + (string)collection.cast<managementbaseobject>().first()["name"]); writeonlistbox("full name: " + (string)collection.cast<managementbaseobject>().first()["fullname"]); writeonlistbox("descriptio...

Silverlight Error Loading dll at Runtime -

i've got silverlight application loads dll file located within clientbin folder @ run time via relative uri. works great on local machine, when deployed on server here, seems fail while trying load file: private void onassemblyopened(object sender, openreadcompletedeventargs e) { assemblypart asmbpart = new assemblypart(); messagebox.show(e.tostring()); assembly asmb = asmbpart.load(e.result) // line causes exception ... } of course silverlight doesn't give me useful error - usual notfound nonsense. there step i've missed in deploying this? permissions or something? dll file in clientbin folder btw - i've checked that! :) another option compress dll zip file, download zip file. way need not play server config. how download , unpack file zip file given in answer . code in essence this:- assemblypart asmbpart = new assemblypart(); var zipres = new streamresourceinfo(args.result, null) var assemres = application.getresourcestream...

get browser session in mysql -

how can browser session in mysql. idea in advance. you can't session information via mysql database , not handling http stuff. fetch information need via php , store there in mysql. http://php.net/manual/en/function.session-id.php

design patterns - What are singletons?? how to use them?? and why to use them? -

possible duplicate: singleton: how should used hello. want know singleton is? how use it? , why have use it. thank much. if can give examples explanation appreciate it. if need single instance of object, use singleton. 1 of many standard design patterns. let me clarify piece of code - public class singleinstance { private static final singleinstance onlyinstance = new singleinstance(); // or other value // private constructor, instance cannot created outside class private singleinstance(){}; public static getsingleinstance() { return onlyinstance; } } since class's constructor private, cannot instantiated in application, ensuring have 1 instance of class singleinstance . use pattern when need ensure 1 instance of particular class created within entire application. to learn more, go here .

sybase ase - Is there a better implementation for SybaseDialect in Version 3.0 of NHibernate? -

we have upgraded nhibernate 3.0 fluent-nhibernate. in version 2.1.2 able use sybasedialect ase 12. in version 3.0 sybasedialect ase 12 not supported. i reused old dialect nhib 2.1.2 , working. what wanted ask since 1 removed considered not implementation, there better 1 out there? since it's working not sure improvements need made thought ask. this blog post has scoop. haven't tried upgrading can't comment if version 2.1.2 sybase dialect nhibernate 3.0 perform differently using nhibernate 2.1.2 version.

ios - Rotating iPhone and changing views -

i've never played around iphone being landscape, have working iphone app assuming user viewing iphone upright. i'd play around rotating phone, , in order that, did simple: i added following code view controller: -(void)willrotatetointerfaceorientation: (uiinterfaceorientation)orientation duration:(nstimeinterval)duration { nslog(@"will rotate interface orientation: %@",orientation); if ((orientation == uiinterfaceorientationlandscapeleft) || (orientation == uiinterfaceorientationlandscaperight)) tableview.frame = cgrectmake(0, 0, 480, 320); else tableview.frame = cgrectmake(0,73,320,390); } and i'm getting bad_access error. don't see view load @ all. so, what's problem, , how implement willrotate method when phone rotates, can resize components? the crash caused line: nslog(@"will rotate interface orientation: %@",orientation); orientation enum value, therefore format specifier should %i no...

javascript - Replace specific text without affecting styling -

need replace colons wherever they're found in specific elements id's. works reason replaces styling attached elements: $(document).ready(function(){ $("#element").each(function () { //for element var s=$(this).text(); //get text $(this).text(s.replace(/:/g, ' ')); //set text replaced version }); }); i tried attaching class element made no difference. how remove colons without affecting else? demo what html code in #element ? if replacing text in #element changes style, means #element contains html tags (and style applied on tags). try this: $(document).ready(function() { $("#element").each(function () { (function trim_colons(el) { (var = 0; < el.childnodes.length; ++i) { var c = el.childnodes[i]; if (c.nodetype == 1) trim_colons(c); else if (c.nodetype == 3) c.nodevalue = c.nodevalue.replace(/:/g, ' '); } })(this); }); }); this correctly ...

rest - What's new in Jersey 1.5 version? -

there place can see changelog jersey 1.5 in front of 1.4? edit; changelog here http://java.net/projects/jersey/sources/svn/content/tags/jersey-1.5/jersey/changes.txt?rev=4533

svn - Install Subversion on Ubuntu with NGINX, not Apache -

i'm using ubuntu 10.10 , install subversion. don't need http access files , use ssh. majority of examples i've seen on how install subversion use apache. don't want install apache on sever since i'm using nginx. can install subversion without installing apache? if yes, how? thank you! if don't need http access subversion repository, need install subversion , create repository this: svnadmin create /path/to/repository then can check out local copies directly: svn co /path/to/repository /path/to/my/checkout or on ssh: svn co svn+ssh://server/path/to/repository if packaging system trying install apache subversion, packaging issue. in ubuntu, subversion package not require apache. requirements are: depends: libsvn1 (= 1.6.12dfsg-1ubuntu1), libapr1 (>= 1.2.7), libc6 (>= 2.4), libsasl2-2 suggests: subversion-tools, db4.8-util, patch

c# - Easiest way to read XML with attributes -

i have xml file read (with xml atrributes). structure doesn't change, content does. sample xml: http://www.yr.no/place/norway/oslo/oslo/oslo/forecast.xml (the url must copied , pasted address field manually or you'll 404 seems.) i'm unable make xsd using code (and using xsd.exe): xmltextreader myxmltextreader = new xmltextreader("forecast.xml"); dataset mydataset = new dataset(); mydataset.readxml(myxmltextreader); mydataset.writexmlschema("forecast.xsd"); results in: column name 'name' defined different mapping types. now, imagine i'm lazy on top of , don't feel spending whole evening manually mapping xml objects. want managed code objects generated me can read data. what options? ...and if knows, xsd convert error message mean? to answer final point xsd.exe error, it's having problems multiple location elements. if save xml , rename first location element baselocation convert okay. you may able ma...

asp.net - How to add users to ASP user database? -

i have configured asp user database. can create users/roles either programmatically or going project -> asp.net configuration in visual studio ide. server database running on doesn't have vs installed. there way add users/roles through command line or iis settings? thank you you can create simple site or admin page on current site , use createuserwizard control. guide customizing control can found here: http://www.4guysfromrolla.com/articles/070506-1.aspx documentation here: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.createuserwizard.aspx you can use membership objects through code if want create own console application command line. do not try , in database directly.

c# - Can I have a section of App_Code which compiles separately from the rest of the folder? -

we have website huge amount of cached objects stored in static variables within app_code. whenever push app_code change our production webservers recycles iis pool , flushes cache. not flush cache when push out changes .aspx , .aspx.cs files. i need have bunch of classes updated several times day able referenced in app_code. either section of app_code can update several times day without cycling iis , flushing cache, or ability reference classes outside of app_code within app_code. is there solution fits problem? updates app_code or /bin/ recycle application pools believe. if you're saying have deployment scenario .aspx.cs file updates not recycle application pool, , if you're able refer page type itself, perhaps can move code .aspx.cs files prevent recycling happening. that's may ugly choice though. one suggestion revise design reduce number of source code updates required on daily basis. perhaps use xml or database storage, , design application little m...

WPF: How to filter out non-Roman fonts from Fonts.SystemFontFamilies? -

i know how create wpf font picker few lines of xaml, binding fonts.systemfontfamilies ( thanks norris cheng's excellent blog post ), can't figure out how filter out international , other non-roman-alphabet font families. users aren't need "mongolian baiti", "microsoft uighur", or "webdings", , when in list makes harder them find fonts do want. are there properties on objects reachable systemfontfamilies can use separate non-symbol roman-alphabet font families rest? edit: information use available in windows 7 fonts control panel, in "designed for" field. strings in field contain "latin" fonts useful latin-alphabet applications, other language names "international" fonts ('mongolian baiti' 'mongolian', example), , "symbol" fonts wingdings. "category" field looks useful separating 'display' fonts 'text' fonts. unfortunately, can't figure out way infor...

Is there a C++ equivalent to Java's BigDecimal? -

i'm looking c++ class can decimal floating point arithmetic. looking through http://speleotrove.com/decimal/ there links sorts of classes people have written , not maintained. digging through decnumber++ stuff led me emails showing gcc support functionality. (formally known iso/iec tr 24733) i'm looking can use drop-in replacement float or double, other people using in own projects. open source. thanks! edit: should point out i'm trying use represent prices. need exact decimals, not huge decimals. there exists huge library called gmp (gnu multiple precision library) supports , has c++ bindings, though honest c++ interface bit wonky , outdated. an example documentation, following creates float called f @ least 500 bits of precision: mpf_class f(1.5, 500);

c# - System.Windows.Forms.Timer object does not tick when loaded from an activated assembly (plugin) -

i working on project loads assemblies (plugins) primary appdomain space (via reflection's assembly.loadfile() , activator class). part of api plugins, hosting application can request control-derived object display on host's form. essentially: "hosting application" winforms application can load assemblies contain controls. hosting application loads assemblies (via assembly.loadfile()) , asks control each assembly. control rendered (added container) on form. everything appears work fine (buttons, labels, images, etc.) control , interactive. however, if timer (winforms component - not system.threading.timer) used in form - not tick. if control used directly in host (when referenced dependency), timer tick expected. is aware of problems winforms timer not being able hook message pump if loaded assembly? it isn't clear "appdomain space" might mean. guessing: here's excellent blog post describes hazards of loading controls in sec...

c++ - Template argument deduction from function body -

if we've function template, template<typename t> void f(t param) {} then can call in following ways, int i=0; f<int>(i);//t=int : no need deduce t f(i); //t=int : deduced t function argument! //likewise sample s; f(s); //t=sample : deduced t function argument! now consider variant of above function template, template<typename targ, typename tbody> void g(targ param) { tbody v=param.member; } now, can compiler deduce template arguments if write, sample s; g(s); //targ=sample, tbody=int?? suppose sample defined as, struct sample { int member; }; there 2 questions: can compiler deduce template arguments in second example? if no, why? there difficulty? if standard doesn't "template argument deduction function body" , because argument(s) cannot deduced? or didn't consider such deduction avoid adding more complexity language? or what? i know views on such deduction. edit: by way, gcc able deduce function...

Handling Large String Constants in Java -

what best way handle large string constants in java? imagine have test fixture soap , want send following string: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <quoterequest xmlns="https://www.bcponline.co.uk"> <header> <sourcecode>bn325</sourcecode> <messagesource>b2b3</messagesource> <profile>b08a</profile> <password>ap3u86v</password> <operatorid>flightline</operatorid> <showweboptions>0</showweboptions> </header> <serviceselection> <serviceprovidercode></ser...

javascript - Ant: how to fail if property contains a certain string -

i want write ant macro call fail task if supplied attribute contains string. way know how string comparison in ant using javascript. have this: <macrodef name="check-for-error"> <attribute name="input"/> <sequential> <echo message="@{input}"/> <script language="javascript"> <![cdata[ var response= "@{input}"; if(response.indexof("fail") !=-1){ project.setproperty("error","true"); } ]]> </script> <fail message="input failed" if="${error}"/> </sequential> </macrodef> the problem approach i'm setting property global inside of javascript, , ant not let reset property. know ant has ability set local properties. how can access local properties within javascript? or there better way together? <...

c# - Storing the RecordString with the FileHelper Class -

we using filehelpers 2.0 in our project. have record defined , have data being imported correctly. after getting array of generic objects: var engine = new filehelperengine<userrecord>(); engine.errormanager.errormode = errormode.saveandcontinue; userrecord[] importedusers = engine.readfile(_filepath); after getting records errored due formatting issues, iterating through importedusers array , doing validation see if information being imported valid. if data not valid, want able log entire string original record file. is there way store entire "recordstring" in userrecord class when filehelperengine reads each of records? we @ work handling beforeread event , storing in field moriginalstring marked way: [fieldnotinfile] public string moriginalstring; you must use last version of library here: http://teamcity.codebetter.com/repository/download/bt65/20313:id/filehelpers_2.9.9_releasebuild.zip cheers

iphone - UITableView crashes on scrolling -

uitableview crashing on scrolling . here sample code.. - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { nslog(@"total count: %d",count); return [objectarray count] ; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:cellidentifier] autorelease]; cell.textlabel.numberoflines = 0; cell.textlabel.font = [uifont fontwithname:@"arial" size:12.0]; cell.detailtextlabel.font = [uifont fontwithname:@"arial" size:10.0]; [cell.textlabel sizetofit]; [cell setaccessorytype:uitableviewcellaccessorydetaildisclosurebutton]; } // configure cell. nslog(@"row number %d", ...

.net - What if data compressed with GZipStream or DeflateStream is longer than the raw data? -

i'm no expert on formats, i'm guessing it's possible input data compressed data longer, due formatting overheads. i'm ok i'm not ok documented behaviour of count parameter gzipstream/deflatestream.write(): "the maximum number of compressed bytes write." usual practice (unless compressing in chunks) pass in length of input data: public static byte[] compress(byte[] data) { using (var compressed = new io.memorystream(data.length)) { using (var compressor = new io.compression.deflatestream(compressed, io.compression.compressionmode.compress)) compressor.write(data, 0, data.length); return compressed.toarray(); } } in edge case i'm talking about, write statement won't write out whole compressed data stream, first data.length bytes of it. double buffer size large data sets that's bit wasteful, , anyway don't guesswork. is there better way this? i pretty sure mistake in documentation. d...

compilation - result of a compiled class in Eclipse for Java EE Developers -

i trying ".class" file java class in eclipse java ee developers. i have enabled the "build" option in project menu , building project still can't find compile file or compilation errors in console window. thanks, sid i wager java source file isn't in location considered java source directory eclipse. go project properties -> java build path -> source , make sure folder keep java source listed. alternatively, move java source file under [project]/src directory default java source folder web projects in eclipse. also, not compilation errors in console. eclipse doesn't use javac or similar compilation. compiles java source file internally on fly. errors appear in problems view. compiled class files appear in output directory designated in java build path properties. default output location web projects build/classes.

symfony1 - Symfony's autoload vendor files doesn't seem to be working -

i'm building symfony 1.4 project, , i'm attempting use pear's crypt_rsa package. unfortunately, package hasn't been updated in awhile, instead of doing simple pear install command line, want include lib/vendor project path can modify various pieces of code use in php5. (it causes warnings , strict errors, , don't want disable strict error checking). i created autoload.yml file in config path contains following: autoload: crypt_rsa: path: %sf_lib_dir%/vendor/crypt recursive: true i attempt utilize crypt_rsa_keypair class ( source ) in following manner: $keypair = new crypt_rsa_keypair(128); this results in following error: warning : require_once(crypt/rsa/errorhandler.php) [ function.require-once ]: failed open stream: no such file or directory in /app_path/lib/vendor/crypt/rsa/keypair.php on line 28 fatal error : require_once() [ function.require ]: failed opening required 'crypt/rsa/errorhandler.php'...

c++ - How to stop time from running backwards on Linux? -

here's little test i've written verify time indeed run forwards in linux. #include <time.h> #include <sys/time.h> bool timegoesforwardtest2() { timeval tv1, tv2; double starttime = gettimeseconds(); // function while ( gettimeseconds() - starttime < 5 ) { gettimeofday( &tv1, null ); gettimeofday( &tv2, null ); if ( tv2.tv_usec == tv1.tv_usec && tv2.tv_sec == tv1.tv_sec ) { continue; // equal times allowed. } // tv2 should greater tv1 if ( !( tv2.tv_usec>tv1.tv_usec || tv2.tv_sec-1 == tv1.tv_sec ) ) { printf( "tv1: %d %d\n", int( tv1.tv_sec ), int( tv1.tv_usec ) ); printf( "tv2: %d %d\n", int( tv2.tv_sec ), int( tv2.tv_usec ) ); return false; } } return true; } test fails result. tv1: 1296011067 632550 tv2: 1296011067 632549 ummm.... why happen? here...

delphi - How to save virtual listview immediately after it displays data? -

i want save data in virtual listview after filled. if use savedialog save data, works. if call save procedure in listviewondata event, prompts error " can not create file...". reproduce observation here. procedure tform6.savefilelist(alistview: tlistview; sfilename: string); begin f:= tfilestream.create(sfilename, fmcreate or fmopenread); ... ... f.free; end; procedure tform6.savevirtualistinsavedialog;// buttonclick calls procedure begin if savedialog1.execute savefilelist(listview1, savedialog1.filename);; // works , save data in sfilename. .. end; procedure tform6.listview1data(sender: tobject; item: tlistitem); begin ld begin ... ... // filling data in virtual list end; // right after filling data, call dosavelist procedure. dosavelist; //error line " can not create file", if annotate line // , call savevirtualistindialog in buttonclick event, //the dat...

Google Chrome extensions -

is there way run native c/c++/obj-c within google chrome extension, official page says extension other web pages, see there no way except native client(nacl). technically possible. i believe looking npapi plugins . not take lightly warning, however: npapi big hammer should used when no other approach work. why extension need c/c++/objective-c, exactly? re: op comment check out this question !

c# - How can i create a checksum from a DataTable object? -

i have datatable 45-50 columns , 45-50 rows , want create checksum text or md5, sha1, don't know 1 better. i'll create text , search in database if there 1 more of it. text length must between 100-200 character, don't know if can it. what's opinions , how can that? thanks. well algorithm wise, either md5 or sha1 (newer) work checksum. couple of things though: why text length need between 100-200 characters? it's still hash, , portrays same information no matter length. what looking do? what part require with?