Daily Archives

Articles indexed Saturday June 7 2014

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

  • Correct microdata and/or microformats for real estate listings?

    - by Ernests Karlsons
    Given I am running a real estate rentals listing website, what would be the correct microdata or microformats for the listing pages? There is the usual data: address, photos, price, start date, possible end date, person who is renting it out, list of amenities, description etc. Are there also microformats/microdata that can be used in the listing summary page (e.g., page that displays all listings in a particular city)?

    Read the article

  • Unity 3D - Error BCE0019 , " 'paused' is not a member of PauseScript"

    - by user3666251
    I am trying to make a game for Android in Unity. Came to the part where I have to make a pause menu option. Made a GUITexture and placed it on the top right side of the screen then I attached this script to it : #pragma strict function OnMouseDown(){ this.paused = !this.paused; } function OnGUI(){ if(this.paused){ if (GUI.Button(Rect(10,10,100,50),"Restart")){ Application.LoadLevel(Application.loadedLevel); } // Insert the rest of the pause menu logic } } It gives me this error : "Assets/Scripts/PauseScript.js(4,10): BCE0019: 'paused' is not a member of 'PauseScript'. " "PauseScript" is the name of my pause script. Thank you.

    Read the article

  • Light shaped like a line

    - by Michael
    I am trying to figure out how line-shaped lights fit into the standard point light/spotlight/directional light scheme. The way I see it, there are two options: Seed the line with regular point lights and just deal with the artifacts. Easy, but seems wasteful. Make the line some kind of emissive material and apply a bloom effect. Sounds like it could work, but I can't test it in my engine yet. Is there a standard way to do this? Or for non-point lights in general?

    Read the article

  • Best way to blend colors in tile lighting? (XNA)

    - by Lemoncreme
    I have made a color, decent, recursive, fast tile lighting system in my game. It does everything I need except one thing: different colors are not blended at all: Here is my color blend code: return (new Color( (byte)MathHelper.Clamp(color.R / factor, 0, 255), (byte)MathHelper.Clamp(color.G / factor, 0, 255), (byte)MathHelper.Clamp(color.B / factor, 0, 255))); As you can see it does not take the already in place color into account. color is the color of the previous light, which is weakened by the above code by factor. If I wanted to blend using the color already in place, I would use the variable blend. Here is an example of a blend that I tried that failed, using blend: return (new Color( (byte)MathHelper.Clamp(((color.R + blend.R) / 2) / factor, 0, 255), (byte)MathHelper.Clamp(((color.G + blend.G) / 2) / factor, 0, 255), (byte)MathHelper.Clamp(((color.B + blend.B) / 2) / factor, 0, 255))); This color blend produces inaccurate and strange results. I need a blend that is accurate, like the first example, that blends the two colors together. What is the best way to do this?

    Read the article

  • Camera movement and threshold not working

    - by irish guy mcconagheh
    I have a platformer that is in progress, part of this has a camera which I only want to move when the character moves out of a certain threshold, to try to accomplish this I have the following if statement: if(((Mathf.Abs(target.transform.position.x))-(Mathf.Abs(transform.position.x)))>thres){ x = moveTo(transform.position.x, target.position.x, trackSpeed); } in unity/c#. In pseudocode it means if((absolute value of player x) - (absolute value of camera x) is greater than the threshold){ move { however this does not seem to work correctly. it appears to work for the first couple of times the threshold is reached, however the distance between the camera and the player has to increase every time for the camera to move. I do not believe the movement of the camera is the problem, however the code for it is as follows: private float moveTo(float n, float target, float accel) { if (n == target) { return n; } else { float dir = Mathf.Sign(target - n); n += accel * Time.deltaTime * dir; return (dir == Mathf.Sign(target-n))? n: target; } } }

    Read the article

  • Swift CMutablePointers in factories e.g. NewMusicSequence

    - by Gene De Lisa
    How do you use C level factory methods in Swift? Let's try using a factory such as NewMusicSequence(). OSStatus status var sequence:MusicSequence status=NewMusicSequence(&sequence) This errors out with "error: variable 'sequence' passed by reference before being initialized". Set sequence to nil, and you get EXC_BAD_INSTRUCTION. You can try being explicit like this: var sp:CMutablePointer<MusicSequence>=nil status=NewMusicSequence(sp) But then you get a bad access exception when you set sp to nil. If you don't set sp, you get an "error: variable 'sp' used before being initialized" Here's the reference.

    Read the article

  • jquery mobile mPDF not rendering on form submission

    - by Adam
    Im trying to have the user submit form data to a mPDF page the will render a pdf with the data included. The problem Im having is that jquery mobile initializes the mPDF page not allowing the mPDF to render properly. Im trying to figure out how to stop jquery mobile from initializing the mPDF page. Just a note, when I remove query mobile the functionality works. HTML <form id="rxForm" method="post" action="rxPDF.php"> <input type="text" name="dueDate"></form> </form> <button id="printPDF">Submit</button> JQUERY $('#printPDF').on('click', function() { console.log('pdf'); $('#rxForm').submit(); return false; }); mPDF <?php include ("library/mpdf.php"); $dueDate = $_POST['dueDate']; $html = 'The date is '.$dueDate.''; $mpdf = new mPDF(); $mpdf->WriteHTML($html, 0); $mpdf->Output(); exit; ?> I appreciate anyone's help!

    Read the article

  • What does this pointer-heavy C code do?

    - by justRadojko
    Could someone explain to me what should two following lines do: s.httpheaderline[s.httpheaderlineptr] = *(char *)uip_appdata; ++((char *)uip_appdata); This is taken from uIP code for microcontrollers. s - structure httpheaderline - http packet presented as a string httpheadrlineptr - integer value uip_appdata - received ethernet packet (string) If some more info is needed please let me know. BTW. Eclipse is reporting an error on the second line with message Invalid lvalue in increment so i'm trying to figure out how to solve this.

    Read the article

  • Finding occurrences of element before and after the element in Array

    - by user3718040
    I am writing a algorithm, if an array contain 3 does not contain between two 1s. like this int array={5, 2, 10, 3, 15, 1, 2, 2} the above array contain 3, before 3 there is no 1 and after 3 is one 1 it should return True. int array={3,2,18,1,0,3,-11,1,3} in this array after first element of 3 there is two 1 it should return False. I have try following code public class Third { public static void main(String[] args){ int[] array = {1,2,4,3, 1}; for(int i=0;i<array.length;i++) { if(array[i]==3) { for(int j=0;j<array[i];j++) { if(array[j]==1) { System.out.println("I foud One before "+array[j]); }else { break; } System.out.println("yes i found the array:"+array[i]); } for(int z=0;z>array[i];z++) { if(array[z]==1) { System.out.println("I found after 3 is :"+array[z]); } break; } } } } } I am not getting exact result from my above code which i want.

    Read the article

  • Communicate between content script and options page

    - by Gaurang Tandon
    I have seen many questions already and all are about background page to content script. Summary My extension has an options page, and a content script. The content script handles the storage functionality (chrome.storage manipulation). Whenever, a user changes a setting in the options page, I want to send a message to the content script to store the new data. My code: options.js var data = "abcd"; // let data chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { chrome.tabs.sendMessage(tabs[0].id, "storeData:" + data, function(response){ console.log(response); // gives undefined :( }); }); content script js chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { // not working }); My question: Why isn't the approach not working? Is there any other (better) approach for this procedure.

    Read the article

  • Right border shifts to bottom line

    - by zencimusa
    http://jsfiddle.net/W9LXd/ I want the div under the #araclar to have it's right border stay in the same line. How can I prevent it from shifting? CSS: #düzenleyici{ border: 1px solid #000; width: 600px; height: 300px; box-shadow: 1px 1px 4px #000; } #araclar{ width:auto; height:50px; background:#EEEEEE; display:block; padding:5px 15px 5px 15px; border-bottom:1px solid #000; } #araclar>div{ padding:0 5px 0 5px; display:inline; border:1px solid #000; } HTML: <div id="düzenleyici"> <div id="araclar"> <div> Renk <div> </div> </div>

    Read the article

  • How can I add forward class references used in the -Swift.h header?

    - by Bill
    I'm integrating Swift code into a large Objective-C project, but I'm running into problems when my Swift code refers to Objective-C classes. For example, suppose I have: An Objective-C class called MyTableViewController An Objective-C class called DeletionWorkflow I declared a Swift class as follows: class DeletionVC: MyTableViewController { let deleteWorkflow: DeletionWorkflow ... } If I now try to use this class by importing ProjectName-Swift.h into Objective-C code, I get undefined symbol errors for both MyTableViewController and DeletionWorkflow. I can fix the problem in that individual source file by importing DeletionWorkflow.h and MyTableViewController.h before I import ProjectName-Swift.h but this doesn't scale up to a large project where I want my Swift and Objective-C to interact often. Is there a way to add forward class references to ProjectName-Swift.h so that these errors don't occur when I try to use Swift classes from Objective-C code in my app?

    Read the article

  • Writing array to text file

    - by user3661876
    I have an array, but it won't write each index to the text file. Instead it is only writing the last index and the other indexes are not appearing. Can anyone help me to get the entire array printed to the text file? static void solve(int k) { if (k == N) // We placed N-1 queens (0 included), problem solved! { // Solution found! using (StreamWriter sw = new StreamWriter("names.txt")) { Console.Write("Solution: "); for (int i = 0; i < N; i++) { Console.Write(position[i] + " "); foreach (int s in position[i].ToString()) { string list = position[i].ToString(); sw.Write(list + " "); } } Console.WriteLine(); sum += 1; } }

    Read the article

  • std::conditional compile-time branch evaluation

    - by cmannett85
    Compiling this: template < class T, class Y, class ...Args > struct isSame { static constexpr bool value = std::conditional< sizeof...( Args ), typename std::conditional< std::is_same< T, Y >::value, isSame< Y, Args... >, // Error! std::false_type >::type, std::is_same< T, Y > >::type::value; }; int main() { qDebug() << isSame< double, int >::value; return EXIT_SUCCESS; } Gives me this compiler error: error: wrong number of template arguments (1, should be 2 or more) The issue is that isSame< double, int > has an empty Args parameter pack, so isSame< Y, Args... > effectively becomes isSame< Y > which does not match the signature. But my question is: Why is that branch being evaluated at all? sizeof...( Args ) is false, so the inner std:conditional should not be evaluated. This isn't a runtime piece of code, the compiler knows that sizeof..( Args ) will never be true with the given template types. If you're curious, it's supposed to be a variadic version of std::is_same, not that it works...

    Read the article

  • Ushahidi - How to make the markers stay on the map on zoom change?

    - by Guttemberg
    I am using the platform Ushahidi Web-2.7.3 , see: http://ti5.net.br/provedorlegal.com.br, and when I zoom in beyond a certain level, the clustered markers disappear from the map. I also tested this on an older version of a site, see: http://movimentofichalimpa.org/mapa, where the clustered markers do not disappear on zooming in, but just become ungrouped, as is normal with a cluster strategy. How can I make the markers remain on the map when zooming in?

    Read the article

  • Surface Area of a Spheroid in Python

    - by user3678321
    I'm trying to write a function that calculates the surface area of a prolate or oblate spheroid. Here's a link to where I got the formulas (http://en.wikipedia.org/wiki/Prolate_spheroid & http://en.wikipedia.org/wiki/Oblate_spheroid). I think I've written them wrong, but here is my code so far; from math import pi, sqrt, asin, degrees, tanh def checkio(height, width): height = float(height) width = float(width) lst = [] if height == width: r = 0.5 * width surface_area = 4 * pi * r**2 surface_area = round(surface_area, 2) lst.append(surface_area) elif height > width: #If spheroid is prolate a = 0.5 * width b = 0.5 * height e = 1 - a / b surface_area = 2 * pi * a**2 * (1 + b / a * e * degrees(asin**-1(e))) surface_area = round(surface_area, 2) lst.append(surface_area) elif height < width: #If spheroid is oblate a = 0.5 * height b = 0.5 * width e = 1 - b / a surface_area = 2 * pi * a**2 * (1 + 1 - e**2 / e * tanh**-1(e)) surface_area = round(surface_area, 2) lst.append(surface_area, 2) return lst

    Read the article

  • Convert executed SQL result to a list of Model object

    - by huynq9
    I'm wondering that is it possible to convert the executed query result to a list of models. I'm using Ruby with ActiveRecord and need to execute custom SQL query to join two or many tables. The code looks like below: connection = ActiveRecord::Base.connection sql = "select T1.f1, T2.f2 from T1 left join T2 on T1.id = T2.id" @result = connection.execute(sql) In Ruby code, I defined a models to manage the executed SQL result: class Model property :f1, :f2 end Is there any way to convert @result to list of Model object? so I can deal with each item in the list as following @result.each do |item| puts item.f1 puts item.f2 end

    Read the article

  • ArrayAdapter need to be clear even i am creating a new one

    - by Roi
    Hello I'm having problems understanding how the ArrayAdapter works. My code is working but I dont know how.(http://amy-mac.com/images/2013/code_meme.jpg) I have my activity, inside it i have 2 private classes.: public class MainActivity extends Activity { ... private void SomePrivateMethod(){ autoCompleteTextView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, new ArrayList<String>(Arrays.asList("")))); autoCompleteTextView.addTextChangedListener(new MyTextWatcher()); } ... private class MyTextWatcher implements TextWatcher { ... } private class SearchAddressTask extends AsyncTask<String, Void, String[]> { ... } } Now inside my textwatcher class i call the search address task: @Override public void afterTextChanged(Editable s) { new SearchAddressTask().execute(s.toString()); } So far so good. In my SearchAddressTask I do some stuff on doInBackground() that returns the right array. On the onPostExecute() method i try to just modify the AutoCompleteTextView adapter to add the values from the array obtained in doInBackground() but the adapter cannot be modified: NOT WORKING CODE: protected void onPostExecute(String[] addressArray) { ArrayAdapter<String> adapter = (ArrayAdapter<String>) autoCompleteDestination.getAdapter(); adapter.clear(); adapter.addAll(new ArrayList<String>(Arrays.asList(addressArray))); adapter.notifyDataSetChanged(); Log.d("SearchAddressTask", "adapter isEmpty : " + adapter.isEmpty()); // Returns true!!??! } I dont get why this is not working. Even if i run it on UI Thread... I kept investigating, if i recreate the arrayAdapter, is working in the UI (Showing the suggestions), but i still need to clear the old adapter: WORKING CODE: protected void onPostExecute(String[] addressArray) { ArrayAdapter<String> adapter = (ArrayAdapter<String>) autoCompleteDestination.getAdapter(); adapter.clear(); autoCompleteDestination.setAdapter(new ArrayAdapter<String>(NewDestinationActivity.this,android.R.layout.simple_spinner_dropdown_item, new ArrayList<String>(Arrays.asList(addressArray)))); //adapter.notifyDataSetChanged(); // no needed Log.d("SearchAddressTask", "adapter isEmpty : " + adapter.isEmpty()); // keeps returning true!!??! } So my question is, what is really happening with this ArrayAdapter? why I cannot modify it in my onPostExecute()? Why is working in the UI if i am recreating the adapter? and why i need to clear the old adapter then? I dont know there are so many questions that I need some help in here!! Thanks!!

    Read the article

  • trouble setting node['chef-client']['interval']

    - by atiniir
    I've searched many places and haven't get found the answer to this, I suspect I'm missing something either fundamental or basic (maybe both) I'm using the chef-client::windows_service recipe and trying to set the interval and can't seem to sort it out. I've tried at the role level with: { "defaults": { "chef_client": { "interval":15 } }, "overrides":{ } } and at the node level with: { "chef_client": { "interval":25 }, "tags":[] } but the interval on the node is still 1800 (default)

    Read the article

  • CICS web service requestor GET CONTAINER returns neither data nor error

    - by Namhcir
    I am developing a CICS web service requestor application to consume a distributed web service. I used the web services assistant DFHWS2LS to transform the wsdl to copybooks successfully. I have no problem issuing the PUT CONTAINER and INVOKE SERVICE api commands, but when I issue GET CONTAINER I am not receiving any containers or data. No response codes or error messages, but no data. Any ideas on how to debug this would be greatly appreciated. Thanks,

    Read the article

  • How to convert a AChartEngine chart to bitmap

    - by user2137817
    I want to convert a line graph I made with AChartEngine lib to bitmap.How should I do?I didn't found on the net anything that can help. Is the toBitmap() method suitable?if yes then how to use it? Update: I used this method : public static Bitmap loadBitmapFromView(View v) { v.setDrawingCacheEnabled(true); v.layout( 0,0,800,600); v.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); v.buildDrawingCache(); v.getDrawingCache(); Bitmap bmp = Bitmap.createBitmap(800,600, Bitmap.Config.ARGB_8888); v.setDrawingCacheEnabled(false); return bmp; } and saved the result in a png file but all I got is an empty file !

    Read the article

  • How do I change the root directory of an apache server?

    - by Spencer Cooley
    Does anyone know how to change the document root of the Apache server? I basically want localhost to come from /users/spencer/projects directory instead of /var/www. Edit I ended up figuring it out. Some suggested I change the httpd.conf file, but I ended up finding a file in /etc/apache2/sites-available/default and changed the root directory from /var/www to /home/myusername/projects_folder and that worked.

    Read the article

  • SQL Server replication and load balance

    - by Ahmed Galal
    I'm running a web service that serves a mobile app on IIS 8 and SQL Server 2014, my service has a massive load and i'm trying to improve performance, most of the load is happening on SQL. i don't think i have a bottleneck, my processor and ram is up to the max and i think my code is not that bad, am already using memcached and other stuff to avoid hitting SQL too much. i know i can always upgrade the server hardware but i already have a spare server that i would like to use, so i was thinking to split the SQL load on the 2 servers. What i was thinking of is to setup replication on the other server and do some load balancing, but am not sure how to do the load balance. I know i can adjust my code to hit the other server for some queries but i was hoping to find a solution that avoid changing my code. So my question is, What are the ways of doing load balancing between 2 SQL servers ? I would appreciate suggestions or best practices or some directions. Thanks.

    Read the article

  • Cant access websites internally but can externally, happened all of a sudden on Windows Server 2008

    - by Mike Flynn
    Without any type of change I can access sites from within my server, not even Google. I can access them externally. I have no idea where to start. My internet Lan Settings are set to automatic and not to proxy. Nothing was changed on my end, how can I diagnose this issue? Check my server wasnt using a proxy Cant ping or access websites on my server, and others like google nslookup on my sites causes a refusal

    Read the article

  • Apache: scope for environmental variables

    - by Anonymous
    While there's documentation available on Apache environmental variables, I can not find answer to one important question. Imagine I use rewrite rules to set environmental variable RewriteRule ... ... [E=something:1] What is the scope of "something" - global Apache server (this means "something" will be available for other request transactions), this request (means that "something" is only valid for THIS http request (and its related processing - but what's about internal redirects and other internal stuff - are they considered as THIS request, or another one?), and may be set differently within another (concurrent) request?

    Read the article

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