How can I export a SHP file with polygons, and height attributes to AutoCAD? I have tried the 'Export to CAD' function in ArcGIS but it does not include any attribute data.
Thanks.
What I would like to do in my code is something like that below:
static class MyClass
{
static byte[,,] array3d = { { {0,0},{0,0}},{{0,0},{0,0}}};
static MyClass()
{
someMethod(array3d[0]);
someMethod(array3d[1]);
}
static void someMethod(byte[,])
{
}
}
I would like to know if there is some way to do what I am trying to when calling someMethod(). If not, what should I do?
In django views
def add(request):
dict{}
co_data = optarr
dict.update({'co_data' : co_data})
logging.debug(co_data)
return render_to_response('scheme/create.html',context_instance=RequestContext(request,{'dict': dict}))
And data has the following string 1##2##3##4##
And in the template when i say {{co_data}} it doesnt display the values.Please point out whats wrong in the code.
Thanks..
I want to make a simple EXE file, where there is one object in the scene and the user can rotate that object by using arrow keys (or mouse).
Is there any way in which I don't have to use a game engine and do it only using 3dsmax script?
Cause there is a special renderer I want to use, which is V-Ray a kind of renderer which provides 3D images for 3D glasses.
I am not good at making games and engines so I want to know if I can do it only with 3dsmax scripts?
I have a simple 2D array:
int[,] m = {{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
};
How can I print this out onto a text file or something? I want to print the entire array onto a file, not just the contents. For example, I don't want a bunch of zeroes all in a row: I want to see the {{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
}; in it.
Is there a way to align text when priting using cout? I'm using tabs, but when the words are too big they won't be aligned anymore
Sales Report for September 15, 2010
Artist Title Price Genre Disc Sale Tax Cash
Merle Blue 12.99 Country 4% 12.47 1.01 13.48
Richard Music 8.49 Classical 8% 7.81 0.66 8.47
Paula Shut 8.49 Classical 8% 7.81 0.72 8.49
I am trying to apply an image brush to a Triangle in WPF without success. What am i doing wrong?
This is my attempt:
Dim ModelTri As New MeshGeometry3D
ModelTri.Positions.Add(New Point3D(0, 0, 0))
ModelTri.Positions.Add(New Point3D(100, 0, 0))
ModelTri.Positions.Add(New Point3D(100, 100, 0))
Dim MeshTri As New MeshGeometry3D
MeshTri.TriangleIndices.Add(0)
MeshTri.TriangleIndices.Add(1)
MeshTri.TriangleIndices.Add(2)
'Texture
Dim TexturePoints As New PointCollection
TexturePoints.Add(New Point(100, 0))
TexturePoints.Add(New Point(0, 100))
TexturePoints.Add(New Point(100, 100))
MeshTri.TextureCoordinates = TexturePoints
'Image Brush
Dim imgBrush As New ImageBrush()
imgBrush.ImageSource = New BitmapImage(New Uri("Mercury.jpg", UriKind.Relative))
imgBrush.Stretch = Stretch.Fill
imgBrush.TileMode = TileMode.Tile
imgBrush.SetValue(NameProperty, "imgBrush")
Dim Mat As Material
Dim DMaterial As New DiffuseMaterial
DMaterial.Brush = imgBrush
Dim Bind As New Binding("imgBrush")
Bind.Source = imgBrush
BindingOperations.SetBinding(DMaterial, BindingGroupProperty, Bind)
'This doesnt work
Mat = DMaterial
'This works
'Mat = New DiffuseMaterial(New SolidColorBrush(Colors.Khaki))
Dim triangleModel As GeometryModel3D = New GeometryModel3D(ModelTri, Mat)
Dim model As New ModelVisual3D()
model.Content = triangleModel
Viewport.Children.Add(model)
Hello.
Well, this smells like a tumbleweed, but I will ask it anyway.
Suppose you have a noweb file with some c# code. You also have the c++ pretty-print filter dpp. If you run the command noweave -filter ./dpp -x test.nw > csharp.tex on the file below, it will print everything except for the curly braces. Instead of them, I get an em-dash and a closing quotations marks (i.e. ?) in the dvi. The tex source looks fine... Any ideas?
@ C\# test file
<<test.c>>=
while( (a[right] >= pivot) && (left < right) )
{
right--;
}
This is the first Python script I've tried to create. I'm reading a xml file from a tar.gz package and then I want to pretty print it. However I can't seem to turn it from a file-like object to a string. I've tried to do it a few different ways including str(), tostring(), etc but nothing is working for me.
For testing I just tried to print the string at "print myfile[0:200]" and it always generates "<tarfile.ExFileObject object at 0x10053df10>"
import os
import sys
import tarfile
from xml.dom.minidom import parseString
tar = tarfile.open("data/ucd.all.flat.tar.gz", "r")
getfile = tar.extractfile("ucd.all.flat.xml")
myfile = str(getfile)
print myfile[0:200]
output = parseString(getfile).toprettyxml()
print output
tar.close()
I'm typesetting in LaTeX, and I'd like to display a "variable" (in my case, a reference \ref{blah} to an item number in list) in roman rather than the default arabic. Is there an easy way to do this? Thanks for any pointers!
I'm trying to print a document. The document is an array of NSImageReps, or a single NSPDFImageRep, which has multiple pages. I'm having trouble figuring out how to use the NSPrintOperation class to print this.
The NSPrintOperation seems to need an NSView to print. Do I need to manually add each image into the view at a calculated position and then let it do the pagination? that seems like it isn't in the spirit of Cocoa... is there some technique that I'm missing?
i have this multi dimentional array that i want to print into a table having each record/item go into its own row but it goes column wise. this is the output that im getting: http://mypetshopping.com/product.php
ps: the value of $product will by dynamic based on what product is being viewed.
<?php
session_start();
?>
<table>
<thead>
<tr>
<th>Name</th>
<th>Hash</th>
<th>Quantity</th>
<th>Size</th>
<th>Color</th>
</tr>
</thead>
<tbody>
<?php
function addCart($product, $quantity, $size,$color) {
$hash = md5($product);
$_SESSION['cart'][$product]['name'] = $product;
$_SESSION['cart'][$product]['hash'] = $hash;
$_SESSION['cart'][$product]['quantity'] = $quantity;
$_SESSION['cart'][$product]['size'] = $size;
$_SESSION['cart'][$product]['color'] = $color;
}
addCart('Red Dress',1,'XL','red');
addCart('Blue Dress',1,'XL','blue');
addCart('Slippers',1,'XL','orange');
addCart('Green Hat',1,'XXXL','green');
$cart = $_SESSION['cart'];
foreach($cart as $product => $array) {
foreach($array as $key => $value) {
?>
<tr>
<td><?=$value;?></td>
<td><?=$value;?></td>
<td><?=$value;?></td>
<td><?=$value;?></td>
<td><?=$value;?></td>
</tr>
<?php
}
}
?>
The 3D rotation tool is excellent but it only lets you rotate 2D objects, this means my object is wafer thin.
Is there any way to add simple extrusion or depth to a symbol?
I don't really want to use any 3rd party libraries like Away3D or Papervision, this is overkill for my simple 2D game. I only want to do this creating a couple motion tweens if possible.
More Details:
Below is what my symbol looks like (just with a bit more color). The symbol does a little 3D rotation and then flies away, it's just for something like a scoreboard within the app.
My input is String formated as the following:
3/4/2010 10:40:01 AM
3/4/2010 10:38:31 AM
My code is:
DateFormat dateFormat = new SimpleDateFormat("dd/mm/yyyy hh:mm:ss aa");
try
{
Date today = dateFormat.parse(time);
System.out.println("Date Time : " + today);
}
catch (ParseException e)
{
e.printStackTrace();
}
the output is:
Sun Jan 03 10:38:31 AST 2010
Sun Jan 03 10:40:01 AST 2010
I'm not sure from where the day (Sun) came from? or (AST)? and why the date is wrong? I just wanted to keep the same format of the original String date and make it into a Date object.
I'm using Netbeans 6.8 Mac version.
I have this code in Python
inputted = input("Enter in something: ")
print("Input is {0}, including the return".format(inputted))
that outputs
Enter in something: something
Input is something
, including the newline
I am not sure what is happening; if I use variables that don't depend on user input, I do not get the newline after formatting with the variable. I suspect Python might be taking in the newline as input when I hit return.
How can I make it so that the input does not include any newlines so that I may compare it to other strings/characters? (e.g. something == 'a')
I am using the PHP library tools on a we hosting service( with cURL enabled). I have so far tried 2 tools but I cant get the output of my code to print to the screen.
http://github.com/jdp/twitterlibphp - PHP library
Sample code -
<?php
require("twitter.lib.php");
$twitter = new Twitter("xxxx", "xxxxx");
$public_timeline = $twitter->getPublicTimeline();
echo'<pre>';
print_r( $public_timeline );
echo'</pre>';
?>
I don't get any output. What can be the problem? Do I need to install any modules or packages? Please Help
I can't figure out why, but when I print this form in IE7, the first page's content gets aligned to the bottom of the page. I am calling page-break-after:always on the table element that shows the data on the first page. Any ideas?
Hello,
I'm curious, whether there is any way to print formated numpy.arrays, e.g., in the way similar to this:
x = 1.23456
print '%.3f' % x
If I want to print the numpy.array of floats, it prints several decimals, often in 'scientific' format, which is rather hard to read even for low-dimensional arrays. However, numpy.array apparently has to be printed as a string, i.e., with %s. Is there any solution ready for this purpose? Many thanks in advance :-)
Hello,
From a MySQL table called "submission" containing the fields "loginid, submissionid, title, url, datesubmitted, displayurl", I would like to print an HTML table thats contains all "title" and corresponding "datesubmitted" where "loginid" equals "$profile." The code I am trying to use is below. It isn't working. Any ideas why it isn't working?
Thanks in advance,
John
$profile = $_GET['profile'];
$sqlStr = "SELECT loginid, submissionid, title, url, datesubmitted, displayurl
FROM submission
WHERE loginid = $profile
ORDER BY datesubmitted DESC";
$result = mysql_query($sqlStr);
$arr = array();
echo "<table class=\"samplesrec\">";
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td class="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2">'.$row["datesubmitted"].'</a></td>';
echo '</tr>';
}
echo "</table>";
A point in 3-d is defined by (x,y,z). Distance d between any two points (X,Y,Z) and (x,y,z) is d= Sqrt[(X-x)^2 + (Y-y)^2 + (Z-z)^2].
Now there are a million entries in a file, each entry is some point in space, in no specific order. Given any point (a,b,c) find the nearest 10 points to it. How would you store the million points and how would you retrieve those 10 points from that data structure.
I try to display thanks to vtk (python wrapper) several glyphs in a scene with each their own colour and rotation. Unfortunately, just the rotation (using vtkTensorGlyph) is taken in consideration by vtk. Reversely, just color is taken in consideration when I use a vtkGlyph3D.
Here is a ready to use piece of code with a vtkTensorGlyph. Each cube should have a random color but there all will be in the same color. I read and read again the doc of vtk but I found no solution.
Thanks in advance for any idea
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
import scipy.linalg as sc
import random as ra
import numpy as np
import itertools
points = vtk.vtk.vtkPoints() # where to locate each glyph in the scene
tensors = vtk.vtkDoubleArray() # rotation for each glyph
tensors.SetNumberOfComponents(9)
colors = vtk.vtkUnsignedCharArray() # should be the color for each glyph
colors.SetNumberOfComponents(3)
# let's make 10 cubes in the scene
for i in range(0, 50, 5):
points.InsertNextPoint(i, i, i) # position of a glyph
colors.InsertNextTuple3(ra.randint(0, 255), ra.randint(0, 255), ra.randint(0, 255) ) # pick random color
rot = list(itertools.chain(*np.reshape(sc.orth(np.random.rand(3, 3)).transpose(), (1, 9)).tolist())) # random rotation matrix (row major)
tensors.InsertNextTuple9(*rot)
polydata = vtk.vtkPolyData() # create the polydatas
polydata.SetPoints(points)
polydata.GetPointData().SetTensors(tensors)
polydata.GetPointData().SetScalars(colors)
cubeSource = vtk.vtkCubeSource()
cubeSource.Update()
glyphTensor = vtk.vtkTensorGlyph()
glyphTensor.SetColorModeToScalars() # is it really work ?
try:
glyphTensor.SetInput(polydata)
except AttributeError:
glyphTensor.SetInputData(polydata)
glyphTensor.SetSourceConnection(cubeSource.GetOutputPort())
glyphTensor.ColorGlyphsOn() # should not color all cubes independently ?
glyphTensor.ThreeGlyphsOff()
glyphTensor.ExtractEigenvaluesOff()
glyphTensor.Update()
# next is usual vtk code
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(glyphTensor.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
ren = vtk.vtkRenderer()
ren.SetBackground(0.2, 0.5, 0.3)
ren.AddActor(actor)
renwin = vtk.vtkRenderWindow()
renwin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())
iren.SetRenderWindow(renwin)
renwin.Render()
iren.Initialize()
renwin.Render()
iren.Start()
I want to print the execution time taken for each individual ANT target and its dependent targets.
<target name="target1" depends="target2, target3">
....
</target>
When run should show following output
Target 2 - x seconds
Target 3 - y seconds
Target 1 - z seconds
Any suggestions on how to achieve this?
I have a class like this with a bunch of properties:
class ClassName
{
string Name {get; set;}
int Age {get; set;}
DateTime BirthDate {get; set;}
}
I would like to print the name of the property and it's value using the value's ToString() method and the Property's name like this:
ClassName cn = new ClassName() {Name = "Mark", Age = 428, BirthData = DateTime.Now}
cn.MethodToPrint();
// Output
// Name = Mark, Age = 428, BirthDate = 12/30/2010 09:20:23 PM
Reflection is perfectly okay, in fact I think it is probably required. I'd also be neat if it could somehow work on any class through some sort of inheritance. I'm using 4.0 if that matters.