compare_oracle / oraclechunk41.json
xPXXX's picture
Upload 10 files
26d7090
Raw
History Blame Contribute Delete
26.9 kB
Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
{"QuestionId": 29723408, "AnswerCount": 1, "Tags": "<python><flask><celery>", "CreationDate": "2015-04-18T22:05:10.720", "AcceptedAnswerId": "29723950", "Title": "Flask app context and celery integration", "Body": "<p>When integrating celery with a Flask app does celery need to be aware of the Flask application context?</p>\n\n<p>Can I just do something like:</p>\n\n<pre><code>import celery from Celery\n\ncelery = Celery()\n\n@task\ndef mytask():\n</code></pre>\n\n<p>Or do I have to do this:</p>\n\n<pre><code>def make_celery(app=None):\n app = app or create_app(os.getenv('FLASK_CONFIG') or 'default')\n celery = Celery(__name__, broker=app.config.CELERY_BROKER_URL)\n celery.conf.update(app.conf)\n TaskBase = celery.Task\n\n class ContextTask(TaskBase):\n abstract = True\n\n def __call__(self, *args, **kwargs):\n with app.app_context():\n return TaskBase.__call__(self, *args, **kwargs)\n\n celery.Task = ContextTask\n return celery\n</code></pre>\n\n<p>And then run celery = make_celery(app)?</p>\n", "Lable": "No"}
{"QuestionId": 29735197, "AnswerCount": 1, "Tags": "<theano>", "CreationDate": "2015-04-19T20:04:32.660", "AcceptedAnswerId": null, "Title": "does Theano's symbolic matrix inverse \"know\" about structured matrices?", "Body": "<p>In my application I am computing the inverse of a block tridiagonal matrix A - will Theano's matrix inverse account for that structure (by using a more efficient matrix inverse algorithm)?</p>\n\n<p>Further, I only need the diagonal and first off diagonal blocks of the resulting inverse matrix. Is there a way of preventing Theano from computing the remaining blocks? </p>\n\n<p>Generally, I'm curious whether it would be worth implementing a forward/backward block tridagonal matrix inverse algorithm myself.</p>\n", "Lable": "D"}
{"QuestionId": 29735843, "AnswerCount": 2, "Tags": "<php><mysql>", "CreationDate": "2015-04-19T21:03:57.253", "AcceptedAnswerId": "29736038", "Title": "Categorize Results in HTML/PHP Table MYSQL", "Body": "<p>I have two tables, <code>dishes</code> and <code>days_avail</code>, where <code>dishes</code> contains information regarding dishes cooked and <code>days_avail</code> contains what days a certain dish is available. </p>\n\n<p><code>days_avail</code> looks like this:</p>\n\n<pre><code>daysid || dishid || monday || tuesday || wednesday || friday\n</code></pre>\n\n<p>daysid: unique id</p>\n\n<p>dishid: dish id from dishes table</p>\n\n<p>Mon - Fri: boolean</p>\n\n<p>So, what I am able to do is pull the dishes and show relevant info along with what day it is available on. However, what I am trying to accomplish is categorizing the dishes by the days they are available. So something like this:</p>\n\n<pre><code>Monday\ndish name\ndish desc desc desc\n\nTuesday\nDish name\ndish desc dish desc\n</code></pre>\n\n<p>My query is as follows:</p>\n\n<pre><code>$sql = \"SELECT * FROM dishes JOIN days_avail ON days_avail.dishid = dishes.id WHERE user_id = :cookid ORDER BY days_avail.daysid\";\n try {\n $stmt = $db-&gt;prepare($sql);\n $stmt-&gt;execute(array(\n ':cookid' =&gt; $cookid\n ));\n}\n catch(Exception $error) {\n echo '&lt;p class=\"bg-danger\"&gt;', $error-&gt;getMessage(), '&lt;/p&gt;';\n}\n\n while($row = $stmt-&gt;fetch()) { \n $dish_name = $row['dish_name'];\n $dish_desc = $row['dish_desc'];\n $dish_price = $row['dish_price'];\n $mon = $row['Monday'];\n $tues = $row['Tuesday'];\n $wed = $row['Wednesday'];\n $thurs = $row['Thursday'];\n $fri = $row['Friday'];\n }\n</code></pre>\n\n<p>I can't group the dishes under one day its available. I have tried using a if statement (example: if($mon == 1) { echo \"Monday // dish_info, etc\" }) but this results in the heading being repeated for each dish. </p>\n\n<p>I have also tried using java handlebars to more or less run a query and then simply \"stuff\" the results in the (appropriate) div boxes but did not work.</p>\n\n<p>I am get a complete lost here. I would greatly appreciate any help. </p>\n\n<p>Thank you</p>\n", "Lable": "No"}
{"QuestionId": 29825174, "AnswerCount": 1, "Tags": "<python><list><neural-network><caffe>", "CreationDate": "2015-04-23T13:37:42.157", "AcceptedAnswerId": "29825383", "Title": "python list not showing full elements", "Body": "<p>I'm inserting images into Decaf, and want to extract features from 6,7,8th layers. 6th and 7th are supposed to be 4096-dimensions, and 8th is supposed to be 1000.</p>\n\n<p>I'm assuming that the generated output functions like a list, and want to record each element in a separate text file as follows:</p>\n\n<pre><code>def intoDecaf(image):\n img = misc.imread(image)\n fname = str(image)\n fname = fname.replace('.jpg','')\n print fname\n scores = net.classify(img,center_only=True)\n feat6 = net.feature('fc6_cudanet_out')\n feat7 = net.feature('fc7_cudanet_out')\n feat8 = net.feature('fc8_cudanet_out')\n\n f6name = fname+'-f6.txt'\n f7name = fname+'-f7.txt'\n f8name = fname+'-f8.txt'\n\n f6 = open(f6name,'w')\n f7 = open(f7name,'w')\n f8 = open(f8name,'w')\n\n for f in feat6:\n f6.write(str(f))\n f6.write('\\t')\n # and the same for f7 and f8\n</code></pre>\n\n<p>The f8 file correctly has 1000 files, but f6 and f7 text files have something like the following:</p>\n\n<pre><code>[ -1.63451958 -8.0507412 -1.09678674 ..., 11.38702393 1.99127924\n 4.76321936] \n</code></pre>\n\n<p>The dots in the middle are literally like that. What happend to all the numbers? Do those dots signify something? some kind of abridgement?\nIs this something that has to do with decaf or python?</p>\n", "Lable": "D"}
{"QuestionId": 29858592, "AnswerCount": 1, "Tags": "<weka><predict><related-content>", "CreationDate": "2015-04-24T22:29:27.910", "AcceptedAnswerId": "30006039", "Title": "how to predict related videos to a video in weka", "Body": "<p>I'm trying to predict related videos to a video,\nis that possible in weka?<br>\nthe database takes the following structrue:</p>\n\n<pre><code> video_id,catygory,keywords,related_videos_ids\n</code></pre>\n\n<p>a single keywords field might have many values (for ex: stackoverflow, predict, videos),so the related_videos (the video could have more than one related video).<br>\nThe related videos depend on catygory an keywords<br>\nwhat's the way to do that in weka?? any ideas?</p>\n", "Lable": "No"}
{"QuestionId": 29870218, "AnswerCount": 1, "Tags": "<swift><pointers><core-data><exc-bad-instruction>", "CreationDate": "2015-04-25T20:13:35.990", "AcceptedAnswerId": "29871741", "Title": "Error saving NSManagedObjectContext in swift", "Body": "<p>I'm using Xcodes auto generated code for a core data swift project which includes this function in the app delegate: </p>\n\n<pre><code>func saveContext () {\n if let moc = self.managedObjectContext {\n var error: NSError? = nil\n if moc.hasChanges &amp;&amp; !moc.save(&amp;error) {\n // Replace this implementation with code to handle the error appropriately.\n // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.\n NSLog(\"Unresolved error \\(error), \\(error!.userInfo)\")\n abort()\n }\n }\n }\n</code></pre>\n\n<p>When I have an error with my managed objects instead of printing a message with details about the error the app crashes with an <code>EXC_BAD_INSTRUCTION</code> error.</p>\n\n<p>In <a href=\"https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/index.html#//apple_ref/occ/instm/NSManagedObjectContext/save:\" rel=\"nofollow noreferrer\">the documentation</a> it says:</p>\n\n<blockquote>\n <p>A pointer to an NSError object. You do not need to create an NSError object. The save operation aborts after the first failure if you pass NULL.</p>\n</blockquote>\n\n<p>Is the app aborting because <code>error</code> is nil? \nIs this a bug or is this expected behavior? (and if it's expected, what approach am I supposed to take to recover from the error instead of crashing?)</p>\n\n<p>(I'm running Xcode 6.3.1)</p>\n\n<p><strong>Edit 1:</strong> error is at <code>moc.save</code> function, not from <code>abort()</code> - e.g. commenting out abort doesn't stop crash, and the NSLog is never reached.</p>\n\n<p><img src=\"https://i.stack.imgur.com/pPFXs.png\" alt=\"EXC_BAD_INSTRUCTION arghhhh\"></p>\n\n<p><strong>Edit 2</strong> adding screenshots of backtrace (?)</p>\n\n<p><img src=\"https://i.stack.imgur.com/ZVS2P.png\" alt=\"Backtrace\">\n<img src=\"https://i.stack.imgur.com/QKMLd.png\" alt=\"Sadness\"></p>\n", "Lable": "No"}
{"QuestionId": 30009363, "AnswerCount": 1, "Tags": "<php><eclipse><web><escaping><wampserver>", "CreationDate": "2015-05-03T01:40:26.093", "AcceptedAnswerId": "30009380", "Title": "PHP character escape sequence does not work", "Body": "<p>I am an extreme web programming beginner who is just starting to learn PHP with some knowledge of HTML and JavaScript. </p>\n\n<p>I use WAMP Server as my web server and Eclipse PDT as my IDE.\nI created a .php file in Eclipse.\nI just want to run a simple code that I pulled from a text book: </p>\n\n<pre><code>&lt;?php\necho \"Hello World\\napple\";\n?&gt;\n</code></pre>\n\n<p>However, the line break does not work and it just makes a space. </p>\n\n<p>How can I solve this?</p>\n", "Lable": "No"}
{"QuestionId": 30330394, "AnswerCount": 1, "Tags": "<command-line><homebrew><caffe>", "CreationDate": "2015-05-19T15:51:27.600", "AcceptedAnswerId": "30389640", "Title": "What does the `--fresh` option do in Brew?", "Body": "<p>While following installation instructions (e.g., for <a href=\"http://caffe.berkeleyvision.org/install_osx.html\" rel=\"nofollow\">caffe</a> for os x), I run into the <code>--fresh</code> flag for <a href=\"http://brew.sh/\" rel=\"nofollow\">homebrew</a>. For example,</p>\n\n<pre><code>brew install --fresh -vd snappy leveldb gflags glog szip lmdb\n</code></pre>\n\n<p>However, I see no documentation about what <code>--fresh</code> does, and I don't find it in the source code for homebrew. What does this flag do? (Or what did it used to do?)</p>\n", "Lable": "D"}
{"QuestionId": 30340866, "AnswerCount": 1, "Tags": "<c++><qt><ffmpeg>", "CreationDate": "2015-05-20T05:22:31.177", "AcceptedAnswerId": null, "Title": "How to make QProcess stop by button or keyboard in GUI?", "Body": "<p>Here I want to make a recorder by ffmpeg.exe.</p>\n\n<p>And, I found the commend line, succeed running and generate the video file. And I know press \"Esc\" or \"q\" on keyboard can terminal </p>\n\n<p>Now, I want to use GUI to control the recoder(ffmpeg.exe). I select Qt here, and my work environment is windows 7 sp1.</p>\n\n<p>I use QProcess to execute it, you will see following.</p>\n\n<p>But I have no idea for terminal the process.</p>\n\n<p>The code list:\nmain.cpp is simple.</p>\n\n<pre><code>#include \"mainwindow.h\"\n#include &lt;QApplication&gt;\n\nint main(int argc, char *argv[])\n{\n QApplication a(argc, argv);\n MainWindow w;\n w.show();\n\n return a.exec();\n}\n</code></pre>\n\n<p>mainwindow.h</p>\n\n<pre><code>#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include &lt;QMainWindow&gt;\n#include &lt;QProcess&gt;\n\nnamespace Ui {\nclass MainWindow;\n}\n\nclass MainWindow : public QMainWindow\n{\n Q_OBJECT\n\npublic:\n explicit MainWindow(QWidget *parent = 0);\n ~MainWindow();\n\nprivate:\n QProcess *pro;\n QString recorder;\n QString outputName;\n QString options;\n\nprivate slots:\n void startRecode();\n void stopRecode();\n};\n\n#endif // MAINWINDOW_H\n</code></pre>\n\n<p>mainwindow.cpp</p>\n\n<pre><code>#include \"mainwindow.h\"\n\n#include &lt;QProcess&gt;\n#include &lt;QTest&gt;\n#include &lt;QPushButton&gt;\n#include &lt;QVBoxLayout&gt;\n\nMainWindow::MainWindow(QWidget *parent) :\n QMainWindow(parent),\n pro(new QProcess)\n{\n QDateTime current_date_time = QDateTime::currentDateTime();\n QString current_date = current_date_time.toString(\"yyyy-MM-dd-hh_mm_ss\");\n\n recorder = \"E:\\\\bin\\\\ffmpeg.exe\";\n outputName = current_date + \".mp4\";\n options = \"-f gdigrab -framerate 6 -i desktop -vcodec libx264 -preset:v ultrafast -tune:v zerolatency -hide_banner -report\";\n //-t 00:00:05\"; this option can limit the process running time, and work well no GUI, but I don't want to use given time to stop recording.\n\n QWidget *centerWindow = new QWidget;\n setCentralWidget(centerWindow);\n\n QVBoxLayout *mainLayout = new QVBoxLayout;\n QPushButton *startButton = new QPushButton(\"start recording\");\n QPushButton *stopButton = new QPushButton(\"stop recording\");\n mainLayout-&gt;addWidget(startButton);\n mainLayout-&gt;addWidget(stopButton);\n\n centerWindow-&gt;setLayout(mainLayout);\n\n connect(startButton, SIGNAL(clicked()), this, SLOT(startRecode()));\n connect(stopButton, SIGNAL(clicked()), this, SLOT(stopRecode()));\n}\n\nMainWindow::~MainWindow()\n{\n delete pro;\n}\n\nvoid MainWindow::startRecode()\n{\n pro-&gt;execute(QString(recorder + \" \" +options +\" \" + outputName));\n}\n\nvoid MainWindow::stopRecode(){\n pro-&gt;terminate(); // not work\n //pro-&gt;close(); // not work, too\n //pro-&gt;kill(); // not work, T_T\n\n //how to terminate the process by pushbutton??\n}\n</code></pre>\n\n<p>There have some ideas for me?</p>\n\n<p>or, have other solutions for my recorder?</p>\n", "Lable": "No"}
{"QuestionId": 30352785, "AnswerCount": 2, "Tags": "<matlab><plot><grib>", "CreationDate": "2015-05-20T14:34:35.560", "AcceptedAnswerId": null, "Title": "Plotting global sea surface temperatures on MATLAB", "Body": "<p>I am trying to plot global sea surface temperatures for April 2015 on MATLAB using <a href=\"http://ds.data.jma.go.jp/tcc/tcc/products/elnino/cobesst/cobe-sst.html\" rel=\"nofollow\">JMA's dataset in GRiB format</a>. I have also installed the nctoolbox and m_map toolboxes. </p>\n\n<p>Below is my code: </p>\n\n<pre><code>!wget http://ds.data.jma.go.jp/tcc/tcc/products/elnino/cobesst/gpvdata/2010-2019/sst201504.grb\nnc=ncgeodataset('sst201504.grb')\nnc.variables %to check the variable names in this file\nlat=double('lat');\nlon=double('lon');\nsst=double(squeeze('Water_temperature_depth_below_sea'));\nm_proj('miller','lat',[min(lat(:)) max(lat(:))],...'lon',[min(lon(:)) max(lon(:))])\nm_pcolor(lon,lat,sst);\n</code></pre>\n\n<p>However, when I used the m-pcolor function, the following error message is generated:</p>\n\n<pre><code>Error using pcolor (line 53)\nColor data input must be a matrix.\n\nError in m_pcolor (line 53)\n[h]=pcolor(X,Y,data,varargin{:});\n</code></pre>\n\n<p>I am still able to plot the coastline and gridlines using the following code though, but without the coloured temperature anomalies:</p>\n\n<pre><code>m_coast;\nm_grid;\n</code></pre>\n\n<p>Did I miss out anything in my code? <code>lat</code> and <code>lon</code> are <strong>1x3</strong> double arrays, while <code>sst</code> is a <strong>1x33</strong> double array. </p>\n", "Lable": "No"}
{"QuestionId": 30374607, "AnswerCount": 1, "Tags": "<javascript><ckeditor>", "CreationDate": "2015-05-21T13:03:04.063", "AcceptedAnswerId": "30376193", "Title": "Add additional CKEDITOR languages", "Body": "<p>I need some help with a problem in CKEditor. I can't add Spanish as an additional language.</p>\n\n<p>My project currently has 2 languages: <code>en</code> and <code>pt-br</code></p>\n\n<p>Today, I need to add <code>es</code> (Spanish)</p>\n\n<p>As you can see in the following image, I put <code>es.js</code> with the other ones.</p>\n\n<p><img src=\"https://i.stack.imgur.com/V6mC2.png\" alt=\"enter image description here\"></p>\n\n<p>But when I check the available languages in the console, the Spanish option does not exist.</p>\n\n<p><img src=\"https://i.stack.imgur.com/uAFv9.png\" alt=\"enter image description here\"></p>\n", "Lable": "No"}
{"QuestionId": 30401153, "AnswerCount": 0, "Tags": "<java><hibernate><architecture><dao>", "CreationDate": "2015-05-22T15:58:54.903", "AcceptedAnswerId": null, "Title": "Domain to Model classes", "Body": "<p>I am writing some code that will serve a website and I have some questions about my \"architecture\".</p>\n\n<ol>\n<li><strong>Domain</strong> I have a database and and at the lowest level I have the **Domain* *package that contains the classes that represent the tables of the database. I use Hibernate and lazy fetch for relationships.</li>\n<li><strong>Access</strong> This package has all the classes that perform database actions on the <em>domains</em>. I guess this is the equivalent of DAO. I get entries using the primary key, return all the entries in a table, perform a query on it. Everything is returns as a <em>domain</em> class or a collection of it.</li>\n<li><strong>Service</strong> This packages has the class (again related to a <em>domain</em> class each) that has more complex logic. It uses the <strong>Access</strong> package to get <em>domain</em> objects and transform them to <em>model</em> objects where <em>model</em> is what I call classes that represent an equivalent <em>domain</em> class but without the members that have relationships on them like *ToMany which would possibly have hibernate proxies that cannot be serialised and also make the object \"heavier\". In the future I might write custom methods/transformation to turn those collections of <em>domain</em> object to something descriptive for presentation but for now I disregarde them.</li>\n<li><strong>Model</strong> This package has the exact same number of classes as the <strong>Domain</strong> and like I mentioned is the a representation of the <em>domain</em> objects to something I can use for presentations, transmit, etc. (This is like parallel to the other hierarchy not part of the order.)</li>\n<li><strong>Servlet</strong> This packages contains all the Servlets for the websites and each servlet contains the code for something the website wants to do. It uses the <em>service</em> classes to get the data it wants to manipulate. The <em>service</em> classes will get the relevant <em>domain</em> objects and transform them to <em>model</em> objects which will be returned to the <em>servlet</em> classes that will perform the operations needed by the website request and then return to the website the data in JSON format.</li>\n</ol>\n\n<p>So obviously I would like some feedback to this approach and my following thoughts.</p>\n\n<p>1) I think the <em>service</em> classes should have only code having to do with transforming the <em>domain</em> object to a <em>model</em> object. I am thinking of using Dozer and just add code that might be needed for something more complex that Dozer can't do (basically the in the future bit). From what I saw since my <em>model</em> classes are basically <em>domain</em> classes without the heavy stuff and the members have the same name I don't even need annotations or xml.</p>\n\n<p>2)In the <strong>Access</strong> I use as a parameter the base class of all <em>domain</em> classes so I can have an abstract class and implement all the common methods in there like so</p>\n\n<pre><code>public abstract class DomainAccess&lt;T extends Domain&gt; {\n\n protected abstract Logger getLogger();\n\n protected DatabaseFacade db;\n\n protected Class&lt;T&gt; domainClass;\n\n @Inject\n public DomainAccess(DatabaseFacade databaseFacade, Class&lt;T&gt; domainClass) {\n this.db = databaseFacade;\n this.domainClass = domainClass;\n }\n\n @SuppressWarnings(\"unchecked\")\n public T fetchByPrimaryKey(Object primaryKey) {\n return (T) db.find(domainClass, primaryKey);\n }\n\n // TODO This might be better to be used for complete comparison if expanded\n public boolean exists(T object) {\n return fetchByPrimaryKey(object.getPrimaryKey()) == null ? false : true;\n }\n\n public void save(T object) {\n db.save(object);\n }\n\n public void merge(T object) {\n db.merge(object);\n }\n\n public void delete(T object) {\n db.remove(object);\n }\n\n public void saveOrUpdate(T object) {\n if (exists(object)) {\n merge(object);\n } else {\n save(object);\n }\n }\n\n public void deleteByPrimaryKey(T object) throws EntityNotFoundException {\n Object primaryKey = object.getPrimaryKey();\n T objectToDelete = fetchByPrimaryKey(primaryKey);\n\n if (objectToDelete == null) {\n getLogger().debug(\"There was no entry found with primary key: \" + primaryKey);\n throw new EntityNotFoundException(\"No entry was found with specified primary key [\" + primaryKey + \"]\");\n } else {\n getLogger().debug(\"Deleting entry with id: \" + primaryKey);\n delete(objectToDelete);\n }\n }\n\n @SuppressWarnings(\"unchecked\")\n public List&lt;T&gt; getResultList(String hql, String... parameters) {\n TypedQuery&lt;T&gt; query = db.createTypedQuery(hql, domainClass);\n for (int i = 0; i &lt; parameters.length; i++) {\n query.setParameter(i + 1, parameters[i]);\n }\n return query.getResultList();\n\n }\n\n @SuppressWarnings(\"unchecked\")\n public T getSingleResult(String hql, String... parameters) {\n TypedQuery&lt;T&gt; query = db.createTypedQuery(hql, domainClass);\n for (int i = 1; i &lt;= parameters.length; i++) {\n query.setParameter(i, parameters[i - 1]);\n }\n\n return query.getSingleResult();\n }\n}\n</code></pre>\n\n<p>3) Similarly I think in the Service I think i shoud use the Model as a parameter like \n public abstract class DomainService {</p>\n\n<pre><code> protected abstract Logger getLogger();\n\n protected final Validator validator;\n\n protected DomainService() {\n // TODO this might be needed only for insertion so instead of a class member, maybe it's better to have it as\n // a method variable?\n ValidatorFactory factory = Validation.buildDefaultValidatorFactory();\n this.validator = factory.getValidator();\n }\n\n /**\n * Inserts an entry in the database for the object passes an an argument.\n * \n * @param object The object representing the entry to be inserted\n * @throws ValidationException When the object doesn't pass the validation. i.e. a member value is not valid based\n */\n //TODO handle validation exception with message\n abstract public void insert(T object) throws ValidationException;\n\n /**\n * Deletes an entry from the database. A whole object of the appropriate type is passed as an argument which\n * will be used as a storage/collection of the attributes of the entry by which the deletion can occur. Different\n * implementations can use these attributes to performs filtering and collection of entries to be deleted.\n * \n * @param object An object representing the entry to be deleted.\n * \n * @throws EntityNotFoundException when no entry to be deleted is found\n */\n // TODO remove TransactionRequiredException, IllegalArgumentException\n abstract public void delete(T object) throws EntityNotFoundException;\n\n /**\n * Returns all the entries of the table.\n * \n * @return a list containing objects representing all the entries in the table.\n */\n abstract public List&lt;T&gt; fetchAll();\n}\n</code></pre>\n\n<p>So, in the servlet where I will have all the values for an object I will construct a <em>member</em> instance and then pass that down to the <em>service</em> which will transform it to a <em>domain</em> or use it to update an existing <em>domain</em> object (it was retrieved form the database for instance) and so on</p>\n", "Lable": "No"}
{"QuestionId": 30434335, "AnswerCount": 2, "Tags": "<silverlight><asp.net-web-api><odata><generator><odata-v4>", "CreationDate": "2015-05-25T08:45:44.077", "AcceptedAnswerId": "30502523", "Title": "How to generate OData v4 Client for Silverlight 5?", "Body": "<p>We're trying to get set up with Web API 2.2 and OData v4 for ASP.NET + Silverlight 5.</p>\n\n<p>Initiall POC had a Unit Test project connecting using Simple.OData. This worked great. But we've been unable to set up an OData Client on Silverlight 5.</p>\n\n<p>Using Client Code Generator v4 and keep getting error</p>\n\n<blockquote>\n <p>The type or namespace name 'Client' does not exist in the namespace\n 'Microsoft.OData' (are you missing an assembly\n reference?) C:\\Workspaces\\GKS\\Main\\Source\\Simutek.Gks\\Source\\Simutek.Gks.UI.SL.Common\\GksODataClient.cs Simutek.Gks.UI.SL.Common</p>\n</blockquote>\n\n<p>Packages:</p>\n\n<pre><code> &lt;package id=\"Microsoft.OData.Client\" version=\"6.12.0\" targetFramework=\"sl50\" /&gt;\n &lt;package id=\"Microsoft.OData.Core\" version=\"6.12.0\" targetFramework=\"sl50\" /&gt;\n &lt;package id=\"Microsoft.OData.Edm\" version=\"6.12.0\" targetFramework=\"sl50\" /&gt;\n &lt;package id=\"Microsoft.Spatial\" version=\"6.12.0\" targetFramework=\"sl50\" /&gt;\n &lt;package id=\"Newtonsoft.Json\" version=\"6.0.8\" targetFramework=\"sl50\" /&gt;\n</code></pre>\n\n<p>References look good and we've also tried AssemblyBinding in app.config:</p>\n\n<pre><code>&lt;dependentAssembly&gt;\n &lt;assemblyIdentity name=\"Microsoft.OData.Edm\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" /&gt;\n &lt;bindingRedirect oldVersion=\"0.0.0.0-6.12.0.0\" newVersion=\"6.12.0.0\" /&gt;\n &lt;/dependentAssembly&gt;\n &lt;dependentAssembly&gt;\n &lt;assemblyIdentity name=\"Microsoft.OData.Core\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" /&gt;\n &lt;bindingRedirect oldVersion=\"0.0.0.0-6.12.0.0\" newVersion=\"6.12.0.0\" /&gt;\n &lt;/dependentAssembly&gt;\n &lt;dependentAssembly&gt;\n &lt;assemblyIdentity name=\"Microsoft.Spatial\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" /&gt;\n &lt;bindingRedirect oldVersion=\"0.0.0.0-6.12.0.0\" newVersion=\"6.12.0.0\" /&gt;\n&lt;/dependentAssembly&gt;\n</code></pre>\n\n<p><strong>Update:</strong> Indeed, while the <strong>Microsoft.OData.Client</strong> NuGet package installs on Silverlight it does in fact not specify SL5 in its targets.\nI now see that the package only targets </p>\n\n<blockquote>\n <p>portable-net45+wp8+win8+wpa</p>\n</blockquote>\n\n<p>So while I can get things going in a PCL project, I can't do so in one targeting Silverlight 5.</p>\n\n<p>Is there a work around, anyone who have achieved this? </p>\n", "Lable": "No"}