Search Results

Search found 133 results on 6 pages for 'asd'.

Page 5/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Select distinct... in fulltext search

    - by lam3r4370
    <?php session_start(); $user =$_GET['user']; $conn = mysql_connect("localhost","...","..."); mysql_select_db("..."); $sql= "SELECT filter FROM userfilter WHERE user='$user'"; $mksql = mysql_query($sql); while($row =mysql_fetch_assoc($mksql)) { $filter=$row['filter']; $sql2 = "SELECT DISTINCT * FROM rss WHERE MATCH(content,title) AGAINST ('$filter')"; $mksql2 = mysql_query($sql2) or die(mysql_error()); while($rows=mysql_fetch_assoc($mksql2)) { echo ..... } ?> If I have two rows content that contains the $filter ,it outputs me that content but it's repeating. For example: title|content asd |This is a sample content ,number one das |This is a sample content ,number two .... And if my keywords are "sample" and "number" ,it outputs me twice the title and the content.How to prevent that?

    Read the article

  • codeigniter pagination Numbers not displayed correcly

    - by murai
    Codeigniter pagination Numbers not displayed correcly in result page,. Plz help me. /controller page code/ function search_all() { $this->load->view(‘prd’); $config = array(); $config[‘base_url’] = base_url().’/product_search/search_all’; $config[“total_rows”] = $this->search_product_model->record_count(); $config[“per_page”] = 8; $config[“uri_segment”] = 3; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data[“results”] = $this->search_product_model-> get_search($config[“per_page”], $page); $data[“links”] = $this->pagination->create_links(); //$this->load->view(“example1”, $data); $this->load->view(‘asd’, $data); }

    Read the article

  • Using control from a separate class in C#

    - by DazSlayer
    I have a program that dynamically creates controls when it starts, it works just fine when the code to do this is in the class of the actual form. I tried moving the code to a separate class and found that I could not use Controls.Add(). How can I add controls to the Form from a separate class? This is what I have so far: TextBox txtbx = new TextBox(); txtbx.Text = "asd" + x.ToString(); txtbx.Name = "txtbx" + x.ToString(); txtbx.Location = new Point(10, (20 * x)); txtbx.Height = 20; txtbx.Width = 50; Controls.Add(txtbx); Error 1 The name 'Controls' does not exist in the current context

    Read the article

  • Java access the caller variable, is it possible? how?

    - by lacas
    i have a class main { Class1 class1=new Class1(); class1.function1(); } class Class1 { int abc=1; ArrayList<Class2> class2s=new ArrayList<Class2>(); int function1() { class2s.add(new Class2(asd)); abc=555; } } class Class2 { int functionx() { Log.e("abc?", ""+PARENT???.abc); } } How can I get the caller Class's variable, say abc?

    Read the article

  • Convert Python 3.x snippet to C#/LINQ.

    - by Hamish Grubijan
    I want to sort elements of a HashSet<string> and join them by a ; character. Python interpreter version: >>> st = {'jhg', 'uywer', 'nbcm', 'utr'} >>> strng = ';'.join(sorted(s)) >>> strng 'ASD;anmbh;ashgg;jhghjg' C# signature of a method I seek: private string getVersionsSorted(HashSet<string> versions); I can do this without using Linq, but I really want to learn it better. Many thanks!

    Read the article

  • Fortran - String with unknown characters into substrings

    - by Masoud
    I am trying to put an input string into sub-string arrays. The number of data in the input file are less than 10 but unknown. The number of spaces between each data is also unclear. Example: Asd B Cwqe21 Ddsw Eww I am quite novice to Fortran, so I do not know which format I should use. My problem is that I do not know the number of data (here I assumed that there are 5), so how can I make the code work? I tried the following which did not work: CHARACTER (LEN=100), DIMENSION(10) :: string READ (1,*) (string,I=1,10) It seems that the error I got was because there was no 6th string to read and put into string(6). I tried using the "Index" to find the space, but since I do not know how many spaces are in the string, it did not help me.

    Read the article

  • Opengl-es picking object

    - by lacas
    I saw a lot of picking code opengl-es, but nothing worked. Can someone give me what am I missing? My code is (from tutorials/forums) Vec3 far = Camera.getPosition(); Vec3 near = Shared.opengl().getPickingRay(ev.getX(), ev.getY(), 0); Vec3 direction = far.sub(near); direction.normalize(); Log.e("direction", direction.x+" "+direction.y+" "+direction.z); Ray mouseRay = new Ray(near, direction); for (int n=0; n<ObjectFactory.objects.size(); n++) { if (ObjectFactory.objects.get(n)!=null) { IObject obj = ObjectFactory.objects.get(n); float discriminant, b; float radius=0.1f; b = -mouseRay.getOrigin().dot(mouseRay.getDirection()); discriminant = b * b - mouseRay.getOrigin().dot(mouseRay.getOrigin()) + radius*radius; discriminant = FloatMath.sqrt(discriminant); double x1 = b - discriminant; double x2 = b + discriminant; Log.e("asd", obj.getName() + " "+discriminant+" "+x1+" "+x2); } } my camera vectors: //cam Vec3 position =new Vec3(-obj.getPosX()+x, obj.getPosZ()-0.3f, obj.getPosY()+z); Vec3 direction =new Vec3(-obj.getPosX(), obj.getPosZ(), obj.getPosY()); Vec3 up =new Vec3(0.0f, -1.0f, 0.0f); Camera.set(position, direction, up); and my picking code: public Vec3 getPickingRay(float mouseX, float mouseY, float mouseZ) { int[] viewport = getViewport(); float[] modelview = getModelView(); float[] projection = getProjection(); float winX, winY; float[] position = new float[4]; winX = (float)mouseX; winY = (float)Shared.screen.width - (float)mouseY; GLU.gluUnProject(winX, winY, mouseZ, modelview, 0, projection, 0, viewport, 0, position, 0); return new Vec3(position[0], position[1], position[2]); } My camera moving all the time in 3d space. and my actors/modells moving too. my camera is following one actor/modell and the user can move the camera on a circle on this model. How can I change the above code to working?

    Read the article

  • Free, simple, configurable SOCKS5 server

    - by Pooria Azimi
    I've been looking (for the past 6-7 hours) for a fast, free and configurable SOCKS5 server. I haven't found anything that matches my needs. They are either too complicated, too bare-bones or simply buggy as hell. This is (all) I need: I want it to run on Linux (and also OS X, preferably) I want it to listen on localhost:8888 When my app (say wget.. or curl --socks5=localhost:8888) requests http://www.google.com/search?q=asd (or any other url - both http and https), I want it to fetch the page not from google's servers, but from http://localhost:4444/cached?uri=http://www.google.com/search%3Fq%3Dasd. Nothing more! I don't need caching, or anything else. I just want a SOCKS5 server, running locally, which redirects all queries to my own (local) server. It could be written in C, C++, Python, PHP, Perl, Node.js or any other language. I don't care, as long as it supports my (very limited) needs, or I can easily change the source to make it so. Thanks a lot

    Read the article

  • Nec USB 3.0 controller drops connection - Ubuntu 12.04.1

    - by Tom
    I have some serious problems with Technaxx pci-e 302p card. It has uPD720200a NEC chip with 4020 firmware. BIOS recognises it. Sometimes it recognises devices and system mounts them and are functional for few minutes, other times they can't be mount and error occours. After fresh install card worked fine, but after kernel and firmware update it behaves as mentioned. Outputs: uname -a Linux asd-GA-MA770-UD3 3.2.0-30-generic #48-Ubuntu SMP Fri Aug 24 16:52:48 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux lspci -vvv USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04) (prog-if 30 [XHCI]) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at fd8fe000 (64-bit, non-prefetchable) [size=8K] Capabilities: <access denied> Kernel driver in use: xhci_hcd lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 07d1:3c0a D-Link System DWA-140 RangeBooster N Adapter(rev.B2) [Ralink RT3072] Bus 005 Device 004: ID 1997:1221 Bus 005 Device 003: ID 15c2:003c SoundGraph Inc. lsmod Module Size Used by nls_iso8859_1 12713 0 nls_cp437 16991 0 vfat 17585 0 fat 61512 1 vfat vesafb 13844 1 saa7134_alsa 18602 1 rfcomm 47604 0 bnep 18281 2 bluetooth 180104 10 rfcomm,bnep tda827x 18182 1 snd_hda_codec_hdmi 32474 1 ir_lirc_codec 12859 0 lirc_dev 19204 1 ir_lirc_codec tda8290 22616 1 arc4 12529 2 snd_hda_codec_realtek 224173 1 ir_mce_kbd_decoder 12777 0 ir_sony_decoder 12510 0 ir_jvc_decoder 12507 0 tuner 27428 1 ir_rc6_decoder 12507 0 snd_hda_intel 33773 5 rt2800usb 22684 0 rt2800lib 58925 1 rt2800usb crc_ccitt 12667 1 rt2800lib rt2x00usb 20762 1 rt2800usb rt2x00lib 51144 3 rt2800usb,rt2800lib,rt2x00usb mac80211 506816 3 rt2800lib,rt2x00usb,rt2x00lib ir_rc5_decoder 12507 0 rc_avermedia_m135a 12526 0 rc_imon_pad 12505 0 ir_nec_decoder 12507 0 cfg80211 205544 2 rt2x00lib,mac80211 snd_hda_codec 127706 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel snd_ctxfi 111202 2 snd_hwdep 13668 1 snd_hda_codec imon 32839 0 snd_pcm 97188 5 saa7134_alsa,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_ctxfi snd_seq_midi 13324 0 saa7134 181851 1 saa7134_alsa videobuf_dma_sg 19354 2 saa7134_alsa,saa7134 snd_rawmidi 30748 1 snd_seq_midi snd_seq_midi_event 14899 1 snd_seq_midi joydev 17693 0 rc_core 26412 13 ir_lirc_codec,ir_mce_kbd_decoder,ir_sony_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_rc5_decoder,rc_avermedia_m135a,rc_imon_pad,ir_nec_decoder,imon,saa7134 snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event fglrx 3263886 101 videobuf_core 26390 2 saa7134,videobuf_dma_sg v4l2_common 16454 2 tuner,saa7134 videodev 98259 3 tuner,saa7134,v4l2_common sp5100_tco 13791 0 snd_timer 29990 2 snd_pcm,snd_seq snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq snd 78855 28 saa7134_alsa,snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_ctxfi,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device v4l2_compat_ioctl32 17128 1 videodev tveeprom 21249 1 saa7134 i2c_piix4 13301 0 soundcore 15091 1 snd edac_core 53746 0 serio_raw 13211 0 snd_page_alloc 18529 3 snd_hda_intel,snd_ctxfi,snd_pcm edac_mce_amd 23709 0 wmi 19256 0 mac_hid 13253 0 ppdev 17113 0 parport_pc 32866 1 k10temp 13166 0 lp 17799 0 parport 46562 3 ppdev,parport_pc,lp usb_storage 49198 0 uas 18180 0 usbhid 47199 0 hid 99559 1 usbhid firewire_ohci 41000 0 firewire_core 63558 1 firewire_ohci crc_itu_t 12707 1 firewire_core floppy 70365 0 pata_atiixp 13204 2 r8169 62099 0 dmesg | tail after plugging to usb 3.0 port [ 834.871296] sd 9:0:0:0: rejecting I/O to offline device [ 834.871308] sd 9:0:0:0: rejecting I/O to offline device [ 834.871319] sd 9:0:0:0: rejecting I/O to offline device [ 834.871330] sd 9:0:0:0: rejecting I/O to offline device [ 834.871530] sd 9:0:0:0: [sdd] Unhandled error code [ 834.871536] sd 9:0:0:0: [sdd] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [ 834.871545] sd 9:0:0:0: [sdd] CDB: Read(10): 28 00 0e 8e 48 0a 00 00 3e 00 [ 834.871564] end_request: I/O error, dev sdd, sector 244205578 [ 834.875497] sd 8:0:0:1: Device offlined - not ready after error recovery [ 834.885339] usb 9-2: USB disconnect, device number 2 Are there any other outputs need for answering? I'll post them ASAP. I could of course reject updating the system but I think it's halfway solution. Any help appreciated. BTW USB 2.0 and 1.1 ports run well, card itself runs under win7 as charm. Tom

    Read the article

  • Can Internet Explorer bind events to absolute positioned elements ?

    - by mark
    Can Internet Explorer bind events to absolute positioned elements ? I can't bind a "click" to an element that is overlapping another. Have tried loads of different ways, here a few tests that don't work in IE: //version 1: $(".classHolder").click(function(){ alert( $(this).html() ); }); //version 2: $(".classHolder").each(function(){ $(this).click(function(){ alert( $(this).html() ); }); }); //version 3: $("#id3").click(function(){ alert( $(this).html() ); }); //version 4: $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); // in all trials I tested with and without: // $("img").unbind(); // $("div").unbind(); // just to make sure no "ghost" events were bind into the elements but no success. // replace all [ for < , and all ] for [html] [head] [script src="http://code.jquery.com/jquery-latest.js"][/script] [script type="application/javascript"] $(document).ready(function(){ $("#id3").click(function(){ alert( $(this).html() ); }); $("#id3").trigger("click"); }); [/script] [/head] [body] [div id="id1" style="position:relative;"] [img id="id2" src="http://www.google.co.uk/intl/en_com/images/srpr/logo1w.png" style=";z-index:-1;"/] [div id="id3" class="classHolder" style="position:absolute;border:2px solid red;left:0px;top:0px;width:70px;height:70px;z-index:1002;"]G[/div] [div id="id4" class="classHolder" style="position:absolute;border:2px solid red;left:210px;top:0px;width:25px;height:70px;z-index:1001;"]L[/div] asd asdf asdfg [/div] [/body] [/html]

    Read the article

  • Parsing XML in Javascript getElementsByTagName not working

    - by Probocop
    Hi, I am trying to parse the following XML with javascript: <?xml version='1.0' encoding='UTF-8'?> <ResultSet> <Result> <URL>www.asd.com</URL> <Value>10500</Value> </Result> </ResultSet> The XML is generated by a PHP script to get how many pages are indexed in Bing. My javascript function is as follows: function bingIndexedPages() { ws_url = "http://archreport.epiphanydev2.co.uk/worker.php?query=bingindexed&domain="+$('#hidden_the_domain').val(); $.ajax({ type: "GET", url: ws_url, dataType: "xml", success: function(xmlIn){ alert('success'); result = xmlIn.getElementsByTagName("Result"); $('#tb_actualvsindexedbing_indexed').val($(result.getElementsByTagName("Value")).text()); $('#img_actualvsindexedbing_worked').attr("src","/images/worked.jpg"); }, error: function() {$('#img_actualvsindexedbing_worked').attr("src","/images/failed.jpg");} }); } The problem I'm having is firebug is saying: 'result.getElementsByTagName is not a function' Can you see what is going wrong? Thanks

    Read the article

  • Why do hoverClass and activeClass properties won't work together ?

    - by Dumb Questioner
    Why do hoverClass and activeClass properties not work together in the following example ? <html> <head> <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.4.2.js"></script> <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/tags/1.8rc1/ui/jquery-ui.js"></script> <style type="text/css"> .draggable {width:100px; height:100px; padding-bottom:5px; background-color:#dddddd;} #dropBox {width:556px; height:400px; } .sameStylePrecedenceAsDropHoverAndActive {background-color:#ff4490;} .drop-hover {background-color: #ff8040; } .drop-active {background-color: #ffffff; } </style> <script type="text/javascript"> $(document).ready(function() { $('.draggable').draggable({ helper: 'clone' }); $('#dropBox').droppable({ accept: '.draggable', activeClass: 'drop-active', hoverClass: 'drop-hover', drop: function(event, ui) { alert("Dropped!"); } }); }); </script> </head> <body> <div id="dropBox" class="sameStylePrecedenceAsDropHoverAndActive"></div> <div class="draggable">asd</div> </body> </html>

    Read the article

  • [php] Firefox refreshes page 1, even after redirection to page 2

    - by Znarkus
    Hi! This is a quite weird and annoying problem, which is reproduced with the script below. Say we have two pages: script.php and script.php?second. Page 1 creates some database entries and redirects to page 2. On page 2, the user is presented with an editor for said entries. If page 1 for some reason crashes on the first try, and prints some error message, a strange thing will happend. If we refresh page 1 (and this time it redirects fine), every consecutive refresh (of page 2) will actually refresh page 1 and again redirect to page 2. In the above example this would create new database entries for every refresh, which is the problem I want to circumvent by redirecting to page 2. <?php header('Content-type: text/plain'); session_start(); if (!isset($_GET['second'])) { $_SESSION['counter'] = isset($_SESSION['counter']) ? $_SESSION['counter'] + 1 : 1; /*$_SESSION['counter'] = 0; exit('asd');*/ header("Location: {$_SERVER['PHP_SELF']}?second", true, 303); exit; } echo "Counter: {$_SESSION['counter']}"; To try the above complete script, first run it with the commented code intact, then by enabling the commented code. I've tried 301, 302 and 303 redirections. Does someone know why this is happening?

    Read the article

  • im i doing this right or wrong using pointers in C

    - by Amandeep Singh Dhari
    i like to point out that i need some help with my home work, ok the lectuer gave us the idea of a program and we have to make it from bottom to top. got to have user to type in two set of string. pointers take in the value and then puts into a prototype i need to make a 3rd pointer that has the value of p1 and p2. like this p1 = asd, p2 = qwe and p3 = asdqwe #include "stdafx.h" #include <ctype.h> char *mystrcat(char*s1p, char*s2p); // Prototype char main(void) { char string1[80]; char string2[80]; printf("%s", "enter in your srting one "); gets_s(string1); printf("%s", "enter in your srting two "); gets_s(string2); *mystrcat(string1, string2); return 0; } char *mystrcat(char *s1p,char *s2p) { //char *string3; //char *string4; //string3 = s1p; //string4 = s2p; printf("whatever = %s%s\n", s1p, s2p); return 0; } this is the code that i made so far just need some help, thank guys in advance.

    Read the article

  • Why doesn't line-height work on FF/3.5.8(Mac)?

    - by Znarkus
    I can't get line-height on a text input to work on Firefox 3.5.8/(Mac). Works flawlessly on: IE6 IE7 IE8 FF3.6/PC FF3.6/Mac Safari Test code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>asd</title> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css" /> </head> <body> <input type="text" value="Hello" style="line-height:50px;height:50px;font-size:16px;" /> <input type="text" value="Hello" style="padding:17px 0;font-size:16px;" /> </body> </html> Is there an alternate solution or any idea how to fix this? Edit: Updated the test code, to compare line-height vs. padding technique. Padding works on all above browsers except IE8. Whaat? I can't test on FF/3.5.8 anymore, could someone please report the result from this browser on any plattform? I'm now thinking this is a Firefox 3.5.8 issue, plattform independent.

    Read the article

  • Ruby on rails 2 level model

    - by jony17
    I need some help creating a very simple forum in a existing model. What I want in a Game page, have a mini forum, where is possible create some topics and some comments to this topics. In the beginning I'm only implement topics. This is the error I have: Mysql2::Error: Column 'user_id' cannot be null: INSERT INTO `topics` (`game_id`, `question`, `user_id`) VALUES (1, 'asd', NULL) This is my main model: game.rb class Game < ActiveRecord::Base attr_accessible :name validates :user_id, presence: true validates :name, presence: true, length: { maximum: 50 } belongs_to :user has_many :topics, dependent: :destroy end topic.rb class Topic < ActiveRecord::Base validates_presence_of :question validates_presence_of :game_id attr_accessible :question, :user_id validates :question, length: {maximum: 50}, allow_blank: false belongs_to :game belongs_to :user end topic_controller.rb def create @game = Game.find(params[:game_id]) @topic = @game.topics.create(params[:topic]) @topic.user_id = current_user.id respond_to do |format| if @topic.save format.html { redirect_to @game, notice: 'Topic was successfully created.' } else format.html { render action: "new" } end end end game/show.html.erb <h2>Topics</h2> <% @game.topics.each do |topic| %> <p> <b>Question:</b> <%= topic.question %> </p> <% end %> <h2>Add a topic:</h2> <%= form_for([@game, @game.topics.build]) do |f| %> <div class="field"> <%= f.label :question %><br /> <%= f.text_field :question %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> Thanks ;)

    Read the article

  • xterm not wrapping text properly

    - by mulllhausen
    I'm configuring both my gnome-terminal and xterm columns (i still haven't picked which of these I will be using) and I have a couple of issues I would like to fix: the typing area seems to be smaller (fewer columns) than the display area the typed text is not wrapping to the next line when it reaches the end - it just continues back around on the same line, overwriting the prompt (i have set a custom bash prompt with PS1 in case this is relevant) $ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 7.1 (wheezy) Release: 7.1 Codename: wheezy $ echo $TERM xterm $ stty -a [peter@pc ~] $ stty -a speed 38400 baud; rows 52; columns 126; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke $[peter@mine ~] $ # the column width only goes up to here ------------------------------------------------> the results are identical in both the xterm and in gnome-terminal 3.4.1.1 and as you can see, the output of the stty -a command goes right up to the edge of the screen, while the typing does not go that far. I have found that I can get the desired result by setting the columns to a very large number, eg: $ stty cols 1800 this fixes both problems. Is it the right way to go about solving this problem? Will this "break" any of the output from programs? So far I have tried top and stty -a and these seem OK. more info as requested in the comments i found that if i cat some input into a file then the columns actually strech the full width of the terminal window: [peter@mine applications] $ cat > /tmp/asd aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssssssssssssssssssssssssssssssssssssssssssssssssssqqqqqqqqqqqqqqqq qqqq does this imply that it is actually bash that is restricting the number of columns and not the terminal? if so then how to alter the number of columns in bash?

    Read the article

  • Diff 2 files while ignoring parts of lines

    - by Millianz
    I would like to diff a file system. Currently my bash script prints out the file system recursively into a file (ls -l -R) and diffs it with an expected output. An example for a line in this file would be: drw---- 100000f3 00000400 0 ./foo/ My current diff command is diff "$TEMP_LOG" "$DIFF_FILE_OUT" --strip-trailing-cr --changed-group-format='%' --unchanged-group-format='' "$SubLog" As you can see I ignore additional lines in the current output file, I only care about lines that match with the master output. I now have the problem though that some files may differ in size, or a folder might even have a different name, but due to it's location I know what access rights it should have. For example: Output: ------- 00000000 00000000 528 ./foo/bar.txt Master: ------- 00000000 00000000 200 ./foo/bar.txt Only the size differs here, and it doesn't matter, I would like to just ignore certain parts of the diff, kind of like an ansi c comment. Master: ------- 00000000 00000000 /*200*/ ./foo/bar.txt -- OR -- Master: d------ 00000000 00000000 /*10*/ ./foo//*123123*///*76456546*//bar.txt Output: d------ 00000000 00000000 0 ./foo/asd/sdf/bar.txt And still have it diff correctly. Is this even possible with diff, or will I have to write a custom script for it? Since I'm fairly new to cygwin I might be using the completely wrong tool all together, I'm happy for any suggestions. Update: Taking a step back, here is the general task at hand that I want to achieve. I want to write a script that checks the file system to see if the read/write permissions are set up correctly. The structure of the file system is under my control, so I don't have to worry about it changing too much. Sometimes folders/files might not be present, but if they are their permissions must be checked. For Example assume that the following is a snapshot of the current file system structure drw ./foo drw ./foo/bar -rw ./foow/bar/bar.txt drw ./foo/baz -rw ./foo/baz/baz.txt And this is what the file system structure might dictate, i.e. if these folders / files are present, the permissions must match. drw ./foo drw ./foo/bar -rw ./foo/bar/bar.txt --- ./foo/bar/foobar.txt drw ./foo/baz -rw ./foo/baz/foobaz.txt In this case the file system checked out ok, since all files present match their expected values. The situation becomes more complicated as soon as certain folders might have any arbitrary name, only due to their location I know what their permissions should be. Assume that the directory ./foo/bar in the above example might be such a case, i.e. instead of bar the folder could have any name, but still match the -rw permissions. This seems like a very complicated situation, and I'm not even sure if I can solve it with bash scripting alone. I might have to write an actual application.

    Read the article

  • error working with wsdl files in visual studio 2008

    - by deostroll
    Hi. I got a wsdl file in email. At first I didn't know how to use it. I've simply saved the file to my disk. Opened visual studio...added a service reference...provided path to file, and service was discovered. I opened the object browser to see the types and methods that got imported. I figure anything that ends with the name 'Client' is a good place to start using the web service. I've tried using a simple method to get data but it has run into and expception. Need help in resolving it. System.InvalidOperationException was unhandled Message="The XML element 'ListsRequest' from namespace 'http://www.asd.org/MGMMIRAGE.MDM.WS/Customer' references a method and a type. Change the method's message name using WebMethodAttribute or change the type's root element using the XmlRootAttribute." Source="System.Xml" StackTrace: at System.Xml.Serialization.XmlReflectionImporter.ReconcileAccessor(Accessor accessor, NameTable accessors) at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel, XmlMappingAccess access) at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean openModel) at System.Xml.Serialization.XmlReflectionImporter.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc) at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.XmlSerializerImporter.ImportMembersMapping(XmlName elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, Boolean isEncoded, String mappingKey) at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.ImportMembersMapping(String elementName, String ns, XmlReflectionMember[] members, Boolean hasWrapperElement, Boolean rpc, String mappingKey) at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.LoadBodyMapping(MessageDescription message, String mappingKey, MessagePartDescriptionCollection& rpcEncodedTypedMessageBodyParts) at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.CreateMessageInfo(MessageDescription message, String key) at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.EnsureMessageInfos() at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.EnsureMessageInfos() at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.get_Request() at System.ServiceModel.Description.XmlSerializerOperationBehavior.CreateFormatter() at System.ServiceModel.Description.XmlSerializerOperationBehavior.System.ServiceModel.Description.IOperationBehavior.ApplyClientBehavior(OperationDescription description, ClientOperation proxy) at System.ServiceModel.Description.DispatcherBuilder.BindOperations(ContractDescription contract, ClientRuntime proxy, DispatchRuntime dispatch) at System.ServiceModel.Description.DispatcherBuilder.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime) at System.ServiceModel.Description.DispatcherBuilder.BuildProxyBehavior(ServiceEndpoint serviceEndpoint, BindingParameterCollection& parameters) at System.ServiceModel.Channels.ServiceChannelFactory.BuildChannelFactory(ServiceEndpoint serviceEndpoint) at System.ServiceModel.ChannelFactory.CreateFactory() at System.ServiceModel.ChannelFactory.OnOpening() at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.ChannelFactory.EnsureOpened() at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) at System.ServiceModel.ChannelFactory`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannel() at System.ServiceModel.ClientBase`1.CreateChannelInternal() at System.ServiceModel.ClientBase`1.get_Channel() at MDMWSDemo.MDMWebSrvc.MGMCustomerSoapPortTypeClient.MDMWSDemo.MDMWebSrvc.MGMCustomerSoapPortType.CountryCodeGet(CountryCodeGetRequest request) in C:\Documents and Settings\tbhagava01\My Documents\Visual Studio 2008\Projects\MDMWSDemo\MDMWSDemo\Service References\MDMWebSrvc\Reference.cs:line 2983 at MDMWSDemo.MDMWebSrvc.MGMCustomerSoapPortTypeClient.CountryCodeGet(String countryCode) in C:\Documents and Settings\tbhagava01\My Documents\Visual Studio 2008\Projects\MDMWSDemo\MDMWSDemo\Service References\MDMWebSrvc\Reference.cs:line 2989 at MDMWSDemo.Program.Main(String[] args) in C:\Documents and Settings\tbhagava01\My Documents\Visual Studio 2008\Projects\MDMWSDemo\MDMWSDemo\Program.cs:line 15 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • <plugin> not a function

    - by bah
    Hi, I've been trying to solve this mystery almost 2 hours, this is giving me a headache. I tried 2 plug-ins already and I'm always getting "* is not a function". My code is exactly like examples so I don't know why it's not working. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>asd</title> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript' src='serial/jquery.scrollTo'></script> <script type='text/javascript' src='serial/jquery.serialScroll'></script> <script type="text/javascript"> $(document).ready(function(){ $('#slider').serialScroll({ items:'li', offset:-230, //when scrolling to photo, stop 230 before reaching it (from the left) start:1, //as we are centering it, start at the 2nd duration:1200, force:true, stop:true, lock:false, cycle:false, //don't pull back once you reach the end easing:'easeOutQuart', //use this easing equation for a funny effect jump: true //click on the images to scroll to them }); }); </script> </head> <body> <div id="slider"> <ul> <li><img width="500" height="500" src="dummy/dummy.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy1.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy2.jpg" alt="Css Template Preview" /></li> <li><img width="500" height="500" src="dummy/dummy3.jpg" alt="Css Template Preview" /></li> </ul> </div> </body> </html> I must be missing something essential there because I see nothing what's wrong. I'm using jQuery 1.4.2. and there are plug-ins I've tried - Easy Slider, jQuery serial scroll

    Read the article

  • User Control as container at design time

    - by Luca
    I'm designing a simple expander control. I've derived from UserControl, drawn inner controls, built, run; all ok. Since an inner Control is a Panel, I'd like to use it as container at design time. Indeed I've used the attributes: [Designer(typeof(ExpanderControlDesigner))] [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] Great I say. But it isn't... The result is that I can use it as container at design time but: The added controls go back the inner controls already embedded in the user control Even if I push to top a control added at design time, at runtime it is back again on controls embedded to the user control I cannot restrict the container area at design time into a Panel area What am I missing? Here is the code for completeness... why this snippet of code is not working? [Designer(typeof(ExpanderControlDesigner))] [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public partial class ExpanderControl : UserControl { public ExpanderControl() { InitializeComponent(); .... [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] internal class ExpanderControlDesigner : ControlDesigner { private ExpanderControl MyControl; public override void Initialize(IComponent component) { base.Initialize(component); MyControl = (ExpanderControl)component; // Hook up events ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); s.SelectionChanged += new EventHandler(OnSelectionChanged); c.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving); } private void OnSelectionChanged(object sender, System.EventArgs e) { } private void OnComponentRemoving(object sender, ComponentEventArgs e) { } protected override void Dispose(bool disposing) { ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); // Unhook events s.SelectionChanged -= new EventHandler(OnSelectionChanged); c.ComponentRemoving -= new ComponentEventHandler(OnComponentRemoving); base.Dispose(disposing); } public override System.ComponentModel.Design.DesignerVerbCollection Verbs { get { DesignerVerbCollection v = new DesignerVerbCollection(); v.Add(new DesignerVerb("&asd", new EventHandler(null))); return v; } } } I've found many resources (Interaction, designed, limited area), but nothing was usefull for being operative... Actually there is a trick, since System.Windows.Forms classes can be designed (as usual) and have a correct behavior at runtime (TabControl, for example).

    Read the article

  • Different behaviour using unidirectional or bidirectional relation

    - by sinuhepop
    I want to persist a mail entity which has some resources (inline or attachment). First I related them as a bidirectional relation: @Entity public class Mail extends BaseEntity { @OneToMany(mappedBy = "mail", cascade = CascadeType.ALL, orphanRemoval = true) private List<MailResource> resource; private String receiver; private String subject; private String body; @Temporal(TemporalType.TIMESTAMP) private Date queued; @Temporal(TemporalType.TIMESTAMP) private Date sent; public Mail(String receiver, String subject, String body) { this.receiver = receiver; this.subject = subject; this.body = body; this.queued = new Date(); this.resource = new ArrayList<>(); } public void addResource(String name, MailResourceType type, byte[] content) { resource.add(new MailResource(this, name, type, content)); } } @Entity public class MailResource extends BaseEntity { @ManyToOne(optional = false) private Mail mail; private String name; private MailResourceType type; private byte[] content; } And when I saved them: Mail mail = new Mail("[email protected]", "Hi!", "..."); mail.addResource("image", MailResourceType.INLINE, someBytes); mail.addResource("documentation.pdf", MailResourceType.ATTACHMENT, someOtherBytes); mailRepository.save(mail); Three inserts were executed: INSERT INTO MAIL (ID, BODY, QUEUED, RECEIVER, SENT, SUBJECT) VALUES (?, ?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE, MAIL_ID) VALUES (?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE, MAIL_ID) VALUES (?, ?, ?, ?, ?) Then I thought it would be better using only a OneToMany relation. No need to save which Mail is in every MailResource: @Entity public class Mail extends BaseEntity { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true) @JoinColumn(name = "mail_id") private List<MailResource> resource; ... public void addResource(String name, MailResourceType type, byte[] content) { resource.add(new MailResource(name, type, content)); } } @Entity public class MailResource extends BaseEntity { private String name; private MailResourceType type; private byte[] content; } Generated tables are exactly the same (MailResource has a FK to Mail). The problem is the executed SQL: INSERT INTO MAIL (ID, BODY, QUEUED, RECEIVER, SENT, SUBJECT) VALUES (?, ?, ?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE) VALUES (?, ?, ?, ?) INSERT INTO MAILRESOURCE (ID, CONTENT, NAME, TYPE) VALUES (?, ?, ?, ?) UPDATE MAILRESOURCE SET mail_id = ? WHERE (ID = ?) UPDATE MAILRESOURCE SET mail_id = ? WHERE (ID = ?) Why this two updates? I'm using EclipseLink, will this behaviour be the same using another JPA provider as Hibernate? Which solution is better?

    Read the article

  • Javascript AJAX function not working in IE?

    - by Sam152
    I have this code: function render_message(id) { var xmlHttp; xmlHttp=new XMLHttpRequest(); xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.getElementById('message').innerHTML=xmlHttp.responseText; document.getElementById('message').style.display=''; } } var url="include/javascript/message.php"; url=url+"?q="+id; xmlHttp.open("GET",url,true); xmlHttp.send(null); } For some reason it does not work in IE and an error is being reported on this line "document.getElementById('message').innerHTML=xmlHttp.responseText;" with an "Unknown Runtime Error". Can anyone help? Edit: The code being added to the div is valid code ect. Here is the response: <div style="margin-left:auto;margin-right:auto;width:400px;"> <img src="/forum/img/avatars/2.gif" width="90" height="89" style="float:left;"> <div style="margin-left:100px;"> <span style="font-size:16pt;">Sam152</a></span><br> <span style="font-size:10pt;text-transform:uppercase;font-weight:bold;">From Sam152</span><br> <span style="font-size:10pt;font-weight:bold;">Recieved April 17, 2009, 9:44 am</span><br> <br><br> </div> </div> <div style="margin-left:auto;margin-right:auto;width:400px;"> asd</div> <div style="margin-left:auto;margin-right:auto;width:400px;text-align:right;padding-top:10px;"> <span onClick="requestPage('http://www.gametard.com/include/scripts/delete_message.php?id=14');document.getElementById('message14').style.display='none';document.getElementById('message').style.display='none';" class="button">Delete</span> <span onClick="document.getElementById('message').style.display='none';" class="button">Close</span> <span onClick="document.getElementById('to').value ='Sam152';document.getElementById('to').style.color ='#000';document.getElementById('newmessage').style.display='';" class="button">Reply</span> </div>

    Read the article

  • User Control as container

    - by Luca
    I'm designing a simple expander control. I've derived from UserControl, drawn inner controls, built, run; all ok. Since an inner Control is a Panel, I'd like to use it as container at design time. Indeed I've used the attributes: [Designer(typeof(ExpanderControlDesigner))] [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] Great I say. But it isn't... The result is that I can use it as container at design time but: The added controls go back the inner controls already embedded in the user control Even if I push to top a control added at design time, at runtime it is back again on controls embedded to the user control I cannot restrict the container area at design time into a Panel area What am I missing? Here is the code for completeness... why this snippet of code is not working? [Designer(typeof(ExpanderControlDesigner))] [Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))] public partial class ExpanderControl : UserControl { public ExpanderControl() { InitializeComponent(); .... [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] internal class ExpanderControlDesigner : ControlDesigner { private ExpanderControl MyControl; public override void Initialize(IComponent component) { base.Initialize(component); MyControl = (ExpanderControl)component; // Hook up events ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); s.SelectionChanged += new EventHandler(OnSelectionChanged); c.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving); } private void OnSelectionChanged(object sender, System.EventArgs e) { } private void OnComponentRemoving(object sender, ComponentEventArgs e) { } protected override void Dispose(bool disposing) { ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService)); IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService)); // Unhook events s.SelectionChanged -= new EventHandler(OnSelectionChanged); c.ComponentRemoving -= new ComponentEventHandler(OnComponentRemoving); base.Dispose(disposing); } public override System.ComponentModel.Design.DesignerVerbCollection Verbs { get { DesignerVerbCollection v = new DesignerVerbCollection(); v.Add(new DesignerVerb("&asd", new EventHandler(null))); return v; } } } I've found many resources (Interaction, designed, limited area), but nothing was usefull for being operative...

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >