Daily Archives

Articles indexed Saturday May 22 2010

Page 5/81 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • When do you trust the data / variables

    - by Wizzard
    We all know that all user data, GET/POST/Cookie etc etc needs to be validated for security. But when do you stop, once it's converted into a local variable? eg if (isValidxxx($_GET['foo']) == false) { throw InvalidArgumentException('Please enter a valid foo!'); } $foo = $_GET['foo']; fooProcessor($foo); function fooProcessor($foo) { if (isValidxxx($foo) == false) { throw Invalid...... } //other stuff } To me thats over the top. But what if you load the value from the database... I hope I make sense :)

    Read the article

  • Can I use ruby rest-client to POST a binary file to an http API?

    - by Angela
    I have been using rest-client in ruby in post XML to a third-party API. I need to be able to include a binary image that's uploaded. How do I do that? Uploading Attachments Both letters and postcards will, in most cases, require the attachment of documents. Those attachments might be PDFs in the case of letters or images in the case of postcards. To uploading an attachment, submit a POST to: http://www.postful.com/service/upload Be sure to include the Content-Type and Content-Length headers and the attachment itself as the body of the request. POST /upload HTTP/1.0 Content-Type: application/octet-stream Content-Length: 301456 ... file content here ... If the upload is successful, you will receive a response like the following: 290797321.waltershandy.2

    Read the article

  • How can I edit an exe's resources (File Description, Icon, etc.) using a command line utility?

    - by Coder7862396
    The whole story: I have created a fancy .NET program which has an installer created by the Visual Studio Installer (VSI). The VSI creates 2 files (setup.exe and MyProgramSetup.msi). I understand the reasons for both files being needed, however, I only want to distribute a SINGLE executable installer to users. I do not want them to see 2 files and have to choose between them. In order to do this I have merged the 2 files into a self-extracting archive using IExpress (as seen in this answer: http://stackoverflow.com/questions/535966/merge-msi-and-exe). This works well, however, the self-extracting archive that gets created has an ugly icon and confusing file info (the File Description is "Win32 Cabinet Self-Extractor" with 43 black spaces after it). I need to replace the icon with my custom one and change some of the file properties like "Description", "Company", etc. I would like to have this automatically done as a build step so having a program which is a command line/console utility would be great. I've searched for a while now and can only find one program which does exactly what I want (ResourceTuner Console: http://www.heaventools.com/command-line_resource_editor.htm) but it costs an arm and a leg and my budget is $0. Does anyone know a better way to achieve what I want, or know of a program which can replace an executable's resources without having to use a GUI? By the way, I have also tried "SiComponents Resource Builder 3" which can't even open the executable, and "Julien Audo's ResEdit" which just crashes when I execute the command: "resedit.exe -convert "Modified Resources.rc" "MyProgramSetup.exe"

    Read the article

  • How to make automake less ugly?

    - by Brendan Long
    I recently learned how to use automake, and I'm somewhat annoyed that my compile commands went from a bunch of: g++ -O2 -Wall -c fileName.cpp To a bunch of: depbase=`echo src/Unit.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ g++ -DHAVE_CONFIG_H -I. -I./src -g -O2 -MT src/Unit.o -MD -MP -MF $depbase.Tpo -c -o src/Unit.o src/Unit.cpp &&\ mv -f $depbase.Tpo $depbase.Po Is there any way to clean this up? I can usually easily pick out warning messages, but now the wall of text to read though is 3x bigger and much weirder. I know what my flags are, so making it just says "Compiling xxx.cpp" for each file would be perfect.

    Read the article

  • How do I handle the browser's "share page" intent in android?

    - by gfxmonk
    I read here ( http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html ) what intent-filter is required to handle the "share link" intent that the android web browser sends. I have placed this inside an block in my AndroidManifest.xml like so: <activity android:name=".ShareLink"> <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> <meta-data/> </activity> I cannot for the life of me get this to be triggered though. When I share a link in the android browser, the emulator log shows it's creating a chooser intent, but doesn't give the details of the intent the chooser is acting on. No chooser window pops up, and the intent gets handled by the SMS application. I have also tried kicking off the intent manually: adb shell am start -D -a android.intent.action.SEND -c android.intent.category.DEFAULT -t text/plain -d http://google.com/ but the response I get is: Starting: Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain } Error: Activity not started, unable to resolve Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain flg=0x10000000 } Can anyone tell me what I'm doing wrong? My main (launcher) activity works fine, so I assume there is no issue with installation on the emulator.

    Read the article

  • masm division overflow

    - by Help I'm in college
    I'm trying divide two numbers in assembly. I'm working out of the Irvine assembly for intel computers book and I can't make division work for the life of me. Here's my code .code main PROC call division exit main ENDP division PROC mov eax, 4 mov ebx, 2 div ebx call WriteDec ret divison ENDP END main Where WriteDec should write whatever number is in the eax register (should be set to the quotient after the division call). Instead everytime I run it visual studio crashes (the program does compile however).

    Read the article

  • I want Oracle Query for Formatted Output

    - by reply2viveksshah
    The following is my table design: Ecode Degree YOQ 7654321 SSC 2000 7654321 HSC 2002 7654321 Bcom 2006 7654321 MCA 2010 7654322 SSC 2002 7654322 HSC 2004 7654322 Bcom 2007 7654323 SSC 2002 7654323 HSC 2004 7654323 BE 2008 I want the following formatted output using an oracle query: Ecode Degree year 7654321 SSC,HSC,Bcom,MCA 2000,2002,2006,2010 7654322 SSC,HSC,Bcom 2002,2004,2007 7654323 SSC,HSC,BE 2002,2004,2008 How can this be done?

    Read the article

  • How can I get my License Key from a boot CD?

    - by dubRun
    We recently acquired a server that's been in use for a while, but no associated software, logins, etc. We attempted to blank the administrator account password, but that didn't work. We also tried some deeper edits on the password, but no avail there either. Now what I'm looking to do is to re-install windows using the existing registry key on the server now. I've read that you can access the product key in the registry, and using the password tool (a linux boot cd) we are able to view the registry. When I tried this, I got the ProductId (Which version of windows), not the registry key. The OS I'm attempting to read from in Windows Server 2003 R2.

    Read the article

  • How to recover from broken file?

    - by Earlz
    Hello I have a broken file. It was encrypted(by me) and I did get it unencrypted though I can not remember if it is tar or tar.gz. I believe whichever one it is though is corrupted. I've tried both methods and everything else I could think of for what kind of archive format it could be(7z, zip, etc) and it errors out. What is a possible course of action to take here? The files on it are not extremely important though they are irreplaceable. Are there any tools out there for "fixing" tar or tar.gz formats?

    Read the article

  • Connect server to router with workstation in between?

    - by letseatfood
    I have a server (9 yr old Dell with Ubuntu 10.04 Server Edition) and a workstation (Laptop with Vista) which are both connected to a router. The workstation is able to access the server via web browser for testing my web development projects. Since the server is old and does not have a wireless card, I am wondering if it is possible to connect the server directly to the workstation while maintaining the ability to connect to the server from the workstation. The reason is that the computers are in a separate room from the router and I am trying to limit the amount of wires on the floor, along with trying to avoid buying more hardware (like a wireless card). Thanks and I will be more than happy to clarify!

    Read the article

  • Recovering a Windows XP License key

    - by Fortyrunner
    I threw out a Windows XP machine a while ago (the motherboard failed). I kept the hard drive and the XP installation media. Problem is the license key was on a sticker on the machine - doh! The original manufacturer has gone bust (Evesham) and I suspect that Microsoft will be of little help. Is there any easy way to get the license key off the hard disk? Can I just find the file with the registry data in it and get the key using a hex editor? I really need a spare XP key for use in a Windows VM.

    Read the article

  • SQLAuthority News – Downloads Available for Microsoft SQL Server Compact 3.5

    - by pinaldave
    There are few downloads released for Microsoft SQL Server Compact 3.5. Here is quick lists of the same. Microsoft SQL Server Compact 3.5 Service Pack 2 for Windows Desktop SQL Server Compact 3.5 SP2 is an embedded database that allows developers to build robust applications for Windows desktops and mobile devices. The download contains the files for installing SQL Server Compact 3.5 SP2 and Synchronization Services for ADO.NET version 1.0 SP1 on Windows desktop. Microsoft SQL Server Compact 3.5 Service Pack 2 Server Tools SQL Server Compact 3.5 SP2 Server Tools Windows Installer (MSI) file installs replication components on the computer running the Internet Information Services (IIS) for synchronizing data with SQL Server 2005, SQL Server 2008 and SQL Server 2008 R2 November CTP. Microsoft SQL Server Compact 3.5 Service Pack 2 Books Online SQL Server Compact 3.5 is a small footprint in-process database engine that allows developers to build robust applications for Windows Desktops and Mobile Devices. This download contains the Books Online for the SP2 version of SQL Server Compact 3.5. Note: The brief description below the download link is taken from respective download page. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: SQL, SQL Authority, SQL Documentation, SQL Download, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology

    Read the article

  • How to Write SEO-Friendly Articles

    Writing articles is one of the oldest tools that SEO experts use to help drive traffic to their websites - because it works! But what are the best ways to write SEO-friendly articles that will attract traffic to your website?

    Read the article

  • SQL Server Query Slow from PHP, but FAST from SQL Mgt Studio - WHY???

    - by Ray
    I have a fast running query (sub 1 sec) when I execute the query in SQL Server Mgt Studio, but when I run the exact same query in PHP (on the same db instace) using FreeTDS v8, mssql_query(), it takes much longer (70+ seconds). The tables I'm hitting have an index on a date field that I'm using in the Where clause. Could it be that PHP's mssql functions aren't utilizing the index? I have also tried putting the query inside a stored procedure, then executing the SP from PHP - the same results in time difference occurs. I have also tried adding a WITH ( INDEX( .. ) ) clause on the table where that has the date index, but no luck either. Here's the query: SELECT 1 History, h.CUSTNMBR CustNmbr, CONVERT(VARCHAR(10), h.ORDRDATE, 120 ) OrdDate, h.SOPNUMBE OrdNmbr, h.SUBTOTAL OrdTotal, h.CSTPONBR PONmbr, h.SHIPMTHD Shipper, h.VOIDSTTS VoidStatus, h.BACHNUMB BatchNmbr, h.MODIFDT ModifDt FROM SOP30200 h WITH (INDEX (AK2SOP30200)) WHERE h.SOPTYPE = 2 AND h.DOCDATE >= DATEADD(dd, -61, GETDATE()) AND h.VOIDSTTS = 0 AND h.MODIFDT = CONVERT(VARCHAR(10), DATEADD(dd, -1*@daysAgo, GETDATE()) , 120 ) ;

    Read the article

  • Not able to pass multiple override parameters using nose-testconfig 0.6 plugin in nosetests

    - by Jaikit
    Hi, I am able to override multiple config parameters using nose-testconfig plugin only if i pass the overriding parameters on commandline. e.g. nosetests -c nose.cfg -s --tc=jack.env1:asl --tc=server2.env2:abc But when I define the same thing inside nose.cfg, than only the value for last parameter is modified. e.g. tc = server2.env2:abc tc = jack.env1:asl I checked the plugin code. It looks fine to me. I am pasting the part of plugin code below: parser.add_option( "--tc", action="append", dest="overrides", default = [], help="Option:Value specific overrides.") configure: if options.overrides: self.overrides = [] overrides = tolist(options.overrides) for override in overrides: keys, val = override.split(":") if options.exact: config[keys] = val else: ns = ''.join(['["%s"]' % i for i in keys.split(".") ]) # BUG: Breaks if the config value you're overriding is not # defined in the configuration file already. TBD exec('config%s = "%s"' % (ns, val)) Let me know if any one has any clue.

    Read the article

  • MySQL ORDER BY DESC is fast but ASC is very slow

    - by Pepper
    Hello, I'm completely stumped on this one. For some reason when I sort this query by DESC it's super fast, but if sorted by ASC it's extremely slow. This takes about 150 milliseconds: SELECT posts.id FROM posts USE INDEX (published) WHERE posts.feed_id IN ( 4953,622,1,1852,4952,76,623,624,10 ) ORDER BY posts.published DESC LIMIT 0, 50; This takes about 32 seconds: SELECT posts.id FROM posts USE INDEX (published) WHERE posts.feed_id IN ( 4953,622,1,1852,4952,76,623,624,10 ) ORDER BY posts.published ASC LIMIT 0, 50; The EXPLAIN is the same for both queries. id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE posts index NULL published 5 NULL 50 Using where I've tracked it down to "USE INDEX (published)". If I take that out it's the same performance both ways. But the EXPLAIN shows the query is less efficient overall. id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE posts range feed_id feed_id 4 \N 759 Using where; Using filesort And here's the table. CREATE TABLE `posts` ( `id` int(20) NOT NULL AUTO_INCREMENT, `feed_id` int(11) NOT NULL, `post_url` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `content` blob, `author` varchar(255) DEFAULT NULL, `published` int(12) DEFAULT NULL, `updated` datetime NOT NULL, `created` datetime NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `post_url` (`post_url`,`feed_id`), KEY `feed_id` (`feed_id`), KEY `published` (`published`) ) ENGINE=InnoDB AUTO_INCREMENT=196530 DEFAULT CHARSET=latin1; Is there a fix for this? Thanks!

    Read the article

  • Web-based document merge solution?

    - by rugcutter
    We are looking for a web-based document merge solution. Our application is a web-based project management tool built using Xataface - PHP on Windows IIS + mySQL. We have a function that allows the user to generate a status report in Microsoft Word format based on data in the tool. Currently this function is implemented using LiveDocX. We have a status report template, and LiveDocX performs the merge into the template using data from our project management tool. The main drawback is LiveDocx is web-service based. We are looking to replace LiveDocX in order to reduce our dependence on the up-time of a third-party web-service that we cannot control. Does anyone have any suggestions on a web based document merge solution that I can install on my IIS or PHP based server?

    Read the article

  • CrystalReports.NET - varbinary blob

    - by BhejaFry
    Hi folks, what's the proper way to display an image stored in sqlserver database as an varbinary(max) datatype in CrystalReports for .NET? I have added a 'blobfieldobject' item in crystal reports & it is bound to a datatable with the column of type 'varbinary(max)' but the image won't show up instead a dark background is diplayed. TIA

    Read the article

  • slsvcutil.exe Proxy and Interfaces

    - by JPM
    Is it possible when using slsvcutil.exe to generate a proxy through the command line not to have the proxy file output the Interface in an Asynchronous fashion. For example, if I have a function "foo()" on the serverside in the Interface, when I generate the proxy using Slsvcutil.exe, it makes two functions in the interface definition in the proxy named "BeginFoo()" and "EndFoo()". All I want is "Foo()", I don't need the other two methods. Is this possible? I'm using the proxy with Monotouch which is why I need to use Slsvcutil.exe but don't need the Asynchronous methods. Thanks!

    Read the article

  • Using hashing to group similar records

    - by Neil Dobson
    I work for a fulfillment company and we have to pack and ship many orders from our warehouse to customers. To improve efficiency we would like to group identical orders and pack these in the most optimum way. By identical I mean having the same number of order lines containing the same SKUs and same order quantities. To achieve this I was thinking about hashing each order. We can then group by hash to quickly see which orders are the same. We are moving from an Access database to a PostgreSQL database and we have .NET based systems for data loading and general order processing systems, so we can either do the hashing during the data loading or hand this task over to the DB. My question firstly is should the hashing be managed by DB, possibly using triggers, or should the hash be created on-the-fly using a view or something? And secondly would it be best to calculate a hash for each order line and then to combine these to find an order-level hash for grouping, or should I just use a trigger for all CRUD operations on the order lines table which re-calculates a single hash for the entire order and store the value in the orders table? TIA

    Read the article

  • Git: can I store known repositories along the repository?

    - by 0x6adb015
    I am setting up a Git repository. I know you can add repositories using git config --global, but is there a way that those known repositories gets cloned by users? The goal would be that once the repo gets cloned by userz, they can push to other repos just by their aliases. For example, I add git://X/mobility.git as X to the repo (somehow), a user clone it from git://Y, but then can do git push X without previously doing the git config. How to do that?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >