Daily Archives

Articles indexed Saturday September 15 2012

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

  • Settings messed up after crash

    - by ChocoDeveloper
    After an abrupt shutdown many settings were messed up: #1 Firefox was a mess. Bookmarks were gone, and I couldn't even add new ones. I had to reset firefox from safe mode and install all my addons and configure everything. This was a pain but is now solved. #2 The background in the login screen shows the one I chose with Ubuntu Tweak for a second, and then it puts back the default one. I tried changing it again with Ubuntu Tweak but it's still happening. #3 All my shortcuts in the sidebar were replaced by the default ones. I re-added them manually, also a pain. So how can I solve 2? And in case this happens again, is there a way to fix everything easy and fast?

    Read the article

  • How can I fix the "TERM environment variable not set" warning in eclipse

    - by Robert
    I'm running ubuntu 12.04 LTS and working with eclipse (juno) on a c++ project. I keep getting "TERM environment variable not set" in the console while trying to run the program. I realize this means the variable needs to get set. My question is what should it be set to and how do I set it? I've read that it should be 'xterm' in a few places. So I added export TERM=xterm in my .profile and while eclipse stopped giving me the warning, instead it would output unreadable garbage everynow and then (not a side effect of the program). It did display the program output but intermixed were weird characters. This leads me to believe it's not 'xterm' I should be setting TERM to. Or I'm setting it in an incorrect way. Any help is appreciated. Sample output: **TERM environment variable not set.** Please make a selection ----------------------- 1. Create a budget 2. Edit a budget 3. Display a budget 4. Save a budget 5. Load a budget 6. Exit What is your selection: 1 **TERM environment variable not set.** Enter the name of your budget: etc The program continues to execute as expected but the message is highly annoying As someone has commented, I do use system("clear") which is likely the source of the warning? Either way, is this likely just an eclipse issue or something I can fix in ubuntu/linux

    Read the article

  • Recovering an Ubuntu installation - Ubuntu eats itself after 'sudo apt-get install -f'

    - by Tony Martin
    Updater (I assume) put a no entry style alert icon on the panel which informed me that certain package dependencies were not up to snuff. Upgrades were thereafter only partial. The dialogue advised that I sudo apt-get install -f. I did this hoping that app-get would fulfil dependencies and replace corrupted files and watched it systematically remove every component of linux, both the stuff I had installed and the core ubuntu packages. I could only assume at this stage that this was in preparation for a fresh install but, of course, I know better now - if you find yourself with apt-get warning you that you are about to remove several hundred packages and asking you to type an involved confirmation string seek advice before proceeding. I digress. This was a 64 bit install of 12.04. All that is left is grub pointing to a couple of windows recovery partitions on the hard drive. Thankfully the Ext4 partition is reachable from a stick boot. EDIT: I've logged onto the machine with a 64 bit stick and can see the file structure left behind by apt-get after {ahem} fixing. My first instinct was to run install from the stick but it seemed to want to do another install rather than a repair. My question then: is there a way to recover the current installation so that if I reinstall the packages I had they will pick up the original settings? I'm particularly worried about losing email from evolution - the rest I could probably lash back together. As for the use of PPA I'm not sure what you're driving at. I generally use Ubuntu Software Centre to install software, though I have used terminal scripts to add new repositories and software successfully following guidance on various websites. The most recent change I made was a downgrade of Wine in an attempt to install and run excel2007 (a necessity, I think, as I have VBA work to do). The installer had stalled and had to be killed. I wonder if that corrupted whatever database holds a model of the package installation structure. I would also be interested to know how this disaster came about. I see people in the know recommending the sudo apt-get install -f as a fairly innocuous cure in similar circumstances. Thanks for your attention, Tony Martin p.s. Do please forgive the rant aspects of the original post. It's hard to write rationally with a large hole in the pit of your stomach.

    Read the article

  • Graphics on ubuntu 12.04 not working

    - by Rhavin
    I've got a new build specs: i5 3570k gigabyte z77 d3h Using integrated graphics I've managed to install Ubuntu 12.04 with the alternate installer, and to get video with the nomodeset option on grub screen. However when I log in, I only get the 4:3 display option. I can't get it to change. Under the settings:details tab it recognizes the hd4000 integrated graphics. Hoping someone could help!

    Read the article

  • KVM Bridged Network Not Working

    - by EApubs
    I just installed KVM on my Ubuntu Server according to this guide : https://help.ubuntu.com/community/KVM/Installation Then prepared a bridged network as shown in here : https://help.ubuntu.com/community/KVM/Networking Then, I created a virtual machine with virt-manager. I tried several times but the guest fails to connect to the network! Any help? ifconfig : br0 Link encap:Ethernet HWaddr d0:27:88:b0:e4:38 inet addr:192.168.20.100 Bcast:192.168.20.255 Mask:255.255.255.0 inet6 addr: fe80::d227:88ff:feb0:e438/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:62 errors:0 dropped:0 overruns:0 frame:0 TX packets:62 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10493 (10.4 KB) TX bytes:8433 (8.4 KB) eth0 Link encap:Ethernet HWaddr d0:27:88:b0:e4:38 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:62 errors:0 dropped:0 overruns:0 frame:0 TX packets:63 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11361 (11.3 KB) TX bytes:8479 (8.4 KB) Interrupt:41 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) virbr0 Link encap:Ethernet HWaddr 5a:8c:57:95:af:3b inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) brctl show : bridge name bridge id STP enabled interfaces br0 8000.d02788b0e438 no eth0 virbr0 8000.000000000000 yes brctl showmacs br0 : port no mac addr is local? ageing timer 1 5c:d9:98:67:b6:28 no 48.33 1 d0:27:88:b0:e4:38 yes 0.00 1 e0:2a:82:f9:6c:09 no 0.00 ip route : default via 192.168.20.1 dev br0 metric 100 192.168.20.0/24 dev br0 proto kernel scope link src 192.168.20.100 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 *In the guest * I was unable to copy paste the info from the guest because can't ssh to it. It didn't get any ip from DHCP. Won't work even after setting it up manually.

    Read the article

  • What IDEs are available for Ubuntu?

    - by Roland Taylor
    This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. See the FAQ for more information. This is a community wiki for IDEs available on Ubuntu. Please post one IDE per answer (including more than just a screenshot or a link, please at least put a short description). In your answer, tell us what the IDE is for (which language(s) or if it is RAD capable).

    Read the article

  • Help Desk Software with user groups and temporary ban function?

    - by Zillo
    Does anyone know any Help Desk Software which allow you to create user groups / to mark/categorize specific users in some way / and to to ban specific users/e-mails (not user groups) for a specific period of time? Kayako? OTRS? simpledesk?... Kayako looks to be very functional but not sure if it has this option. zendesk is also very functional but a SaaS service not a downloadable software. Since the functions that I am saying are very common in forum software, maybe simpledesk could do it since it is based in SMF. Any ideas?

    Read the article

  • OpenGL 3.0+ framebuffer to texture/images

    - by user827992
    I need a way to capture what is rendered on screen, i have read about glReadPixels but it looks really slow. Can you suggest a more efficient or just an alternative way for just copying what is rendered by OpenGL 3.0+ to the local RAM and in general to output this in a image or in a data stream? How i can achieve the same goal with OpenGL ES 2.0 ? EDIT: i just forgot: with this OpenGL functions how i can be sure that I'm actually reading a complete frame, meaning that there is no overlapping between 2 frames or any nasty side effect I'm actually reading the frame that comes right next to the previous one so i do not lose frames

    Read the article

  • 2D SAT Collision Detection not working when using certain polygons

    - by sFuller
    My SAT algorithm falsely reports that collision is occurring when using certain polygons. I believe this happens when using a polygon that does not contain a right angle. Here is a simple diagram of what is going wrong: Here is the problematic code: std::vector<vec2> axesB = polygonB->GetAxes(); //loop over axes B for(int i = 0; i < axesB.size(); i++) { float minA,minB,maxA,maxB; polygonA->Project(axesB[i],&minA,&maxA); polygonB->Project(axesB[i],&minB,&maxB); float intervalDistance = polygonA->GetIntervalDistance(minA, maxA, minB, maxB); if(intervalDistance >= 0) return false; //Collision not occurring } This function retrieves axes from the polygon: std::vector<vec2> Polygon::GetAxes() { std::vector<vec2> axes; for(int i = 0; i < verts.size(); i++) { vec2 a = verts[i]; vec2 b = verts[(i+1)%verts.size()]; vec2 edge = b-a; axes.push_back(vec2(-edge.y,edge.x).GetNormailzed()); } return axes; } This function returns the normalized vector: vec2 vec2::GetNormailzed() { float mag = sqrt( x*x + y*y ); return *this/mag; } This function projects a polygon onto an axis: void Polygon::Project(vec2* axis, float* min, float* max) { float d = axis->DotProduct(&verts[0]); float _min = d; float _max = d; for(int i = 1; i < verts.size(); i++) { d = axis->DotProduct(&verts[i]); _min = std::min(_min,d); _max = std::max(_max,d); } *min = _min; *max = _max; } This function returns the dot product of the vector with another vector. float vec2::DotProduct(vec2* other) { return (x*other->x + y*other->y); } Could anyone give me a pointer in the right direction to what could be causing this bug?

    Read the article

  • Rotate model using quaternion

    - by ChocoMan
    Currently I have this to rotate my 3D model that rotates on it's local axis independent from the world's axis: // Rotate model with Right Thumbstick modelRotation -= pController.ThumbSticks.Right.X * mRotSpeed; // float value What I'm trying to do is rotate the model using quaternion and not by a matrix. I've searched for tutorials, but have found none that explains thoroughly on how to achieve this. Does anyone know how to I can use quaternions to rotate my model or a complete tutorial?

    Read the article

  • how to modify shadow mapping in "3D Graphics with XNA Game Studio 4.0"?

    - by naprox
    So I've been following the tutorials from the book Sean James's "3D Graphics with XNA Game Studio 4.0", and have been doing fine until i reached the shadow mapping part. in this book it creates point lights with a Sphere model. my first Q is how to draw a directional Light with this frame work? secondly it can do shadow mapping just for one light, how can i do shadow mapping for all or parts of the lights in the game? i just want to know how to modify this codes to do the above tasks. I've followed tutorials on MSDN and some other sites and didn't got the answer. please help me, its so urgent. and if any one wants, the complete code is here: http://www.mediafire.com/?6ct11mc1g8f891h

    Read the article

  • Python: confused with classes, attributes and methods in OOP

    - by user1586038
    A. Am learning Python OOP now and confused with somethings in the code below. Question: 1. def init(self, radius=1): What does the argument/attribute "radius = 1" mean exactly? Why isn't it just called "radius"? The method area() has no argument/attribute "radius". Where does it get its "radius" from in the code? How does it know that the radius is 5? """ class Circle: pi = 3.141592 def __init__(self, radius=1): self.radius = radius def area(self): return self.radius * self.radius * Circle.pi def setRadius(self, radius): self.radius = radius def getRadius(self): return self.radius c = Circle() c.setRadius(5) """ B. Question: In the code below, why is the attribute/argument "name" missing in the brackets? Why was is not written like this: def init(self, name) and def getName(self, name)? """ class Methods: def init(self): self.name = 'Methods' def getName(self): return self.name """

    Read the article

  • How select data from SQLite table where date = week of year?

    - by vovaxo
    I have table expense: "create table " + Expense.TABLE_NAME + "(" + Expense.ID + " integer primary key autoincrement not null, " + Expense.CATEGORY_ID + " integer, " + Expense.ITEM + " text, " + Expense.PRICE + " real, " + Expense.DATE + " date, " + Expense.TIME + " time);"; And I want to select Expense.PRICE where Expense.DATE = current day/week/month. I tried to do this cursor = mDB.rawQuery("select " + Expense.PRICE + " where " + " (strftime('%W', " + Expense.DATE + "))" + "=" + week, null); where week is week = calendar.get(Calendar.WEEK_OF_YEAR); but it gives an error in cursor: 09-15 09:32:02.647: E/AndroidRuntime(18939): Caused by: java.lang.NullPointerException 09-15 09:32:02.647: E/AndroidRuntime(18939): at com.pllug.summercamp.expensemanager.DataAdapter.getPrice(DataAdapter.java:242)

    Read the article

  • dynamically bound elements don't subscribe to CSS rules

    - by user961627
    I'm using ajax to dynamically populate a menu. The problem is the dynamically created elements do not follow the CSS rules, although they're created with the right classname. This is surprising. Here's my HTML: <div id='menu1'> <ul class='menu'> <?php $sql = /// /* some sql string, which works */ $result = mysql_query($sql); while($row = mysql_fetch_array( $result )) { $prod_id = $row['product_id']; $prod_name = $row['product_name']; echo "<li data-title='$prod_id' class='menu1_item'>".$prod_name."</li> "; } ?> </ul> </div> <div id='menu2'> <ul class='menu'> </ul> </div> <div id='menu3'> <ul class='menu'> </ul> </div> Here's my jquery: $(".menu1_item").click( function() { $.ajax({ type: "POST", data: { m: '2', id: $(this).attr('data-title') }, url: "fetch_designs.php", success: function(msg){ if (msg != ''){ $("#menu2").html(msg).show(); $(".menu2_item").bind('click',function() { $.ajax({ type: "POST", data: { m: '3', id: $(this).attr('data-title') }, url: "fetch_designs.php", success: function(msg){ if (msg != ''){ $("#menu3").html(msg).show(); } } }); //end menu2 click }); //end if } //end success } }); //end menu1 click }); My CSS is as follows: ul.menu li { cursor:pointer; list-style: none; } #menu1, #menu2, #menu3 { margin:50px; position:relative; display:block; float:left; } .menu1-item .menu2-item .menu3-item { padding:4px; background-color:lightgray; color:black; cursor:pointer; }

    Read the article

  • CSS / HTML - Image will not show up

    - by weka
    Ugh, ok. I've been up all night working this thing and now an image won't show. It's so darn annoying. Trying to get this .png image to show up on a simple PHP webpage. I just wanna go to sleep X_X CSS: <style> .achievement { position:relative; width:500px; background:#B5B5B5; float:left; padding:10px; margin-bottom:10px; } .icon { float:left; width:32px; height:32px; background: url("images/trophy.php") no-repeat center; padding:05px; border:4px solid #4D4D4D; } .ptsgained { position:absolute; top:0; right:0; background:#79E310; color:#fff; font-family:Tahoma; font-weight:bold; font-size:12px; padding:5px; } .achievement h1 { color:#454545; font-size:12pt; font-family:Georgia; font-weight:none; margin:0;padding:0; } .achievement p { margin:0;padding:0; font-size:12px; font-family:Tahoma; color:#1C1C1C; } .text { margin-left:10px; float:left; } </style> HTML: <div class="achievement"> <span class="ptsgained">+10</span> <div class="icon"></div> <div class="text"><h1>All Around Submitter</h1> <p>Submit and have approved content in all 6 areas.</p> </div> </div> What am I doing wrong, guys? :\

    Read the article

  • I want search a item frome database

    - by vishal
    I want search a item frome database bye date and id but if I want to search only by date or id tahn data are display but if I want to search by both date and id than not both are display but combine both and than display. my code: SqlConnection con = new SqlConnection("Data Source=NODE5-PC;Initial Catalog=hans;Persist Security Info=True;User ID=sa;Password=123"); cmd = new SqlCommand("SELECT UserId, Date, Report FROM Daily_Report WHERE (Date='" + txtdate.Text + "' or UserId='" + txtempid.Text + "') OR (UserId='" + txtempid.Text + "' and UserId='" + txtempid.Text + "')", con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); GridView2.DataSource = rdr; GridView2.DataBind(); con.Close();

    Read the article

  • Synchronizing issue: I want the main thread to be run before another thread but it sometimes doesn´t

    - by Rox
    I have done my own small concurrency framework (just for learning purposes) inspired by the java.util.concurrency package. This is about the Callable/Future mechanism. My code below is the whole one and is compilable and very easy to understand. My problem is that sometimes I run into a deadlock where the first thread (the main thread) awaits for a signal from the other thread. But then the other thread has already notified the main thread before the main thread went into waiting state, so the main thread cannot wake up. FutureTask.get() should always be run before FutureTask.run() but sometimes the run() method (which is called by new thread) runs before the get() method (which is called by main thread). I don´t know how I can prevent that. This is a pseudo code of how I want the two threads to be run. //From main thread: Executor.submit().get() (in get() the main thread waits for new thread to notify) ->submit() calls Executor.execute(FutureTask object) -> execute() starts new thread -> new thread shall notify `main thread` I cannot understand how the new thread can start up and run faster than the main thread that actually starts the new thread. Main.java: public class Main { public static void main(String[] args) { new ExecutorServiceExample(); } public Main() { ThreadExecutor executor = new ThreadExecutor(); Integer i = executor.submit(new Callable<Integer>() { @Override public Integer call() { return 10; } }).get(); System.err.println("Value: "+i); } } ThreadExecutor.java: public class ThreadExecutor { public ThreadExecutor() {} protected <V> RunnableFuture<V> newTaskFor(Callable c) { return new FutureTask<V>(c); } public <V> Future<V> submit(Callable<V> task) { if (task == null) throw new NullPointerException(); RunnableFuture<V> ftask = newTaskFor(task); execute(ftask); return ftask; } public void execute(Runnable r) { new Thread(r).start(); } } FutureTask.java: import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; import java.util.logging.Level; import java.util.logging.Logger; public class FutureTask<V> implements RunnableFuture<V> { private Callable<V> callable; private volatile V result; private ReentrantLock lock = new ReentrantLock(); private Condition condition = lock.newCondition(); public FutureTask(Callable callable) { if (callable == null) throw new NullPointerException(); this.callable = callable; } @Override public void run() { acquireLock(); System.err.println("RUN"+Thread.currentThread().getName()); V v = this.callable.call(); set(v); condition.signal(); releaseLock(); } @Override public V get() { acquireLock(); System.err.println("GET "+Thread.currentThread().getName()); try { condition.await(); } catch (InterruptedException ex) { Logger.getLogger(FutureTask.class.getName()).log(Level.SEVERE, null, ex); } releaseLock(); return this.result; } public void set(V v) { this.result = v; } private void acquireLock() { lock.lock(); } private void releaseLock() { lock.unlock(); } } And the interfaces: public interface RunnableFuture<V> extends Runnable, Future<V> { @Override void run(); } public interface Future<V> { V get(); } public interface Callable<V> { V call(); }

    Read the article

  • Understanding flow of object creation

    - by Boris Mandovskes
    I'm new to java and I wonder if there is simple way to know flow like the following of object creation, I'm using eclipse and when I write new ObjectInputStream and press CTRL+SPACE. I don't see any option that I can enter new BufferedInputStream (I have copied the code from example) and than to create new object for FileInputStream etc. in = new ObjectInputStream(new BufferedInputStream(new FileInputStream("emp.dat"))); List temp = (List)in.readObject(); I give that example since this is the first time that I saw this kind of creation new object flow and I want to use some best practice for the next times.

    Read the article

  • Access static method from non static class possible in java and not in c#

    - by sagar_kool
    Access static method from non static class with object. It is not possible in C#. Where it is done by JAVA. How it works? example of java /** * Access static member of the class through object. */ import java.io.*; class StaticMemberClass { // Declare a static method. public static void staticDisplay() { System.out.println("This is static method."); } // Declare a non static method. public void nonStaticDisplay() { System.out.println("This is non static method."); } } class StaticAccessByObject { public static void main(String[] args) throws IOException { // call a static member only by class name. StaticMemberClass.staticDisplay(); // Create object of StaticMemberClass class. StaticMemberClass obj = new StaticMemberClass(); // call a static member only by object. obj.staticDisplay(); // accessing non static method through object. obj.nonStaticDisplay(); } } Output of the program: This is static method. This is static method. This is non static method. How to do this in C#? thanks in advance..

    Read the article

  • Partial view links not working in Fire Fox

    - by user329540
    I have a MVC4 asp.net application, I have two layouts a main layout for the main page and a second layout for the nested pages. The problem I have is with the second layout, on this layout I call a partial view which has my navigation links. In IE the navigation menu displays fine and when each item is clicked it navigates as expected. However in FF when the page renders the navigation bar is displayed but it has no 'click functionality' if you will its as if its simply text. My layout of nested page: <header> <img src="../../Images/fronttop.png" id="nestedPageheader" alt="Background Img"/> <div class="content-wrapper"> <section > <nav> <div id="navcontainer"> </div> </nav> </section> <div> </header> The script to retreive partial view and information for dynamic links on layout page. <script type="text/javascript"> var menuLoaded = false; $(document).ready(function () { if($('#navcontainer')[0].innerHTML.trim() == "") { $.ajax({ url: "@Url.Content("~/Home/MenuLayout")", type: "GET", success: function (response, status, xhr) { var nvContainer = $('#navcontainer'); nvContainer.html(response); menuLoaded = true; }, error: function (XMLHttpRequest, textStatus, errorThrown) { var nvContainer = $('#navcontainer'); nvContainer.html(errorThrown); } }); } }); </script> May partial view: @model Mscl.OpCost.Web.Models.stuffmodel <div class="menu"> <ul> <li><a>@Html.ActionLink("Home", "Index", "Home")</a></li> <li><a>@Html.ActionLink("some stuff", "stuffs", "stuff")</a></li> <li> <h5><a><span>somestuff</span></a></h5> <ul> <li><a>stuffs1s</a> <ul> @foreach (var image in Model.stuffs.Where(g => g.Grouping == 1)) { <li> <a>@Html.ActionLink(image.Title, "stuffs", "stuff", new { Id = image.CategoryId }, null)</a> </li> } </ul> </li> </ul> </il> </ul> </div> I need to know why this works fine in IE but why its not working in FF(all versions). Any assistance would be appreciated.

    Read the article

  • wp+sql+image not goin in the folder

    - by happy
    this is my code for uploading image in database but image are going to the desird forlder...but when i m tryin to retrieve the images to diaplay,,they are not displayed..anyone help me...... $category=$_POST['category']; $uploadDir = 'D:/xampp/htdocs/js/wordpress/wp-content/plugins/img/imagess/ '; $fileName = $_FILES['Photo']['name']; $tmpName = $_FILES['Photo']['tmp_name']; $fileSize = $_FILES['Photo']['size']; $fileType = $_FILES['Photo']['type']; $filePath = $uploadDir . $fileName; $result = move_uploaded_file($tmpName,$filePath); if (!$result) { echo "Error uploading file"; exit; } if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } global $wpdb; //$insert=$wpdb->insert('images',array('image_name'=>$filePath,'cat_name'=>$category),array('%b','%s')); $insert=$wpdb->insert('images',array('image_name'=>$filePath,'cat_name'=>$category)); $wpdb->insert('categories',array('cat_name'=>$category)); echo "Successfully Submitted";

    Read the article

  • c# - PubNub JSON serialization code works in example project but not in my project

    - by pilau
    I am making a Winamp plugin with the single function of sending the details of the song being played over HTTP to a webpage. It works like this: Winamp song event triggered - check for new song - publish to webpage using PubNub (C# API). So far I got to the stage where everything works exactly as it is supposed to, except for the PubNub code which doesn't serialize the object I'm passing for publishing into JSON. All I keep getting in the PubNub console is a mere {} - an empty JSON object. A little background on the project structure: I am using Sharpamp which is a custom library that enables making Winamp plugins with C#. I am also using the PubNub C# API. The gen_notifier_cs project is the C++ plugin wrapper created by Sharpamp. notifier_cs is where all my code resides. The two other projects are self explanatory I assume. I have referenced the PubNub API in notifier_cs, and also have referenced Sharpamp in both notifier_cs and PubNub API. So, the objects that need to get serialized are of a class Song as defined in Sharpamp: public class Song { public string Title { get; internal set; } public string Artist { get; internal set; } public string Album { get; internal set; } public string Year { get; internal set; } public bool HasMetadata { get; internal set; } public string Filename { get; internal set; } } So let's say if I have a song object with song data in it, I would go pubnub.publish("winamp_pipe", song); to publish it and PubNub will automatically serialize the data into JSON. But that's just not working in my solution. To test why it wasn't serializing, I copied that class to the example code file in the PubNub API. Visual Studio changed the class to this (notice the public Song() method): public class Song { public Song() { return; } public string Album { get; set; } public string Artist { get; set; } public string Filename { get; set; } public bool HasMetadata { get; set; } public string Title { get; set; } public string Year { get; set; } } On the same example file I initiated a default song object with some values: Song song = new Song(); song.Album = "albumname"; song.Artist = "artistname"; song.HasMetadata = true; song.Title = "songtitle"; song.Year = "2012"; And published it: pubnub.publish("winamp_pipe", song); and it worked! I got the JSON object in the PubNub channel! {"Album":"albumname","Artist":"artistname","Filename":null,"HasMetadata":true,"Title":"songtitle","Year":"2012"} So, I tried replacing the "new" Song class with the original one defined in Sharpamp. I tried adding another class definition in the notifier_cs project but that clashes with the one in Sharpamp which I have to rely on. I have been trying so many things as far as I could come up with. Needless to say none prevailed. Still, all I get is an empty JSON object. I have been pulling out my hair for the last day. I know this post is super long but I appreciate your input nonetheless. Thanks in advance.

    Read the article

  • Assign value to HTML textbox from JSP

    - by prakash_d22
    Hello I am creating a web page to add some information about given product.I need to enter id,name,description and image as information.I need the id to be auto generated.I am using jsp and database as access.I am fetching the count(*)+1 value from database and assigning to my html text box but its showing as null.can i get some help? Code: <body> <%@page import="java.sql.*"%> <%! String no; %> <% try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:pd"); ResultSet rs = null; Statement st = con.createStatement(); String sql = ("select count(*)+1 from products"); st.executeUpdate(sql); while (rs.next()) { no=rs.getString("count(*)+1"); } rs.close(); st.close(); con.close(); } catch(Exception e){} %> <Form name='Form1' action="productcode.jsp" method="post"> <table width="1024" border="0"> <tr> <td width="10">&nbsp;</td> <td width="126">Add Product: </td> <td width="277">&nbsp;</td> <td width="583">&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>Product Id:</td> <td><label> <input type="text" name="id" value="<%= no%>"/> </label></td> <td>&nbsp;</td> .... and so on

    Read the article

  • Combine Related Resources With TastyPie

    - by Aaron Ng
    How can I combine multiple Resources in TastyPie? I have 3 models I'd like to combine: users, profiles and posts. Ideally I'd like profiles nested within user. I'm not sure where to go from here. class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['username','id','date_joined'] #Improper Auth authorization = Authorization() class UserProfileResource(ModelResource): class Meta: queryset = UserProfile.objects.all() resource_name = 'profile' class UserPostResource(ModelResource): user = fields.ForeignKey(UserResource,'user', full=True) class Meta: queryset = UserPost.objects.all() resource_name = 'userpost' #Improper Auth authorization = Authorization()

    Read the article

  • getting height of the dynamically loaded div

    - by user1223654
    i am facing some difficulty with getting the height of the dynamically loaded div image.. sometimes , it gives the correct height but sometimes it gives zero .. here is my code $.ajax({ type: "POST", url: "images.php", data: dataStr, cache: false, async : false, success: function(data) { $('.up').empty(); $(".up").html(data); alert($(".loadimg").height()); } }); here is what i am appending echo '<div class="imagediv"> <img src="default.jpg" class="loadimg" /> </div> ';

    Read the article

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