Daily Archives

Articles indexed Tuesday December 21 2010

Page 11/33 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Validating/Allowing YouTube Embed Code

    - by mellowsoon
    Hi, hopefully this is a simple question. I have a simple custom forum on my site written in PHP. For security reasons I don't allow any HTML in the forum posts. I only allow certain BBCode tags. I would however like to allow embedded YouTube videos. So my question is this: What's the best (most secure) way to validate the YouTube embed code? YouTube is currently using iframes to embed videos, but obviously I can't just allow the iframe tag. I also need to ensure the src of the iframe is a YouTube URL, and ensure there's no other malicious bits of code in the iframe code.

    Read the article

  • Restart Delphi Application Programmatically

    - by Smasher
    It should not be possible to run multiple instances of my application. Therefore the project source contains: CreateMutex (nil, False, PChar (ID)); if (GetLastError = ERROR_ALREADY_EXISTS) then Halt; Now I want to restart my application programmatically. The usual way would be: AppName := PChar(Application.ExeName) ; ShellExecute(Handle,'open', AppName, nil, nil, SW_SHOWNORMAL) ; Application.Terminate; But this won't work in my case because of the mutex. Even if I release the mutex before starting the second instace it won't work because shutdown takes some time and two instance cannot run in parallel (because of common resources and other effects). Is there a way to restart an application with such characteristics? (If possible without an additional executable) Thanks in advance.

    Read the article

  • How can I undo my last git add/commit ?

    - by dan
    I edited a file and did: git add file.py git commit -m 'fixed bug' I then edited another file and performed a minor bug fix. I don't want two commits, one after the other, showing 'bug fix'. I want one commit with 'bug fixes'. How can I undo the last add/commit and change the first commit message? I was looking at the git reset, git revert, git undo commands but I don't want to screw up my repo with a guess EDIT: Found out how to do it: http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

    Read the article

  • Parent Child Relationships with Fluent NHibernate?

    - by ElHaix
    I would like to create a cascading tree/list of N number of children for a given parent, where a child can also become a parent. Given the following data structure: CountryType=1; ColorType=3; StateType=5 6,7,8 = {Can, US, Mex} 10, 11, 12 = {Red, White, Blue} 20,21,22= {California, Florida, Alberta} TreeID ListTypeID ParentTreeID ListItemID 1 1 Null 6 (Canada is a Country) 2 1 Null 7 (US is a Country) 3 1 Null 8 (Mexico is a Country) 4 3 3 10 (Mexico has Red) 5 3 3 11 (Mexico has White) 6 5 1 22 (Alberta is in Canada) 7 5 7 20 (California is in US) 8 5 7 21 (Florida is in US) 9 3 6 10 (Alberta is Red) 10 3 6 12 (Alberta is Blue) 11 3 2 10 (US is Red) 12 3 2 11 (Us is Blue) How would this be represented in Fluent NHibernate classes? Some direction would be appreciated. Thanks.

    Read the article

  • Partition of tables in MySQL

    - by Joel
    Hello, I have read that in a case where a table has many columns, but most of the time only one of them is used (say a title column in a forum post), a way to increase performance would be a partition to two tables, where one will contain only the title and the other one will contain the other columns (such as the forum post body). However, in case I use select ForumTitle from Forum; won't that be good enough to prevent the load of all columns (such as the forum post's body) to the memory, and eliminate the need of partition? Thanks, Joel

    Read the article

  • Modular GWT design concerns

    - by GlGuru
    Hi, I have a couple of questions regarding a modular GWT based application framework. I have some ideas about them but being new to the field of web development I feel they are far from ideal. I'd appreciate a few comments and suggestions in this regard. Here are my questions: I am developing a framework which will allow third parties to embed GWT applications into our website and do some communication with them using simple iFrame postMessage. All these third party modules are going to use our SDK which is also GWT based. The problem arises that even though all the modules will be using the same codebase there is going to be a massive overheard in the amount of duplicate Javascript code (i.e. our common SDK code base which is quite large) being downloaded on the client's machine. This is highly redundant and problematic, not only due to the sheer size of duplicate code but, also due to the fact that subsequent updates of the SDK would require the modules to be recompiled which is going to create a DLL hell kind of scenario in the long run. What is the best way of doing this kind of thing? Is there a way where I can have some static GWT code (i.e. the SDK) and the dynamic GWT module refers to it (even if lies on a different domain) and it all work happily? The other part of the problem lies in providing robust scripting front end to the SDK. At first it appears to be trivial since Javascript itself is a scripting language. However, I do not know how to load and call a piece of pure Javascript code at runtime? I am willing to put restrictions on the target Javascript (i.e. having a function main and unique namespace or something). Furthermore the Javascript will come as a string from a database and not as a full URL. If its doable in Javascript how does one get this right in GWT i.e. forcing the compiler to emit a certain function in the generated Javascript? This I believe can be lesser of a problem by having a stub Javascript with all the right requirements which just loads up a GWT generated Javascript. Is any of this possible at all? I generally hate to be this verbose but I hope to find a quick solution to the problem as its holding up my progress. I'd highly appreciate any comments, suggestions and experiences.

    Read the article

  • emacs public/protected/private label indentation of C++ header file not working for zero offset

    - by murrekatt
    I cannot get zero offset for some things for my C++ header files in emacs even if I have it defined in my .emacs file. The header file below shows a class definition inside two namespaces and most importantly the public keyword I would like to have with zero offset like below. namespace n1 { namespace n2 { class SomeClass { public: // this line with zero offset SomeClass(); ... }; } // n2 } // n2 In my .emacs file I have added label like this: (c-set-offset 'label 0) I used Ctrl-C Ctrl-S to find out what to modify. Other offsets I have defined in the .emacs file are working fine and also values other than 0 work for label. When I set offset 0 for label it turns out to be 1 when hitting tab for that line. This is strange and looks like something else is overriding or adding a minimum of 1. Can anyone explain how I can achieve what I want and maybe also an explanation what is happening currently? Phew, this was my first question here. Thanks :)

    Read the article

  • Reporting Services Expression

    - by Alex
    I'm trying to set the Hidden-property of a Textbox based on this expression: =IIf(IsNothing(Parameters!customer_numbers.Value) AND IsNothing(Parameters!country_codes.Value),False,True) Error: "Argument not specified for parameter 'FalsePart' of Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object" I'm a jScript/C# guy and not used to this pseudo-VB language. What is wrong? Regards Alex

    Read the article

  • expected `;' before "pennies"? C++ Debugging (Code Completed)

    - by Josh Lake
    Can anyone tell me why I get an error on my last cout? #include <iostream> #include <cmath> #include <stdio.h> #include <cstring> #include <conio.h> using namespace std; inline void keep_window_open() { char ch; cin>>ch; } int main() { cout << "How many pennies do you have?\n"; int pennies; cin >> pennies; double total_pen; total_pen = (0.01 * pennies); if (pennies >= 1) { string penn = " pennies."; }else { string penn = " penny."; } cout << "How many nickles do you have?\n"; int nickles; cin >> nickles; double total_nic; total_nic = (0.05 * nickles); if (nickles >= 1) { string five = " nickels."; }else { string five = " nickel."; } cout << "How many dimes do you have?\n"; int dimes; cin >> dimes; double total_dim; total_dim = (0.10 * dimes); if (dimes >= 1) { string ten = " dimes."; }else { string ten = " dime."; } cout << "How many quarters do you have?\n"; int quarters; cin >> quarters; double total_qua; total_qua = (0.25 * quarters); if (quarters >= 1) { string twentyfive = " quarters."; }else { string twentyfive = " quarter."; } cout << "How many half-dollars do you have?\n"; int half_dollars; cin >> half_dollars; double total_dol; total_dol = (0.50 * half_dollars); if (half_dollars >= 1) { string fifty = " half dollars."; }else { string fifty = " half dollar."; } string saying = "You have "; cout << saying pennies penn << "\n" << saying nickles five << "\n" << saying dimes ten << "\n" << saying quarters twentyfive << "\n" << saying half_dollars fifty << "\n"; keep_window_open() return 0; }

    Read the article

  • How can I show a div, then hide the other divs when a link is clicked?

    - by Abriel
    I am right now trying to hide six divs while showing only one of the divs. I've tried JavaScript and in jQuery, but nothing seems to work! Click here to get to the website. I would like to know if it has to do with my CSS, jQuery, or the HTML. Or is there an easier way of doing this? HTML: <div id="resourceLinks"> <a href="#" name="resource" id="resource1">General&nbsp;Information</a><br /> <a href="#" name="resource" id="resource2">Automatic&nbsp;401(k)</a><br /> <a href="#" name="resource" id="resource3">Consumer&nbsp;Fraud</a><br /> <a href="#" name="resource" id="resource4">Direct&nbsp;Deposit</a><br /> <a href="#" name="resource" id="resource5">Diversity</a><br /> <a href="#" name="resource" id="resource6">Women</a><br /> <a href="#" name="resource" id="resource7">Young&nbsp;Adults&nbsp;(20s&nbsp;-&nbsp;40s)</a> </div> <div id="resource1></div> <div id="resource2></div> <div id="resource3></div> <div id="resource4></div> <div id="resource5></div> <div id="resource6></div> <div id="resource7></div> CSS: #resource1, #resource2, #resource3, #resource4, #resource5, #resource6, #resource7 { position: absolute; margin-left: 400px; margin-top: -10px; width: 300px; padding-bottom: 120px; } #resourceLinks { position: fixed; margin-left: -450px; z-index: 3; margin-top: 180px; font-size: 16px; } jQuery: $(document).ready(function(){ $('#resourceLinks a').click(function (selected) { var getName = $(this).attr("id"); var projectImages = $(this).attr("name"); $(function() { $(".resource").hide().removeClass("current"); $("#" + projectImages ).show("normal").addClass("current"); }); }); });

    Read the article

  • jQuery compatible JavaScript documentation generator

    - by clyfe
    I need to choose a documentation generator (similar to jdoc in java or rdoc in ruby) for my javascript project that (built with jquery, underscore and backbone) Candidates: jsdoc toolkit pdoc natural docs docco YUI doc doctool http://jquery.bassistance.de/docTool/docTool.html other ? Requirements should work with jquery, underscore and backbone. that means object-literal methods etc I really like pdoc but its too centered around prototype, poorly documented, and I don't want to make extra files (sections?) to make it work (not sure about this) docco is nice but I want structured output (as in menu + class/func structure like jdoc) must be command line/makefile compatible (not web pastie) Tips, tricks, tutorials, success stories, advice greatly welcomed. Why Doesn't jQuery use JSDoc?

    Read the article

  • Add shortcut SQL management studio 2008 to select top 1000 order by PK desc

    - by JP Hellemons
    Hello, when I right click a table I can select select top 1000 rows and edit top 200 rows I'd like to add an option select bottom 1000 rows I am pretty sure that I've seen it somewhere online how to do this. But I can't remember where... already found this: http://sqlserver-training.com/how-to-change-default-value-of-select-or-edit-top-rows-in-ssms-2008/- but it seems impossible to add a template query...

    Read the article

  • Terminal server for Linux

    - by Hubert Kario
    What are the features of graphical terminal servers and technologies available for Linux? is it open source/free how well does it scale management (?) what's the network usage, susceptibility to latency support for session pause/resume what client platforms does it support support for sound (playback and record) directory/local disk sharing local printing other cons/pros This question is supposed to be a community wiki for comparison between the different technologies, but it looks like I don't have enough points to make questions into wikis(?)

    Read the article

  • What program sent which packet to the network [closed]

    - by Erik Johansson
    I would like to have a tcpdump like program that shows which program sent a specific packet, instead of just getting the port number. This is a generic problem I've had on and off sometimes when you have and old tcpdump file lying around you have no way to find what program was sending that data.. The solution in how i can identify which process is making UDP traffic on linux ? is an indication that I can solve this with auditd, dTrace, OProfile or SystemTap, but doesn't show how to do it. I.e. it doesn't show the source port of the program calling bind().. The problem I had was strange UDP packets, and since those ports are so short lived it took me a while to solve this issue. I solved this by running an ugly hack similar to: while true; date +%s.%N;netstat -panut;done So either a method better than this hack, a replacement for tcpdump, or some way to get this info from the kernel so I can patch tcpdump. EDIT: This was asked on superuser "tracking what programs sends to net", no good solution though.

    Read the article

  • Windows Server 2008 R2: User account set to not show on login

    - by josecortesp
    Hello There, this is my first Serverfault Question: I found myself this afternoon Setting up a Win Server 2008 R2 system for use with Team foundation source code control, and in order to give team-mates right to connect, i had to create user account for each of them (10 persons) (I can't and I don't want to create a domain). The point is that, after that, all that user accounts are showing in the login screen. Can i set those accounts to not show there? How? Thanks in advance

    Read the article

  • Compiling Ubuntu server: "libQtGui.so: undefined reference to png functions" errors

    - by Kowalikus
    I want to compile wkhtmltopdf on Ubuntu Server, but I have a problem with following errors: /usr/lib/libQtGui.so: undefined reference to `png_read_info@PNG12_0' /usr/lib/libQtGui.so: undefined reference to `png_set_gAMA@PNG12_0' /usr/lib/libQtGui.so: undefined reference to `png_set_PLTE@PNG12_0' ... /usr/lib/libQtGui.so: undefined reference to `png_create_info_struct@PNG12_0' /usr/lib/libQtGui.so: undefined reference to `png_set_bgr@PNG12_0' /usr/lib/libQtGui.so: undefined reference to `png_get_valid@PNG12_0' What can I do? in /usr/lib lrwxrwxrwx 1 17 2010-02-17 15:00 libQtGui.so -> libQtGui.so.4.5.2 lrwxrwxrwx 1 17 2010-02-17 14:59 libQtGui.so.4 -> libQtGui.so.4.5.2 lrwxrwxrwx 1 17 2010-02-17 14:59 libQtGui.so.4.5 -> libQtGui.so.4.5.2 -rw-r--r-- 1 10071604 2009-10-14 23:34 libQtGui.so.4.5.2

    Read the article

  • How can OpenGL graphics be displayed remotely using VNC?

    - by Jared Brown
    I am attempting to run a program that uses OpenGL to render a model in a viewport through VNC unsuccessfully. The error message I receive is - Xlib: extension "GLX" missing on display ":1.0". It was my understanding that VNC can be configured to render all graphics remotely and send a compressed screen grab from the display buffer to the local client. This would seem to negate the need for GLX extensions on the local client. Can VNC be configured this way and could you briefly describe how? Remote host: vncserver on RHEL 5 Local client: UltraVNC on Windows XP

    Read the article

  • How to setup dhcp3-server to advertise the DNS server the server itself has got from DHCP?

    - by Ivan
    The Ubuntu 10.04 server has eth0 Internet interface configured by means of an ISP's DHCP. At the same time the server has static eth0 LAN interface to which it provides masquerading (NAT) and LAN-internal DHCP service (dhcp3-server). As far as I've understood the manual, I had to hardcode DNS servers to advertise through LAN DHCP with option domain-name-servers in dhcpd.conf. But what if the ISP changes his DNS server IP silently (we use a SOHO-class ISP, so this won't surprise me much)? Can I configure dhcpd to advertise the DNS server the server uses itself, the one gotten by its DHCP client mechanism?

    Read the article

  • VNC application/terminal server

    - by sebastian nielsen
    Which software should I use, if I want to set up a linux VNC terminal server that works in this way: The VNC server should be able to accept up to X simultanous connections on the same port 5900. The VNC server should use 640x480 on 8 or 16bit color. When the VNC server receives the connection, it should start a new "session" for a user, and auto-launch a specific linux application for that user. If the application is killed, crashes, or is exited in any way, user should be disconnected (kicked) from server. If the user disconnect, the application should be killed in a "graceful way", that allows the application to cleanup. (There should be no way to "pick up" a old session) Any ideas?

    Read the article

  • .htaccess configuration issue

    - by Hammad Haider
    Hi, i am using two website on one domain like: www.example.com & www.example.com/site2, i want to know that on my site2, in my site2 their are 2 folders name folder1 and folder2 my index.php is in folder2 but the defination of methods defined in folder2 i am including the files through .htaccess but i am unable to get those files which are in folder1 and getting Error-500 and 400 on browser and i am using following lines but they are not working in .htaccess file The line below works fine RedirectMatch ^/$ http://www.example.com.pk/site2/views/ AllowOverride All php_value include_path ".:/home/example/public_html/site2/system" waiting for your quick response. Thanks Regards, Hammad Haider.

    Read the article

  • The security database on the server does not have a computer account for this workstation trust relationship

    - by alex
    I have a Server 2008 machine called OTTO I recently, by mistake, booted up an old machine, also called OTTO (the hardware was unstable, so the new one was set up to take it's place) I shut down the old machine, turned it off, and recycled it (it won't ever be back on) Now, whenever i try to log in to the real OTTO with the domain account (mydomain\Administrator) i get the following error: The security database on the server does not have a computer account for this workstation What can I do to fix this? It doesn't appear in active directory any more I've added it, but I'm guessing this had no effect, due to a different SID I can log in as the local administrator however

    Read the article

  • Windows 7 - You don't have permissions to save in this folder

    - by James
    Huh? I'm getting this message - "You don't have permissions to save in this folder" - even though I am the only user on this machine, and administrator. How can I set permissions for myself to do everything, everywhere (including saving deleting etc)? Thanks. Edit: Sorry, forgot to say which folder it was. It is a folder in Program Files, where I save my PHP files for local testing. Sorry if Im a bit daft with all this, but I've upgraded straight from XP to 7, and having never used vista, I'm used to being allowed to have full control.

    Read the article

  • A few question about some advanced Autohotkey uses

    - by user47625
    Hello, I'm using this wonderfull piece of software for some time now, but just for few quite basic things. So I'm wondering if these things would be possible: to use different set of shortcuts for different applications - so one shortcut performs different actions in different places. to make some form of modes for application, where you could use some swtch (vim style) and this would change things the shortucat would do if it would be possible to place some caption that indicates which mode you are using - little improvement of previous item I tkank everyone for answer.

    Read the article

  • Excel - "send to Mail recipient" creates 2nd copy of EMail in Inbox

    - by ssollinger
    When sending Excel sheets using the menu item "File" - "Sent To" - "Mail recipient (as attachment)" I get additional copies of the email in the Inbox. When I press "send" then I get 2 copies of the email in Outlook - as expected one in the Outbox (which moves into the Sent folder as soon it is sent off) and an additional one in the Inbox. How do I stop the copy message appearing in the Inbox? System: Excel 2000, Outlook 2000, Windows XP. Antivirus is AVG Free 2011. I know this is a very old system, but it is not my PC and there isn't any chance to get it replaced in the near future yet. SOme further details: The copy in the inbox appears at the same time as the normal copy goes into the Outbox (i.e. as soon I press send). It doesn't contain anything in the From field (i.e. there is no sender, just the recipient of the mail). It has a different icon in Outlook to the other emails - the icon is the one for "saved or unsent message". I tried it with a few different spreadsheets and it happens with all of them. It happens with every recipient, and it only happens if sending from within Excel (i.e. using the Send to menu item). I can delete the attachment before sending and it will still create a copy. If I create a new message in Outlook and then add the Excel document as attachment then I don't get the copy of the message in the inbox, it only happens when using the send to item in Excel. It only started doing this recently. Around that time the Antivirus (AVG Free) was upgraded to the latest version (from the previous version - 2010? - to version 2011), but this might not be related. I thought I know Excel really well but have never seen this happening before, and I can't find any setting in Excel or Outlook that is causing this. Any ideas?

    Read the article

  • Increse gap (pause) between songs

    - by holms
    Hello, I googled a lot before asking. This is really a problem. I know that there's an option in preference to switch off cross fading, but this is not what I want to do. Cross fading doesn't add any gap at all. If there's no gap between two songs, so you won't hear any. I need a real GAP between song, I mean a REAL pause about 2 seconds. Why? My MD player can't handle songs if there are no gaps in line input. Even with 1 second gap MD records 2 songs as 1. Is there any software that can increase the gap in the playlist? I know that Winamp has a plugin for putting pauses between songs. Is there anything for iTunes or Mac OS X? Another work around is to add a 2 sec MP3 between each song in the playlist but this is really killing me to do. I'm more on lossless stuff, so .CUE files would be an option too (using XLD for converting)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >