The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Job manager crashed while running this job (missing heartbeats).
Error code: JobManagerCrashedError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
0
string |
---|
<s>[INST] php session security [/INST] most database engines should support dumping your database into a file. i know mysql does, anyway. this will just be a text file, so you could submit that to subversion, or whatever you use. it'd be easy to run a diff on the files too. </s> |
<s>[INST] php session security [/INST] one guideline is to call session_regenerate_id every time a session's security level changes. this helps prevent session hijacking. </s> |
<s>[INST] what is the meaning of the type safety warning in certain java generics casts? [/INST] you can tell your users to add your from address to their contacts when they complete their order, which, if they do so, will help a lot. otherwise, i would try to get a log from some of your users. sometimes they have details about why it was flagged as spam in the headers of the message, which you could use to tweak the text. other things you can try: put your site name or address in the subject keep all links in the message pointing to your domain (and not email.com) put an address or other contact information in the email </s> |
<s>[INST] what is the meaning of the type safety warning in certain java generics casts? [/INST] this warning is there because java is not actually storing type information at run-time in an object that uses generics. thus, if object is actually a list<string> , there will be no classcastexception at run-time except until an item is accessed from the list that doesn't match the generic type defined in the variable. this can cause further complications if items are added to the list, with this incorrect generic type information. any code still holding a reference to the list but with the correct generic type information will now have an inconsistent list. to remove the warning, try: list<?> list = (list<?>) object; however, note that you will not be able to use certain methods such as add because the compiler doesn't know if you are trying to add an object of incorrect type. the above will work in a lot of situations, but if you have to use add, or some similarly restricted method, you will just have to suffer the yellow underline in eclipse (or a suppresswarning annotation). </s> |
<s>[INST] iphone app in landscape mode, 2008 systems [/INST] rdoc uses simplemarkup so it's fairly simple to create lists, etc. using *, - or a number. it also treats lines that are indented at the same column number as part of the same paragraph until there is an empty line which signifies a new paragraph. do you have a few examples of comments you want rdoc'ed so we could show you how to do them and then you could extrapolate that for the rest of your comments? </s> |
<s>[INST] iphone app in landscape mode, 2008 systems [/INST] the best way to deploy video on the web is using flash - it's much easier to embed cleanly into a web page and will play on more or less any browser and platform combination. the only reason to use windows media player is if you're streaming content and you need extraordinarily strong digital rights management, and even then providers are now starting to use flash even for these. see bbc's iplayer for a superb example. i would suggest that you switch to flash even for internal use. you never know who is going to need to access it in the future, and this will give you the best possible future compatibility. edit - march 20 2013. interesting how these old questions resurface from time to time! how different the world is today and how dated this all seems. i would not recommend a flash only route today by any means - best practice these days would probably be to use html 5 to embed h264 encoded video, with a flash fallback as described here: http://diveintohtml5.info/video.html </s> |
<s>[INST] iphone app in landscape mode, 2008 systems [/INST] if the fact that the first button is used by default is consistent across browsers, put them the right way around in the source code, and then use css to switch their apparent positions. float them left and right to switch them around visually, for example. </s> |
<s>[INST] iphone app in landscape mode, 2008 systems [/INST] tortoise svn with ankhsvn for vs 2005 </s> |
<s>[INST] the definitive guide to form-based website authentication [/INST] we run buildbot - trac at work. i haven't used it too much since my codebase isn't part of the release cycle yet. but we run the tests on different environments (osx/linux/win) and it sends emails — and it's written in python. </s> |
<s>[INST] the definitive guide to form-based website authentication [/INST] you may also be interested in the output of the explain() method , and the resulting explanation object , which will give you an idea of how things are scored the way they are. </s> |
<s>[INST] the definitive guide to form-based website authentication [/INST] definitive article sending credentials the only practical way to send credentials 100% securely is by using ssl . using javascript to hash the password is not safe. common pitfalls for client-side password hashing: if the connection between the client and server is unencrypted, everything you do is vulnerable to man-in-the-middle attacks . an attacker could replace the incoming javascript to break the hashing or send all credentials to their server, they could listen to client responses and impersonate the users perfectly, etc. etc. ssl with trusted certificate authorities is designed to prevent mitm attacks. the hashed password received by the server is less secure if you don't do additional, redundant work on the server. there's another secure method called srp , but it's patented (although it is freely licensed ) and there are few good implementations available. storing passwords don't ever store passwords as plaintext in the database. not even if you don't care about the security of your own site. assume that some of your users will reuse the password of their online bank account. so, store the hashed password, and throw away the original. and make sure the password doesn't show up in access logs or application logs. owasp recommends the use of argon2 as your first choice for new applications. if this is not available, pbkdf2 or scrypt should be used instead. and finally if none of the above are available, use bcrypt. hashes by themselves are also insecure. for instance, identical passwords mean identical hashes--this makes hash lookup tables an effective way of cracking lots of passwords at once. instead, store the salted hash. a salt is a string appended to the password prior to hashing - use a different (random) salt per user. the salt is a public value, so you can store them with the hash in the database. see here for more on this. this means that you can't send the user their forgotten passwords (because you only have the hash). don't reset the user's password unless you have authenticated the user (users must prove that they are able to read emails sent to the stored (and validated) email address.) security questions security questions are insecure - avoid using them. why? anything a security question does, a password does better. read part iii: using secret questions in @jens roland answer here in this wiki. session cookies after the user logs in, the server sends the user a session cookie. the server can retrieve the username or id from the cookie, but nobody else can generate such a cookie (todo explain mechanisms). cookies can be hijacked : they are only as secure as the rest of the client's machine and other communications. they can be read from disk, sniffed in network traffic, lifted by a cross-site scripting attack, phished from a poisoned dns so the client sends their cookies to the wrong servers. don't send persistent cookies. cookies should expire at the end of the client session (browser close or leaving your domain). if you want to autologin your users, you can set a persistent cookie, but it should be distinct from a full-session cookie. you can set an additional flag that the user has auto-logged in, and needs to log in for real for sensitive operations. this is popular with shopping sites that want to provide you with a seamless, personalized shopping experience but still protect your financial details. for example, when you return to visit amazon, they show you a page that looks like you're logged in, but when you go to place an order (or change your shipping address, credit card etc.), they ask you to confirm your password. financial websites such as banks and credit cards, on the other hand, only have sensitive data and should not allow auto-login or a low-security mode. list of external resources dos and don'ts of client authentication on the web (pdf) 21 page academic article with many great tips. ask yc: best practices for user authentication forum discussion on the subject you're probably storing passwords incorrectly introductory article about storing passwords discussion: coding horror: you're probably storing passwords incorrectly forum discussion about a coding horror article. never store passwords in a database! another warning about storing passwords in the database. password cracking wikipedia article on weaknesses of several password hashing schemes. enough with the rainbow tables: what you need to know about secure password schemes discussion about rainbow tables and how to defend against them, and against other threads. includes extensive discussion. </s> |
<s>[INST] checklist for iis 6/asp.net windows authentication? [/INST] i write a soap server that receives xml requests and creates xml responses. (unfortunately, it's not my project, so it's closed source, but that's another problem). it turned out for me that creating (soap) xml documents is fairly simple if you have a data structure that "fits" the schema. i keep the envelope since the response envelope is (almost) the same as the request envelope. then, since my data structure is a (possibly nested) dictionary, i create a string that turns this dictionary into <key>value</key> items. this is a task that recursion makes simple, and i end up with the right structure. this is all done in python code and is currently fast enough for production use. you can also (relatively) easily build lists as well, although depending upon your client, you may hit problems unless you give length hints. for me, this was much simpler, since a dictionary is a much easier way of working than some custom class. for the books, generating xml is much easier than parsing! </s> |
<s>[INST] checklist for iis 6/asp.net windows authentication? [/INST] with the "built in" stuff, you can't, as using 1.0.* or 1.0.0.* will replace the revision and build numbers with a coded date/timestamp, which is usually also a good way. for more info, see the assembly linker documentation in the /v tag. as for automatically incrementing numbers, use the assemblyinfo task: assemblyinfo task this can be configured to automatically increment the build number. there are 2 gotchas: each of the 4 numbers in the version string is limited to 65535. this is a windows limitation and unlikely to get fixed. why are build numbers limited to 65535? using with with subversion requires a small change: using msbuild to generate assembly version info at build time (including subversion fix) retrieving the version number is then quite easy: version v = assembly.getexecutingassembly().getname().version; string about = string.format(cultureinfo.invariantculture, @"yourapp version {0}.{1}.{2} (r{3})", v.major, v.minor, v.build, v.revision); and, to clarify: in .net or at least in c#, the build is actually the third number, not the fourth one as some people (for example delphi developers who are used to major.minor.release.build) might expect. in .net, it's major.minor.build.revision. </s> |
<s>[INST] encrypting passwords [/INST] with the "built in" stuff, you can't, as using 1.0.* or 1.0.0.* will replace the revision and build numbers with a coded date/timestamp, which is usually also a good way. for more info, see the assembly linker documentation in the /v tag. as for automatically incrementing numbers, use the assemblyinfo task: assemblyinfo task this can be configured to automatically increment the build number. there are 2 gotchas: each of the 4 numbers in the version string is limited to 65535. this is a windows limitation and unlikely to get fixed. why are build numbers limited to 65535? using with with subversion requires a small change: using msbuild to generate assembly version info at build time (including subversion fix) retrieving the version number is then quite easy: version v = assembly.getexecutingassembly().getname().version; string about = string.format(cultureinfo.invariantculture, @"yourapp version {0}.{1}.{2} (r{3})", v.major, v.minor, v.build, v.revision); and, to clarify: in .net or at least in c#, the build is actually the third number, not the fourth one as some people (for example delphi developers who are used to major.minor.release.build) might expect. in .net, it's major.minor.build.revision. </s> |
<s>[INST] encrypting passwords [/INST] second the buildbot - trac integration. you can find more information about the integration on the buildbot website . at my previous job, we wrote and used the plugin they mention (tracbb). what the plugin does is rewriting all of the buildbot urls so you can use buildbot from within trac. ( http://example.com/tracbb ). the really nice thing about buildbot is that the configuration is written in python. you can integrate your own python code directly to the configuration. it's also very easy to write your own buildsteps to execute specific tasks. we used buildsteps to get the source from svn, pull the dependencies, publish test results to webdav, etcetera. i wrote an x10 interface so we could send signals with build results. when the build failed, we switched on a red lava lamp. when the build succeeded, a green lava lamp switched on. good times :-) </s> |
<s>[INST] encrypting passwords [/INST] i think you should go for solution 2. there is no 'swap' function in any sql variant i know of. if you need to do this regularly, i suggest solution 1, depending on how other parts of the software are using this data. you can have locking issues if you're not careful. but in short: there is no other solution than the ones you provided. </s> |
<s>[INST] encrypting passwords [/INST] it depends on what kind of application you are building. create a representative test scenario, and start hammering away. then you will know the definitive answer. besides your use case, it also depends on cpu, memory, front-side bus, operating system, cache settings, etcetera. seriously, just test your own scenario. if you need some numbers (that actually may mean nothing in your scenario): oracle berkeley db: performance metrics and benchmarks performance metrics & benchmarks: berkeley db </s> |
<s>[INST] encrypting passwords [/INST] if you are choosing an encryption method for your login system then speed is not your friend, jeff had a to-and-frow with thomas ptacek about passwords and the conclusion was that you should use the slowest, most secure encryption method you can afford to. from thomas ptacek's blog: speed is exactly what you don’t want in a password hash function. modern password schemes are attacked with incremental password crackers. incremental crackers don’t precalculate all possible cracked passwords. they consider each password hash individually, and they feed their dictionary through the password hash function the same way your php login page would. rainbow table crackers like ophcrack use space to attack passwords; incremental crackers like john the ripper, crack, and lc5 work with time: statistics and compute. the password attack game is scored in time taken to crack password x. with rainbow tables, that time depends on how big your table needs to be and how fast you can search it. with incremental crackers, the time depends on how fast you can make the password hash function run. the better you can optimize your password hash function, the faster your password hash function gets, the weaker your scheme is. md5 and sha1, even conventional block ciphers like des, are designed to be fast. md5, sha1, and des are weak password hashes. on modern cpus, raw crypto building blocks like des and md5 can be bitsliced, vectorized, and parallelized to make password searches lightning fast. game-over fpga implementations cost only hundreds of dollars. </s> |
<s>[INST] encrypting passwords [/INST] perhaps this is a little academic and off topic but hx tags are probably not the best choice for a tag cloud for reasons of document structure and all that sort of thing. maybe span s or an ol with appropriate class attributes (plus some css)? </s> |
<s>[INST] encrypting passwords [/INST] i would use javascript to submit the form. the function would be triggered by the onkeypress event of the form element and would detect whether the enter key was selected. if this is the case, it will submit the form. here are two pages that give techniques on how to do this: 1 , 2 . based on these, here is an example of usage (based on here ): <script type="text/javascript">//<!-- function submitenter(myfield,e) { var keycode; if (window.event) { keycode = window.event.keycode; } else if (e) { keycode = e.which; } else { return true; } if (keycode == 13) { myfield.form.submit(); return false; } else { return true; } } //--></script> <input name="mytext" type="text" onkeypress="return submitenter(this,event)" /> </s> |
<s>[INST] encrypting passwords [/INST] the main problem with php sessions and security (besides session hijacking) comes with what environment you are in. by default php stores the session data in a file in the os's temp directory. without any special thought or planning this is a world readable directory so all of your session information is public to anyone with access to the server. as for maintaining sessions over multiple servers. at that point it would be better to switch php to user handled sessions where it calls your provided functions to crud (create, read, update, delete) the session data. at that point you could store the session information in a database or memcache like solution so that all application servers have access to the data. storing your own sessions may also be advantageous if you are on a shared server because it will let you store it in the database which you often times have more control over then the filesystem. </s> |
<s>[INST] format string to title case [/INST] are you looking to get a list of objects that have a certain attribute? if so, a list comprehension is the right way to do this. result = [obj for obj in listofobjs if hasattr(obj, 'attributename')] </s> |
<s>[INST] format string to title case [/INST] here is a simple static method to do this in c#: public static string totitlecaseinvariant(string targetstring) { return system.threading.thread.currentthread.currentculture.textinfo.totitlecase(targetstring); } </s> |
<s>[INST] format string to title case [/INST] in what language? in php it is: ucwords() example: $helloworld = ucwords('hello world'); </s> |
<s>[INST] format string to title case [/INST] what i was thinking of can be achieved using list comprehensions, but i thought that there was a function that did this in a slightly neater way. i.e. 'bar' is a list of objects, all of which have the attribute 'id' the mythical functional way: foo = 12 foo in iter_attr(bar, 'id') the list comprehension way: foo = 12 foo in [obj.id for obj in bar] in retrospect the list comprehension way is pretty neat anyway. </s> |
<s>[INST] format string to title case [/INST] without using a ready-made function, a super-simple low-level algorithm to convert a string to title case: convert first character to uppercase. for each character in string, if the previous character is whitespace, convert character to uppercase. this asssumes the "convert character to uppercase" will do that correctly regardless of whether or not the character is case-sensitive (e.g., '+'). </s> |
<s>[INST] .net xml comment into api documentation [/INST] i've seen it done in a kind of iffy, but pretty reliable way. basically, an element is set to use a specific font and a string is set to that element. if the font set for the element does not exist, it takes the font of the parent element. so, what they do is measure the width of the rendered string. if it matches what they expected for the desired font as opposed to the derived font, it's present. this won't work for monospaced fonts. here's where it came from: javascript/css font detector (ajaxian.com; 12 mar 2007) </s> |
<s>[INST] .net xml comment into api documentation [/INST] you're looking for sandcastle project page: sandcastle releases blog: sandcastle blog ndoc code documentation generator for .net used to be the tool of choice, but support has all but stopped. </s> |
<s>[INST] .net xml comment into api documentation [/INST] have a look at sandcastle , which does exactly that. it's also one of the more simpler solutions out there, and it's more or less the tool of choice, so in the long run, maybe we could help you to set up sandcastle if you specify what issues you encountered during setup? </s> |
<s>[INST] .net xml comment into api documentation [/INST] despite what the msdn article archive of msdn article says about user/machine hive, it doesn't write to hkey_users. rather it writes to hkcu if you select just me and hklm if you select everyone. so my solution is going to be to use the user/machine hive, and then in the application it checks if the registry entries are in hkcu and if not, copies them from hklm. i know this probably isn't the most ideal way of doing it, but it has the least amount of changes. </s> |
<s>[INST] internationalization in your projects [/INST] variables containing primitive types are passed by value in php5. variables containing objects are passed by reference. there's quite an interesting article from linux journal from 2006 which mentions this and other oo differences between 4 and 5. http://www.linuxjournal.com/article/9170 </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] @bernard: i have to admit, most of your example went straight over my head. it does compile, and seems to work, though. is this safe for smp systems or speedstep? that's a good question... i think the code's ok. from a practical standpoint, we use it in my company every day, and we run on a pretty wide array of boxes, everything from 2-8 cores. of course, ymmv, etc, but it seems to be a reliable and low-overhead (because it doesn't make a context switch into system-space) method of timing. generally how it works is: declare the block of code to be assembler (and volatile, so the optimizer will leave it alone). execute the cpuid instruction. in addition to getting some cpu information (which we don't do anything with) it synchronizes the cpu's execution buffer so that the timings aren't affected by out-of-order execution. execute the rdtsc (read timestamp) execution. this fetches the number of machine cycles executed since the processor was reset. this is a 64-bit value, so with current cpu speeds it will wrap around every 194 years or so. interestingly, in the original pentium reference, they note it wraps around every 5800 years or so. the last couple of lines store the values from the registers into the variables hi and lo, and put that into the 64-bit return value. specific notes: out-of-order execution can cause incorrect results, so we execute the "cpuid" instruction which in addition to giving you some information about the cpu also synchronizes any out-of-order instruction execution. most os's synchronize the counters on the cpus when they start, so the answer is good to within a couple of nano-seconds. the hibernating comment is probably true, but in practice you probably don't care about timings across hibernation boundaries. regarding speedstep: newer intel cpus compensate for the speed changes and returns an adjusted count. i did a quick scan over some of the boxes on our network and found only one box that didn't have it: a pentium 3 running some old database server. (these are linux boxes, so i checked with: grep constant_tsc /proc/cpuinfo) i'm not sure about the amd cpus, we're primarily an intel shop, although i know some of our low-level systems gurus did an amd evaluation. hope this satisfies your curiosity, it's an interesting and (imho) under-studied area of programming. you know when jeff and joel were talking about whether or not a programmer should know c? i was shouting at them, "hey forget that high-level c stuff... assembler is what you should learn if you want to know what the computer is doing!" </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] partially. the text is inserted, but the warning is still generated. i found a discussion that indicated the text needed to be preceded with 'e', as such: insert into escapetest (text) values (e'this is the first part \n and this is the second'); this suppressed the warning, but the text was still not being returned correctly. when i added the additional slash as michael suggested, it worked. as such: insert into escapetest (text) values (e'this is the first part \\n and this is the second'); </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] there is nothing i know of that can do this without you at least writing a little bit of code... you will need 2 separate library: a csv parser framework an xml serialization framework the csv parser i would recommend (unless you want to have a little bit of fun to write your own csv parser) is opencsv (a sourceforge project for parsing csv data) the xml serialization framework should be something that can scale in case you want to transform large (or huge) csv file to xml: my recommendation is the sun java streaming xml parser framework (see here ) which allows pull-parsing and serialization. </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] very roughly and from memory since i don't have code on this laptop: using (oledbconnection conn = new oledbconnection()) { conn.connectionstring = "whatever connection string"; using (oledbcommand cmd = new oledbcommand()) { cmd.connection = conn; cmd.commandtext = "select * from cooltable"; using (oledbdatareader dr = cmd.executereader()) { while (dr.read()) { // do something like console.writeline(dr["column name"] as string); } } } } </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] all editions of sql server 2000/2005/2008 support having multiple databases, each using their own collation sequence. you don't need the enterprise version. when you have a database that uses a collation sequence that is different from default collation for the database server, you will need to take some extra precautions if you use temporary tables and/or table variables. temp tables/variables live in the tempdb database, which uses the collation seqyuence used by by the master databases. just remember to use " collate database_default " when defining character fields in the temp tables/variables. i blogged about that not too long ago, if you want some more details. </s> |
<s>[INST] string literals and escape characters in postgresql [/INST] cool. i also found the documentation regarding the e: http://www.postgresql.org/docs/8.3/interactive/sql-syntax-lexical.html#sql-syntax-strings quote formatting by 'randall' postgresql also accepts "escape" string constants, which are an extension to the sql standard. an escape string constant is specified by writing the letter e (upper or lower case) just before the opening single quote, e.g. e'foo' . (when continuing an escape string constant across lines, write e only before the first opening quote.) within an escape string, a backslash character ( \ ) begins a c-like backslash escape sequence, in which the combination of backslash and following character(s) represents a special byte value: \b is a backspace, \f is a form feed, \n is a newline, \r is a carriage return, \t is a tab. also supported are \ <digits> , where < digits > represents an octal byte value, and \x <hexdigits> , where < hexdigits > represents a hexadecimal byte value. (it is your responsibility that the byte sequences you create are valid characters in the server character set encoding.) any other character following a backslash is taken literally. thus, to include a backslash character, write two backslashes (\\). also, a single quote can be included in an escape string by writing \', in addition to the normal way of ''. </s> |
<s>[INST] adding a method to an existing object instance in python [/INST] encoding flash video is actually very easy with ffmpeg. you can use one command to convert from just about any video format, ffmpeg is smart enough to figure the rest out, and it'll use every processor on your machine. invoking it is easy: ffmpeg -i input.avi output.flv ffmpeg will guess at the bitrate you want, but if you'd like to specify one, you can use the -b option, so -b 500000 is 500kbps for example. there's a ton of options of course, but i generally get good results without much tinkering. this is a good place to start if you're looking for more options: video options . you don't need a special web server to show flash video. i've done just fine by simply pushing .flv files up to a standard web server, and linking to them with a good swf player, like flowplayer . wmvs are fine if you can be sure that all of your users will always use [a recent, up to date version of] windows only, but even then, flash is often a better fit for the web. the player is even extremely skinnable and can be controlled with javascript. </s> |
<s>[INST] adding a method to an existing object instance in python [/INST] the database will do this for you. look at "select ... for update", which is designed just for this kind of thing. it will give you a write lock on the selected rows, which you can then commit or roll back. </s> |
<s>[INST] adding a method to an existing object instance in python [/INST] in python monkeypatching generally works by overwriting a class or function's signature with your own. below is an example from the zope wiki : from someotherproduct.somemodule import someclass def speak(self): return "ook ook eee eee eee!" someclass.speak = speak this code will overwrite/create a method called speak in the class. in jeff atwood's recent post on monkey patching , he showed an example in c# 3.0 which is the current language i use for work. </s> |
<s>[INST] adding a method to an existing object instance in python [/INST] is this a console application or a windows forms application? if it's a .net 1.1 console application this is, sadly, by design -- it's confirmed by an msft dev in the second blog post you referenced : btw, on my 1.1 machine the example from msdn does have the expected output; it's just that the second line doesn't show up until after you've attached a debugger (or not). in v2 we've flipped things around so that the unhandledexception event fires before the debugger attaches, which seems to be what most people expect. it sounds like .net 2.0 does this better (thank goodness), but honestly, i never had time to go back and check. </s> |
<s>[INST] adding a method to an existing object instance in python [/INST] it's a windows forms application. the exceptions that are caught by application.threadexception work fine, and i don't get the ugly .net exception box ( ok to terminate, cancel to debug? who came up with that??). i was getting some exceptions that weren't being caught by that and ended up going to the appdomain.unhandledexception event that were causing problems. i think i've caught most of those exceptions, and i am displaying them in our nice error box now. so i'll just have to hope there are not some other circumstances that would cause exceptions to not be caught by the application.threadexception handler. </s> |
<s>[INST] ensuring that exceptions are always caught [/INST] you say you have enough trouble getting one cube to display... so i am not sure if you have got one to display or not. basically... put your code for writing a cube in one function, then just call that function 100 times. void drawcube() { //code to draw the cube } void displaycubes() { for(int i = 0; i < 10; ++i) { for(int j = 0; j < 10; ++j) { glpushmatrix(); //alter these values depending on the size of your cubes. //this call makes sure that your cubes aren't drawn overtop of each other gltranslatef(i*5.0, j*5.0, 0); drawcube(); glpopmatrix(); } } } that is the basic outline for how you could go about doing this. if you want something more efficient take a look into display lists sometime once you have the basics figured out :) </s> |
<s>[INST] how to make subdomain user accounts in a webapp [/INST] if you are doing "just extract and run", you are going to run in security issues. this is especially true if you are users are running vista (or later). is there a reason why you wanted to avoid packaging your applications inside an installer? using an installer would alleviate the "external source" problem. you would be able to use .chm files without any problems. we use installaware to create our install packages. it's not cheap, but is very good. if cost is your concern, wix is open source and pretty robust. wix does have a learning curve, but it's easy to work with. </s> |
<s>[INST] how to make subdomain user accounts in a webapp [/INST] the gnu c library regular expressions facility (regcomp(), regexec() and friends) is broken. use libetre instead; the function signatures match the ones provided by glibc. http://laurikari.net/tre/ </s> |
<s>[INST] how to make subdomain user accounts in a webapp [/INST] the trick to that is to use url rewriting so that name.domain.com transparently maps to something like domain.com/users/name on your server. once you start down that path, it's fairly trivial to implement. </s> |
<s>[INST] how to make subdomain user accounts in a webapp [/INST] don't worry about dns and url rewriting your dns record will be static, something like: *.yourdomain.com a 123.123.123.123 ask your dns provider to do it for you (if it's not done already) or do it by yourself if you have control over your dns records. this will automatically point all your subdomains (current and future ones) into the same http server. once it's done, you will only need to parse host header on every single http request to detect what hostname was used to access your server-side scripts on your http server. assuming you're using asp.net, this is kind of silly example i came up with but works and demonstrates simplicity of this approach: <%@ language="c#" %> <% string subdomain = request.url.host.split('.')[0].toupper(); if (subdomain == "clientxxx") response.write("hello clientxxx, your secret number is 33"); else if (subdomain == "clientyyy") response.write("hello clientyyy, your secret number is 44"); else response.write(subdomain+" doesn't exist"); %> </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] i would look into imap imap, pop3 and nntp </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] try changing the argument names to sender and args . and, after you have it working, switch the call over to scriptmanager.registerclientscriptblock , regardless of ajax use. </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] i'm sure you could write a small app that takes an xsd file and parses it into a sql script. i've never seen code out there to do it though, but that's not saying it doesn't exist. </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] ok, per pix0r 's, sparks ' and dave 's answers it looks like there are three ways to do this: virtual hosts open c:\xampp\apache\conf\extra\httpd-vhosts.conf. un-comment ~line 19 ( namevirtualhost *:80 ). add your virtual host (~line 36): <virtualhost *:80> documentroot c:\projects\transitcalculator\trunk servername transitcalculator.localhost <directory c:\projects\transitcalculator\trunk> order allow,deny allow from all </directory> </virtualhost> open your hosts file (c:\windows\system32\drivers\etc\hosts). add 127.0.0.1 transitcalculator.localhost #transitcalculator to the end of the file (before the spybot - search & destroy stuff if you have that installed). save (you might have to save it to the desktop, change the permissions on the old hosts file (right click > properties), and copy the new one into the directory over the old one (or rename the old one) if you are using vista and have trouble). restart apache. now you can access that directory by browsing to http://transitcalculator.localhost/ . make an alias starting ~line 200 of your http.conf file, copy everything between <directory "c:/xampp/htdocs"> and </directory> (~line 232) and paste it immediately below with c:/xampp/htdocs replaced with your desired directory (in this case c:/projects ) to give your server the correct permissions for the new directory. find the <ifmodule alias_module></ifmodule> section (~line 300) and add alias /transitcalculator "c:/projects/transitcalculator/trunk" (or whatever is relevant to your desires) below the alias comment block, inside the module tags. change your document root edit ~line 176 in c:\xampp\apache\conf\httpd.conf; change documentroot "c:/xampp/htdocs" to #documentroot "c:/projects" (or whatever you want). edit ~line 203 to match your new location (in this case c:/projects ). notes: you have to use forward slashes "/" instead of back slashes "\". don't include the trailing "/" at the end. restart your server . </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] i think that you are after this $username = $_server['php_auth_user']; $password = $_server['php_auth_pw']; </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] how about running ie with the html favorites file as a parameter? iexplore file://\windows\fav.htm </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] i think we could also include non-.net-specific approaches to parallel processing if those are among the best options to consider. </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] or you could start throwing critical exceptions. surely, an access violation exception will catch your users' attention. </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] using smo/dmo, it isn't too difficult to generate a script of your schema. data is a little more fun, but still doable. in general, i take "script it" approach, but you might want to consider something along these lines: distinguish between development and staging, such that you can develop with a subset of data ... this i would create a tool to simply pull down some production data, or generate fake data where security is concerned. for team development, each change to the database will have to be coordinated amongst your team members. schema and data changes can be intermingled, but a single script should enable a given feature. once all your features are ready, you bundle these up in a single sql file and run that against a restore of production. once your staging has cleared acceptance, you run the single sql file again on the production machine. i have used the red gate tools and they are great tools, but if you can't afford it, building the tools and working this way isn't too far from the ideal. </s> |
<s>[INST] how can i get the authenticated user name under apache using plain http authentication and php? [/INST] @larsenal if you want to branch outside of .net there has been a lot of discussion about intel's threading building blocks which is a parallel library for c++. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] i usually do a project for the gui a project for the business logic a project for data access and a project for unit tests. but sometimes it is prudent to have separation based upon services (if you are using a service oriented architecture) such as authentication, sales, etc. i guess the rule of thumb that i work off of is that if you can see it as a component that has a clear separation of concerns then a different project could be prudent. but i would think that folders versus projects could just be a preference or philosophy. i personally feel that if reusable code is split into projects it is simpler to use other places than if it is just in folders. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] here's a dynamic sql script i've used in the past. it can be further modified but it will give you the basics. i prefer scripting it to avoid the mistakes you can make using the management studio: declare @olddb varchar(100) declare @newdb varchar(100) declare @vchbackuppath varchar(255) declare @query varchar(8000) /*test code to implement select @olddb = 'pubs' select @newdb = 'pubs2' select @vchbackuppath = '\\dbserver\c$\program files\microsoft sql server\mssql.1\mssql\backup\pubs.bak' */ set nocount on; select @query = 'create database ' + @newdb exec(@query) select @query = ' declare @vbakpath varchar(256) declare @oldmdfname varchar(100) declare @oldldfname varchar(100) declare @newmdfpath varchar(100) declare @newldfpath varchar(100) declare @restquery varchar(800) select @vbakpath = ''' + @vchbackuppath + ''' select @oldldfname = name from ' + @olddb +'.dbo.sysfiles where filename like ''%.ldf%'' select @oldmdfname = name from ' + @olddb +'.dbo.sysfiles where filename like ''%.mdf%'' select @newmdfpath = physical_name from ' + @newdb +'.sys.database_files where type_desc = ''rows'' select @newldfpath = physical_name from ' + @newdb +'.sys.database_files where type_desc = ''log'' select @restquery = ''restore database ' + @newdb + ' from disk = n'' + '''''''' + @vbakpath + '''''''' + '' with move n'' + '''''''' + @oldmdfname + '''''''' + '' to n'' + '''''''' + @newmdfpath + '''''''' + '', move n'' + '''''''' + @oldldfname + '''''''' + '' to n'' + '''''''' + @newldfpath + '''''''' + '', nounload, replace, stats = 10'' exec(@restquery) --print @restquery' exec(@query) </s> |
<s>[INST] what good technology podcasts are out there? [/INST] the only answer i can think of right now is - read the manual for uudeview. as much as i would like to help you, i am not an expert in this area, so you'll have to wait for someone more knowledgable to come down here and help you. meanwhile i can give you links to some documents that might help you: uudeview home page using xdflengine gettting started with the xdfl engine sorry if this doesn't help you. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] if you are into web design and website creation then i recommend boagworld and also the rissington podcast even if you are not. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] i agree that your text editor is probably your best bet. i do know some people who swear by xmlspy , if you need something that's tailored specifically for dealing with xml files in a visual way. i bet you could find some f/oss work-alikse but i'm not aware of any. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] the oxygen xml editor a great ide for windows, bit expensive tho. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] in the stack overflow podcast se-radio was mentioned. it's pretty in depth. also if you are an aspiring javascript developer, the douglas crockford "the javascript programming language" and "advanced javascript" talks on yui developer theatre are excellent. there are a few other gems on the podcast too. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] open source xml editors examined - it is a little bit outdated though. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] it's kind of low tech, and there might be a better solution out there, but you could just store your schema in an sql script which can be run to create the database. i think you can execute a command to generate this script, but i don't know the command unfortunately. then, commit the script into source control along with the code that works on it. when you need to change the schema along with the code, the script can be checked in along with the code that requires the changed schema. then, diffs on the script will indicate diffs on schema changes. with this script, you could integrate it with dbunit or some kind of build script, so it seems it could fit in with your already automated processes. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] i work a lot with xml, and have found oxygen to be a great editor. it's cross-platform and has a graphical schema editor, but since i use dtds and not schemas, i can't vouch for the schema editor's quality. the rest of the editing package (such as the xml editor and xslt debugger) is solid, so it could be worth a try. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] i like general software stackoverflow (perhaps too obvious) deep fried bytes hanselminutes software engineering radio (via brenden) herding code dot net alt.net podcast polymorphic podcast productivity 43 folders </s> |
<s>[INST] what good technology podcasts are out there? [/INST] the google developer podcast is good. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] denny wrote: i personally feel that if reusable code is split into projects it is simpler to use other places than if it is just in folders. i really agree with this - if you can reuse it, it should be in a separate project. with that said, it's also very difficult to reuse effectively :) here at so, we've tried to be very simple with three projects: mvc web project (which does a nice job of separating your layers into folders by default) database project for source control of our db unit tests against mvc models/controllers i can't speak for everyone, but i'm happy with how simple we've kept it - really speeds the builds along! </s> |
<s>[INST] what good technology podcasts are out there? [/INST] in the rails world, there's the concept of migrations, scripts in which changes to the database are made in ruby rather than a database-specific flavour of sql. your ruby migration code ends up being converted into the ddl specific to your current database; this makes switching database platforms very easy. for every change you make to the database, you write a new migration. migrations typically have two methods: an "up" method in which the changes are applied and a "down" method in which the changes are undone. a single command brings the database up to date, and can also be used to bring the database to a specific version of the schema. in rails, migrations are kept in their own directory in the project directory and get checked into version control just like any other project code. this oracle guide to rails migrations covers migrations quite well. developers using other languages have looked at migrations and have implemented their own language-specific versions. i know of ruckusing , a php migrations system that is modelled after rails' migrations; it might be what you're looking for. </s> |
<s>[INST] what good technology podcasts are out there? [/INST] by default, always just create new folder within the same project you will get single assembly (without additional ilmerge gymnastic) easier to obfuscate (because you will have less public types and methods, ideally none at all) separating your source code into multiple projects makes only sense if you... have some portions of the source code that are part of the project but not deployable by default or at all (unit tests, extra plugins etc.) more developers involved and you want to treat their work as consumable black box. (not very recommended) if you can clearly separate your project into isolated layers/modules and you want to make sure that they can't cross-consume internal members. (also not recommended because you will need to decide which aspect is the most important) if you think that some portions of your source code could be reusable, still don't create it as a new project. just wait until you will really want to reuse it in another solution and isolate it out of original project as needed. programming is not a lego, reusing is usually very difficult and often won't happen as planned. </s> |
<s>[INST] how to tab focus onto a dropdown field in mac osx [/INST] why not create a domain object based approach to this problem: public class customerdownloadinfo { private string sku; private readonly icustomer customer; public customerdownloadinfo(icustomer customer){ customer = customer; } public void attachsku(string sku){ sku = sku; } public string sku{ get { return sku; } } public string link{ get{ // etc... etc... } } } there are a million variations on this, but once you aggregate this information, wouldn't it be easier to present? </s> |
<s>[INST] how to tab focus onto a dropdown field in mac osx [/INST] the way i like to do this is using the %x literal, which makes it easy (and readable!) to use quotes in a command, like so: directorylist = %x[find . -name '*test.rb' | sort] which, in this case, will populate file list with all test files under the current directory, which you can process as expected: directorylist.each do |filename| filename.chomp! # work with file end </s> |
<s>[INST] how to tab focus onto a dropdown field in mac osx [/INST] go to system preferences > keyboard and mouse, then choose keyboard shortcuts. at the bottom, ensure full keyboard access is set to "all controls". it's a long time since i turned it on but i think that's all you need to do </s> |
<s>[INST] how to tab focus onto a dropdown field in mac osx [/INST] apple menu > system preferences > keyboard & mouse > keyboard shortcuts: change the radio button at the bottom from "text boxes and lists only" to "all controls." edit: dammit. we're a fast group around here aren't we? :-) </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] i'd like to see that query, but i imagine it's some problem with some sort of iterator, and while i can't think of any situations where its possible, i bet it's from a bad while/case/cursor or a ton of poorly implemented views. </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] using the example you gave: <form> <input type="text" name="field1" /><!-- put your cursor in this field and press enter --> <input type="submit" name="prev" value="previous page" /> <!-- this is the button that will submit --> <input type="submit" name="next" value="next page" /> <!-- but this is the button that i want to submit --> </form> if you click on "previous page", only the value of "prev" will be submitted. if you click on "next page" only the value of "next" will be submitted. if however, you press enter somewhere on the form, neither "prev" nor "next" will be submitted. so using pseudocode you could do the following: if "prev" submitted then previous page was click else if "next" submitted then next page was click else no button was click </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] @chopeen you could change the way you're calculating these statistics, and instead keep a separate table of all per-product stats.. when an order is placed, loop through the products and update the appropriate records in the stats table. this would shift a lot of the calculation load to the checkout page rather than running everything in one huge query when running a report. of course there are some stats that aren't going to work as well this way, e.g. tracking customers' next purchases after purchasing a particular product. </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] for sql server 2005, i'd recommend using table variables and partially building the data as you go. to do this, create a table variable that represents your final result set you want to send to the user. then find your primary table (say the orders table in your example above) and pull that data, plus a bit of supplementary data that is only say one join away (customer name, product name). you can do a select into to put this straight into your table variable. from there, iterate through the table and for each row, do a bunch of small select queries that retrieves all the supplemental data you need for your result set. insert these into each column as you go. once complete, you can then do a simple select * from your table variable and return this result set to the user. i don't have any hard numbers for this, but there have been three distinct instances that i have worked on to date where doing these smaller queries has actually worked faster than doing one massive select query with a bunch of joins. </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] post the query :d also i feel like one of the possible problems could be having a ton (read 200+) of name/value tables which could condensed into a single lookup table. </s> |
<s>[INST] are there best practices for testing security in an agile development shop? [/INST] a virtualhost would also work for this and may work better for you as you can host several projects without the need for subdirectories. here's how you do it: httpd.conf (or extra\httpd-vhosts.conf relative to httpd.conf. trailing slashes "\" might cause it not to work): namevirtualhost *:80 # ... <virtualhost *:80> documentroot c:\projects\transitcalculator\trunk\ servername transitcalculator.localhost <directory c:\projects\transitcalculator\trunk\> order allow,deny allow from all </directory> </virtualhost> hosts file (c:\windows\system32\drivers\etc\hosts usually): # localhost entries 127.0.0.1 localhost transitcalculator.localhost now restart xampp and you should be able to access http://transitcalculator.localhost/ and it will map straight to that directory. this can be helpful if you're trying to replicate a production environment where you're developing a site that will sit on the root of a domain name. you can, for example, point to files with absolute paths that will carry over to the server: <img src="/images/logo.png" alt="my logo" /> whereas in an environment using aliases or subdirectories, you'd need keep track of exactly where the "images" directory was relative to the current file. </s> |
<s>[INST] .net obfuscation tools/strategy [/INST] the dragon book is definitely the "building compilers" book, but if your language isn't quite as complicated as the current generation of languages, you may want to look at the interpreter pattern from design patterns . the example in the book designs a regular expression-like language and is well thought through, but as they say in the book, it's good for thinking through the process but is effective really only on small languages. however, it is much faster to write an interpreter for a small language with this pattern than having to learn about all the different types of parsers, yacc and lex, et cetera... </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] i've also been investigating wiki software for use as a kb, but it is tricky to find something that is easy to use for non-technical people. there are many wikis that attempt to provide wysiwyg editing, but most of the software i've found generates nasty inefficient html markup from the wysiwyg editor. one notable exception to this is confluence which generates wiki syntax from a wysiwyg editor. this still isn't perfect (show me a wysiwyg editor that is) but is a pretty good compromise between retaining simple wiki syntax for those who like it and allowing non-technical users to contribute content. the only problem is that confluence isn't free ($1,200 for 25 user license). edit: i also tried dekiwiki and while the ui is nice it doesn't seem to be quite ready for primetime (suffers terribly from the bad wysiwyg output disease mentioned above). also seems like they lack direction as there are so many different ways of accomplishing the same task. </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] which language you are using? it seems like pretty much all of them have built-in sql escape functions that would be better to use. for example, php has mysql_real_escape_string and addslashes . </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] i would also escape comments (double dash) -- </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] you're better off using prepared statements with placeholders. are you using php, .net...either way, prepared statements will provide more security, but i could provide a sample. </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] i've looked at worldpay and secpay in the past; you need to know your onions to use them competently, i think - if you want really nice integration, at any rate. </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] i am not sure if mysql supports parameterized queries, if so, you should make an effort to go this route. this will ensure the users input can't do anything malicious. otherwise some "bad" characters in addition to what you mentioned would be semicolon (;) and comments (-- and /* */). </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] the glib library used on the gnome project may also be some use. moreover it is pretty well tested. ibm developer works has a good tutorial on its use: manage c data using the glib collections </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] while semi-related to your question, it does not entirely fit the powershell netcmdlets motif. but i wanted to post it anyhow as i use it daily and it may help others. simply making shift-control-c key combo into displaying the visual studio command prompt. </s> |
<s>[INST] what do i need to escape when sending a query? [/INST] pdf has the disadvantage of requiring the adobe reader i use foxit reader on windows at home and at work. a lot smaller and very quick to open. very handy when you are wondering what exactly a80000326.pdf is and why it is clogging up your documents folder. </s> |
<s>[INST] data verifications in getter/setter or elsewhere? [/INST] for maximum security, performance, and correctness use prepared statements. here's how to do this with lots of examples in different languages, including php: https://stackoverflow.com/questions/1973/what-is-the-best-way-to-avoid-sql-injection-attacks </s> |
<s>[INST] data verifications in getter/setter or elsewhere? [/INST] use prepared/parameterized queries! </s> |
<s>[INST] data verifications in getter/setter or elsewhere? [/INST] i have adapted code found on the codeproject to create the following: arraylist primenumbers = new arraylist(); for(int i = 2; primenumbers.count < 10000; i++) { bool divisible = false; foreach(int number in primenumbers) { if(i % number == 0) { divisible = true; } } if(divisible == false) { primenumbers.add(i); console.write(i + " "); } } testing this on my asp.net server took the rountine about 1 minute to run. </s> |
<s>[INST] data verifications in getter/setter or elsewhere? [/INST] validation should be captured separately from getters or setters in a validation method. that way if the validation needs to be reused across multiple components, it is available. when the setter is called, such a validation service should be utilized to sanitize input into the object. that way you know all information stored in an object is valid at all times. you don't need any kind of validation for the getter, because information on the object is already trusted to be valid. don't save your validation until a database update!! it is better to fail fast . </s> |
<s>[INST] data verifications in getter/setter or elsewhere? [/INST] my team scripts out all database changes, and commits those scripts to svn, along with each release of the application. this allows for incremental changes of the database, without losing any data. to go from one release to the next, you just need to run the set of change scripts, and your database is up-to-date, and you've still got all your data. it may not be the easiest method, but it definitely is effective. </s> |
<s>[INST] is there a keyboard shortcut to view all open documents in visual studio 2008 [/INST] it's because the pipe version is creating a subshell, which reads the variable into its local space which then is destroyed when the subshell exits. execute this command $ echo $$;cat | read a 10637 and use pstree -p to look at the running processes, you will see an extra shell hanging off of your main shell. | |-bash(10637)-+-bash(10786) | | `-cat(10785) </s> |
<s>[INST] my website got hacked.. what should i do? [/INST] i really like regular expressions. as long as the command strings are fairly simple, you can write a few regexes that could take a few pages of code to manually parse. i would suggest you check out http://www.regular-expressions.info for a good intro to regexes, as well as specific examples for java. </s> |
<s>[INST] my website got hacked.. what should i do? [/INST] a simple string tokenizer on spaces should work, but there are really many ways you could do this. here is an example using a tokenizer: string command = "kick person"; stringtokenizer tokens = new stringtokenizer(command); string action = null; if (tokens.hasmoretokens()) { action = tokens.nexttoken(); } if (action != null) { docommand(action, tokens); } then tokens can be further used for the arguments. this all assumes no spaces are used in the arguments... so you might want to roll your own simple parsing mechanism (like getting the first whitespace and using text before as the action, or using a regular expression if you don't mind the speed hit), just abstract it out so it can be used anywhere. </s> |
End of preview.