pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
22,550,720
1
Comparing Values of two lists and Printing to a file <p>I have a program that is supposed to be comparing the contents of a list to values returned by a tinter treeview and if the values do not match, writing the element of the list to a file. The idea is to allow the user to remove an element in the tree (which is populated by reading from a the same file I'm trying to write to). here is the code:</p> <pre><code> selected_book = info_box.focus() del_book = info_box.item(selected_book, 'values') title_file_clear = open("titles", 'w') author_file_clear = open("authors", 'w') title_file_clear.close() author_file_clear.close() title_file_3 = open("titles", "a") author_file_3 = open("authors", "a") for i in range(0,len(titles)): if titles[i] == del_book[0] is False: print(titles[i], file=title_file_3) for i in range(0,len(authors)): if authors[i] == del_book[1] is False: print(authors[i], file=author_file_3) title_file_3.close() author_file_3.close() </code></pre> <p>But all it seems to do is blank the files. (I do know this is not likely to be the most efficient piece of code, but I've been tweaking it for a while to try to get it to work)</p>
14,012,208
0
<p>Their javascript seems to be changing the CSS. The CSS does the transformation and fading work.</p> <p>I <a href="http://mitchell-me.com/QuickOptimizer/Cache/43b42ff4cc2c854d0f53e3a3eef13bd85f3aff56b295be5a866e5835449041e2.js" rel="nofollow">snooped through their javascript</a>...</p> <pre><code>$("#service li").click(function(e){e.preventDefault();var index=$(this).index();$('#service li').removeClass("active");if(!$(this).hasClass("active")&amp;&amp;!intrans){intrans=true;switch(index){case 0:TweenLite.to($(".dial"),1.5,{css:{shortRotation:0},ease:Expo.easeInOut});TweenLite.to($(".gear"),1.5,{css:{autoAlpha:0,rotation:0},ease:Expo.easeInOut});TweenLite.to($(".bulb"),1.5,{css:{autoAlpha:1,rotation:0},ease:Expo.easeInOut});$('#electric, #electric1').delay(800).animate({opacity:1},{easing:easeType,duration:"100",complete:function(){}});$('#mechanic, #mechanic1').delay(200).animate({opacity:0},{easing:easeType,duration:"100",complete:function(){intrans=false}});break;case 1:TweenLite.to($(".dial"),1.5,{css:{shortRotation:115,transformOrigin:"103px 103px"},ease:Expo.easeInOut});TweenLite.to($(".bulb"),1.5,{css:{autoAlpha:0,x:0,y:0,rotation:120,transformOrigin:"20px 40px"},ease:Expo.easeInOut});TweenLite.to($(".gear"),1.5,{css:{autoAlpha:1,x:0,y:0,rotation:120,transformOrigin:"50px 48px"},ease:Expo.easeInOut});$('#electric, #electric1').delay(200).animate({opacity:0},{easing:easeType,duration:"100",complete:function(){}});$('#mechanic, #mechanic1').delay(800).animate({opacity:1},{easing:easeType,duration:"100",complete:function(){intrans=false}});break;}} </code></pre> <p>And it looks like they're using <a href="http://www.greensock.com/tweenlite/" rel="nofollow">Tweenlite</a> and <a href="http://www.greensock.com/tweenmax/" rel="nofollow">Tweenmax</a> for it.</p>
375,843
0
<p>Using <code>includeInLayout ="true"</code> or <code>"false"</code> will toggle the space that it takes in the flow of items being rendered in that section. </p> <p><strong>Important note:</strong> If you don't specify <code>visible="false"</code> when using <code>includeInLayout = "false"</code> then you will usually get something that is undesired which is that your item (<code>boxAddComment</code>) is still visible on the page but stuff below <code>id="boxAddComment"</code> will overlap it visually. So, in general, you probably want "<code>includeInLayout</code>" and "<code>visible</code>" to be in synch. </p>
35,046,120
1
SQLAlchemy InvalidRequestError: failed to locate name happens only on gunicorn <p>Okay, so I have the following. In <code>user/models.py</code>:</p> <pre><code>class User(UserMixin, SurrogatePK, Model): __tablename__ = 'users' id = Column(db.Integer, primary_key=True, index=True) username = Column(db.String(80), unique=True, nullable=False) email = Column(db.String(80), unique=False, nullable=False) password = Column(db.String(128), nullable=True) departments = relationship("Department",secondary="user_department_relationship_table", back_populates="users") </code></pre> <p>and in <code>department/models.py</code>:</p> <pre><code>user_department_relationship_table=db.Table('user_department_relationship_table', db.Column('department_id', db.Integer,db.ForeignKey('departments.id'), nullable=False), db.Column('user_id',db.Integer,db.ForeignKey('users.id'),nullable=False), db.PrimaryKeyConstraint('department_id', 'user_id') ) class Department(SurrogatePK, Model): __tablename__ = 'departments' id = Column(db.Integer, primary_key=True, index=True) name = Column(db.String(80), unique=True, nullable=False) short_name = Column(db.String(80), unique=True, nullable=False) users = relationship("User", secondary=user_department_relationship_table,back_populates="departments") </code></pre> <p>Using the flask development server locally this works totally fine. However, once I deploy to the standard python buildpack on heroku, the <code>cpt/app.py</code> loads both modules to register their blueprints:</p> <pre><code>from cpt import ( public, user, department ) ... def register_blueprints(app): app.register_blueprint(public.views.blueprint) app.register_blueprint(user.views.blueprint) app.register_blueprint(department.views.blueprint) return None </code></pre> <p>and eventually errors out with the following:</p> <blockquote> <p>sqlalchemy.exc.InvalidRequestError: When initializing mapper Mapper|User|users, expression 'user_department_relationship_table' failed to locate a name ("name 'user_department_relationship_table' is not defined"). If this is a class name, consider adding this relationship() to the class after both dependent classes have been defined.</p> </blockquote> <p>I'd like to know if there's a better way to organize these parts to avoid this error obviously, but I'm more curious why this organization works fine on the development server but blows up something fierce on gunicorn/heroku.</p>
5,405,587
0
<p>You're constantly multiplying the <code>noOfYears</code> variable by -1, so it keeps switching between -1 and 1. Try using <code>noOfYears * -1</code> instead (without the equals-sign).</p>
28,475,696
0
Differences when using functions for casper.evaluate <p>I'm using PhantomJS v2.0 and CasperJS 1.1.0-beta3. I want to query a specific part inside the page DOM.</p> <p>Here the code that did not work:</p> <pre><code>function myfunc() { return document.querySelector('span[style="color:#50aa50;"]').innerText; } var del=this.evaluate(myfunc()); this.echo("value: " + del); </code></pre> <p>And here the code that did work:</p> <pre><code>var del=this.evaluate(function() { return document.querySelector('span[style="color:#50aa50;"]').innerText; }); this.echo("value: " + del); </code></pre> <p>It seems to be the same, but it works different, I don't understand.</p> <p>And here a code that did also work:</p> <pre><code>function myfunc() { return document.querySelector('span[style="color:#50aa50;"]').innerText; } var del=this.evaluate(myfunc); this.echo("value: " + del); </code></pre> <p>The difference here, I call the myfunc without the '()'.</p> <p>Can anyone explain the reason? </p>
31,222,522
0
<p>Hmmm, you aren't using parameters in the correct order. As per mail documentation (<a href="http://php.net/manual/en/function.mail.php" rel="nofollow">http://php.net/manual/en/function.mail.php</a>), it should be:</p> <pre><code>mail("[email protected]", $subject, $message, $from); </code></pre> <p>I am not sure where you want to use <code>$phone</code> but may be you can concatenate it to <code>$message</code> before sending it.</p>
14,939,936
0
<p>To get detailed info you can try <code>gcc -E</code> to analyse your pre-processor output which can easily clear your doubt</p>
29,121,473
0
<p>cUrl is a server side command. It will just read the result, that is html/js code in your case but will not execute it. To solve your problem( you want to grab and save an image) use instead gd libraries.</p>
30,157,238
0
Disabled Firefox Add-on ActionButton not grayed out <p>When creating a Firefox Add-on <code>ActionButton</code> <code>disabled</code>, e.g.,</p> <pre><code>var button = new ActionButton({ id: 'my-link', label: 'My label', icon: { '16': './icon-16.png', '32': './icon-32.png', '64': './icon-64.png' }, onClick: handleClick, disabled: true }); </code></pre> <p>the button indeed isn't clickable and doesn't produce any events, but the icon does <em>not</em> appear grayed out as advertised in <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/ui_button_action" rel="nofollow">the documentation</a>.</p> <p>Any ideas as to why this might be?</p>
29,367,249
0
<p>Try by changing the tint color of the searchable in xib or in code as <code>[self.searchDisplayController setTintColor:[UIColor whiteColor]];searchDisplayController</code></p>
11,011,435
0
<p>The AppFabric configuration tool updates the web.config file in at this location only</p> <blockquote> <p>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config</p> </blockquote> <p>When building with the "Any CPU" option as I was you must manually edit this file</p> <pre><code>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config </code></pre> <p>With these settings (from the Framework64 version)</p> <pre><code>&lt;connectionStrings&gt; &lt;add connectionString="Data Source=(local);Initial Catalog=AppFabricMonitoringDB;Integrated Security=True" name="ApplicationServerMonitoringConnectionString" providerName="System.Data.SqlClient" /&gt; &lt;add connectionString="Data Source=(local);Initial Catalog=AppFabricPersistenceDB;Integrated Security=True" name="ApplicationServerWorkflowInstanceStoreConnectionString" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; </code></pre> <p>They were previously set to the default</p> <pre><code>&lt;connectionStrings&gt; &lt;add connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=AppFabricMonitoringDB;Integrated Security=True" name="ApplicationServerMonitoringConnectionString" providerName="System.Data.SqlClient" /&gt; &lt;add connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=AppFabricPersistenceDB;Integrated Security=True" name="ApplicationServerWorkflowInstanceStoreConnectionString" providerName="System.Data.SqlClient" /&gt; &lt;/connectionStrings&gt; </code></pre>
32,881,079
0
<p>Not sure if anyone still cares, but you can actually load your custom functions saved in a .ps1 file to the remote computer, via a PSSession. I tried it out and it works for me. <a href="http://stackoverflow.com/questions/14441800/how-to-import-custom-powershell-module-into-the-remote-session">Check out this guy's solution</a></p>
3,857,790
0
<p>I think you would have to capture audio directly from the phone's microphone and stream it to your own recognition service. The Google recognition APIs are built as an Intent that launches their own Recognition dialog and gives you back results. If you want continuous recognition without a UI, you'll have to build that functionality yourself.</p>
37,117,740
0
<p>Assuming that <code>resultSet</code> is a <code>List</code> implementation from the standard Java library, the answer to the "deep or shallow copy" question is "neither". <code>ListIterator</code>s of <code>List</code> classes in the standard Java library do not return a copy; they returns a <em>reference</em>, so you access the object stored in the <code>List</code>, not a copy of it.</p> <p>Since Java arrays are mutable, any modifications that your loop makes to <code>data</code> are done on the <code>Object[]</code> array stored inside the list.</p> <p>As <a href="http://stackoverflow.com/users/1221571/eran">Eran</a> correctly notes in his comment, since <code>List</code> and <code>ListIterator</code> are only interfaces, it is entirely conceivable to come up with an implementation that returns copies of list elements rather than references to actual elements. These copies could be deep or shallow, depending on your own implementation. However, list implementations supplied by Java library always return references to actual list elements.</p>
6,050,395
0
<p>Are you forgetting to add the frog view?</p> <pre><code>// Assume that you have a contentView that is visible // and then a frogView to add to it when the button is pressed... [contentView addSubview:frogView]; </code></pre>
4,262,521
0
<blockquote> <p>Professional Excel Development by Stephen Bullen describes how to register UDFs, which allows a description to appear in the Function Arguments dialog:</p> </blockquote> <pre><code>Function IFERROR(ByRef ToEvaluate As Variant, ByRef Default As Variant) As Variant If IsError(ToEvaluate) Then IFERROR = Default Else IFERROR = ToEvaluate End If End Function Sub RegisterUDF() Dim s As String s = "Provides a shortcut replacement for the common worksheet construct" &amp; vbLf _ &amp; "IF(ISERROR(&lt;expression&gt;, &lt;default&gt;, &lt;expression&gt;)" Application.MacroOptions macro:="IFERROR", Description:=s, Category:=9 End Sub Sub UnregisterUDF() Application.MacroOptions Macro:="IFERROR", Description:=Empty, Category:=Empty End Sub </code></pre> <p>From: <a href="http://www.ozgrid.com/forum/showthread.php?t=78123&amp;page=1" rel="nofollow noreferrer">http://www.ozgrid.com/forum/showthread.php?t=78123&amp;page=1</a></p> <p>To show the Function Arguments dialog, type the function name and press <kbd>Ctrl</kbd><kbd>A</kbd>. Alternatively, click the "fx" symbol in the formula bar:</p> <p><img src="https://i.stack.imgur.com/7CMpJ.png" alt="enter image description here"></p>
39,142,509
0
<p>You can have a <code>maven-war-plugin</code> and configure to include empty folders.</p> <pre><code>&lt;plugin&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;version&gt;2.4&lt;/version&gt; &lt;configuration&gt; &lt;includeEmptyDirectories&gt;true&lt;/includeEmptyDirectories&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre>
15,686,372
0
Rendering each day using json data <p>I have a web service that returns a color for each day like this:</p> <pre><code>({"total_rows":"96","rows":[ {"row":{"date":"2013-01-01","airqualityindex":"50","categorycolorinteger":"-16718848"}}, {"row":{"date":"2013-01-02","airqualityindex":"45","categorycolorinteger":"-16718848"}}, {"row":{"date":"2013-01-03","airqualityindex":"57","categorycolorinteger":"-256"}}, {"row":{"date":"2013-01-04","airqualityindex":"36","categorycolorinteger":"-16718848"}}, {"row":{"date":"2013-01-05","airqualityindex":"42","categorycolorinteger":"-16718848"}}, {"row":{"date":"2013-01-06","airqualityindex":"51","categorycolorinteger":"-256"}} ...]}) </code></pre> <p>I want to shade each day cell's background color using the categorycolorinteger returned from this web service. I think I may be able to do that with dayRender but I haven't found a good example of how to do this.</p> <p>Thanks, Amy</p>
17,185,055
0
How to upload a new version for document use alfresco restfull api? <p>I want upload a file to alfresco and I want to create a new version if the file was exists in alfresco. How can i do it. I saw the alfresco api :"/alfresco/service/api/upload" has a parameter "majorversion", Can I use it or has another way? Thanks.</p>
30,439,911
0
<p>You can use the ExpandString function, <a href="http://blogs.microsoft.co.il/scriptfanatic/2011/01/02/expanding-strings-and-environment-variables-in-powershell/" rel="nofollow">like this</a>:</p> <pre><code>$ExecutionContext.InvokeCommand.ExpandString($TemplVal) </code></pre> <p>(assuming $TemplVal has the template string).</p>
28,024,042
0
<p>It depends from the task. There are plenty of tasks, for which John von Neumann computers are good enough. For example calculate precise values of functions in some range, or for example apply some filter at image, or store text into db and read it from it or store prices of some products etc. This is not area where NN are needed. Of course it is possible theoretically to train NN to choose where and how to save data. Or to train it to accountancy. But for cases where big array of data need to be analyzed, and current methods doesn't feet NN can be option to consider. Or speech recognition, or buying some pictures which will become masterpieces in the future can be done with NN.</p>
4,578,507
0
Who owns domain purchased via GoogleApps? <p>My original plan was to use google appengine for an application. For this I purchased a domain via GoogleApps at Godaddy. Since Google Appengine fails to impress me, I would love to move my website to another server. But who is the owner of the domain now? GoogleApp "purchased" the domain for me - how can I regain control over the domain I paid for? </p>
39,132,696
0
<p>You should import FormsModule:</p> <pre><code>@NgModule({ imports: [CommonModule, FormsModule] </code></pre>
33,206,579
0
Find total number of Increasing Subsequences of given length <p>Given an array of numbers and <strong>question</strong> is to find <strong>total number</strong> of <em>Increasing sub-sequences of length</em> <strong>lis-1</strong>, where <strong>lis</strong> is the length of <code>Largest Increasing sub-sequence</code> of that given array. </p> <p><strong>Example:</strong> Suppose the array is <code>5 6 3 4 7 8</code>. Here, <strong>lis = 4</strong>. So, <strong>lis-1 = 3</strong>. Therefore, the total number of sub-sequences are <code>8</code> and given below: </p> <pre><code>5 6 7 5 6 8 3 4 7 3 4 8 3 7 8 6 7 8 5 7 8 4 7 8 </code></pre> <p>Can someone give me an idea for this algorithm, i'm not able to figure it out.</p>
5,417,647
0
save() and _save() model's methods in playframework <p>When create playramework's model we can use save() or _save() method. Why these both methods are avalible in the framework, what's the reason? (in this context they do the same - save object to db).</p> <p>Why I ask this: I have used save() method when doing some validation in it, but the end-user of my class could use _save() if he would want to save without validation. So I ask myself why there are two methods which are both public.</p> <blockquote> <p>I've handled it like this: The problem was with finding the place for making the validation while saving. In fact I've handled this issue using @PrePersist anotation for some method near the save() when I want to be sure that validation code would be invoced when persisting. So now I'm ok with save() and _save() :)</p> </blockquote>
7,260,906
0
Buildbot - Two Schedulers with one builder = Double checkin emails? <p>I have a buildbot running with two Schedulers - One triggered by code checkins and another triggered by content checkins; the former needs a much shorter treeStableTimer. Both of these Schedulers trigger the same builder, but what happens now is that everyone gets build notification mails twice for each checkin; once for the code scheduler and once for the content scheduler.</p> <p>For example, if the following checkins go in... CL# 1000 12:00pm user_a (code) CL# 1001 1:00pm user_b (content) ...we'd see a build fire off on CL#1000 and send build notification mail to user_a. Then, a build would fire off from CL#1001 and send build notification to user_a and user_b - user_a gets two notifications that his checkin succeeded, when he should only get one.</p> <p>I'd like to set things up so that we have two Schedulers, but when a builder triggers and sends email, it sends notification to the number of people who checked in since that builder's last build, not that Scheduler's last build. This seems straightforward conceptually, but I haven't seen anything on this in the docs or forums.</p> <p>What's the right way to do this? We do need different treeStableTimers on the same builder, and people need build mail notification when their build completes, regardless of which of the two Schedulers triggered the builder.</p>
11,020,716
0
<p>Bean profiles could be great fit for this - based on the "active" profile let one or the other bean be created. </p> <p>Somewhat of an older article, but is still a good reference to profiles in Spring 3.1- <a href="http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/" rel="nofollow">http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/</a></p>
28,400,366
0
<p>Here is a super simple I made just now with some comments of what is going on. The client connects to the server can can type messages which the server will print out. This is not a chat program since the server receives messages, and the client send them. But hopefully you will understand better it better :)</p> <p>Server:</p> <pre><code> import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class Main { public static DataInputStream in; public static DataOutputStream out; public static void main(String[] args) throws IOException { int port = 4444; ServerSocket server = null; Socket clientSocket = null; try { //start listening on port server = new ServerSocket(port); System.out.println("Listening on port: " + port); //Accept client clientSocket = server.accept(); System.out.println("client Connected!"); //initialize streams so we can send message in = new DataInputStream(clientSocket.getInputStream()); out = new DataOutputStream(clientSocket.getOutputStream()); String message = null; while (true) { // as soon as a message is being received, print it out! message = in.readUTF(); System.out.println(message); } } catch (IOException e){ e.printStackTrace(); if (!server.isClosed()){server.close();} if (!clientSocket.isClosed()){clientSocket.close();} } } } </code></pre> <p>Client:</p> <pre><code> import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { //declare a scanner so we can write a message Scanner keyboard = new Scanner(System.in); // localhost ip String ip = "127.0.0.1"; int port = 4444; Socket socket = null; try { //connect socket = new Socket(ip, port); //initialize streams DataInputStream in = new DataInputStream(socket.getInputStream()); DataOutputStream out = new DataOutputStream(socket.getOutputStream()); while (true){ System.out.print("\nMessage to server: "); //Write a message :) String message = keyboard.nextLine(); //Send it to the server which will just print it out out.writeUTF(message); } } catch (IOException e){ e.printStackTrace(); if (!socket.isClosed()){socket.close();} } } } </code></pre>
33,361,777
0
<pre><code>l = [1,2,3,4, 5, 6, 7, 8] print [[l[:i], l[i:]] for i in range(1, len(l))] </code></pre> <p>If you want all combinations. you can do like this.</p> <pre><code>print [l[i:i+n] for i in range(len(l)) for n in range(1, len(l)-i+1)] </code></pre> <p>or</p> <pre><code>itertools.combinations </code></pre>
36,776,725
0
<p><a href="https://github.com/google/gson" rel="nofollow">Google's gson library</a> doesn't require you to use annotations or constructors:</p> <pre><code>import com.google.gson.Gson; import java.util.Date; public class Test { public static void main(String[] args) { Gson gson = new Gson(); String toJson = gson.toJson(new Thing()); System.out.println(toJson); // prints {"appleType":"granny","date":"Apr 21, 2016 10:31:17 AM","numPies":6} Thing fromJson = gson.fromJson(toJson, Thing.class); System.out.println(fromJson); // prints com.mycompany.mavenproject1.Thing@506c589e } } class Thing { String appleType = "granny"; Date date = new Date(); int numPies = 6; } </code></pre> <p>Jackson may have similar features, but I don't know.</p>
16,113,761
0
MIDL (Microsoft Interface Definition Language) is a text-based interface description language by Microsoft, based on the DCE/RPC IDL which it extends for use with the Microsoft Component Object Model. Its compiler is also called MIDL.
15,379,134
0
Regular Expression for mm/dd/yyyy in asp.net <p>What would be the regular expression for mm/dd/yyyy in asp.net with month ,date and year validation?</p>
33,051,015
0
<p>Since the price requires a decimal value we should supply it a decimal value. Try the following view:</p> <pre><code>def get_queryset(self, *args, **kwargs): qs = super(ProductListView, self).get_queryset(*args,**kwargs) query = self.request.GET.get("q", False) # provide default value or you get a KeyError if query: filter_arg = Q(title__icontains=query) | Q(description__icontains=query) try: filter_arg |= Q(price=float(query)) except ValueError: pass qs = self.model.objects.filter(filter_arg) return qs </code></pre> <p><code>qs = super(ProductListView, self).get_queryset(*args,**kwargs)</code> This is used to obtain the queryset provided by the parent classes of our view class <code>ProductListView</code>. Look in to python classes and inheritance here: <a href="http://www.jesshamrick.com/2011/05/18/an-introduction-to-classes-and-inheritance-in-python/" rel="nofollow">http://www.jesshamrick.com/2011/05/18/an-introduction-to-classes-and-inheritance-in-python/</a></p> <p><code>filter_arg |= Q(price=float(query))</code> this is used to append to our filter_arg value. It's the same as <code>filter_arg = filter_arg | Q(price=float(query)</code></p> <p><code>float(query)</code> with this we are trying to convert the query variable to a float and we put this in a <code>try</code> statement because it could give us a <code>ValueError</code> in which case the <code>query</code> value is not a <code>float</code>.</p>
5,145,623
0
<p>The opensource framework <a href="https://github.com/ekonbenefits/impromptu-interface">Impromptu-Interface</a> was designed to do this. It generates a cached lightweight proxy with a static interface and uses the dlr to forward the invocation to the original object.</p> <pre><code>using ImpromptuInterface; public interface ISimpeleClassProps { string Prop1 { get; } long Prop2 { get; } Guid Prop3 { get; } } </code></pre> <p>-</p> <pre><code>dynamic tOriginal= new ExpandoObject(); tOriginal.Prop1 = "Test"; tOriginal.Prop2 = 42L; tOriginal.Prop3 = Guid.NewGuid(); ISimpeleClassProps tActsLike = Impromptu.ActLike(tOriginal); </code></pre>
16,740,810
0
<p>The reference assemblies are empty placeholder assemblies installed with visual studio that are used during compilation.</p> <p>Try repairing visual studio.</p>
28,279,970
1
Batch file runs with "not recognized...command", how to fix this? <p>I have a batch file which when executed sets PATHs, prompts user for input and loads a script via Python. The python script creates a grid with the size of each cell determined by the user input variable (<code>cellsize</code>). The following is from my .bat file:</p> <pre><code>@echo off rem Root OSGEO4W home dir to the following directory call "C:\OSGeo4W64\bin\o4w_env.bat" rem List available o4w programs rem but only if osgeo4w called without parameters @echo on set PYTHONPATH=C:\OSGeo4W64\apps\qgis\python set PATH=C:\OSGeo4W64\apps\qgis\bin;%PATH% @echo off echo. set /p cellsize="Enter cellsize: " cellsize=1 cmd /k python "Script.py" %cellsize% @echo on </code></pre> <p>The .bat works the way it's supposed to, I obtain the correct results, but I receive the following error:</p> <blockquote> <p>'cellsize' is not recognized as an internal or external command, operable program or batch file</p> </blockquote> <p>What simple mistake(s) did I make? I am a beginner but still learning.</p>
24,072,511
0
<p>You could generate the groupings using <code>cut</code> and then use a <code>facet_grid</code> to display the multiple histograms:</p> <pre><code># Sample data with y depending on x set.seed(144) dat &lt;- data.frame(x=rnorm(1000)) dat$y &lt;- dat$x + rnorm(1000) # Generate bins of x values dat$grp &lt;- cut(dat$x, breaks=2) # Plot library(ggplot2) ggplot(dat, aes(x=y)) + geom_histogram() + facet_grid(grp~.) </code></pre> <p><img src="https://i.stack.imgur.com/fHzq6.png" alt="enter image description here"></p>
15,265,016
0
<p>As far as I can help you is to check this: <a href="http://stackoverflow.com/questions/12512417/asp-net-mvc-4-ajax-beginform-and-html5">ASP.NET MVC 4 - Ajax.BeginForm and html5</a></p> <p>And maybe this (you can get an idea or two here): <a href="http://stackoverflow.com/questions/11036942/mvc4-ajax-beginform-and-partial-view-gives-undefined">MVC4 - Ajax.BeginForm and Partial view gives &#39;undefined&#39;</a></p>
22,968,999
0
<p>Here you go: <strong>Fiddle</strong> <a href="http://jsfiddle.net/fx62r/2/" rel="nofollow">http://jsfiddle.net/fx62r/2/</a></p> <p><code>inline-block</code> leaves white-space between elements. I would use <code>float: left;</code> instead of inline block</p> <p>Write elements on same line to avoid white-space. Like this:</p> <p><code>&lt;div class="icon"&gt;&lt;/div&gt;&lt;div class="title"&gt;&lt;/div&gt;&lt;div class="icon"&gt;&lt;/div&gt;</code></p> <p>And remove Margin:</p> <pre><code> .icon { margin: 0 0.2em 0.2em 0; //Remove. } .title { margin: 0 0.2em 0.2em 0; //Remove } </code></pre>
9,424,244
0
<p>My answer <a href="http://stackoverflow.com/questions/9363827/building-gpl-c-program-with-cuda-module">to this recent question</a> likely describes what you need.</p> <p>A couple of additional notes:</p> <ol> <li>You don't need to compile your .cu to a .cubin or .ptx file. You need to compile it to a .o object file and then link it with the .o object files from your .cpp files compiled wiht g++.</li> <li>In addition to putting your cuda kernel code in cudaFunc.cu, you also need to put a C or C++ wrapper function in that file that launches the kernel (unless you are using the CUDA driver API, which is unlikely and not recommended). Also add a header file with the prototype of this wrapper function so that you can include it in your C++ code which needs to call the CUDA code. Then you link the files together using your standard g++ link line.</li> </ol> <p>I'm starting to repeat my <a href="http://stackoverflow.com/questions/9363827/building-gpl-c-program-with-cuda-module">other answer</a>, so I recommend just reading it. :)</p>
24,987,866
0
<p>Make sure that you are using the proper <code>yourtablename</code> and following name conventions. The table name is always lower-case and pluralized. </p> <p>For example, if your model name is <code>User</code>, your table name is <code>users</code>. If your model name is <code>Image</code>, your table name will be <code>images</code>. </p> <p>Let me know if this solved the problem. </p>
33,644,746
0
<p>I had to use this code to check if the file exist or not.</p> <pre><code>Dim currentPath As String = System.IO.Path.Combine(IO.Directory.GetCurrentDirectory(), Textbox1.Text) If IO.File.Exists(currentPath) Then ..Do something here Else MsgBox("Executable doesn't exist!", vbOKOnly, "Error!") End If </code></pre>
12,193,531
0
<p>You should use this structure to manage transactions with Oracle (see <a href="http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oracletransaction.commit%28v=vs.100%29.aspx#Y612" rel="nofollow">MSDN docs</a>) :</p> <pre><code>Public Sub RunOracleTransaction(ByVal connectionString As String) Using connection As New OracleConnection(connectionString) connection.Open() Dim command As OracleCommand = connection.CreateCommand() Dim transaction As OracleTransaction ' Start a local transaction transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted) ' Assign transaction object for a pending local transaction command.Transaction = transaction Try command.CommandText = _ "INSERT INTO Dept (DeptNo, Dname, Loc) values (50, 'TECHNOLOGY', 'DENVER')" command.ExecuteNonQuery() command.CommandText = _ "INSERT INTO Dept (DeptNo, Dname, Loc) values (60, 'ENGINEERING', 'KANSAS CITY')" command.ExecuteNonQuery() transaction.Commit() Console.WriteLine("Both records are written to database.") Catch e As Exception transaction.Rollback() Console.WriteLine(e.ToString()) Console.WriteLine("Neither record was written to database.") End Try End Using End Sub </code></pre>
11,503,342
0
<p>You are looking for the two properties:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listcontrol.valuemember.aspx" rel="nofollow"><code>ValueMember</code></a>.</li> <li><a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listcontrol.displaymember.aspx" rel="nofollow"><code>DisplayMember</code></a>.</li> </ul> <p>In your case, you have to set the combobox's <code>ValueMember</code> property to <code>value1</code> and the <code>DisplayMember</code> property to <code>option1</code>.</p> <p><strong>Update:</strong> The following is an exmple of how you can populate the items of a combobox from list of some entity <code>Foo</code>:</p> <pre><code>public class Foo(){ public string Id { get; set; } public string Name { get; set; } } var ds = new List&lt;Foo&gt;(){ new Foo { Id = "1", Name = "name1" }, new Foo { Id = "2", Name = "name2" }, new Foo { Id = "3", Name = "name3" }, new Foo { Id = "4", Name = "name4" }, }; comboboxName.DataSource = ds; comboboxName.ValueMember = "Id"; comboboxName.DisplayMember = "Name"; </code></pre> <p><strong>Update2:</strong> That's because you are adding the same object each time. In the following block of your code:</p> <pre><code>Foo categoryInsert = new Foo(); foreach (string s in categories) { categoryInsert.path = s; categoryInsert.name = s; combo3data.Add(categoryInsert); } </code></pre> <p>Each time The <code>foreach</code> iterate over the <code>categories</code>, all what it does, is changing the same object <code>categoryInsert</code>'s values <code>path</code> and <code>name</code> not creating a new one. Thus, you end up with the same object added in each iteration to the <code>combo3data</code>. What you need is create a new <code>Foo</code> object inside the <code>foreach</code> itself each time, i.e: move the <code>Foo categoryInsert = new Foo();</code> inside the <code>foreach</code> loop. Something like:</p> <pre><code>foreach (string s in categories) { Foo categoryInsert = new Foo(); categoryInsert.path = s; categoryInsert.name = s; combo3data.Add(categoryInsert); } </code></pre>
11,898,420
0
<p>Heres an answer I cribbed, genericised and brought up to date from <a href="http://www.cs.nyu.edu/~vs667/articles/mergesort/" rel="nofollow">here</a></p> <pre><code>public static IList&lt;T&gt; MergeSort&lt;T&gt;( this IList&lt;T&gt; unsorted, IComparer&lt;T&gt; comparer = null) { if (unsorted == null || unsorted.Count &lt; 2) { return unsorted; } if (comparer == null) { comparer = Comparer&lt;T&gt;.Default; } IList&lt;T&gt; sorted = new List&lt;T&gt;(); int middle = (int)unsorted.Count/2; Ilist&lt;T&gt; left = unsorted.GetRange(0, middle); IList&lt;T&gt; right = unsorted.GetRange(middle, unsorted.Count - middle); var sortLeft = Task&lt;IList&lt;T&gt;&gt;.Factory.StartNew( () =&gt; left.MergeSort(comparer)); var sortRight = Task&lt;IList&lt;T&gt;&gt;.Factory.StartNew( () =&gt; right.MergeSort(comparer)); left = sortLeft.Result; right = sortRight.Result; int leftPtr = 0; int rightPtr = 0; for (int i = 0; i &lt; left.Count + right.Count; i++) { if (leftPtr == left.Count) { sorted.Add(right[rightPtr]); rightPtr++; } else if (rightPtr == right.Count) { sorted.Add(left[leftPtr]); leftPtr++; } else if (comparer.Compare(left[leftPtr], right[rightPtr]) &lt; 0) { sorted.Add(left[leftPtr]); leftPtr++; } else { sorted.Add(right[rightPtr]); rightPtr++; } } return sorted; } </code></pre> <p>This code, will use the default <code>IComparer&lt;T&gt;</code> unless you pass your own.</p> <p>As you can see this code self iterates on each half of the unsorted array, I've added some code using the <a href="http://msdn.microsoft.com/en-us/library/dd537613.aspx" rel="nofollow"><code>Task</code></a> TPL class to run those calls asynchronously on seperate threads.</p> <p>You could use the code like this,</p> <pre><code>var strings = new List&lt;string&gt; { "cixymn", "adfxij", "adxhxy", "abcdef", "iejfyq", "uqbzxo", "aaaaaa" }; var sortedStrings = strings.MergeSort(); </code></pre> <p>If the default string comparer is not lexicographical enough for you, you could instantiate and pass your a selected <a href="http://msdn.microsoft.com/en-us/library/system.stringcomparer.aspx" rel="nofollow"><code>StringComparer</code></a>, perhaps like this,</p> <pre><code>var sortedStrings = strings.MergeSort(StringComparer.OrdinalIgnoreCase); </code></pre> <p>In the unlikely event that none of the <code>StringComparer</code>s meet your requirements, you could write your own implementation of <code>IComparer&lt;string&gt;</code> and pass that to the <code>MergeSort</code> function instead.</p> <p>In any case, it makes sense to keep the merge sort generic and resuable for all types and pass the specialization into the function. </p>
22,195,715
0
<p>There are multiple ways to do what you are trying to do, the easiest one would be the following:</p> <pre><code>OutputDict = {} for key in Dict1.iterkeys(): if key in Dict2: OutputDict[key] = Dict1[key] + Dict2[key][2] </code></pre> <p>Since all the operations are O(1), and we run it for each key on Dict1 (or Dict2 depending) all this runs in O(min(n,m)) where n is the length of Dict1 and m the length of Dict2</p>
2,093,416
0
Group by and non distinct columns and data normalization <p>I have a large table(60 columns, 1.5 million records) of denormalized data in MS SQL 2005 that was imported from an Access database. I've been tasked with normalizing and inserting this data into our data model. </p> <p>I would like to create a query that used a grouping of, for example "customer_number", and returned a result set that only contains the columns that are non distinct for each customer_number. I don't know if it's even possible, but it would be of great help if it was.</p> <p>Edit:if my table has 3 columns(cust_num,cust_name_cust_address) and 5 records</p> <pre><code>|cust_num|cust_name|cust_address |01 |abc |12 1st street |02 |cbs |1 Aroundthe Way |01 |abc |MLK BLVD |03 |DMC |Hollis Queens |02 |cbs |1 Aroundthe Way </code></pre> <p>the results from my desired query should just be the data from cust_num and cust_name because cust_address has different values for that grouping of cust_num. A cust_num has many addresses but only one cust_name.</p> <p>Can someone point me in the right direction? </p> <p>Jim</p>
37,439,331
0
<p>Since you have your javascript loading before your html, <code>document.getElementById("demo")</code> ends up being null, since the DOM hasn't loaded yet.</p> <p>Try moving that javascript to the bottom (I put it after the body tag, but not sure this is best practice). This way the DOM loads first, and then your javascript knows where to find the id of "demo".</p>
1,148,149
0
<p>You can just calculate in your query like this:</p> <pre><code>$query = "SELECT (Sqrt(min. Economy) x ( 1 + Sqrt(Distance)/75 + Sqrt(Players)/10 ) Sqrt(88) x ( 1 + Sqrt(23)/75 + Sqrt(23)/10 ) = 15 cred./h) as `Distance`, * FROM routes ORDER BY id DESC LIMIT 8;"; </code></pre> <p>Use as for naming your calculation so its become a column and use * to get the other fields.</p>
28,064,493
0
<p>An IBAction method has the format</p> <pre><code>-(IBAction)name:(id)sender </code></pre>
29,776,560
0
<p>Solution:</p> <pre><code>public static void UiInvoke(Action a) { Application.Current.Dispatcher.Invoke(a); } </code></pre> <p>And how to call it:</p> <pre><code>UiInvoke(() =&gt; { Seznam.Add(new Model.Zprava(DateTime.Now.ToString(), data, Model.Od.Server)); }); </code></pre>
4,893,178
0
<p>From my poking around, it doesn't look like there's much you can do. You might have luck using <code>autoconf</code> to generate <code>setup.py</code>, or you could use <code>automake</code> and <code>libtool</code> and do the whole thing with autofoo. Automake provides a macro <code>AM_PATH_PYTHON</code> that sets a whole pile of useful variables and gives the following example for declaring an extension module:</p> <pre><code>pyexec_LTLIBRARIES = quaternion.la quaternion_la_SOURCES = quaternion.c support.c support.h quaternion_la_LDFLAGS = -avoid-version -module </code></pre>
26,117,479
0
Facebook long lived Page Access Token <p>I am administrator of facebook page which DOES NOT have a classic facebook account assigned. So I am not able to create any facebook application as you can see in Picture <a href="https://i.stack.imgur.com/umeyL.png" rel="nofollow noreferrer">1</a>. How can I obtain long lived (never expiring) page access token, which I need to use Graph API? I need to post messages to the facebook page from my server.</p> <p>Thanks for advice</p> <p><img src="https://i.stack.imgur.com/umeyL.png" alt="enter image description here"></p>
40,464,006
0
<p>Try like this :</p> <pre><code> progressDialog = new ProgressDialog(getActivity()); </code></pre> <p>And if you wish to customize your dialog and put self created Layout in it.</p> <pre><code>/** * Created by vivek on 18/10/16. */ public class CustomDialog { private static Dialog dialog; private static Context context; public CustomDialog(Context context) { this.context = context; } /** * Comman progress dialog ... initiates with this * * @param message * @param title */ public static void showProgressDialog(Context context, String title, String message) { if (dialog == null) { dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.custom_loader); dialog.setCancelable(false); dialog.setCanceledOnTouchOutside(false); dialog.show(); } } public static boolean isProgressDialogRunning() { if (dialog != null &amp;&amp; dialog.isShowing()) { return true; } else return false; } /** * Dismiss comman progress dialog */ public static void dismissProgressDialog() { if (dialog != null &amp;&amp; dialog.isShowing()) { dialog.dismiss(); dialog = null; } } } // End of main class over here ... </code></pre>
4,381,251
0
<p>The simpliest solution depends from wich method did you like to send mails.</p> <p>If you have for example already installed sendmail - in this case to send the mail with notification log you can call it with params. It depend on your system settings.</p>
19,960,459
0
<p>Do not use response in that case, this will ask the Save as dialog box. If you want to save the file to your disk without any prompt do something like this. I am giving you in C#</p> <pre><code>System.Web.UI.WebControls.DataGrid grid = new System.Web.UI.WebControls.DataGrid(); grid.HeaderStyle.Font.Bold = true; grid.DataSource = datatable; grid.DataMember = datatable.TableName; grid.DataBind(); using(StreamWriter sw = new StreamWriter ("d:\\temp\test.xls")) { using (HtmlTextWriter hw = new HtmlTextWriter(sw)) { grid.RenderControl(hw); } } </code></pre>
29,447,937
0
<p>Below are my notes on the conversion process from Polymer 0.5 to 0.8.</p> <h3>See Polymer 0.8 Migration Guide</h3> <p><a href="https://www.polymer-project.org/0.8/docs/migration.html" rel="nofollow">https://www.polymer-project.org/0.8/docs/migration.html</a></p> <h3>HTML Conversion Process</h3> <ol> <li>polymer-element to dom-module</li> <li>polymer-element name to <li>polymer-element attribute/property camelCase to dash-case</li> <li>polymer-element attributes="xxx xxxx" add to javascript properties</li> <li>polymer-element layout <code>&lt;polymer-element name="x-foo" layout horizontal wrap&gt;</code> <ul> <li>add <code>&lt;link rel="import" href="../layout/layout.html"&gt;</code> to top with other imports</li> <li>add hostAttributes <code>hostAttributes: {class: "layout horizontal wrap"}</code> to Polymer({</li> </ul></li> <li>polymer-element move up <code>&lt;link rel="import" type="css" href="my-awesome-button.css"&gt;</code> from <code>&lt;template&gt; to &lt;dom-module&gt;</code> </li> <li>polymer-element move up <code>&lt;style&gt;&lt;/style&gt;</code> from <code>&lt;template&gt;</code> to <code>&lt;dom-module&gt;</code> <ul> <li>see www.polymer-project.org/0.8/docs/devguide/local-dom.html</li> </ul></li> <li>template repeat to is="x-repeat" and repeat= to items= (temporary) <ul> <li>see www.polymer-project.org/0.8/docs/devguide/experimental.html</li> </ul></li> <li>template is="auto-binding" to is="x-binding" (temporary)</li> <li>template if= to is="x-if" (temporary) or use diplay block or none</li> <li>textContent binding from <code>&lt;div&gt;First: {{first}}&lt;/div&gt;</code> TO <code>&lt;span&gt;{{first}}&lt;/span&gt;&lt;br&gt;</code></li> <li>elements <code>on-click="{{handleClick}}"</code> to <code>on-click="handleClick"</code></li> </ol> <h3>Javascript Conversion Process</h3> <ol> <li>polymer-element name to Polymer({ is: </li> <li>polymer-element attributes="" to javascript <code>properties: { }</code></li> </ol> <h3>CSS Conversion Process</h3> <ol> <li>polymer-element move up <code>&lt;style&gt;&lt;/style&gt;</code> from <code>&lt;template&gt;</code> to <code>&lt;dom-module&gt;</code> (as noted above) <ul> <li>see www.polymer-project.org/0.8/docs/migration.html#styling</li> </ul></li> </ol> <h3>Difference example of paper-button conversion by Polymer team</h3> <p><a href="http://chuckh.github.io/road-to-polymer/compare-code.html?el=paper-button" rel="nofollow">http://chuckh.github.io/road-to-polymer/compare-code.html?el=paper-button</a></p>
4,046,054
0
<p>It is kind of possible using <code>in_array()</code>:</p> <pre><code>if (in_array($_SESSION['id'], array("000001", "000002"))) </code></pre> <p>or alternatively using <code>switch</code>:</p> <pre><code>switch ($_SESSION["id"]) { case "000001": case "000002": // do something break; default: break; } </code></pre>
25,882,323
0
<p>The issue is that jquery.soap is not accounting for <code>CDATA</code> elements, in <a href="https://github.com/doedje/jquery.soap/blob/f642fc079e2d7ea40b2ea1fc12070b068ff0770b/jquery.soap.js" rel="nofollow">the current code of the jquery.soap.js file</a>, inside the function <code>dom2soap</code>, from line 482 to line 488 there is this code:</p> <pre><code> if (child.nodeType === 1) { var childObject = SOAPTool.dom2soap(child); soapObject.appendChild(childObject); } if (child.nodeType === 3 &amp;&amp; !whitespace.test(child.nodeValue)) { soapObject.val(child.nodeValue); } </code></pre> <p>The problem is that the <code>nodeType</code> for a <code>CDATA</code> element is 4, so your <code>CDATA</code> elements are being ignored. </p> <p>I've forked the original jquery.soap repo, I've created a new branch called <code>cdata-fix</code> and I've made a few changes in the jquery.soap.js file that should solve your issue. <a href="https://github.com/josepot/jquery.soap/commit/4ebf86b4cc21012e2aedbb64ab27ef81b03dc915#diff-85e01184326c2ae667438b42ecbdc31c" rel="nofollow">You can see those changes here</a>.</p> <p>I've created <a href="https://github.com/doedje/jquery.soap/pull/61" rel="nofollow">this pull request</a> in the jquery.soap repo, hopefully the pull request will be accepted, but in the meanwhile feel free to use my version of the jquery.soap.js, I'm quite confident that it will work just fine.</p> <p>In <strong><a href="http://plnkr.co/edit/EY0lmyJESSO2FV8j6LIp?p=preview" rel="nofollow">this Plunker</a></strong> you can see that the changes that I've made to the jquery.soap.js file are fixing your issue. (Have a look at the payload of the post with a 404 error)</p> <p><strong>UPDATE:</strong></p> <p>The pull request <a href="https://github.com/doedje/jquery.soap/pull/61" rel="nofollow">has been accepted</a>.</p>
30,780,847
0
<p>You can use the following function for that, it will handle your two delimiters for spli</p> <pre><code>CREATE FUNCTION dbo.MultipleSplitStrings ( @List NVARCHAR(MAX), @Separator1 Varchar(100), @Separator2 Varchar(100) ) RETURNS TABLE AS RETURN ( SELECT Item = y.i.value('(./text())[1]', 'nvarchar(4000)') FROM ( SELECT x = CONVERT(XML, '&lt;i&gt;' + REPLACE(REPLACE(@List, ISNULL(@Separator1,''), '&lt;/i&gt;&lt;i&gt;') , ISNULL(@Separator2,''), '&lt;/i&gt;&lt;i&gt;') + '&lt;/i&gt;').query('.') ) AS a CROSS APPLY x.nodes('i') AS y(i) ); GO Select * From dbo.MultipleSplitStrings ('10:0,11:1,12:3,13:4,15:5,16:6',',',':') </code></pre> <p>Result :</p> <pre><code>item 10 0 11 1 12 3 13 4 15 5 16 6 </code></pre>
13,222,960
0
How to revoke the permission that my app get from user's google gmail AccountManager.getAuthToken( <p>Created a test app using Eclipse to get the <code>authToken</code> from one of my google e-mail accounts on my device.</p> <p>Executing this prompted me with the allow access dialog where i press allow access: </p> <pre><code>accountManager.getAuthToken(account,"oauth2:https://www.googleapis.com/auth/userinfo.profile", false, new GetAuthTokenCallback(), null); </code></pre> <p>I wanted to create a chooser dialog that works from API8 and up where the user can choose what google account he allow me to access. To do this i have to revoke the permission to see the screen again. </p> <p>should i see my test app on this page or not?<br> <a href="https://accounts.google.com/b/0/IssuedAuthSubTokens?hl=en" rel="nofollow"><strong>Authorized Access to your Google Account</strong></a></p> <p>I have search for a way to revoke the permission and non is working..<br> Only thing working is to create a new app project. </p> <p><strong>UPDATE 2013</strong><br> Using the Google Play service GCM and this is working ok</p>
40,553,016
0
<p>After reviewing all the other answers, I ended up with this:</p> <pre><code>function oldSchoolMakeBuild(cb) { var makeProcess = exec('make -C ./oldSchoolMakeBuild', function (error, stdout, stderr) { stderr &amp;&amp; console.error(stderr); cb(error); }); makeProcess.stdout.on('data', function(data) { process.stdout.write('oldSchoolMakeBuild: '+ data); }); } </code></pre> <p>Sometimes <code>data</code> will be multiple lines, so the <code>oldSchoolMakeBuild</code> header will appear once for multiple lines. But this didn't bother me enough to change it.</p>
1,779,395
0
<p><code>do { … }</code> requires a condition at the end, such as <code>do { … } while (busy);</code> If you just want to execute a piece of code in a block, just put that block there and remove the <code>do</code>.</p>
13,372,749
0
Percent errors using the arc cosine function trying to output 3 different numbers of percentages <p>I coded all of this but it will not output any of my percent errors i'm not quite sure where to put the percent? It is suppose to output 3 different numbers but I can't even get to the output because of this error i have no idea i tried changing everything to floats and and ints but the error message of % is overloading the function?</p> <pre><code>double dRandom() { return double(rand()/RAND_MAX); } int main() { int loop_count=100, count=0; int result=0; float x=dRandom(); double y=dRandom(); float arccos (float x); float function=0; srand(time(NULL)); for(int i=1; i&lt;4;++i) { for (int k=1; k&lt;= loop_count; ++k) { function= (x* arccos(x)-sqrt(1- pow(x,2)))%RAND_MAX;//this line is where i'm not sure how to add the percent sign in correctly } } if(x&lt;y) cout&lt;&lt;result; return 0; } </code></pre>
12,385,977
0
preg_replace with two arrays <p>I've have a problem with <code>preg_replace()</code> using arrays.</p> <p>Basically, I'd like to transpose this string ;</p> <pre><code>$string = "Dm F Bb F Am"; </code></pre> <p>To </p> <pre><code>$New_string = "F#m D D A C#m"; </code></pre> <p>Here is what I do: </p> <pre><code>$Find = Array("/Dm/", "/F/", "/Bb/", "/Am/", "/Bbm/", "/A/", "/C/"); $Replace = Array('F#m', 'A', 'D', 'C#m', 'Dm', 'C#', 'E'); $New_string = preg_replace($Find, $Replace, $string); </code></pre> <p>But I get this result instead :</p> <p>E##m E# D E# E#m</p> <p>Problem is that every match is replaced by the following, something like this happens (example for E##m):</p> <p>Dm -> F#m -> A#m -> C##m -> E##m</p> <p>Is there any solution to simply change 'Dm' to 'F#m', "F" to "A", etc ?</p> <p>Thank you !</p>
33,755,378
0
<p>I've already tried to use commands.flush() before call the close() method, but this don't change anything.</p> <p>Instead, if I write more than one file, as an example file-1.xml, file-2.xml, file-3.xml, the files numer one and two was written before I closing the application and the file number three was written only after closing.</p>
9,150,845
0
<p>With CSS3 you can now target the [title] attribute but as to a real world solution i don't see any. I would rather suggest you used a plugin such as <a href="http://onehackoranother.com/projects/jquery/tipsy/" rel="nofollow">tipsy</a> for that task, as it is more cross browser supported and less fuss.</p> <p>This is a demo of a styled [title] attribute:</p> <p><strong>CSS</strong></p> <pre><code>span:hover { color: red; position: relative; } span[title]:hover:after { content: attr(title); padding: 4px 8px; color: #333; position: absolute; left: 0; top: 100%; white-space: nowrap; z-index: 20px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -moz-box-shadow: 0px 0px 4px #222; -webkit-box-shadow: 0px 0px 4px #222; box-shadow: 0px 0px 4px #222; background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc)); background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); background-image: -ms-linear-gradient(top, #eeeeee, #cccccc); background-image: -o-linear-gradient(top, #eeeeee, #cccccc); } </code></pre> <p>Demo: <a href="http://jsfiddle.net/BvGHS/" rel="nofollow">http://jsfiddle.net/BvGHS/</a></p>
40,125,667
0
<p>Have a look at <a href="https://github.com/linq2db/linq2db" rel="nofollow">LinqToDb</a>. It also has a version for Mono and it should work with Unity3D.</p> <p>Good luck.</p>
5,695,226
0
Send part of an arraylist <p>I have an <code>arraylist</code> in Java that I fill with certain data, but I want to send the array list starting at certain a index say, e.g.: <code>20</code>.</p>
3,000,283
0
<pre><code>p.location[0].name ## OR p.location.first.name </code></pre> <p>p.location is an array of one element</p>
40,678,084
0
Using jQuery plugins inside Typescript file <p>I'm using typescript for the first time in my company projects, and I have this JS file:</p> <pre><code>/// &lt;reference path="jquery.d.ts" /&gt; /// &lt;reference path="bootstrap-switch.d.ts" /&gt; function CreateIdeSkuValidoSwitch() { $("[name='actived_ideskuvalido']").bootstrapSwitch(); } </code></pre> <p>But when I will use this in my Typescript function, the compile say: property does not exist on type 'jQuery'.</p> <p>I want to know, how I use this jQuery plugin switch inside my ts files with jQuery.</p> <p>Sorry my bad english.</p>
40,246,073
0
<p>Please edit the code, it looks like you have an error on mongo with 'Admin.findOne'</p> <pre><code>if(err) deferred.resolve(err); </code></pre> <p>to </p> <pre><code>if(err) deferred.reject(err); </code></pre>
14,068,247
0
Why am I getting undefined method `comments' when using acts_as_commentable_with_threading? <p>On the community's #show page, I get:</p> <blockquote> <p>undefined method `comments'</p> </blockquote> <p>I was wondering why was I get this error?</p> <p><strong>community_topics_controller.rb</strong></p> <pre><code>def show @community_topic = CommunityTopic.find params[:id] @comment = @community_topic.comments.build @community_topic.comments.pop respond_to do |format| format.html # show.html.erb format.json { render json: @community_topic } end end </code></pre> <p><strong>models/community_topic.rb</strong></p> <pre><code>acts_as_commentable </code></pre> <p><strong>views/community_topics/show.html.erb</strong></p> <pre><code>&lt;%= render 'comments/form' %&gt; </code></pre> <p><strong>views/comments/_form.html.erb</strong></p> <pre><code> &lt;div class="field"&gt; &lt;%= f.label :comment %&gt;&lt;br /&gt; &lt;%= f.text_area :comment %&gt; &lt;%= f.hidden_field :commentable_id %&gt; &lt;%= f.hidden_field :commentable_type %&gt; &lt;/div&gt; </code></pre>
21,859,548
0
<p>My understanding is that you want to execute the onResize() function when the resize event is received. You seem to be a bit out of sync with how the document-ready stuff is intended to work -- and I recommend that you read some of the basic jquery tutorials -- but, basically, you want to use the function in $(function()....) to apply the event handler to the window after the document is fully loaded. </p> <p>Here, you seem to be -- mistakenly -- assuming that your running $(window).resize... after calling $(docyument).ready...would have waited until the .ready() function executed, but that's not how that works. The code that should be executed after the document reaches the fully-loaded state should go into the function parameter to $().</p> <p>Basically, you want to put your event handler assignment in the .ready() function like this:</p> <pre><code>$(function() { $(window).resize(onResize); }); </code></pre>
29,412,661
0
<p>As you ask specifically about the BBC: </p> <p>You <em>are</em> allowed to display <a href="http://www.bbc.co.uk/news/10628494" rel="nofollow">the RSS feed of BBC headlines</a> - you could use the WordPress <a href="https://codex.wordpress.org/WordPress_Widgets#Using_RSS_Widgets" rel="nofollow">RSS Links widget</a> to do this.</p> <p>You certainly <em>aren't</em> allowed to just copy someone else's story (or start removing branding etc.) – which is quite reasonable.</p> <p>Note: The BBC doesn't have an <a href="https://en.wikipedia.org/wiki/Application_programming_interface" rel="nofollow">API</a> for news, but some do - e.g. The Guardian's <a href="http://open-platform.theguardian.com/" rel="nofollow">Open Platform</a> - again there will usually be strict restrictions on how you can display things, required branding, what you are/aren't allowed to change. </p> <p>Correct approach: choose one or two relevant quotes you find interesting, highlight those, and make sure you have prominent link back to the original article.</p>
29,102,377
0
<p>This worked for me:</p> <blockquote> <p>To remove extra space Use the code as</p> <pre><code>zpc.write("! UTILITIES\r\nIN-MILLIMETERS\r\nSETFF 10 2\r\nPRINT\r\n".getBytes()); zp.getGraphicsUtil().printImage(bmp,0,0,100,100,false); </code></pre> <p>where the 4th and the 5th parameters can be as you required ...</p> </blockquote>
39,856,475
0
<p>You can use :</p> <pre><code>git config --get-regexp user.name </code></pre> <p>For the <strong>user name</strong>. for the <strong>repository name</strong>, you may have different repositories with different names, so I guess parsing :</p> <pre><code>git remote get-url origin </code></pre> <p>could help if you only care about the origin ? The format would be (prefixes would differ between ssh or https) <code>[email protected]:{github_handle}/{repo_name}.git</code></p>
16,145,138
0
Strange exception when using groupBy in slick <p>I have a table with a few columns, two of them are: vendingMachineId (which are repeated) and each one has a timestamp.</p> <p>I want to get latest timestamp for each vendingMachineId so I did this:</p> <pre><code>def getLastReading(assetIds: List[Int])(implicit db: Session): Map[Int, String] = { val vmrps = (((for { vmrp &lt;- VendingMachineReadingProducts if (vmrp.vendingMachineId inSet assetIds) } yield (vmrp.vendingMachineId, vmrp.timestamp)).sortBy(_._2.desc)).groupBy(x =&gt; (x._1, x._2))).map { case (all, q) =&gt; all._1 -&gt; all._2 }.list vmrps map { case (assetId, timestamp) =&gt; { assetId -&gt; (new SimpleDateFormat(DateTimeUtils.defaultDateTimeFormat)).format(timestamp) } } toMap } </code></pre> <p>The issue is that I receive a strange exception:</p> <pre><code>scala.slick.SlickException: Unexpected node Ref @20339870 -- SQL prefix: select at scala.slick.driver.BasicStatementBuilderComponent$QueryBuilder.toComprehension(BasicStatementBuilderComponent.scala:75) ~[slick_2.10-1.0.0.jar:1.0.0] at scala.slick.driver.BasicStatementBuilderComponent$QueryBuilder.expr(BasicStatementBuilderComponent.scala:285) ~[slick_2.10-1.0.0.jar:1.0.0] at scala.slick.driver.PostgresDriver$QueryBuilder.expr(PostgresDriver.scala:55) ~[slick_2.10-1.0.0.jar:1.0.0] at scala.slick.driver.BasicStatementBuilderComponent$QueryBuilder.buildSelectPart(BasicStatementBuilderComponent.scala:155) ~[slick_2.10-1.0.0.jar:1.0.0] </code></pre> <p>Does anyone know what I am doing wrong?</p>
25,736,753
0
how to do reduce multiple query into one query <pre><code>Query 1: select item_no from hdd where item_no='$in' and id != '$id' Query 2: select sr from hdd where sr='$hd' Query 3: select item_no from hdd where casing_no='$c' and id != '$id' </code></pre> <p>Result Required : </p> <pre><code>Q1 = num_rows = 0 Q2 = num_rows &lt;&gt; 0 Q3 = num_rows = 0 </code></pre> <p>How can perform above task in single query ? ?</p> <p>Done this :</p> <pre><code>SELECT id FROM hdd WHERE status='1' AND item_no='$in' AND FIND_IN_SET('$hd', sr)&lt;&gt;0 AND casing='$c' AND id&lt;&gt;'111' </code></pre>
26,792,768
0
Loading a .obj file all black <p>I've successfully loaded a 3d model that I triangulated using Blender. Trouble is its all black and I can't figure out how to get it to show color or textures.</p> <p>I have an ambient light initialized like this:</p> <p>function init() { scene = new THREE.Scene;</p> <pre><code>camera = new THREE.PerspectiveCamera( 75, (window.innerWidth) / (window.innerHeight), 1, 10000); camera.position.x = 500; camera.position.z = 100; camera.lookAt(new THREE.Vector3(0, 0, 0)); camera.rotateZ(90 * Math.PI / 180); scene.add(new THREE.AmbientLight(0xffffff)); populate(); renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); renderer.render(scene, camera); document.body.appendChild(renderer.domElement); document.addEventListener('keydown', function(event) { keydown(event); }); </code></pre> <p>}</p> <p>Here's the .mtl that goes with the .obj Blender MTL File: 'mq9.blend' Material Count: 4</p> <p>newmtl Material__69 Ns 9.803922 Ka 0.000000 0.000000 0.000000 Kd 0.225882 0.225882 0.225882 Ks 0.900000 0.900000 0.900000 Ni 1.000000 d 1.000000 illum 2</p> <p>newmtl _6___Default Ns 19.607843 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.900000 0.900000 0.900000 Ni 1.000000 d 1.000000 illum 2</p> <h1>map_Kd missile.jpg</h1> <p>newmtl mq_9 Ns 31.372549 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.990000 0.990000 0.990000 Ni 1.000000 d 1.000000 illum 2</p> <h1>map_Kd predator.jpg</h1> <h1>map_Bump predator_Normal.jpg</h1> <p>newmtl mq_90 Ns 31.372549 Ka 0.000000 0.000000 0.000000 Kd 0.800000 0.800000 0.800000 Ks 0.990000 0.990000 0.990000 Ni 1.000000 d 1.000000 illum 2</p> <h1>map_Kd predator.jpg</h1> <h1>map_Bump predator_Normal.jpg</h1> <p>The various .jpgs are all found but for some reason they don't seem to be rendering by three.js. I'm wondering if the jpgs need to be modified somehow to reflect the triangulation?</p> <p>Screenshot: <img src="https://i.stack.imgur.com/NwunH.png" alt="enter image description here"></p>
37,347,382
0
How to remove all bootstrap processing from radio button? <p>I am using coldfusion and bootstrap to make a site. I have some radio buttons that need to be selected depending on the value of a query output, but for some reason I cannot get any of the radio buttons to select at all based on their value. I was thinking maybe it is something in bootstrap 3 that is causing an issue. </p> <p>Is there a way to remove all bootstrap style from a series of radio buttons?</p> <p>Edit I am using this to check the boxes:</p> <pre><code>&lt;cfinput type="radio" name="update_type" value="#form.update_type#" checked="#form.update_type eq 3#" /&gt; </code></pre>
36,960,628
0
How to return results together with update operations in BaseX? <p>I recognized that (<code>insert</code>/<code>delete</code>)-XQueries executed with the BaseX client always returning an empty string. I find this very confusing or unintuitive.</p> <p>Is there a way to find out if the query was "successful" without querying the database again (and using potentially buggy "transitive" logic like "if I deleted a node, there must be 'oldNodeCount-1' nodes in the XML")?</p>
15,408,459
0
How to Revert database to last modified from recent Restore? <p>me and my fried were developing a project in separate system but created database in same name, Today i restored my database in my friend's machine accidentally. Is there any way to roll back the database in SQL-Server, which means i want to get database that i restore before.</p>
16,450,393
0
<p>You're asking for the filesize of a directory, which in this case is 4,096 bytes. This number will vary for a directory depending on what sort of filesystem you're using and how many files are in it. </p>
2,004,367
0
UIImageView's CALayer's anchorPoint "accessing unknown component of property" error <p>I'm trying to rotate an image about the bottom right corner. To do this I know I need to set the layer's anchorPoint, but I can't access it. I've included the QuartzCore framework in my project. To simplify the problem as much as possible, I've reduced the method to these three lines, which still throw the error "error: accessing unknown 'anchorPoint' component of a property" (line 2).</p> <pre><code>UIView *sqView = [[UIView alloc] init]; sqView.layer.anchorPoint = CGPointMake(1.0, 1.0); [sqView release]; </code></pre> <p>It must be something truly stupid. I've looked at other examples of this and they appear identical. What am I missing?</p>
7,423,066
0
<p>I was having a similar problem. Route values that were passed to my controller action were being reused when I tried to redirect the user with <strong>RedirectToAction</strong>, even if I didn't specify them in the new <strong>RouteValueDictionary</strong>. The solution that I came up with (after reading counsellorben's post) with was to clear out the <strong>RouteData</strong> for the current request. That way, I could stop MVC from merging route values that I didn't specify.</p> <p>So, in your situation maybe you could do something like this:</p> <pre><code>[CustomAuthorize] [HttpGet] public ActionResult Approve(int id) { _customerService.Approve(id); this.RouteData.Values.Clear(); //clear out current route values return RedirectToAction("Search"); //Goes to bad url } </code></pre>
14,421,729
0
How do you grab an element in a JSON tree without an explicit name in Play 2.0? <p>I've been working through parsing .json files in a Play 2.0 project and there is one thing I can't figure out. Here is a snippet from the online docs:</p> <pre><code>{ "users":[ { "name": "Bob", "age": 31.0, "email": "[email protected]" }, { "name": "Kiki", "age": 25.0, "email": null } ] } </code></pre> <p>What I want to know is, how do I grab one whole user? The problem is that I can't figure out how to reference the grouping of parameters that represents a single user. I've tried something like </p> <pre><code>( json \\ "users" ) </code></pre> <p>which just gives all the users as a single element in a list, and I've tried something like </p> <pre><code>( json \ "users" \ (user)(0)) </code></pre> <p>but it seems I have to define 'user' and I have no idea what would be appropriate for that.</p> <p>Better yet, is there a way to grab all the customers in a list? Or even just iterate over the tree and hit upon each user so I can access all the information of a specific user at once?</p>
26,398,213
0
Link against two versions of the same library (same symbols) <p>I'm developing an iOS app and want to link against a particular library. However a forked/old version of that same library (with colliding symbols) has been statically linked into a framework that I'm also using. Because the version pulled in by the framework is forked and out-dated ideally I'd like to somehow use the new library for my purposes, and allow the old/forked version to continue to be used by the framework, all in the one iOS binary.</p> <p>I don't have control over the old/forked version of the library, but I can compile the new version however I please.</p> <p>Is there something I can do to automatically prefix/namespace the symbols in the new version of the library so that I can use them without colliding with symbols in the old version?</p>
5,118,902
0
<p>This question doesn't make much sense. You really should clarify and flesh out the question and explain what you are trying to do.</p> <p>In some ways, an ASP.NET textbox <em>is</em> an HTML text field that C# code can make use of. So what's the problem with an ASP.NET textbox?</p>
4,031,206
0
<p>Sounds like you are looking for the <a href="http://en.wikipedia.org/wiki/HTTP_referrer" rel="nofollow"><strong>HTTP Referrer</strong></a>. You can get it via <a href="http://php.net/manual/en/reserved.variables.server.php" rel="nofollow"><code>$_SERVER['HTTP_REFERER']</code></a>.</p> <p>But note that this can be changed by the user to something else, so you actually cannot rely on that.</p> <hr> <p>Maybe it is better to send the current URL via the Ajax call, along with the ID:</p> <pre><code>$('#file').load('fun2.php?id='+ Math.random() +'&amp;parent=' + encodeURIComponent(window.location)); </code></pre> <p>But again, if one really wants to, he can change this too. So you can never 100% trust that one request is really coming from a certain page.</p> <p>Reference: <a href="https://developer.mozilla.org/en/DOM/window.location" rel="nofollow"><code>window.location</code></a>, <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent" rel="nofollow"><code>encodeURIComponent</code></a></p>
2,090,372
0
<p>i would think there would be a java equivalent to something like the following php</p> <pre><code>$my_numbers = range(0,100); echo implode($my_numbers, ' '); </code></pre> <p>this avoids recursion, loops, control statements, etc.</p>
7,036,293
0
<blockquote> <ol> <li>How to commit my changes to the local git repository as well as my forked repository in github?</li> </ol> </blockquote> <p>To add files changes for commit, use the following command.</p> <pre><code>git add . </code></pre> <p>then, make a local commit by</p> <pre><code>git commit </code></pre> <p>once you make your local commit, you can then push it to your remote GitHub fork.</p> <pre><code>git push </code></pre> <blockquote> <ol> <li>How will the author of the original source code, pull my changes from the forked repository in github</li> </ol> </blockquote> <p>To make your source code pulled by original fork, you have to send a <em>pull request</em> to the project owner.</p> <ol> <li>Go to the web page of your forked project on GitHub.</li> <li>Hit the <em>pull request</em> button on the top right of page</li> <li>Select the commits that you want to submit by <em>change commits</em> button.</li> <li>Write some description of your changes, comments, or etc.</li> <li><em>Send pull request</em> and wait for the owner reply.</li> </ol>
26,991,767
0
<p>For completeness, <a href="http://scikit-learn.org/stable/modules/svm.html#nusvc" rel="nofollow">from the documentation</a>: Nu-SVM is a constrained formulation of SVM (equivalent with the original up to reparametrization) which poses a hard bound on the allowed misclassification. If this bound cannot by satisfied, then the associated convex optimization problem becomes infeasible.</p> <p>From this standpoint the first thing you have to investigate is how much training error you really can expect, and maybe revise your assumptions. Search over a grid of <code>C</code> values for a standard SVM to check that.</p> <p>NuSVC should work with some values strictly less than 1, though. According to your description, you have tried 0.9 -- start adding 9s, ie .99, .999. If it doesn't work at some point, then there has to be another problem somewhere.</p>
15,851,668
0
Fancybox with an i-frame cross-domain, partially rendered with Explorer10 compability mode <p>Site that open a fancybox i-frame, and in the i-frame there is a aspx - ajax page of other domain. just with IE10 in compability mode (No problem with others browsers), the page is just partially rendered, and when I click on a button (example to change the color of the bag) the page is correctly rendered.</p> <p>First rendered:</p> <p><img src="https://i.stack.imgur.com/L8kx0.jpg" alt="First rendered"></p> <p>After click on orange color:</p> <p><img src="https://i.stack.imgur.com/3KDoO.jpg" alt="After click"></p> <p>UPDATE:</p> <p>1) On a separate i-frame (without fancybox) the page works perfectly.</p> <p>2) It's not a cross-domain issue, problem exists also on my pc.</p>
5,703,509
0
<p>If there is some PHP behind, the problem could be calling a function empty($var) in this way:</p> <pre><code>if(empty($var = getMyVar())) { ... } </code></pre> <p>Instead of this You should call it this way:</p> <pre><code>$var = getMyVar(); if(empty($var)) { ... } </code></pre> <p>Or better (as <strong>deceze</strong> has pointed out)</p> <pre><code>if(!getMyVar()) { ... } </code></pre> <p>Problem causes also other similar functions (isset, is_a, is_null, etc).</p>
14,497,906
0
Android-NDK: create GUI elements out of native code <p>as far as I understood the Android-NDK-thingy it works as follows: I have to use a NativeActivity that itself calls into the attached native code handing over some OpenGL graphics context. This context can be used by the native part to draw some things with.</p> <p>What I could not fiddle out until now: how about some GUI elements? Is there a possibility to call back from native code to Java just to create some UI-elements and perhaps to use layouts? Means is it possible to use the standard Android GUI elements also with such native code?</p> <p>If yes: how can this be done? If not: what alternatives exist (except drawing everything manually)?</p> <p>Thanks!</p>
37,488,877
0
<blockquote> <p>I assume that you don't use nginx to serve static assets in development? Runserver can serve static files, but very much slower than nginx, which becomes a problem once you have more than a single web site visitor at a time. You can remove the nginx alias for static and reload nginx to let runserver serve the files, to confirm whether it's a problem in the nginx config. Håken Lid</p> </blockquote> <p>I removed nginx and made the Django server load the static files, and now I can show it to my future users. This answered my question, though it did not solve the problem itself! Thanks anyway !</p>
15,464,859
0
Multiple xmlhttprequest <p>Is it possible with javascript ? or do I need to create two senders ?</p> <p>because this don't work</p> <pre><code>xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xmlhttp.send("textBox="+textBox.value); xmlhttp.send("textBoxID="+textBox.parentNode.id); </code></pre>
11,031,271
0
<p>In short - there shouldn't be a problem. Once 3 &amp; 4 are both installed, the two use different project templates and the references to the MVC assemblies are specifically targetted at the correct versions.</p> <p>Beyond that, the web.configs of the two sites then determine the other assemblies that are used - and since they are seeded by the project templates they will be correct.</p> <p>Now, if you were asking about having 3 &amp; 4 in the same <em>project</em>, that would be another story. But then you wouldn't do that.</p> <p>It's true there are a few known issues with the Razor editor and stuff like that - but none of those are show-stoppers and are almost certainly likely to have been fixed by the time v4 RTMs.</p>