Daily Archives

Articles indexed Sunday December 26 2010

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

  • min.js to clear source

    - by dole
    Hi there As far i know until now, the min version of a .js(javascript) file is obtaining by removing the unncessary blank spaces and comments, in order to reduce the file size. My questions are: How can I convert a min.js file into a clear, easy readable .js file Besides, size(&and speed) are there any other advtages of the min.js file. the js files can be encripted? can js be infected. I think the answer is yes, so the question is how to protect the .js files from infections? Only the first question is most important and I'm looking for help on it. TY

    Read the article

  • Javascript substrings multiline replace by RegExp

    - by Radek Šimko
    Hi, I'm having some troubles with matching a regular expression in multi-line string. <script> var str="Welcome to Google!\n"; str = str + "We are proud to announce that Microsoft has \n"; str = str + "one of the worst Web Developers sites in the world."; document.write(str.replace(/.*(microsoft).*/gmi, "$1")); </script> http://jsbin.com/osoli3/3/edit As you may see on the link above, the output of the code looks like this: Welcome to Google! Microsoft one of the worst Web Developers sites in the world. Which means, that the replace() method goes line by line and if there's no match in that line, it returns just the whole line... Even if it has the "m" (multiline) modifier...

    Read the article

  • Vim: Replacing a line with another one yanked before

    - by duddle
    At least once per day i have the following situation: A: This line should also replace line X ... X: This is line should be replaced I believe that I don't perform that task efficiently. What I do: Go to line A: AG Yank line A: yy Go to line X: XG Paste line A: P Move to old line: j Delete old line: dd This has the additional disadvantage that line X is now in the default register, which is annoying if I find another line that should be replaced with A. Yanking to and pasting from an additional register ("ayy, "aP) makes this simple task even less efficient. My Questions: Did I miss a built-in Vim command to replace a line yanked before? If not, how can I bind my own command that leaves (or restores) the yanked line in the default register?

    Read the article

  • What is the best way to secure a shared git repo for a small distributed team ?

    - by ashy_32bit
    We have a Scala project and we decided to use git. The problem is we are a very small distributed team and we want nobody outside of the team to have even the read only access to our git server (which has a valid IP and is world-accessible in the IP level). I have heard the git-daemon has no authentication mechanism by itself and you should somehow integrate it with ssh or something. What is the best (and easiest) way to make the git server respond only to authorized users ? Or perhaps git-daemon is not for this task ? I may add that I am looking for a simple and straightforward approach. I don't want to compete with github ;-)

    Read the article

  • Calculation of average and Timestamping

    - by user554230
    pls do sumone help me to solve this for me and the number should be variable and not constant. the output should be: Timestamping In 6 Digit 8 5 6 3 0 1 Average In 6 Digit 9 8 7 6 5 2 class Timestamp1 extends Average1 { public static void main (String args[]) { int i = 103658; int j = 10; int k = i % j; System.out.println(" Timestamping In 6 Digit " ); System.out.println(" " + k); int o = 10365; int p = 10; int q = o % p; System.out.println(" " + q); int l = 1036; int m = 10; int n = l % m; System.out.println(" " + n); int r = 103; int s = 10; int t = r % s; System.out.println(" " + t); int u = 10; int v = 10; int w = u % v; System.out.println(" " + w); int x = 1; int y = 10; int z = x % y; System.out.println(" " + z); class Average1 extends Timestamp1 { public void main() { int i = 256789; int j = 10; int k = i % j; System.out.println(" Average In 6 Digit "); System.out.println(" " + k); int o = 25678; int p = 10; int q = o % p; System.out.println(" " + q); int l = 2567; int m = 10; int n = l % m; System.out.println(" " + n); int r = 256; int s = 10; int t = r % s; System.out.println(" " + t); int u = 25; int v = 10; int w = u % v; System.out.println(" " + w); int x = 2; int y = 10; int z = x % y; System.out.println(" " + z); } } } }

    Read the article

  • How to center align background image in JPanel

    - by Jaguar
    I wanted to add background image to my JFrame. Background image means I can later add Components on the JFrame or JPanel Although I coudn't find how to add background image to a JFrame, I found out how to add background image to a JPanel from here: How to set background image in Java? This solved my problem, but now since my JFrame is resizable I want to keep the image in center. The code I found uses this method public void paintComponent(Graphics g) { //Draw the previously loaded image to Component. g.drawImage(img, 0, 0, null); //Draw image } Can anyone say how to align the image to center of the JPanel. As g.drawImage(img, 0, 0, null); provides x=0 and y=0 Also if there is a method to add background image to a JFrame then I would like to know. Thanks.

    Read the article

  • Secure Server Distro

    - by Drama
    Hello, I have a root-server (i7/24GB/1TB) running Ubuntu 10.04 LTS as my OS. After some security audits (OpenVAS, Retina etc) I see that Ubuntu isn't the most secure system for a semi-corporate environment. Its updated from many sources, ofc from the Ubuntu security repo too. But nevertheless I could exploit my OpenSSL install with an exploit from August/September. There are some critical updates needed which Ubuntu does not provide. I was using Debian and Ubuntu for almost 5 years but now I doubt. What distro is secure and up to date from your point of view? How can I make the server more secure? Outsourcing of every software-module to a VM? I am not new to server-hardening, my packages are up to date I read Ubuntu Security Notices and I have no unneeded services installed on my server. Thanks.

    Read the article

  • Remote connection to dynamic public ip & private ip addresses

    - by user53864
    Many times I connected to windows computer which has static public ip address via remote desktop over wan links. I'm wondering how could I connect to the remote computer that has dynamic public ip address & private ip addresses assigned. I've 2 systems at home: xp system-------connected to internet(dynamic public ip) & allowed other users to connected to the internet on the interface. windows vista system--------enabled dhcp on the interface to access internet from xp. How could I remotely connect from my office to the 'vista system'?. If I've a router/modem at my home it may be possible to allow the ports for the system but I don't. Any tips?

    Read the article

  • Torrent, ISA Server 2006 and packet dropped due to TCP_NOT_SYNC

    - by Pascal
    Hi, I'm trying to get uTorrent 2.0.4 to work in a DMZ machine, protected by a ISA Server 2006. I've opened 1 inbound port (via publishing) and opened all the higher ports for that specific machine that runs uTorrent on my DMZ, and it's working almost fine. The problem is that I keep getting packets dropped with 0xc0040017 FWX_E_TCP_NOT_SYN_PACKET_DROPPED. Is there any way to disable this via registry? Is there any way around this? The download speed fluctuates a lot, and when I starts hitting the upper limit that I've defined in uTorrent, the errors start poping up a lot, and the download speed goes way down, and the process repeats on and on Tks Edit My outbound rules are: Port Range: TCP 10000-65535 Outbound Port Range: UDP 10000-65535 Send Edit It's probably a bug handling requests from Windows 7. When I installed the uTorrent on a XP machine, the problem went away

    Read the article

  • Ubuntu - connecting 3rd monitor fails with "xrandr: cannot find crtc for output DVI-0"

    - by MDCore
    I've got a laptop with a DVI and VGA output on the back. With everything connected it will only allow me to run 2 of the 3 monitors e.g. laptop display + VGA or DVI+VGA but not all 3. xrandr says I have 2 CRTC's, 0 and 1. The internet says I should be able to share a CRTC if the modeline is the same, and my 2 external monitors are the exact same make and model. How do I convince the software to drive all this hardware?

    Read the article

  • How to generate user-specific PDF with encrypted hidden watermark?

    - by Dave Jarvis
    Background Using LaTeX to write a book. When a user purchases the book, the PDF will be generated automatically. Problem The PDF should have a watermark that includes the person's name and contact information. Question What software meets the following criteria: Applies encrypted, undetectable watermarks to a PDF Open Source Platform independent (Linux, Windows) Fast (marks a 200 page PDF in under 1 second) Batch processing (exclusively command-line driven) Collusion-attack resistant Non-fragile (e.g., PDF - EPS - PDF still contains the watermark) Well documented (shows example usages) Ideas & Resources Some thoughts and findings: Natural language processing (NLP) watermarks. Apply steganography on a randomly selected image. http://openstego.sourceforge.net/cmdline.html The problem with NLP is that grammatical errors can be introduced. The problem with steganography is that the images are sourced from an image cache, and so recreating that cache with watermarked images will impart a delay when generating the PDF (I could just delete one image from the cache, but that's not an elegant solution). Thank you!

    Read the article

  • Chrome not selecting correct language for Help tab

    - by Andy
    When I click Help in Chrome, a new tab appears with the Google help links etc as expected, but I have a message saying: "This Help Centre is not currently available in your language...", etc. The drop down box at the bottom is not selected correctly for en-GB (my location). Instead it is set at the first language on the list. This happens if I am signed in to my Google account or not. Selecting English from the drop-down works ok, so no great drama. Just wondering if anybody else sees this behaviour? EDIT: Using current stable build 8.0.552.224

    Read the article

  • C#: protecting trial releases

    - by anfono
    I want to provide a trial version of my software. This version should only be evaluated within a specific period of time. Let's say only during January 2011. As this software massively uses the system clock in processing, it would be quite annoying to set the clock to an earlier time to be able to use it over and over. So because of this, I wound't think of a more complicated protection mechanism. So I have thought about exiting after a test like: if (DateTime.Now.Year != 2011 && DateTime.Now.Month != 1) { MessageBox.Show("expired!"); Application.Exit(); } How easy will this be cracked :-) ? Is there a "safe" way to do this ?

    Read the article

  • Database with users design

    - by 1110
    I am in database design development phase. Application will work with large number of users (LARGE :)) I designed 80% of database but I have one Users table which is connected to everything else: Users {UserId, FirstName, LastName, Username, Password, PasswordQuestion, PasswordAnswer, Gender, RoleId, LastLoginDate etc etc} I saw asp.net membership database structure where Users and Membership are two tables. My questions are: Should I use one users table with all users data in it or more tables? If answer is 'more tables', what tables to use? Any advice on how to structure relation between those tables? This is sample relation that I have, and trying to improve. I don't understand why user and userChild are separated tables?

    Read the article

  • wii programming

    - by harald
    hello, my daughter just got a wii for christmas from her parents and her father has nothing better to do than looking for ways to dive into wii programming. i already read a lot about "homebrew" and wii. but i seem to be unable to find answers for the most important questions: do i have to modify the firmware to get the homebrew stuff to work? how likely is it, that the wii get's bricked, if for example there are any nintendo firmware updates? thanks very much!

    Read the article

  • compilation error

    - by Bond
    #include<dirent.h> #include<stdio.h> #include<stdlib.h> #include<sys/stat.h> int main () { struct dirent **namelist; int i,j; char userd[20]; struct stat statBuf; printf("Enter a directory %s\n",userd); scanf("%s",&userd); printf("the dir is %s\n",*userd); i=scandir(".",&namelist,0,alphasort); printf("enter a directory name %s",*userd); printf("scandir returned i=%d\n",&i); if (i<0) perror("Scandir failed to open directory I hope you understand \n"); else { for(j=0;j<i;j++) { printf("j=%d i=%d %s\n",j,i,namelist[j]->d_name); // lstat free(namelist[j]); } } free(namelist); } Can some one help to understand why am I getting warning in above code?

    Read the article

  • How can I check if Zend_Form_Elements has no decorators set

    - by jiewmeng
    I find that even if I just declare an element like $this->addElement('textarea', 'txt1'); I find that it already has decorators set Zend_Debug::dump($this->getElement('txt1')->getDecorators()); http://pastebin.com/7Y24g62w I want to test that I didn't set decorators using setDecorators() or using something like $this->addElement('textarea', 'txt1', array( 'decorators' => array(...) )); If I didn't set any decorators then apply default decorators, how can I do that. I want to apply default decorators per element basis, not using Zend_Form#setDisableLoadDefaultDecoraotrs()

    Read the article

  • Create list-of-controls in Windows.Forms

    - by leiflundgren
    I have decided that I would like to have a list with "complex context", i.e. of custom-controls. (The goal is something looking like a buddy list, with photos, status-icons, text, "start-chat-button".) But I like it to behave as a list: scrollbars, possibility to select multiple items etc. When I have been looking at ListView and ListBox I only see that I can add text and an icon, but not arbitrary controls. I'm I missing how this is done? Or should I use something else then ListView/ListBox?

    Read the article

  • should I put the jar dependancies on the shared repo or just the source files ?

    - by ashy_32bit
    We have a Scala project with few source files (in Scala and Java) and quite some dependencies in various binary formats (jar and DLL). I'm wondering what should go into our shared git repo. Only the source files (developers have to download or somehow resolve the dependencies themselves) or the both the source files and the dependencies? I may add that dependencies are all third parties and available for download for free.

    Read the article

  • Does retrieving an object from Doctrine2 cause __construct() of the model class to run?

    - by jiewmeng
    When I retrieve an object say by $em->find('Application\Models\User', 1); or other methods like DQL, findBy*() cause the __construct() of the model class to run? I am having a problem where I set variables there like reference to EntityManager and I find that its not set. I tried putting a die() in __construct() and it doesn't halt the application. Can I say that if I want to set other properties/fields like EntityManager $em I have to do it some other way? Perhaps something like protected function getEm() { if (!isset($this->em)) { $this->em = \Zend_Registry::get('em'); } return $this->em; }

    Read the article

  • .htaccess not load css file and images and duplicate parent url?

    - by Mahran Elneel
    i have create htaccess and cannot load css file and images but when add ../file.css and images ../ima it work but i want to open in current directory. and when click the link in home page like will be http://localhost/mysite/program/4 but in another page will add http://localhost/mysite/program/program/2 and this wrong location the .htaccess code Options +FollowSymLinks RewriteEngine On # Turn on the rewriting engine RewriteRule ^program/([0-9]+)/?$ get_programs.php?pack_id=$1 [NC,L] RewriteRule ^El-Mensajero/?$ home.php [NC,L] RewriteRule ^Daily-Tours/?$ daily_tours.php [NC,L] RewriteRule ^page/([0-9]+)/?$ get_pages.php?page_id=$1 [NC,L]

    Read the article

  • Easiest Way to read the response from WebResponse

    - by Stacker
    private void RespCallback(IAsyncResult asynchronousResult) { try { WebRequest myWebRequest1 = (WebRequest)asynchronousResult.AsyncState; // End the Asynchronous response. WebResponse webResponse = myWebRequest1.EndGetResponse(asynchronousResult); } catch (Exception) { //TODO:Log the error } } now having the webResponse Object ,what is the easiest way to read its contents?

    Read the article

  • How to keep a shell open across multiple ajax requests in PHP?

    - by Joost van Doorn
    I need to use a shell across multiple ajax requests. Basically this means that the next request should be able to continue with the same shell where the other process left off. The purpose is to communicate with daemons like FTP to open an FTP connection and log in and in the next request continue with that connection and be able to use it for uploads. But it's not limited to only the FTP daemon (as I know that FTP is supported in PHP).

    Read the article

  • how to set setEnabled: for NSButton in an NSTableView

    - by user460366
    Hi All I have an NSTableView which has three columns. The first one is a checkbox and the third one is a button. The button 'is enabled' state depends on whether or not the checkbox is checked. I am setting the table content in the awakeFromNib method and I am implementing the checkbox state in the - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row method. I need to find a way setEnabled: for the NSButton Thanks

    Read the article

  • Android: Change the source of ImageView present in ListView

    - by Vivek
    Hi All, I have a ListView specified by list_item.xml Now I need to change the Image in my list inside onListItemClick. How to achieve this? //list_item.xml <?xml version="1.0" encoding="UTF-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/play" android:id="@+id/img" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_vertical" android:id="@+id/txt" /> </LinearLayout> I have a Custom Adapter to populate my list. Code below is the adapter. public class MyCustomAdapter extends ArrayAdapter<String> { public MyCustomAdapter(Context context, int textViewResourceId, String[] objects) { super(context, textViewResourceId, objects); // TODO Auto-generated constructor stub } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub LayoutInflater inflater=getLayoutInflater(); View row=inflater.inflate(R.layout.list_item, parent, false); TextView label=(TextView)row.findViewById(R.id.txt); label.setText(Sounds[position]); ImageView icon=(ImageView)row.findViewById(R.id.img); icon.setMaxHeight(32); icon.setMaxWidth(32); icon.setPadding(2, 1, 5, 1); icon.setImageResource(R.drawable.play); return row; } } And in onCreate I do the following @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setListAdapter(new MyCustomAdapter(this, R.layout.list_item, Sounds)); //Sounds --> String array } catch(Exception e) { e.printStackTrace(); } } Now when any row is selected, I need to change the image associated with the selected view. Your help is appreciated. Thanks.

    Read the article

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