instruction
stringlengths 27
22.5k
| chosen
stringlengths 27
28.2k
| rejected
stringlengths 19
24.9k
| __index_level_0__
int64 0
10k
|
|---|---|---|---|
<p>As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.</p>
<p>I know that technically this would be an integration test (not a unit test), but I want to find out the best strategies for the following:</p>
<ol>
<li>Testing queries. </li>
<li>Testing inserts. How do I know that the insert that has gone wrong if it fails? I can test it by inserting and then querying, but how can I know that the query wasn't wrong? </li>
<li>Testing updates and deletes -- same as testing inserts</li>
</ol>
<p>What are the best practices for doing these?</p>
<hr>
<p>Regarding testing SQL: I am aware that this could be done, but if I use an O/R Mapper like NHibernate, it attaches some naming warts in the aliases used for the output queries, and as that is somewhat unpredictable I'm not sure I could test for that.</p>
<p>Should I just, abandon everything and simply trust NHibernate? I'm not sure that's prudent.</p>
|
<p>Look into DB Unit. It is a Java library, but there must be a C# equivalent. It lets you prepare the database with a set of data so that you know what is in the database, then you can interface with DB Unit to see what is in the database. It can run against many database systems, so you can use your actual database setup, or use something else, like HSQL in Java (a Java database implementation with an in memory option).</p>
<p>If you want to test that your code is using the database properly (which you most likely should be doing), then this is the way to go to isolate each test and ensure the database has expected data prepared.</p>
|
<p>I would also mock the database, and check that the queries are what you expected. There is the risk that the test checks the wrong sql, but this would be detected in the integration tests</p>
| 2,426
|
<p>The Recent Projects panel on the Start Page of VS2008 Professional doesn't appear to work, and constantly remains empty.</p>
<p>I've noticed this on 3 of our developers VS2008 installations, in fact all the installations that weren't updated from 2005 but installed from scratch. I generally treat this as a bit of a curiosity, but now I have a new laptop and fresh install of VS2008, it's also happening to me, and I've upgraded the phenomena from a curio to an annoyance.</p>
<p>Anyone know if this is a bug or if there is a setting I'm missing somewhere.</p>
<p>Thanks</p>
<p><strong>EDIT</strong> Thanks, but Tools | Options | Environment | General | "items shown in recently used lists" was and is set to 6 by default</p>
|
<p>Is Tools | Options | Environment | General | "items shown in recently used lists" set to a number greater than 0?</p>
|
<p>Is Tools | Options | Environment | General | "items shown in recently used lists" set to a number greater than 0?</p>
| 8,271
|
<p>I've had my printer for almost a year now.</p>
<p>Is there something I should be doing to maintain the motors?</p>
|
<p>The stepper motor itself does not. You may want to inspect the motors for debris or dust.</p>
<p>Depending on your configuration you may want to check on parts of your printer that connect to your stepper motor such as shaft couplings, pulleys, lead screws/threaded rods and belts. The stepper motor wires should occasionally be inspected for wear and strain.</p>
|
<p>No, stepper motors do not require maintenance. They are a brushless kind of motor, so they do not have brushes that need to be replaced.</p>
| 113
|
<p>I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects. </p>
<p>Ideally, this will cover single inheritance, multiple inheritance, and virtual inheritance.</p>
<p>References to external documentation would also be appreciated</p>
<p>Documentation of GCC 4.0x class layout is <a href="http://www.cse.wustl.edu/~mdeters/seminar/fall2005/mi.html#virtual" rel="noreferrer">here</a> and the Itanium, and more broadly GNU, ABI layout documents are <a href="http://www.codesourcery.com/public/cxx-abi/abi.html#general" rel="noreferrer">here</a>. </p>
|
<p>A virtual table is generally treated as an array of function pointers, although compilers are free to put data pointers (in MI and VI scenarios, or to typeinfos), integers (for fixups), or sentinel elements (such as NULL pointers) into it as well. The layout is generally compiler-specific (or ABI-specific where multiple C++ compilers share an ABI), but stable provided the classes being compiled have stable interfaces (otherwise you'd have to recompile your code all the time, and that's a drag). There are also additional tables that are needed to handle corner cases involving virtual and multiple inheritance, and to make sure that virtual calls during derived class construction behave as the Standard says they should under those circumstances (those are what the VTTs and construction tables in the output below are for).</p>
<p>As to the specific case of GCC 4.x: the <code>-fdump-class-hierarchy</code> switch indeed acts as described (and then some). I tested it on <a href="http://coliru.stacked-crooked.com/a/16d53eb062d38bec" rel="noreferrer">Coliru</a> using the sample code below:</p>
<pre><code>struct Base
{
virtual ~Base() {}
virtual void f() = 0;
};
struct OtherBase
{
virtual ~OtherBase() {}
virtual void g() {}
};
struct Derived: public Base
{
virtual ~Derived() {}
virtual void f() {}
};
struct MultiplyDerived: public Base, public OtherBase
{
virtual ~MultiplyDerived() {}
virtual void f() {}
virtual void g() {}
};
struct OtherDerived: public Base
{
virtual ~OtherDerived() {}
virtual void f() {}
};
struct DiamondDerived: public Derived, public OtherDerived
{
virtual ~DiamondDerived() {}
virtual void f() {}
};
struct VirtuallyDerived: virtual public Base
{
virtual ~VirtuallyDerived() {}
virtual void f() {}
};
struct OtherVirtuallyDerived: virtual public Base
{
virtual ~OtherVirtuallyDerived() {}
virtual void f() {}
};
struct VirtuallyDiamondDerived: public VirtuallyDerived, public OtherVirtuallyDerived
{
virtual ~VirtuallyDiamondDerived() {}
virtual void f() {}
};
struct DoublyVirtuallyDiamondDerived: virtual public VirtuallyDerived, virtual public OtherVirtuallyDerived
{
virtual ~DoublyVirtuallyDiamondDerived() {}
virtual void f() {}
};
struct MixedVirtuallyDerived: virtual public Base, public OtherBase
{
virtual ~MixedVirtuallyDerived() {}
};
struct MixedVirtuallyDiamondDerived: public VirtuallyDerived, public MixedVirtuallyDerived
{
virtual ~MixedVirtuallyDiamondDerived() {}
virtual void f() {}
virtual void g() {}
};
struct VirtuallyMultiplyDerived: virtual public Base, virtual public OtherBase
{
virtual ~VirtuallyMultiplyDerived() {}
};
struct OtherVirtuallyMultiplyDerived: virtual public Base, virtual public OtherBase
{
virtual ~OtherVirtuallyMultiplyDerived() {}
};
struct MultiplyVirtuallyDiamondDerived: public VirtuallyMultiplyDerived, public OtherVirtuallyMultiplyDerived
{
virtual ~MultiplyVirtuallyDiamondDerived() {}
virtual void f() {}
virtual void g() {}
};
</code></pre>
<p>and received from G++ (mangled name guide: TI's are typeinfos, TV's are vtables, and Th's and Tv's are thunks used to make correct virtual calls in the presence of multiple and/or virtual inheritance):</p>
<pre>
Vtable for Base
Base::_ZTV4Base: 5u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI4Base)
16 0u
24 0u
32 (int (*)(...))__cxa_pure_virtual
Class Base
size=8 align=8
base size=8 base align=8
Base (0x0x7fd42c0355a0) 0 nearly-empty
vptr=((& Base::_ZTV4Base) + 16u)
Vtable for OtherBase
OtherBase::_ZTV9OtherBase: 5u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI9OtherBase)
16 (int (*)(...))OtherBase::~OtherBase
24 (int (*)(...))OtherBase::~OtherBase
32 (int (*)(...))OtherBase::g
Class OtherBase
size=8 align=8
base size=8 base align=8
OtherBase (0x0x7fd42c035600) 0 nearly-empty
vptr=((& OtherBase::_ZTV9OtherBase) + 16u)
Vtable for Derived
Derived::_ZTV7Derived: 5u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI7Derived)
16 (int (*)(...))Derived::~Derived
24 (int (*)(...))Derived::~Derived
32 (int (*)(...))Derived::f
Class Derived
size=8 align=8
base size=8 base align=8
Derived (0x0x7fd42c02d138) 0 nearly-empty
vptr=((& Derived::_ZTV7Derived) + 16u)
Base (0x0x7fd42c035660) 0 nearly-empty
primary-for Derived (0x0x7fd42c02d138)
Vtable for MultiplyDerived
MultiplyDerived::_ZTV15MultiplyDerived: 11u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI15MultiplyDerived)
16 (int (*)(...))MultiplyDerived::~MultiplyDerived
24 (int (*)(...))MultiplyDerived::~MultiplyDerived
32 (int (*)(...))MultiplyDerived::f
40 (int (*)(...))MultiplyDerived::g
48 (int (*)(...))-8
56 (int (*)(...))(& _ZTI15MultiplyDerived)
64 (int (*)(...))MultiplyDerived::_ZThn8_N15MultiplyDerivedD1Ev
72 (int (*)(...))MultiplyDerived::_ZThn8_N15MultiplyDerivedD0Ev
80 (int (*)(...))MultiplyDerived::_ZThn8_N15MultiplyDerived1gEv
Class MultiplyDerived
size=16 align=8
base size=16 base align=8
MultiplyDerived (0x0x7fd42c04aaf0) 0
vptr=((& MultiplyDerived::_ZTV15MultiplyDerived) + 16u)
Base (0x0x7fd42c0356c0) 0 nearly-empty
primary-for MultiplyDerived (0x0x7fd42c04aaf0)
OtherBase (0x0x7fd42c035720) 8 nearly-empty
vptr=((& MultiplyDerived::_ZTV15MultiplyDerived) + 64u)
Vtable for OtherDerived
OtherDerived::_ZTV12OtherDerived: 5u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI12OtherDerived)
16 (int (*)(...))OtherDerived::~OtherDerived
24 (int (*)(...))OtherDerived::~OtherDerived
32 (int (*)(...))OtherDerived::f
Class OtherDerived
size=8 align=8
base size=8 base align=8
OtherDerived (0x0x7fd42c02d1a0) 0 nearly-empty
vptr=((& OtherDerived::_ZTV12OtherDerived) + 16u)
Base (0x0x7fd42c035780) 0 nearly-empty
primary-for OtherDerived (0x0x7fd42c02d1a0)
Vtable for DiamondDerived
DiamondDerived::_ZTV14DiamondDerived: 10u entries
0 (int (*)(...))0
8 (int (*)(...))(& _ZTI14DiamondDerived)
16 (int (*)(...))DiamondDerived::~DiamondDerived
24 (int (*)(...))DiamondDerived::~DiamondDerived
32 (int (*)(...))DiamondDerived::f
40 (int (*)(...))-8
48 (int (*)(...))(& _ZTI14DiamondDerived)
56 (int (*)(...))DiamondDerived::_ZThn8_N14DiamondDerivedD1Ev
64 (int (*)(...))DiamondDerived::_ZThn8_N14DiamondDerivedD0Ev
72 (int (*)(...))DiamondDerived::_ZThn8_N14DiamondDerived1fEv
Class DiamondDerived
size=16 align=8
base size=16 base align=8
DiamondDerived (0x0x7fd42c0625b0) 0
vptr=((& DiamondDerived::_ZTV14DiamondDerived) + 16u)
Derived (0x0x7fd42c02d208) 0 nearly-empty
primary-for DiamondDerived (0x0x7fd42c0625b0)
Base (0x0x7fd42c0357e0) 0 nearly-empty
primary-for Derived (0x0x7fd42c02d208)
OtherDerived (0x0x7fd42c02d270) 8 nearly-empty
vptr=((& DiamondDerived::_ZTV14DiamondDerived) + 56u)
Base (0x0x7fd42c035840) 8 nearly-empty
primary-for OtherDerived (0x0x7fd42c02d270)
Vtable for VirtuallyDerived
VirtuallyDerived::_ZTV16VirtuallyDerived: 8u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI16VirtuallyDerived)
40 (int (*)(...))VirtuallyDerived::~VirtuallyDerived
48 (int (*)(...))VirtuallyDerived::~VirtuallyDerived
56 (int (*)(...))VirtuallyDerived::f
VTT for VirtuallyDerived
VirtuallyDerived::_ZTT16VirtuallyDerived: 2u entries
0 ((& VirtuallyDerived::_ZTV16VirtuallyDerived) + 40u)
8 ((& VirtuallyDerived::_ZTV16VirtuallyDerived) + 40u)
Class VirtuallyDerived
size=8 align=8
base size=8 base align=8
VirtuallyDerived (0x0x7fd42c02d2d8) 0 nearly-empty
vptridx=0u vptr=((& VirtuallyDerived::_ZTV16VirtuallyDerived) + 40u)
Base (0x0x7fd42c0358a0) 0 nearly-empty virtual
primary-for VirtuallyDerived (0x0x7fd42c02d2d8)
vptridx=8u vbaseoffset=-40
Vtable for OtherVirtuallyDerived
OtherVirtuallyDerived::_ZTV21OtherVirtuallyDerived: 8u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI21OtherVirtuallyDerived)
40 (int (*)(...))OtherVirtuallyDerived::~OtherVirtuallyDerived
48 (int (*)(...))OtherVirtuallyDerived::~OtherVirtuallyDerived
56 (int (*)(...))OtherVirtuallyDerived::f
VTT for OtherVirtuallyDerived
OtherVirtuallyDerived::_ZTT21OtherVirtuallyDerived: 2u entries
0 ((& OtherVirtuallyDerived::_ZTV21OtherVirtuallyDerived) + 40u)
8 ((& OtherVirtuallyDerived::_ZTV21OtherVirtuallyDerived) + 40u)
Class OtherVirtuallyDerived
size=8 align=8
base size=8 base align=8
OtherVirtuallyDerived (0x0x7fd42c02d340) 0 nearly-empty
vptridx=0u vptr=((& OtherVirtuallyDerived::_ZTV21OtherVirtuallyDerived) + 40u)
Base (0x0x7fd42c035900) 0 nearly-empty virtual
primary-for OtherVirtuallyDerived (0x0x7fd42c02d340)
vptridx=8u vbaseoffset=-40
Vtable for VirtuallyDiamondDerived
VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived: 16u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI23VirtuallyDiamondDerived)
40 (int (*)(...))VirtuallyDiamondDerived::~VirtuallyDiamondDerived
48 (int (*)(...))VirtuallyDiamondDerived::~VirtuallyDiamondDerived
56 (int (*)(...))VirtuallyDiamondDerived::f
64 18446744073709551608u
72 18446744073709551608u
80 18446744073709551608u
88 (int (*)(...))-8
96 (int (*)(...))(& _ZTI23VirtuallyDiamondDerived)
104 (int (*)(...))VirtuallyDiamondDerived::_ZThn8_N23VirtuallyDiamondDerivedD1Ev
112 (int (*)(...))VirtuallyDiamondDerived::_ZThn8_N23VirtuallyDiamondDerivedD0Ev
120 (int (*)(...))VirtuallyDiamondDerived::_ZThn8_N23VirtuallyDiamondDerived1fEv
Construction vtable for VirtuallyDerived (0x0x7fd42c02d3a8 instance) in VirtuallyDiamondDerived
VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived0_16VirtuallyDerived: 8u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI16VirtuallyDerived)
40 0u
48 0u
56 (int (*)(...))VirtuallyDerived::f
Construction vtable for OtherVirtuallyDerived (0x0x7fd42c02d410 instance) in VirtuallyDiamondDerived
VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived8_21OtherVirtuallyDerived: 15u entries
0 18446744073709551608u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI21OtherVirtuallyDerived)
40 0u
48 0u
56 (int (*)(...))OtherVirtuallyDerived::f
64 8u
72 8u
80 (int (*)(...))8
88 (int (*)(...))(& _ZTI21OtherVirtuallyDerived)
96 0u
104 0u
112 (int (*)(...))OtherVirtuallyDerived::_ZTv0_n32_N21OtherVirtuallyDerived1fEv
VTT for VirtuallyDiamondDerived
VirtuallyDiamondDerived::_ZTT23VirtuallyDiamondDerived: 7u entries
0 ((& VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived) + 40u)
8 ((& VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
16 ((& VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
24 ((& VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived8_21OtherVirtuallyDerived) + 40u)
32 ((& VirtuallyDiamondDerived::_ZTC23VirtuallyDiamondDerived8_21OtherVirtuallyDerived) + 96u)
40 ((& VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived) + 40u)
48 ((& VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived) + 104u)
Class VirtuallyDiamondDerived
size=16 align=8
base size=16 base align=8
VirtuallyDiamondDerived (0x0x7fd42c07e460) 0
vptridx=0u vptr=((& VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived) + 40u)
VirtuallyDerived (0x0x7fd42c02d3a8) 0 nearly-empty
primary-for VirtuallyDiamondDerived (0x0x7fd42c07e460)
subvttidx=8u
Base (0x0x7fd42c035960) 0 nearly-empty virtual
primary-for VirtuallyDerived (0x0x7fd42c02d3a8)
vptridx=40u vbaseoffset=-40
OtherVirtuallyDerived (0x0x7fd42c02d410) 8 nearly-empty
lost-primary
subvttidx=24u vptridx=48u vptr=((& VirtuallyDiamondDerived::_ZTV23VirtuallyDiamondDerived) + 104u)
Base (0x0x7fd42c035960) alternative-path
Vtable for DoublyVirtuallyDiamondDerived
DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived: 18u entries
0 8u
8 0u
16 0u
24 0u
32 0u
40 (int (*)(...))0
48 (int (*)(...))(& _ZTI29DoublyVirtuallyDiamondDerived)
56 (int (*)(...))DoublyVirtuallyDiamondDerived::~DoublyVirtuallyDiamondDerived
64 (int (*)(...))DoublyVirtuallyDiamondDerived::~DoublyVirtuallyDiamondDerived
72 (int (*)(...))DoublyVirtuallyDiamondDerived::f
80 18446744073709551608u
88 18446744073709551608u
96 18446744073709551608u
104 (int (*)(...))-8
112 (int (*)(...))(& _ZTI29DoublyVirtuallyDiamondDerived)
120 (int (*)(...))DoublyVirtuallyDiamondDerived::_ZTv0_n24_N29DoublyVirtuallyDiamondDerivedD1Ev
128 (int (*)(...))DoublyVirtuallyDiamondDerived::_ZTv0_n24_N29DoublyVirtuallyDiamondDerivedD0Ev
136 (int (*)(...))DoublyVirtuallyDiamondDerived::_ZTv0_n32_N29DoublyVirtuallyDiamondDerived1fEv
Construction vtable for VirtuallyDerived in DoublyVirtuallyDiamondDerived
DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived0_16VirtuallyDerived: 8u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI16VirtuallyDerived)
40 0u
48 0u
56 (int (*)(...))VirtuallyDerived::f
Construction vtable for OtherVirtuallyDerived in DoublyVirtuallyDiamondDerived
DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived8_21OtherVirtuallyDerived: 15u entries
0 18446744073709551608u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI21OtherVirtuallyDerived)
40 0u
48 0u
56 (int (*)(...))OtherVirtuallyDerived::f
64 8u
72 8u
80 (int (*)(...))8
88 (int (*)(...))(& _ZTI21OtherVirtuallyDerived)
96 0u
104 0u
112 (int (*)(...))OtherVirtuallyDerived::_ZTv0_n32_N21OtherVirtuallyDerived1fEv
VTT for DoublyVirtuallyDiamondDerived
DoublyVirtuallyDiamondDerived::_ZTT29DoublyVirtuallyDiamondDerived: 8u entries
0 ((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 56u)
8 ((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 56u)
16 ((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 56u)
24 ((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 120u)
32 ((& DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
40 ((& DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
48 ((& DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived8_21OtherVirtuallyDerived) + 40u)
56 ((& DoublyVirtuallyDiamondDerived::_ZTC29DoublyVirtuallyDiamondDerived8_21OtherVirtuallyDerived) + 96u)
Class DoublyVirtuallyDiamondDerived
size=16 align=8
base size=8 base align=8
DoublyVirtuallyDiamondDerived (0x0x7fd42c07ea10) 0 nearly-empty
vptridx=0u vptr=((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 56u)
VirtuallyDerived (0x0x7fd42c02d478) 0 nearly-empty virtual
primary-for DoublyVirtuallyDiamondDerived (0x0x7fd42c07ea10)
subvttidx=32u vptridx=8u vbaseoffset=-48
Base (0x0x7fd42c035a80) 0 nearly-empty virtual
primary-for VirtuallyDerived (0x0x7fd42c02d478)
vptridx=16u vbaseoffset=-40
OtherVirtuallyDerived (0x0x7fd42c02d4e0) 8 nearly-empty virtual
lost-primary
subvttidx=48u vptridx=24u vbaseoffset=-56 vptr=((& DoublyVirtuallyDiamondDerived::_ZTV29DoublyVirtuallyDiamondDerived) + 120u)
Base (0x0x7fd42c035a80) alternative-path
Vtable for MixedVirtuallyDerived
MixedVirtuallyDerived::_ZTV21MixedVirtuallyDerived: 13u entries
0 8u
8 (int (*)(...))0
16 (int (*)(...))(& _ZTI21MixedVirtuallyDerived)
24 0u
32 0u
40 (int (*)(...))OtherBase::g
48 0u
56 18446744073709551608u
64 (int (*)(...))-8
72 (int (*)(...))(& _ZTI21MixedVirtuallyDerived)
80 0u
88 0u
96 (int (*)(...))__cxa_pure_virtual
VTT for MixedVirtuallyDerived
MixedVirtuallyDerived::_ZTT21MixedVirtuallyDerived: 2u entries
0 ((& MixedVirtuallyDerived::_ZTV21MixedVirtuallyDerived) + 24u)
8 ((& MixedVirtuallyDerived::_ZTV21MixedVirtuallyDerived) + 80u)
Class MixedVirtuallyDerived
size=16 align=8
base size=8 base align=8
MixedVirtuallyDerived (0x0x7fd42c07eee0) 0 nearly-empty
vptridx=0u vptr=((& MixedVirtuallyDerived::_ZTV21MixedVirtuallyDerived) + 24u)
Base (0x0x7fd42c035c60) 8 nearly-empty virtual
vptridx=8u vbaseoffset=-24 vptr=((& MixedVirtuallyDerived::_ZTV21MixedVirtuallyDerived) + 80u)
OtherBase (0x0x7fd42c035cc0) 0 nearly-empty
primary-for MixedVirtuallyDerived (0x0x7fd42c07eee0)
Vtable for MixedVirtuallyDiamondDerived
MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived: 15u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI28MixedVirtuallyDiamondDerived)
40 (int (*)(...))MixedVirtuallyDiamondDerived::~MixedVirtuallyDiamondDerived
48 (int (*)(...))MixedVirtuallyDiamondDerived::~MixedVirtuallyDiamondDerived
56 (int (*)(...))MixedVirtuallyDiamondDerived::f
64 (int (*)(...))MixedVirtuallyDiamondDerived::g
72 18446744073709551608u
80 (int (*)(...))-8
88 (int (*)(...))(& _ZTI28MixedVirtuallyDiamondDerived)
96 (int (*)(...))MixedVirtuallyDiamondDerived::_ZThn8_N28MixedVirtuallyDiamondDerivedD1Ev
104 (int (*)(...))MixedVirtuallyDiamondDerived::_ZThn8_N28MixedVirtuallyDiamondDerivedD0Ev
112 (int (*)(...))MixedVirtuallyDiamondDerived::_ZThn8_N28MixedVirtuallyDiamondDerived1gEv
Construction vtable for VirtuallyDerived (0x0x7fd42c02d750 instance) in MixedVirtuallyDiamondDerived
MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived0_16VirtuallyDerived: 8u entries
0 0u
8 0u
16 0u
24 (int (*)(...))0
32 (int (*)(...))(& _ZTI16VirtuallyDerived)
40 0u
48 0u
56 (int (*)(...))VirtuallyDerived::f
Construction vtable for MixedVirtuallyDerived (0x0x7fd42c0b5380 instance) in MixedVirtuallyDiamondDerived
MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived8_21MixedVirtuallyDerived: 13u entries
0 18446744073709551608u
8 (int (*)(...))0
16 (int (*)(...))(& _ZTI21MixedVirtuallyDerived)
24 0u
32 0u
40 (int (*)(...))OtherBase::g
48 0u
56 8u
64 (int (*)(...))8
72 (int (*)(...))(& _ZTI21MixedVirtuallyDerived)
80 0u
88 0u
96 (int (*)(...))__cxa_pure_virtual
VTT for MixedVirtuallyDiamondDerived
MixedVirtuallyDiamondDerived::_ZTT28MixedVirtuallyDiamondDerived: 7u entries
0 ((& MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived) + 40u)
8 ((& MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
16 ((& MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived0_16VirtuallyDerived) + 40u)
24 ((& MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived8_21MixedVirtuallyDerived) + 24u)
32 ((& MixedVirtuallyDiamondDerived::_ZTC28MixedVirtuallyDiamondDerived8_21MixedVirtuallyDerived) + 80u)
40 ((& MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived) + 40u)
48 ((& MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived) + 96u)
Class MixedVirtuallyDiamondDerived
size=16 align=8
base size=16 base align=8
MixedVirtuallyDiamondDerived (0x0x7fd42c0b5310) 0
vptridx=0u vptr=((& MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived) + 40u)
VirtuallyDerived (0x0x7fd42c02d750) 0 nearly-empty
primary-for MixedVirtuallyDiamondDerived (0x0x7fd42c0b5310)
subvttidx=8u
Base (0x0x7fd42c035d20) 0 nearly-empty virtual
primary-for VirtuallyDerived (0x0x7fd42c02d750)
vptridx=40u vbaseoffset=-40
MixedVirtuallyDerived (0x0x7fd42c0b5380) 8 nearly-empty
subvttidx=24u vptridx=48u vptr=((& MixedVirtuallyDiamondDerived::_ZTV28MixedVirtuallyDiamondDerived) + 96u)
Base (0x0x7fd42c035d20) alternative-path
OtherBase (0x0x7fd42c035d80) 8 nearly-empty
primary-for MixedVirtuallyDerived (0x0x7fd42c0b5380)
Vtable for VirtuallyMultiplyDerived
VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived: 16u entries
0 8u
8 0u
16 0u
24 0u
32 (int (*)(...))0
40 (int (*)(...))(& _ZTI24VirtuallyMultiplyDerived)
48 0u
56 0u
64 (int (*)(...))__cxa_pure_virtual
72 0u
80 18446744073709551608u
88 (int (*)(...))-8
96 (int (*)(...))(& _ZTI24VirtuallyMultiplyDerived)
104 0u
112 0u
120 (int (*)(...))OtherBase::g
VTT for VirtuallyMultiplyDerived
VirtuallyMultiplyDerived::_ZTT24VirtuallyMultiplyDerived: 3u entries
0 ((& VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived) + 48u)
8 ((& VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived) + 48u)
16 ((& VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived) + 104u)
Class VirtuallyMultiplyDerived
size=16 align=8
base size=8 base align=8
VirtuallyMultiplyDerived (0x0x7fd42c0b59a0) 0 nearly-empty
vptridx=0u vptr=((& VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived) + 48u)
Base (0x0x7fd42c035e40) 0 nearly-empty virtual
primary-for VirtuallyMultiplyDerived (0x0x7fd42c0b59a0)
vptridx=8u vbaseoffset=-40
OtherBase (0x0x7fd42c035ea0) 8 nearly-empty virtual
vptridx=16u vbaseoffset=-48 vptr=((& VirtuallyMultiplyDerived::_ZTV24VirtuallyMultiplyDerived) + 104u)
Vtable for OtherVirtuallyMultiplyDerived
OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived: 16u entries
0 8u
8 0u
16 0u
24 0u
32 (int (*)(...))0
40 (int (*)(...))(& _ZTI29OtherVirtuallyMultiplyDerived)
48 0u
56 0u
64 (int (*)(...))__cxa_pure_virtual
72 0u
80 18446744073709551608u
88 (int (*)(...))-8
96 (int (*)(...))(& _ZTI29OtherVirtuallyMultiplyDerived)
104 0u
112 0u
120 (int (*)(...))OtherBase::g
VTT for OtherVirtuallyMultiplyDerived
OtherVirtuallyMultiplyDerived::_ZTT29OtherVirtuallyMultiplyDerived: 3u entries
0 ((& OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived) + 48u)
8 ((& OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived) + 48u)
16 ((& OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived) + 104u)
Class OtherVirtuallyMultiplyDerived
size=16 align=8
base size=8 base align=8
OtherVirtuallyMultiplyDerived (0x0x7fd42c0b5d90) 0 nearly-empty
vptridx=0u vptr=((& OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived) + 48u)
Base (0x0x7fd42c035f00) 0 nearly-empty virtual
primary-for OtherVirtuallyMultiplyDerived (0x0x7fd42c0b5d90)
vptridx=8u vbaseoffset=-40
OtherBase (0x0x7fd42c035f60) 8 nearly-empty virtual
vptridx=16u vbaseoffset=-48 vptr=((& OtherVirtuallyMultiplyDerived::_ZTV29OtherVirtuallyMultiplyDerived) + 104u)
Vtable for MultiplyVirtuallyDiamondDerived
MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived: 26u entries
0 16u
8 0u
16 0u
24 0u
32 (int (*)(...))0
40 (int (*)(...))(& _ZTI31MultiplyVirtuallyDiamondDerived)
48 (int (*)(...))MultiplyVirtuallyDiamondDerived::~MultiplyVirtuallyDiamondDerived
56 (int (*)(...))MultiplyVirtuallyDiamondDerived::~MultiplyVirtuallyDiamondDerived
64 (int (*)(...))MultiplyVirtuallyDiamondDerived::f
72 (int (*)(...))MultiplyVirtuallyDiamondDerived::g
80 8u
88 18446744073709551608u
96 18446744073709551608u
104 18446744073709551608u
112 (int (*)(...))-8
120 (int (*)(...))(& _ZTI31MultiplyVirtuallyDiamondDerived)
128 (int (*)(...))MultiplyVirtuallyDiamondDerived::_ZThn8_N31MultiplyVirtuallyDiamondDerivedD1Ev
136 (int (*)(...))MultiplyVirtuallyDiamondDerived::_ZThn8_N31MultiplyVirtuallyDiamondDerivedD0Ev
144 0u
152 18446744073709551600u
160 18446744073709551600u
168 (int (*)(...))-16
176 (int (*)(...))(& _ZTI31MultiplyVirtuallyDiamondDerived)
184 (int (*)(...))MultiplyVirtuallyDiamondDerived::_ZTv0_n24_N31MultiplyVirtuallyDiamondDerivedD1Ev
192 (int (*)(...))MultiplyVirtuallyDiamondDerived::_ZTv0_n24_N31MultiplyVirtuallyDiamondDerivedD0Ev
200 (int (*)(...))MultiplyVirtuallyDiamondDerived::_ZTv0_n32_N31MultiplyVirtuallyDiamondDerived1gEv
Construction vtable for VirtuallyMultiplyDerived (0x0x7fd42bcdf230 instance) in MultiplyVirtuallyDiamondDerived
MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived0_24VirtuallyMultiplyDerived: 16u entries
0 16u
8 0u
16 0u
24 0u
32 (int (*)(...))0
40 (int (*)(...))(& _ZTI24VirtuallyMultiplyDerived)
48 0u
56 0u
64 (int (*)(...))__cxa_pure_virtual
72 0u
80 18446744073709551600u
88 (int (*)(...))-16
96 (int (*)(...))(& _ZTI24VirtuallyMultiplyDerived)
104 0u
112 0u
120 (int (*)(...))OtherBase::g
Construction vtable for OtherVirtuallyMultiplyDerived (0x0x7fd42bcdf2a0 instance) in MultiplyVirtuallyDiamondDerived
MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived8_29OtherVirtuallyMultiplyDerived: 23u entries
0 8u
8 18446744073709551608u
16 18446744073709551608u
24 0u
32 (int (*)(...))0
40 (int (*)(...))(& _ZTI29OtherVirtuallyMultiplyDerived)
48 0u
56 0u
64 (int (*)(...))__cxa_pure_virtual
72 0u
80 8u
88 (int (*)(...))8
96 (int (*)(...))(& _ZTI29OtherVirtuallyMultiplyDerived)
104 0u
112 0u
120 (int (*)(...))__cxa_pure_virtual
128 0u
136 18446744073709551608u
144 (int (*)(...))-8
152 (int (*)(...))(& _ZTI29OtherVirtuallyMultiplyDerived)
160 0u
168 0u
176 (int (*)(...))OtherBase::g
VTT for MultiplyVirtuallyDiamondDerived
MultiplyVirtuallyDiamondDerived::_ZTT31MultiplyVirtuallyDiamondDerived: 10u entries
0 ((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 48u)
8 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived0_24VirtuallyMultiplyDerived) + 48u)
16 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived0_24VirtuallyMultiplyDerived) + 48u)
24 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived0_24VirtuallyMultiplyDerived) + 104u)
32 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived8_29OtherVirtuallyMultiplyDerived) + 48u)
40 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived8_29OtherVirtuallyMultiplyDerived) + 104u)
48 ((& MultiplyVirtuallyDiamondDerived::_ZTC31MultiplyVirtuallyDiamondDerived8_29OtherVirtuallyMultiplyDerived) + 160u)
56 ((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 48u)
64 ((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 184u)
72 ((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 128u)
Class MultiplyVirtuallyDiamondDerived
size=24 align=8
base size=16 base align=8
MultiplyVirtuallyDiamondDerived (0x0x7fd42bcdf1c0) 0
vptridx=0u vptr=((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 48u)
VirtuallyMultiplyDerived (0x0x7fd42bcdf230) 0 nearly-empty
primary-for MultiplyVirtuallyDiamondDerived (0x0x7fd42bcdf1c0)
subvttidx=8u
Base (0x0x7fd42bce2000) 0 nearly-empty virtual
primary-for VirtuallyMultiplyDerived (0x0x7fd42bcdf230)
vptridx=56u vbaseoffset=-40
OtherBase (0x0x7fd42bce2060) 16 nearly-empty virtual
vptridx=64u vbaseoffset=-48 vptr=((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 184u)
OtherVirtuallyMultiplyDerived (0x0x7fd42bcdf2a0) 8 nearly-empty
lost-primary
subvttidx=32u vptridx=72u vptr=((& MultiplyVirtuallyDiamondDerived::_ZTV31MultiplyVirtuallyDiamondDerived) + 128u)
Base (0x0x7fd42bce2000) alternative-path
OtherBase (0x0x7fd42bce2060) alternative-path
</pre>
|
<p>Most of the compiler implementations that I have seen just "embed" the base object into the derived object. It becomes irrelevant where the vtable is kept because the relative offset into the object will just be added at compile time as references are evaluated. </p>
<p>Multiple and virtual inheritance are more complicated and can require a different offset depending on what is being accessed. </p>
<p>I highly recommend reading this article on Code Project: <a href="http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible" rel="nofollow">The Impossibly Fast C++ Delegates</a></p>
<p>It brilliantly gives a broad picture of how different compilers handle various aspects of inheritance. Fantastic read if you are interested in the low level workings of different compilers. </p>
<p>Edit: I linked the wrong article over there. Corrected. </p>
| 9,610
|
<p>This is a somewhat low-level question. In x86 assembly there are two SSE instructions: </p>
<blockquote>
<p><code>MOVDQA <i><em>xmmi, m128</em></i></code></p>
</blockquote>
<p>and </p>
<blockquote>
<p><code>MOVNTDQA <i><em>xmmi, m128</em></i></code></p>
</blockquote>
<p>The IA-32 Software Developer's Manual says that the <em>NT</em> in MOVNTDQA stands for <em>Non-Temporal</em>, and that otherwise it's the same as MOVDQA.</p>
<p>My question is, what does <em>Non-Temporal</em> mean? </p>
|
<p>Non-Temporal SSE instructions (MOVNTI, MOVNTQ, etc.), don't follow the normal cache-coherency rules. Therefore non-temporal stores must be followed by an SFENCE instruction in order for their results to be seen by other processors in a timely fashion.</p>
<p>When data is produced and not (immediately) consumed again, the fact that memory store operations read a full cache line first and then modify the cached data is detrimental to performance. This operation pushes data out of the caches which might be needed again in favor of data which will not be used soon. This is especially true for large data structures, like matrices, which are filled and then used later. Before the last element of the matrix is filled the sheer size evicts the first elements, making caching of the writes ineffective.</p>
<p>For this and similar situations, processors provide support for non-temporal write operations. Non-temporal in this context means the data will not be reused soon, so there is no reason to cache it. These non-temporal write operations do not read a cache line and then modify it; instead, the new content is directly written to memory. </p>
<p>Source: <a href="http://lwn.net/Articles/255364/" rel="noreferrer">http://lwn.net/Articles/255364/</a></p>
|
<p>According to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1: Basic Architecture,
"Programming with Intel Streaming SIMD Extensions (Intel SSE)" chapter:</p>
<p><strong>Caching of Temporal vs. Non-Temporal Data</strong></p>
<blockquote>
<p>Data referenced by a program can be temporal (data will be used again) or non-temporal (data will be referenced once and not reused in the immediate future). For example, program code is generally temporal, whereas, multimedia data, such as the display list in a 3-D graphics application, is often non-temporal. To make efficient use of the processor’s caches, it is generally desirable to cache temporal data and not cache non-temporal data. Overloading the processor’s caches with non-temporal data is sometimes referred to as "polluting the caches". The SSE and SSE2 cacheability control instructions enable a program to write non-temporal data to memory in a manner that minimizes pollution of caches.</p>
</blockquote>
<p>Description of non-temporal load and store instructions.
Source: Intel 64 and IA-32 Architectures Software Developer’s Manual, Volume 2: Instruction Set Reference</p>
<p><strong>LOAD (MOVNTDQA—Load Double Quadword Non-Temporal Aligned Hint)</strong></p>
<blockquote>
<p>Loads a double quadword from the source operand (second operand) to the destination operand (first operand) using a non-temporal hint if the memory source is WC (write combining) memory type [...]</p>
<p>[...] the processor does not read the data into the cache hierarchy, nor does it fetch the corresponding cache line from memory into the cache hierarchy.</p>
</blockquote>
<p>Note that, as Peter Cordes comments, it's not useful on normal WB (write-back) memory on current processors because the NT hint is ignored (probably because there are no NT-aware HW prefetchers) and the full strongly-ordered load semantics apply. <code>prefetchnta</code> can be used as a pollution-reducing load from WB memory</p>
<p><strong>STORE (MOVNTDQ—Store Packed Integers Using Non-Temporal Hint)</strong></p>
<blockquote>
<p>Moves the packed integers in the source operand (second operand) to the destination operand (first operand) using a non-temporal hint to prevent caching of the data during the write to memory.</p>
<p>[...] the processor does not write the data into the cache hierarchy, nor does it fetch the corresponding cache line from memory into the cache hierarchy.</p>
</blockquote>
<p>Using the terminology defined in <a href="http://www.hpl.hp.com/techreports/Compaq-DEC/WRL-91-12.pdf" rel="noreferrer">Cache Write Policies and Performance</a>, they can be considered as write-around (no-write-allocate, no-fetch-on-write-miss).</p>
<p>Finally, it may be interesting to review <a href="https://sites.utexas.edu/jdm4372/2018/01/01/notes-on-non-temporal-aka-streaming-stores/" rel="noreferrer">John McAlpin notes about non-temporal stores</a>.</p>
| 5,775
|
<p>This is probably <a href="http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/x13320.html" rel="noreferrer">a complex solution</a>.</p>
<p>I am looking for a simple operator like ">>", but for prepending.</p>
<p>I am afraid it does not exist. I'll have to do something like </p>
<pre>
mv myfile tmp
cat myheader tmp > myfile
</pre>
<p>Anything smarter?</p>
|
<p>This still uses a temp file, but at least it is on one line:</p>
<pre><code>echo "text" | cat - yourfile > /tmp/out && mv /tmp/out yourfile
</code></pre>
<p>Credit: <a href="http://www.cyberciti.biz/faq/bash-prepend-text-lines-to-file/" rel="noreferrer">BASH: Prepend A Text / Lines To a File</a></p>
|
<p>Bah! No one cared to mention about <em>tac</em>.</p>
<pre><code>endor@grid ~ $ tac --help
Usage: tac [OPTION]... [FILE]...
Write each FILE to standard output, last line first.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-b, --before attach the separator before instead of after
-r, --regex interpret the separator as a regular expression
-s, --separator=STRING use STRING as the separator instead of newline
--help display this help and exit
--version output version information and exit
Report tac bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report tac translation bugs to <http://translationproject.org/team/>
</code></pre>
| 7,798
|
<p>I've been having this problem with my delta 3D printer where my nozzle isn't moving flat with my print bed (as if the bed is bent) but I have used the edge of my steel ruler and it seems to be perfectly flat. I have properly leveled my bed with a piece of paper and have checked the whole printer to make sure it's square but the problem continues.</p>
<p>What else could be the problem?</p>
<h3>Addition info (from comments)</h3>
<p>The gap grows and shrinks in a parabolic manner and it makes it impossible to get a good first layer. the printer is a FLsun Delta Kossel. The links don't appear to be loose. Is there a way I could share a video?</p>
<p>Upon further inspection I found a bit of play in one of the links, I tightened the bolt and the play is gone but it didn't fix the problem.</p>
<p>I have been playing around a bit and I found that the nozzle is closer to the bed in the center than it is near the edge.</p>
<p>I did some research and it's a calibration issue but I have no idea how to fix it. Does anyone know a quick and easy way to calibrate a Kossel Delta 3D printer?</p>
|
<p>In an earlier comment you stated that you cannot take it apart. So without taking it apart, you could try to determine the profile the old-fashion way with a piece of cardboard and a short pencil, just cut the rough shape of the rod and place it onto the rod, then take the short pencil and draw the profile onto the cardboard with the pencil parallel to the rod. Measuring the distance from the pencil center to the pencil radius will give you the profile of the rod with that off-set. This technique, or the technique used to create <a href="https://www.youtube.com/watch?v=w9FlfMIMv7Q" rel="nofollow noreferrer">notches in logs</a> for log cabins may be used to find the profile at various sections which have to be entered in a 3D CAD model program and splined/lofted to get the surface of the rod.</p>
<p>Alternatively you could use a profile shape tool carpenters use: <a href="https://i.stack.imgur.com/NZyN8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NZyN8.jpg" alt="enter image description here"></a></p>
|
<p>You could pull it apart and have it 3d scanned if you want to know the exact dimensions. There are companies that can do that for you at a certain price. Our company has used such services in scanning various parts before we obtained our own laser scanning device. </p>
<p>The question is whether you want exactly the same (dimension wise) part (maybe you do for ecstatic reasons) while a part that is a little more beefier would work also.</p>
<p><strong>Edit:</strong>
Although tagged with 3D scanning, the OP did not mention whether he would be able to disassemble the part. 3D scanning is an option when taken apart. Another solution has been posted since.</p>
| 908
|
<p>I am just starting to learn javascript, so I don't have the skills to figure out what I assume is a trivial problem.</p>
<p>I'm working with a Wordpress blog that serves as a FAQ for our community and I am trying to pull together some tools to make managing the comments easier. <a href="https://stackoverflow.com/users/4465/levik">Internet Duct Tape's Greasemonkey tools, like Comment Ninja</a>, are helpful for most of it, but I want to be able to get a list of all the IP addresses that we're getting comments from in order to track trends and so forth.</p>
<p>I just want to be able to select a bunch of text on the comments page and click a bookmarklet (<a href="https://stackoverflow.com/users/8119/jacob">http://bookmarklets.com</a>) in Firefox that pops up a window listing all the IP addresses found in the selection.</p>
<p><strong>Update:</strong></p>
<p>I kind of combined a the answers from <a href="https://stackoverflow.com/users/4465/levik">levik</a> and <a href="https://stackoverflow.com/users/8119/jacob">Jacob</a> to come up with this:</p>
<pre><code>javascript:ipAddresses=document.getSelection().match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g).join("<br>");newWindow=window.open('', 'IP Addresses in Selection', 'innerWidth=200,innerHeight=300,scrollbars');newWindow.document.write(ipAddresses)
</code></pre>
<p>The difference is that instead of an <em>alert</em> message, as in levik's answer, I open a new window similar to Jacob's answer. The <em>alert</em> doesn't provide scroll bars which can be a problem for pages with many IP addresses. However, I needed the list to be vertical, unlike Jacob's solution, so I used the hint from levik's to make a <em><br></em> for the join instead of levik's <em>\n</em>. </p>
<p>Thanks for all the help, guys.</p>
|
<p>In Firefox, you could do something like this:</p>
<pre><code>javascript:alert(
document.getSelection().match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g)
.join("\n"))
</code></pre>
<p>How this works:</p>
<ul>
<li>Gets the selection text from the browser ("document.getSelection()" in FF, in IE it would be "document.selection.createRange().text")</li>
<li>Applies a regular expression to march the IP addresses (as suggested by Muerr) - this results in an array of strings.</li>
<li>Joins this array into one string separated by return characters</li>
<li>Alerts that string</li>
</ul>
<p>The way you get the selection is a little different on IE, but the principle is the same. To get it to be cross-browser, you'd need to check which method is available. You could also do more complicated output (like create a floating DIV and insert all the IPs into it).</p>
|
<p><a href="http://javascript.about.com/library/blip.htm" rel="nofollow noreferrer">Here</a> is a good article on obtaining the IP address of your visitors. You could display this in addition to their comment if you wanted or include it as a label or field in your page so you can reference it later.</p>
| 9,852
|
<p>I have always made a point of writing nice code comments for classes and methods with the C# xml syntax. I always expected to easily be able to export them later on.</p>
<p>Today I actually have to do so, but am having trouble finding out how. Is there something I'm missing? I want to go <em>Menu->Build->Build Code Documentation</em>, but there is no option to do that, there.</p>
|
<p>Actually it's in the project properties. Build tab, Output section, XML documentation file, and enter the filename. It will be built on every build of the project.</p>
<p>After that you can build the actual help with <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E82EA71D-DA89-42EE-A715-696E3A4873B2&displaylang=en" rel="noreferrer">Sandcastle</a>.</p>
|
<p>The original NDoc project (mentioned by others) is dead, but there is a new project called <a href="https://sourceforge.net/projects/ndoc3/" rel="nofollow noreferrer">NDoc3</a>.</p>
<p>NDoc3 supports .NET 2.0 - 3.5. It is currently available as a beta version and worked great for me. I'm not sure if the project is still active - the last beta was release in april 2009.</p>
| 7,498
|
<p>We have a lot of open discussions with potential clients, and they ask frequently about our level of technical expertise, including the scope of work for our current projects. The first thing I do in order to gauge the level of expertise on staff they have now or have previously used is to check for security vulnerabilities like XSS and SQL injection. I have yet to find a potential client who is vulnerable, but I started to wonder, would they actually think this investigation was helpful, or would they think, "um, these guys will trash our site if we don't do business with them." Non-technical folks get scared pretty easily by this stuff, so I'm wondering is this a show of good faith, or a poor business practice?</p>
|
<p>I would say that surprising people by suddenly penetration-testing their software may bother people if simply for the fact that they didn't know ahead of time. I would say if you're going to do this (and I believe it's a good thing to do), inform your clients ahead of time that you're going to do this. If they seem a little distraught by this, tell them the benefits of checking for human error from the attacker's point of view in a controlled environment. After all, even the most securely minded make mistakes: the Debian PRNG vulnerability is a good example of this.</p>
|
<p>I think the problem with this would be, that it would be quite hard to do checks on XSS without messing up their site. Also, things like SQL injection could be quite dangerous. If you stuck with appending selects, you might not have too much of a problem, but then the question is, how do you know it's even executing the injected SQL?</p>
| 7,617
|
<p>In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc.</p>
<p>The problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is still in the process of writing. I have found this to be very problematic, especially if I'm trying to read something like an XML document where the file must have some structure to it which won't exist until it is completed being written.</p>
<p>Does .NET (preferably 2.0) have any way to raise an event after the file becomes accessible, or do I have to constantly try reading the file until it doesn't throw an exception to know it is available?</p>
|
<p>You can use a file system watcher to check when the file has been changed. It only becomes "changed" after whichever program had the file previously closes the file. I know you asked for C#, but my VB.Net is much better. Hope you or someone else can translate.</p>
<p>It tries to open the file, if it isn't available, it adds a watcher, and waits for the file to be changed. After the file is changed, it tries to open again. It throws an exception if it waits more than 120 seconds, because you may get caught in a situation where the file is never released. Also, I decided to add a timeout of waiting for the file change of 5 seconds, in case of the small possibility that the file was closed prior to the actual file watcher being created.</p>
<pre><code> Public Sub WriteToFile(ByVal FilePath As String, ByVal FileName As String, ByVal Data() As Byte)
Dim FileOpen As Boolean
Dim File As System.IO.FileStream = Nothing
Dim StartTime As DateTime
Dim MaxWaitSeconds As Integer = 120
StartTime = DateTime.Now
FileOpen = False
Do
Try
File = New System.IO.FileStream(FilePath & FileName, IO.FileMode.Append)
FileOpen = True
Catch ex As Exception
If DateTime.Now.Subtract(StartTime).TotalSeconds > MaxWaitSeconds Then
Throw New Exception("Waited more than " & MaxWaitSeconds & " To Open File.")
Else
Dim FileWatch As System.IO.FileSystemWatcher
FileWatch = New System.IO.FileSystemWatcher(FilePath, FileName)
FileWatch.WaitForChanged(IO.WatcherChangeTypes.Changed,5000)
End If
FileOpen = False
End Try
Loop While Not FileOpen
If FileOpen Then
File.Write(Data, 0, Data.Length)
File.Close()
End If
End Sub
</code></pre>
|
<p>Not sure if there is a way of an event actually being raised by the standard class, but I eas experiencing similar problems on some recent work I was doing.</p>
<p>In short, I was trying to write to a file that was locked at the time. I ended up wrapping the write method up so it would automatically try the write again in a few ms after..</p>
<p>Thinking out loud, Can you probe the file for a ReadOnly status? May be worth then having a wrapper for file IO which can stack up delegates for pending file operations or something.. Thoughts?</p>
| 4,404
|
<p>OK, here is my problem, without being too specific for reasons of being fired for putting company practices on the internet.</p>
<p>There are spreadsheets made. These are uploaded to the database. I need to filter out duplicates from uploading. The only way to do this is by making sure that for each and every entry that two fields aren't the same as an entry already in the database. As just becasue one field is the same does not mean its a duplicate. There are two specific fields lets call them FLDA and FLDB that both must match up to an entry in the database already. I can filter by one field already. I'm thinking this has to be a subquery but I'm not sure how to apply it.
This is hard to decribe. Just ask if your not sure what I mean.</p>
|
<p>I had a similar problem. My solution was to:</p>
<ol>
<li>import into a staging-table. </li>
<li>delete the duplicates</li>
<li>copy what's left over into the live table</li>
</ol>
<p>It's a little BFI, but it just plain works.</p>
|
<p>How are you loading them into the database? Is this with your own code to read the Excel files? You can <a href="https://stackoverflow.com/questions/15828/reading-excel-files-from-c#15839">read the Excel files using ADO/ADO.NET with the right connection string</a>. Then you could read the data using a query that would weed out the dupes. </p>
| 4,272
|
<p>I just completed my first print on my Ender-3 and when the print finalized itself the nozzle didn't elevate itself to clear away from the piece. I watched as the nozzle slowly lowered itself into my print and destroy it. Here is the gcode generated by Slic3r used:</p>
<pre>
; Filament-specific end gcode
G4 ; wait
M221 S100
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
G91
G1 F1800 E-3
G90
G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif} ; Move print head up
G28 X0 ; home x and y axis
G1 Y180; Remove Print Position
M84 ; disable motors
M300 S2600 P100; Beep
; filament used = 24040.5mm (57.8cm3)
; total filament cost = 0.0
</pre>
<p><a href="https://i.stack.imgur.com/mZncw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/mZncw.jpg" alt="preview of the destruction"></a></p>
|
<p>You are using <strong>incorrect commands</strong> in your end-code for the <strong>incorrect tool</strong> with respect to the print head raise.</p>
<p>Slic3r has no knowledge of the maximum printer height (as in variable <code>max_print_height</code>) because there is <strong>no input field to specify this</strong>, as can be seen in this partial screenshot:</p>
<p><a href="https://i.stack.imgur.com/qPz1z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qPz1z.png" alt="Slic3r print area settings"></a></p>
<p>However, in Slic3r PE (Prusa Edition), there is a possibility to enter such a value, as seen in the following partial screenshot:</p>
<p><a href="https://i.stack.imgur.com/lCHxV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lCHxV.png" alt="Slic3r PE print volume settings"></a></p>
<p>Note that in both editions, the <code>Bed shape</code> interface is equivalent when <code>Set...</code> is pressed:
<a href="https://i.stack.imgur.com/jTLBm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jTLBm.png" alt="Slic3r and Slic3r PE bed area settings"></a></p>
<p>To use the raising of the head, respecting the maximum print height, in <strong>Slic3r PE</strong>, you need to add the following line:</p>
<pre><code>{if layer_z < max_print_height}G1 Z{z_offset+min(layer_z+60, max_print_height)}{endif}
</code></pre>
<p>This will parse fine in <strong>Slic3r PE</strong>, but not in <strong>Slic3r</strong> (as <code>max_print_height</code> is not known).</p>
<p>If you want such a command in <strong>Slic3r</strong>, you need to enter (for a printer with a maximum print height of 240 mm):</p>
<pre><code>G1 Z{[z_offset]+min([layer_z]+3, 240)}
</code></pre>
<p>results in Slic3r for a 20x20x20 mm calibration cube with a zero <code>z_offset</code> to:</p>
<pre><code>G1 Z23
</code></pre>
|
<p>Your print end code should have read something akin to this:</p>
<pre><code>; Filament sy end gcode
G4 ; wait
M221 S100
M106 S0 ; turn off cooling fan
M104 S0 ; turn off extruder
M140 S0 ; turn off bed
; End code
G1 F1800 E-3 ; retract 3 mm
G1 Z30 ; Move print head up 30mm
G28 X0 ; home x and y axis
M84 ; disable motors
M300 S2600 P100; Beep
</code></pre>
<p>The problem with your end code is the <code>G90</code> for <strong>absolute</strong> measurements together with the formula <code>G1 Z{z_offset+min(layer_z+30, max_print_height)}{endif}</code> to set the height. The printer itself doesn't calculate anything. That what it doesn't interpret, it ignores, interpreting that whole thing as something crazy like <code>G1 Z30</code> to force the printer to go to Absolute 30 mm above absolute 0. To fix it, your slicer would need to calculate <code>{z_offset+min(layer_z+30, max_print_height)}</code> for the printer - which seems to come out to 30mm above the print and then an if-statement that is not started anywhere.</p>
<p>Going up 30 mm can be much easier be done by staying in <code>G91 ; relative measurements</code> and calling <code>G1 Z30</code> to go up another 30 mm, though this might be too high for the printer frame.</p>
| 1,203
|
<p>I recently (a few days ago) installed .NET 3.5 SP1 and subsequently an aspnet_client folder with a bunch of Crystal Reports support code has been injected into my .net web apps.</p>
<p>Anybody else experienced this?
Am I correct in saying that this is a side effect of SP1?
What is this?</p>
|
<p>No it is a side effect of Crystal Reports. If you don't need it, remove it from your computer it is nothing but a headache. It is safe to delete the aspnet_client folder.</p>
|
<p>What do you need to remove? It keeps on adding that folder back to the project that I'm working on...</p>
| 3,447
|
<p>Printer: Elegoo Mars 3 LCD Resin printer</p>
<p>The letter height is about 3 mm.</p>
<p>I engraved a word (text) on the side of a cylinder (which is about 14 mm in diameter and 4 mm in height). I am not sure about the exact depth of the engraving (but should be about 0.5 mm but that's not important).</p>
<p>The text is easily readable and, at first glance, appears to have come out perfectly.
On second sight, however, the problem becomes obvious: The 3D printer didn't print the style of the font correctly (it's less <strong>bold</strong> than the font style chosen for the text and that's visible in Blender and Chitubox files).</p>
<p>Is that just what I have to accept or is there any way to improve on the result?</p>
|
<p>No, at least not at a consumer level. The layering created by the printing process would create imperfections, and clear resin frequently yellows if not cured properly and then protected form strong UV light. Resins that do not yellow tend to have a blue cast to them.</p>
<p>You would be better off using a commercial grade casting resin and a pressure chamber to remove bubbles. Even then it would be inferior to silicates for even basic lenses.</p>
|
<h1>Clear Resin isn't clear everywhere</h1>
<p>Any light-curing resin has a specific bandwidth to which it is totally opaque just to be able to cure. This is typically a blue color, but at this and adjacent wavelength, the lens will not allow light to pass through it, no matter if you can manage to get imperfections down.</p>
<h1>Resins change color</h1>
<p>Then there is the problem of resins changing coloration. Most cast resins become yellow, and some go blue, but in either case, they do absorb some spectrum to appear as this color.</p>
| 2,154
|
<p>I'm running Apache on Linux within VMWare.</p>
<p>One of the PHP pages I'm requesting does a <code>sleep()</code>, and I find that if I attempt to request a second page whilst the first page is <code>sleep()'ing</code>, the second page hangs, waiting for the <code>sleep()</code> from the first page to finish.</p>
<p><strong>Has anyone else seen this behaviour?</strong></p>
<p>I know that <a href="http://php.net/" rel="nofollow noreferrer">PHP</a> isn't <strong>multi-threaded</strong>, but this seems like gross mishandling of the CPU.</p>
<p><strong>Edit</strong>: I should've mentioned that the CPU usage doesn't spike. What I mean by CPU "hogging" is that no other PHP page seems able to use the CPU whilst the page is sleep()'ing.</p>
|
<p>It could be that the called page opens a session and then doesn't commit it, in this case see <a href="https://stackoverflow.com/questions/498477/php-serving-one-page-at-a-time/498497#498497">this answer</a> for a solution.</p>
|
<p>Are you actually seeing the CPU go to 100% or just that no other pages are being served? How many apache-instances are you runnning? Are they all stopping when you run sleep() in of of the threads?</p>
<p>PHP's sleep() function essentially runs through an idle loop for n seconds. It doesn't release any memory, but it should not increase CPU load significantly.</p>
| 4,157
|
<p>I'd like to ignore multiple wildcard routes. With asp.net mvc preview 4, they ship with:</p>
<pre><code>RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
</code></pre>
<p>I'd also like to add something like:</p>
<pre><code>RouteTable.Routes.IgnoreRoute("Content/{*pathInfo}");
</code></pre>
<p>but that seems to break some of the helpers that generate urls in my program. Thoughts?</p>
|
<p>There are two possible solutions here.</p>
<ol>
<li><p>Add a constraint to the ignore route to make sure that only requests that should be ignored would match that route. Kinda kludgy, but it should work.</p>
<pre><code>RouteTable.Routes.IgnoreRoute("{folder}/{*pathInfo}", new {folder="content"});
</code></pre></li>
<li><p>What is in your content directory? By default, Routing does not route files that exist on disk (actually checks the VirtualPathProvider). So if you are putting static content in the Content directory, you might not need the ignore route.</p></li>
</ol>
|
<p>This can be quite tricky.</p>
<p>When attempting to figure out how to map route data into a route, the system currently searches top-down until it finds something where all the required information is provided, and then stuffs everything else into query parameters.</p>
<p>Since the required information for the route "Content/{*pathInfo}" is entirely satisfied always (no required data at all in this route), and it's near the top of the route list, then all your attempts to map to unnamed routes will match this pattern, and all your URLs will be based on this ("Content?action=foo&controller=bar")</p>
<p>Unfortunately, there's no way around this with action routes. If you use named routes (f.e., choosing Html.RouteLink instead of Html.ActionLink), then you can specify the name of the route to match. It's less convenient, but more precise.</p>
<p>IMO, complex routes make the action-routing system basically fall over. In applications where I have something other than the default routes, I almost always end up reverting to named-route based URL generation to ensure I'm always getting the right route.</p>
| 5,019
|
<p>I am facing problem with an Oracle Query in a .net 2.0 based windows application. I am using <code>System.Data.OracleClient</code> to connect to oracle database. Name of database is <code>myDB</code>. Below the the connection string I am using:</p>
<pre><code>Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)
(HOST = 172.16.0.24)(PORT = 1522)))(CONNECT_DATA =(SERVICE_NAME = ORCL)));
User ID=myDB;Password=myDB;Unicode=True
</code></pre>
<p>If I run the below query then it will given me wrong result (here wrong result means incorrect data. The data doesn't belongs to myDB):</p>
<pre><code>SELECT ID, NAME
FROM MyTempTable
WHERE ID IN (10780, 10760, 11890)
</code></pre>
<p>But if I append the database name along with it the it is giving correct result:</p>
<pre><code>SELECT ID, NAME
FROM "myDB".MyTempTable
WHERE ID IN (10780, 10760, 11890)
</code></pre>
<p>My limitation is that I cannot append the database name as this is a generic application and can run with any database on run time. Please help.</p>
|
<p>This looks like an issue with name resolution, try creating a public synonym on the table:</p>
<p>CREATE PUBLIC SYNONYM <em>MyTempTable</em> for <em>MyTempTable</em>;</p>
<p>Also, what exactly do you mean by <strong>wrong result</strong>, incorrect data, error message?</p>
<hr>
<p>Edit: What is the name of the schema that the required table belongs to? It sounds like the table that you are trying to select from is in a different schema to the one that belongs to the user you are connecting as.</p>
|
<p>Try adding</p>
<pre><code>CONNECT_DATA=(SID=myDB)(SERVICE_NAME=ORCL)
</code></pre>
<p>in the connection string.</p>
| 5,890
|
<p>We need to get data out of some Hyperion cubes (databases) using SSIS. Are there any connection managers available for this? Has anyone done this? </p>
|
<p>There are some third party connectors out there. Don't think any exist from oracle or microsoft.</p>
|
<p>I don't have any experience with Hyperion, but can you make use of the Script Task in SSIS?</p>
| 9,698
|
<p>I just got the Ender 5 Plus with BLTouch set up today. I was having some massive issues and determined that my leveling was off because the BLTouch was flashing red and not connecting. When I turn on the printer there is about a 50% chance that it will probe correctly by deploying the pin and correctly retracting it. However, I'm having about a 75 to 90% fail rate on auto leveling where it is doing measurements. I've checked the wiring and it looks correct, but not sure what else to check.</p>
<p>The fixes I've seen say updating the firmware, but all show firmware at 1.70.0 BL. Mine is at 1.70.2 BL. So I'm not sure if there are more firmware updates to apply.</p>
<p>I do not know how to check which BLTouch I have. And I've been able to make it get to printing 2 times, but something is off because it is stringy at 1 point of the build on the first layer. No adhesion basically. So that is the problem I'm trying to fix, but can't get to it because the BLTouch fails so often on the first part. The only way I've found to fix the BLTouch consistently is turn off machine, pull the pin down, push it up, then turn on the machine again.</p>
<p>Is it possible this is a firmware issue or is just the BLTouch is likely faulty?</p>
|
<p>I have used a standard soldering iron to modify and fix 3D prints in the past. You have to keep some things in mind when doing so:</p>
<ul>
<li>Don't overheat your material. PLA can take a soldering iron of about 230 °C before charring.</li>
<li>Don't use a tip with solder, or you will get grey deposits in the plastic.</li>
<li>Round tips or flat tips both work fine, but you want to not dump <em>too</em> much heat into the model or you start to deform the print as it needs to cool again.</li>
<li>Using snippets from the end of the spool for soldering is a good way to recycle the "waste".</li>
</ul>
|
<p>Cutting materials with a 'hot knife' isn't anything new. There should be a fairly established toolset for working foam. For 3D prints, I prefer to add coatings rather than modify surfaces with a hand held tool after. I do run a drill bit through printed holes though.</p>
| 1,913
|
<p>I am thinking of using a PHP framework called <a href="http://codeigniter.com/" rel="noreferrer">CodeIgniter</a>. </p>
<p>One of the things I am interested in is its speed. I have, however, no way to find out how fast it is, and would rather not simply take the word of their website for it. Does anybody know how I can determine its speed myself, or can someone tell me of a site that can?</p>
|
<p>Code Igniter also has some built-in benchmarking tools:
<a href="http://codeigniter.com/user_guide/general/profiling.html" rel="noreferrer">http://codeigniter.com/user_guide/general/profiling.html</a></p>
|
<p>CodeIgniter is plenty fast for most projects. Some have posted here and if you Google, you will find that it compares favorably to other frameworks with respect to speed.</p>
<p>I would agree with another poster that performance is usually not a big concern when it comes to framework choice. The major frameworks all have sufficient performance for most projects.</p>
| 3,425
|
<p>I've got the following PLA filament that is not feeding correctly into our Ultimaker 2+</p>
<p>It starts to feed and then all of the sudden, the wire 'eats' (read <em>breaks, but not entirely</em>) the plastic filament as you can see on the picture below:</p>
<p><a href="https://i.stack.imgur.com/OnQy7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OnQy7.jpg" alt="Photo of damaged filament"></a></p>
<p>Any hints are more than welcomed.</p>
|
<p>The photograph and your description indicate that the drive gear is eating the filament because the filament has stopped moving. The least likely problem would be that something is jammed at the spool or between the spool and the entry to the drive mechanism.</p>
<p>The more likely problem is that your nozzle is clogged. It is simple to determine if that is the case. If you have a direct drive mechanism (not a bowden tube type), remove all the filament and release the wheel or bearing that presses the filament against the hobbed pulley, which is the part connected to the motor or driven gear if you have a geared mechanism.</p>
<p>Heat the nozzle up to correct temperature for PLA and attempt to push filament through the nozzle. If it does not move, your nozzle is clogged and has to be cleared.</p>
<p>A nozzle clog can be caused by a too-low temperature or a too-high temperature resulting in burned material becoming jammed in the nozzle.</p>
<p>If you have a 0.40 nozzle, find that size of nozzle tool or use a 0.40 mm drill bit and carefully push and turn it into the nozzle.</p>
<p>Also consider to use nylon cleaning method. This involves heating the nozzle to the correct temperature for melting nylon filament, forcing it into the hot end, then allowing it to cool. Reheating it while pulling on the filament will remove some of the debris. Eventually, it will pass through the nozzle and will also pull out clean, with no debris on the end of the filament. It is suggested to research "nylon cleaning method" to learn correct temperatures.</p>
<p>I have used the nylon cleaning method and have removed debris from overheated filament in the past. I have been able to shine a bright light from below and see the open nozzle after completing the process.</p>
<p>The above steps are identical for bowden type systems and require to remove the bowden tube to access the hot end more effectively. The tube can be removed from either the hot end or the drive end, but force is more effectively applied if the tube is removed from the hot end.</p>
|
<p>I had a clogged filament. I heated up to 240 C, and pushed a wire up through the nozzle. It took some effort, and much patience is expected. I left the wire inside, as it helped soften the PLA. Then I pushed the filament by hand from top. After some efforts, the needle moved, indicating the movement of the PLA clog. Once the PLA starts pushing the clogged area, some material comes out the nozzle. Keep pushing and after some hours of effort all is flowing fine! The idea was to transport heat to the clogged PLA by using the needle (from the nozzle end). But it certainly requires patience!</p>
| 609
|
<p>I'm trying to do something like the following:</p>
<pre><code>enum E;
void Foo(E e);
enum E {A, B, C};
</code></pre>
<p>which the compiler rejects. I've had a quick look on Google and the consensus seems to be "you can't do it", but I can't understand why. Can anyone explain?</p>
<p>Clarification 2: I'm doing this as I have private methods in a class that take said enum, and I do not want the enum's values exposed - so, for example, I do not want anyone to know that E is defined as</p>
<pre><code>enum E {
FUNCTIONALITY_NORMAL, FUNCTIONALITY_RESTRICTED, FUNCTIONALITY_FOR_PROJECT_X
}
</code></pre>
<p>as project X is not something I want my users to know about.</p>
<p>So, I wanted to forward declare the enum so I could put the private methods in the header file, declare the enum internally in the cpp, and distribute the built library file and header to people.</p>
<p>As for the compiler - it's GCC.</p>
|
<p>The reason the enum can't be forward declared is that, without knowing the values, the compiler can't know the storage required for the enum variable. C++ compilers are allowed to specify the actual storage space based on the size necessary to contain all the values specified. If all that is visible is the forward declaration, the translation unit can't know what storage size has been chosen – it could be a <code>char</code>, or an <code>int</code>, or something else.</p>
<hr />
<p>From Section 7.2.5 of the ISO C++ Standard:</p>
<blockquote>
<p>The <em>underlying type</em> of an enumeration is an integral type that can represent all the enumerator values defined in the enumeration. It is implementation-defined which integral type is used as the underlying type for an enumeration except that the underlying type shall not be larger than <code>int</code> unless the value of an enumerator cannot fit in an <code>int</code> or <code>unsigned int</code>. If the <em>enumerator-list</em> is empty, the underlying type is as if the enumeration had a single enumerator with value 0. The value of <code>sizeof()</code> applied to an enumeration type, an object of enumeration type, or an enumerator, is the value of <code>sizeof()</code> applied to the underlying type.</p>
</blockquote>
<p>Since the <em>caller</em> to the function must know the sizes of the parameters to correctly set up the call stack, the number of enumerations in an enumeration list must be known before the function prototype.</p>
<p>Update:</p>
<p>In C++0X, a syntax for forward declaring enum types has been proposed and accepted. You can see the proposal at <em><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf" rel="nofollow noreferrer">Forward declaration of enumerations (rev.3)</a></em></p>
|
<p>Because the enum can be an integral size of varying size (the compiler decides which size a given enum has), the pointer to the enum can also have varying size, since it's an integral type (chars have pointers of a different size on some platforms for instance).</p>
<p>So the compiler can't even let you forward-declare the enum and user a pointer to it, because even there, it needs the size of the enum.</p>
| 9,689
|
<p>How can I check the existence of an element in jQuery?</p>
<p>The current code that I have is this:</p>
<pre><code>if ($(selector).length > 0) {
// Do something
}
</code></pre>
<p>Is there a more elegant way to approach this? Perhaps a plugin or a function?</p>
|
<p>In JavaScript, everything is 'truthy' or 'falsy', and for numbers <code>0</code> means <code>false</code>, everything else <code>true</code>. So you could write:</p>
<pre><code>if ($(selector).length)
</code></pre>
<p>You don't need that <code>>0</code> part.</p>
|
<p>Use the following syntax to check if the element actually exists using jQuery.</p>
<pre><code>let oElement = $(".myElementClass");
if(oElement[0]) {
// Do some jQuery operation here using oElement
}
else {
// Unable to fetch the object
}
</code></pre>
| 5,089
|
<p>I need to convert an x12 850 v4010 to a x12 940 v4010. Most of the tools convert from x12 to xml then I would need to map the xml to a 940. I am hoping there is a tool that could convert from one edi document to another.</p>
<p>EDIT FOR INFORMATION:</p>
<blockquote>
<p><a href="http://www.rawlinsecconsulting.com/x12tutorial/index.html" rel="nofollow noreferrer">Quick Background</a></p>
<p>Electronic Data Interchange (EDI) is
classically defined as the
application-to-application exchange of
structured business data between
organizations. X12 is an ANSI standard
that supplies that structure. There
are many good books concerned with the
business benefits of EDI,
implementation considerations, and
operational aspects</p>
</blockquote>
|
<p>Going to give Altova MapForce and Stylus Studio® a try. </p>
<p><a href="http://www.altova.com/downloadtrialmapforce3.html" rel="nofollow noreferrer">http://www.altova.com/downloadtrialmapforce3.html</a></p>
<p><a href="http://www.stylusstudio.com/xml_product_index.html" rel="nofollow noreferrer">http://www.stylusstudio.com/xml_product_index.html</a></p>
|
<p>I would like to try out ALTOVA's mapforce tool to convert EDI 850 X12 to Oracle Apps. Is this a good choice.
I hear that the most popular is <a href="http://www.sterlingcommerce.com/" rel="nofollow noreferrer">http://www.sterlingcommerce.com/</a>, but it is very costly..</p>
<p>Please advice
Shashi</p>
| 9,221
|
<p>What options do I have to publish Flash video from webcams other than Adobe's Flash Media Server and Red5? I would prefer a solution in .NET, Python or PHP but can't find anything.</p>
|
<p>Besides another commercial product, like <a href="http://www.wowzamedia.com/" rel="nofollow noreferrer">Wowza Media Server</a>, you could go with a CDN (Content Delivery Network), like <a href="http://www.limelightnetworks.com/" rel="nofollow noreferrer">Limelight Networks</a> or <a href="http://www.voxel.net/" rel="nofollow noreferrer">Voxel.net</a>. You might even be able to find a local hosting provider that would serve up live Flash video for you.</p>
<p>(Live Flash video in a non-trivial thing to do, so the options are a bit limited.)</p>
|
<p>It looks like WebOrb can do it: <a href="http://www.themidnightcoders.com/weborb/dotnet/faq.shtm" rel="nofollow noreferrer">WebOrb FAQ</a> (last entry)</p>
<blockquote>
<p>Can I stream Flash video to a Flex/Flash client through WebORB?
Yes, WebORB supports FLV video streaming. An example is included with the WebORB for .NET product distribution.</p>
</blockquote>
<p>I haven't worked with WebOrb though, so I can't say for sure how easy it is.</p>
| 6,581
|
<p>How can I specify the filename when dumping data into the response stream?</p>
<p>Right now I'm doing the following:</p>
<pre><code>byte[] data= GetFoo();
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(data);
Response.End();
</code></pre>
<p>With the code above, I get "foo.aspx.pdf" as the filename to save. I seem to remember being able to add a header to the response to specify the filename to save.</p>
|
<p>Add a content-disposition to the header: </p>
<pre><code>Response.AddHeader("content-disposition", @"attachment;filename=""MyFile.pdf""");
</code></pre>
|
<pre><code> Response.AddHeader("Content-Disposition", "attachment;filename=" & FileName & ";")
</code></pre>
| 9,974
|
<p>I accidentally let the print head of my Anet A8 crash into one of 2 clips that are holding a glass sheet onto the hot bed, and suddenly the screen went blank and the printer rebooted, then it started reading 739°C from the extruder thermistor. I tried changing the thermistor, but that didn't have any effect. Also tried swapping the extruder thermistor with the hot bed thermistor, but there was no effect on both. I checked both the connector and the socket of the thermistor for shorts but found none. Any ideas about the reason this is happening?</p>
<p>-Using Skynet3D 2.3.2 on the stock Anet board.</p>
<p><strong>EDIT</strong></p>
<p>I tried burning the bootloader and flashing the firmware onto the Anet V1.0 board using an Arduino UNO as an ISP, but that had absolutely no effect.</p>
<p><strong>EDIT 2</strong></p>
<p>I measured <code>R41</code> located next to the hotend thermistor header
<a href="https://i.stack.imgur.com/5XscH.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5XscH.jpg" alt="R41 location"></a>
and found out it has a resistance of 1.5kΩ, while it should have a resistance of 4.7kΩ, so I suspect this is the main reason behind this high reading. Now the only thing left to figure out is how the resistance of this resistor changed.</p>
<p>I was able to figure out which resistor to measure with the help of this schematic: <a href="https://github.com/ralf-e/ANET-3D-Board-V1.0/blob/master/ANET3D_Board_Schematic.png" rel="noreferrer">https://github.com/ralf-e/ANET-3D-Board-V1.0/blob/master/ANET3D_Board_Schematic.png</a></p>
<p><strong>EDIT 3</strong>
I tested <code>T56</code> (located near the headers) and <code>T55</code> (located near the ATMEGA1284P) for continuity, and found out there's no connection between those, while they should be connected according to the schematics. I also checked the hotbed's terminals <code>T54</code> and <code>T53</code> and found continuity between them, which means the problem might be in the trace between the thermistor header and input pin of the ATMEGA chip (this trace is VERY thin, so any overcurrent might cut it), or any component in this trace.</p>
|
<blockquote>
<p>and found out it has a resistance of 1.5kΩ, while it should have a resistance of 4.7kΩ, so I suspect this is the main reason behind this high reading. Now the only thing left to figure out is how the resistance of this resistor changed.</p>
</blockquote>
<p>You can't measure the resistance of a resistor in circuit - the resistance probably appears to be lower to your multimeter because of some other circuit elements. There's also no reasonable explanation for how a 4.7k resistor could suddenly turn into a 1.5k one. It's highly unlikely this resistor is the cause of your issues.</p>
<p>It is more likely something else is damaged, likely the AtMega1284p microcontroller itself. When your extruder touched the bed clip, perhaps the 12V from the bed shorted through the clip and to the extruder? I would guess that the 12V shorted itself to the thermistor input, which subsequently blew the ESD protection diode on that input. This might explain the high reading and the low apparent resistance of R41.</p>
|
<blockquote>
<p>and found out it has a resistance of 1.5kΩ, while it should have a resistance of 4.7kΩ, so I suspect this is the main reason behind this high reading. Now the only thing left to figure out is how the resistance of this resistor changed.</p>
</blockquote>
<p>You can't measure the resistance of a resistor in circuit - the resistance probably appears to be lower to your multimeter because of some other circuit elements. There's also no reasonable explanation for how a 4.7k resistor could suddenly turn into a 1.5k one. It's highly unlikely this resistor is the cause of your issues.</p>
<p>It is more likely something else is damaged, likely the AtMega1284p microcontroller itself. When your extruder touched the bed clip, perhaps the 12V from the bed shorted through the clip and to the extruder? I would guess that the 12V shorted itself to the thermistor input, which subsequently blew the ESD protection diode on that input. This might explain the high reading and the low apparent resistance of R41.</p>
| 761
|
<p>You can easily use the <code>PropertyChanges</code> events to set the flag. But how do you easily reset it after a save to the <code>ObjectContext</code>?</p>
|
<p>For your specific example, there is no need to worry about it. Web browsers perform typographical rendering and place the correct amount of space between periods and whatever character follows (and it's different depending on the next character, according to kerning rules.)</p>
<p>If you want line breaks, <br/> isn't really a big deal, is it?</p>
<hr>
<p>Not sure what's worthy of a downmod here... You should not be forcing two spaces after a period, unless you're using a monospace font. For proportional fonts, the rederer kerns the right amount of space after a period. See <a href="http://www.webword.com/reports/period.html" rel="noreferrer">here</a> and <a href="http://everything2.com/node/540926" rel="noreferrer">here</a> for detailed discussions.</p>
|
<p>You'd better use white-space: pre-wrap than white-space: pre or &nbsp;
With your example, the latter solutions can start a new line on "rules.&nbsp;" just because your <strong>n</strong>on-<strong>b</strong>reakable <strong>sp</strong>ace hit the end of the line.</p>
| 3,711
|
<p>I'm a 2-week newbie at 3D printing, working on a new Qidi Xpro machine (that is solid and one that I like). So, I do not want to believe that this issue is caused by my printer itself. I'm hoping that my settings have something to do with it.</p>
<p>The problem is all the filament lines (travel lines, I think) that start at a sharp corner and go somewhere else. Most often, the lines go to another sharp corner but sometimes can intersect the middle of a side. See the image below for many examples. I have drawn white lines parallel to the unwanted filament lines in case they are hard to spot.</p>
<p>The unwanted lines also appear in the infill underneath the surface lines. They look like porous infill grid lines since they should probably not be there, and they do not get a full load of filament extrusion. You could easily say "Oh, they are the result of a "leaky" nozzle with poor retraction, but I think it's more complicated than that. I have done a full load of retraction tests and calibrations to optimize retraction lengths and speeds to minimize hairs. </p>
<p>Here is an image showing the problem:</p>
<p><a href="https://i.stack.imgur.com/PnCci.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PnCci.jpg" alt="Unwanted filament trails and infill lines parallel to white lines"></a></p>
<p><a href="https://i.stack.imgur.com/UWQbv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UWQbv.jpg" alt="An image showing the trails in the infill"></a></p>
<p>My Cura settings seem reasonable for PLA: bed 50C, nozzle 200C, print speed 40mm, travel speed 90mm (100-110 makes no difference), retraction length 8.5-9.5mm (makes no big difference), retraction speed 35mm, infill: density 20% (line, grid, makes no difference), z-seam set to random, retract at new layer = enabled.</p>
<p>I want to believe that something in my settings is telling the machine to extrude a 1/2 or 1/3 amount of filament when it starts those travels from sharp corners to somewhere else. But, I have not been able to solve the problem.</p>
<p>Everything else works fine in a print (IMHO) except for another problem that I <a href="https://3dprinting.stackexchange.com/questions/6945/infill-failure-at-the-far-corner-of-two-different-prints">described here</a>. I thought I fixed that one, but I saw it occur on the image shown above (inside the infill, under the surface that is shown above).</p>
<p>Does anyone have any ideas that I might try to solve the problem? Thank you.</p>
<p>UPDATE: Here's an image with Zhop when retracted enabled at zhop height 1mm. This is an infill picture, so it cannot be directly compared to the surfaced original. But, the unwanted trails are all still there (although very thin). Maybe 2mm hop height will do it. I will run another test.</p>
<p><a href="https://i.stack.imgur.com/LYvRg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LYvRg.jpg" alt="With Z-Hop When Retracted = enabled, hop height 1mm"></a></p>
<p>UPDATE:</p>
<p>I ran a second test with zhop 2.0mm, but without success. The problem was still there. (Retraction on, 8.5mm, min distance 0.8mm). Here is a comparison picture. I think the gcode is definitely telling my printer to do what it does, because the problem is not just a random leak. I think I'll try a different slicer in hopes that it generates different gcode.</p>
<p><a href="https://i.stack.imgur.com/CZjwx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CZjwx.jpg" alt="Zhop comparision, 1.0mm on the right."></a></p>
<p>UPDATE ON COMBING</p>
<p>Oscar pointed me to the Cura "combing" setting in his comment below. He nailed teh problem perfectly. Combing means "don't retract, and ooze as you please while you move in a straight line to the destination." That's exactly what I've been showing in my images.</p>
<p>The default for Cura combing is enabled. As a newbie, I didn't know enough to turn it off. Worse yet, if combing is enabled ("don't retract"), it prevents "Zhop When Retracted" from zhopping. So, all my zhop experiments did exactly nothing and had zero effect because no zhopping was occurring. After I disabled combing, then for the first time in my life I actually saw what a zhop looked like. (And thus I can assert that zhopping was not happening with combining=enabled.)</p>
<p>Here is an image of my new "perfect" prints thanks to Oscar's pointer on combing. The left two prints have combing off, zhop off. They are almost perfect, inside and out. The infill walls are generally solid and smooth (20% infill) and without the globs and gaps in the image on the right (with combing on).</p>
<p><a href="https://i.stack.imgur.com/3Mkik.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Mkik.jpg" alt="enter image description here"></a></p>
<p>As a closing note, I think the combing setting was probably also responsible for the problem of missing infill grids in the corner, <a href="https://3dprinting.stackexchange.com/questions/6945/infill-failure-at-the-far-corner-of-two-different-prints">as described in this question.</a> The problem doesn't happen with combing off. My theory is that with combing on (as it was for that question), the oozing pulls filament out of the nozzle during the travel, so there's not enough filament at the destination to bite and bond to the corner. So, turning combing off solved 3 problems for me: the awful surface lines, the unwanted trails in the infill, and the missing infills in the corner. It also greatly improved the quality of the infill walls, too.</p>
|
<p>You can Z-hop what you like, but if it is oozing it is oozing, you will always see the effects of that as it just drops down.</p>
<p>Basically you have <strong>multiple issues</strong>, <strong>first the oozing</strong>, <strong>second the line markings on the top</strong>.</p>
<h1><strong>First</strong></h1>
<p>Oozing is fought by applying correct settings for e.g. print temperature, retraction, coasting, travel speed, as is explained in an <a href="https://3dprinting.stackexchange.com/a/6940/5740">answer</a> on <a href="https://3dprinting.stackexchange.com/questions/6938/what-is-this-weird-support-line-doing-in-this-print">one of your own questions</a>. Note that you have not explorer the coasting option as far as I understand from your question. Coasting means that you stop extruding filament prior to a move when the head is still printing. This is explained by the pressure build-up in the hotend; ideally you set the coasting length as such that all the material that is pressed out as a result of the pressure build-up is extruded just before the head moves/travels to another location. Specific calibration prints can be found to tune this for your printer.</p>
<p><a href="https://i.stack.imgur.com/x08w4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x08w4.jpg" alt="enter image description here" /></a></p>
<h1><strong>Second</strong></h1>
<p>The markings on the top can be removed by setting the correct combing setting. Combing does not use retraction and uses straight moves, this saves a lot of time in printing, but it makes those ugly scars on bottom and top faces. You can set the option to not comb on those surfaces, and frankly, what happens on the inside stays in the inside, I would not worry about that. A good read with additional info on combing is <a href="https://community.ultimaker.com/topic/4850-hum-whats-combing/" rel="nofollow noreferrer">this post</a>.</p>
|
<p>Having run into this type of problem at the library makerspace, under a different slicer, I had a good idea where to start the search. It is, in your case, "z-hop cura slicer" and the best return came from <a href="https://polar3d.freshdesk.com/support/discussions/topics/9000021981" rel="nofollow noreferrer">Polar3D</a>.</p>
<p>Keep in mind that this post is more than 2 years old, but if the feature was there before, it should be there now. </p>
<p>Summary (okay, dead straight copy/paste):</p>
<blockquote>
<p>Cura settings > Basic > Enable Retraction - details (click the little
gear/cog) > "Z hop when retracting (mm)"</p>
<p>You may see it default to 0.3mm, try raising this somewhere around
0.8mm - 1.0mm.</p>
</blockquote>
| 1,047
|
<p>I am looking for something to integrate to my CI workflow.<br>
I've heard of <a href="http://dbdeploy.com" rel="noreferrer">dbdeploy</a> but I'm looking for something else. The reason I don't like dbdeploy is I don't want to install java on my server.</p>
<p>I would prefer of course that the solution doesn't involve stringing some shell scripts together.</p>
|
<p><a href="http://flywaydb.org"><strong>Here</strong></a> is a <strong>feature comparison</strong> between</p>
<ul>
<li>Flyway</li>
<li>Liquibase</li>
<li>c5-db-migration</li>
<li>dbdeploy</li>
<li>mybatis</li>
<li>MIGRATEdb</li>
<li>migrate4j</li>
<li>dbmaintain</li>
<li>AutoPatch</li>
</ul>
|
<p>Visual Studio Team system (database edition) does some refactoring.</p>
<p>I read the Refactoring databases book. I think it's helpful.</p>
<p>But in software dev, you build tests so that you are safe refactoring. They don't touch on tests in the Refactoring Databases book, which was my big disappointment with it.</p>
| 4,730
|
<p>All of a sudden I seem to be having a lot of issues with under extruding on my Ender 3. The bottom layer (of height 0.1 mm) prints perfectly fine. This is done at 15 mm/s speed. However, The moment the print moves to layer 2 and above (at the default speed of 60 mm/s), I start hearing a lot of clicking noise on the extruder.</p>
<p>So far I have tried the following</p>
<ul>
<li>Replace nozzle to eliminate clogs</li>
<li>Cleaned the inside of the hot end assembly</li>
<li>Calibrated extruder steps/mm</li>
<li>Reduced the layer height from 0.3 mm to 0.2 mm</li>
<li>Reduced feed rate to as low at 50 %</li>
<li>Cleaned the filament feeder assembly and verified that it is able to push the filament properly (Extruding when the print is not happening works just fine with no clicking)</li>
</ul>
<p>Even with all the above, the issue is still persisting. I am not what else could be causing this. </p>
<p>I am printing with PLA at 200 C</p>
|
<p>Not allowed to comment, so have to answer:</p>
<ol>
<li><p>The temperature sensor is a thermally sensitive resistor. Unfortunately, the temperature is near the high limit of that sensor, and the manufacturing tolerances are very significant. That is why a temperature tower is important for each printer, as well as each filament. (I have 4 printers and each requires a different temperature for the same filament. My worst-case is out by 25 degrees! - it's the one I bought second-hand because the original purchaser couldn't get it to work. I could replace the NTC, but it is easier just to have settings to suit that printer.)</p></li>
<li><p>Filament does change over time. Lots of theories about why, but the practical response is to tune settings to suit the filament. The alternative is to modify the filament (eg drying, adding oil to surface, etc.), but even with really old filament, I've found adjusting settings (in the slicer, like Cura) to be the most generally workable solution.</p></li>
</ol>
<p>Bottom line is to test, adjust settings and repeat until the system achieves the result you need. Treat most recommendations as serving suggestions, so use them as clues (but not rules) for the puzzles presented as 3D printing.</p>
|
<p>A temperature of 200 °C is fine. You probably have heat creep from a Bowden style extruder. The filament starts getting softer due to heat creeping up from the hot nozzle. Filament expands and clogs the tube causing gear clicking. Usually there is a heat sink at the the Bowden tube connection. You need to cool that immediately. Which is, to set your fan to 100 % speed at layer height = 0. That should do the trick!</p>
| 1,580
|
<p>So, to simplify my life I want to be able to append from 1 to 7 additional characters on the end of some jpg images my program is processing*. These are dummy padding (fillers, etc - probably all 0x00) just to make the file size a multiple of 8 bytes for block encryption.</p>
<p>Having tried this out with a few programs, it appears they are fine with the additional characters, which occur after the <a href="http://en.wikipedia.org/wiki/JPEG#Syntax_and_structure" rel="noreferrer">FF D9 that specifies the end of the image</a> - so it appears that the file format is well defined enough that the 'corruption' I'm adding at the end shouldn't matter.</p>
<p>I can always post process the files later if needed, but my preference is to do the simplest thing possible - which is to let them remain (I'm decrypting other file types and they won't mind, so having a special case is annoying).</p>
<p>I figure with all the talk of <a href="http://en.wikipedia.org/wiki/Steganography" rel="noreferrer">Steganography</a> hullaballo years ago, someone has some input here...</p>
<p>(encryption processing by 8 byte blocks, I don't want to save pre-encrypted file size, so append 0x00 to input data, and leave them there after decoding)</p>
|
<p>No, you can add bits to the end of a jpg file, without making it unusable. The heading of the jpg file tells how to read it, so the program reading it will stop at the end of the jpg data.</p>
<p>In fact, people have hidden zip files inside jpg files by appending the zip data to the end of the jpg data. Because of the way these formats are structured, the resulting file is valid in either format.</p>
|
<p>As others have stated, you have no control how programs process image files and therefore some programs may find the images valid others may not.</p>
<p>However, there is a bigger issue here. Judging by your question, I'm deducing you're practicing "security through obscurity." It's widely considered a very bad practice. Use Google to find a plethora of articles about the topic.</p>
| 7,377
|
<p>I'm printing with opaque grey PETG on glass. The intention is to produce a house number plate, so a shiny, production quality finish on the bottom. For this reason, extruding at 245 °C with a bed at 95 °C, to give a perfect glass finish with no filament lines showing. Smaller test versions have been very promising; this seems to be the maximum temperatures before warping or a severe elephant's foot arises.</p>
<p>However when printing the full-scale version, areas of the first layer of filament seem to go completely "transparent"; there seems to be filament there - you can feel the filament "comb" when you run your finger over it, and it feels a similar thickness to its neighbours.</p>
<p>On the attached photo you might think that those gaps are simply not printed yet, however you can see on the top right corner that it's actually started on the next layer.</p>
<p><a href="https://i.stack.imgur.com/JYOVA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JYOVA.jpg" alt="print"></a></p>
<p>What could be causing this? Is it a blockage which is interrupting flow, and maybe insufficient filament is being "stretched out"? Or maybe it could be something to do with temperature? Could it be insufficient layer height (I'm using 0.2 mm, but 0.24 mm on first layer, increasing further reveals filament lines, but tested higher and lower on smaller scale with success).</p>
<p>I've tested a range of extrude and temperatures and chosen the temps with the best results; but when I "go large" this always seems to happen. I've also calibrated the bed height using the 3 point adjustment screws on this printer (Qidi X-Plus). (The transparent areas are actually occuring in the center where the smaller test prints where working perfectly, so don't know how it could be to do with this). </p>
|
<p>Are you using Z-hop? Is there any play in the Z-axis direction? It appears that parts of the first layer are printed much thinner than other parts.</p>
<p>What can happen if there is a little play in the Z-axis direction that the nozzle doesn't return to the same level after a Z-hop movement (e.g. backlash in the leadscrew nuts).</p>
<p>The "transparent" printed part appears thinner, this must indicate that the Z positioning is not up to par.</p>
|
<p>PETG becomes transparent when the layers completely fuse. Translucency is from incomplete adhesion or voids left. Try small increases to flow or print width to get slightly better fill - or slow the speed (but speed might not affect how much material is output).</p>
<p>Also, I see the top surface has a pattern on it. My FDM printer always does a similar thing and it will take tuning to get it smooth. If you see the pattern repeating consistently, it is possible the extruder stepper (or its driver) is starting to fail. I've had that too.</p>
| 1,581
|
<p>This is driving me crazy.</p>
<p>I have this one php file on a test server at work which does not work.. I kept deleting stuff from it till it became </p>
<pre>
<?
print 'Hello';
?>
</pre>
<p>it outputs </p>
<blockquote>
<p>Hello</p>
</blockquote>
<p>if I create a new file and copy / paste the same script to it it works!
Why does this one file give me the strange characters all the time?</p>
|
<p>That's the <a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" rel="noreferrer">BOM (Byte Order Mark)</a> you are seeing.</p>
<p>In your editor, there should be a way to force saving without BOM which will remove the problem.</p>
|
<p>Found it, file -> encoding -> UTF8 with BOM , changed to to UTF :-)</p>
<p>I should ahve asked before wasing time trying to figure it out :-)</p>
| 3,384
|
<p>I'd like to find an opensource software that communicates directly with the RAMPS board (or any other 3D printer driver) without using the arduino...</p>
<p>It doesn't matter if it runs on Windows or linux as long as it's opensource. Also, I'm not worried about how this communication is done (USB, serial port, parallel port)...</p>
<p>Has anyone ever heard about projects like this?</p>
|
<p>No, there exists no software like that. You can't communicate with a RAMPs board because a RAMPs board has no logic built-in; it's just a dumb breakout board that connects the Arduino Mega to your printer's components (such as stepper drivers, MOSFETs for controlling heaters, endstops,...).</p>
<p>If you wanted to connect a RAMPs board "directly" to your computer, you'd need a way for your computer to generate the pulses that the Arduino normally generates. You could potentially use a parallel port for this but you'd need many more outputs than a single parallel port can provide <em>and</em> you'd need to find a way to do the analog to digital conversion needed for the thermistors.</p>
<p>It's just not very feasible (considering how few computers have parallel ports nowadays).</p>
|
<p>No, there exists no software like that. You can't communicate with a RAMPs board because a RAMPs board has no logic built-in; it's just a dumb breakout board that connects the Arduino Mega to your printer's components (such as stepper drivers, MOSFETs for controlling heaters, endstops,...).</p>
<p>If you wanted to connect a RAMPs board "directly" to your computer, you'd need a way for your computer to generate the pulses that the Arduino normally generates. You could potentially use a parallel port for this but you'd need many more outputs than a single parallel port can provide <em>and</em> you'd need to find a way to do the analog to digital conversion needed for the thermistors.</p>
<p>It's just not very feasible (considering how few computers have parallel ports nowadays).</p>
| 267
|
<p>Does anyone know of a good (preferably open source) library for dealing with the Modbus protocol? I have seen a few libraries, but I am looking for some people's personal experiences, not just the top ten Google hits. I figure there has to be at least one other person who deals with PLCs and automation hardware like I do out there.</p>
<p>Open to any other materials that might have been a help to you as well...</p>
|
<p>I have done a lot of communication with devices for the past few years, since I work for a home automation company, but we don't use Modbus. We do communication in a standard and open way using Web Services for Devices(WSD) which is also know as <a href="http://en.wikipedia.org/wiki/Devices_Profile_for_Web_Services" rel="noreferrer">Devices Profile for Web Services(DPWS)</a>.</p>
<p>During this time at one point, I did hear of a project called <a href="http://code.google.com/p/nmodbus/" rel="noreferrer">NModbus</a>. It is an open source library for working with modbus. I have not used it, but looking at the site and the <a href="http://code.google.com/p/nmodbus/source/list" rel="noreferrer">changesets</a> on Google Code, it looks pretty active. You may want to give it a look and even get involved in. This is the only library that I have heard of that targets .Net.</p>
|
<p>Have a look at the offering from Colway Solutions <a href="http://www.colwaysolutions.com" rel="nofollow">http://www.colwaysolutions.com</a>. They have a unique licensing scheme where you pay for each Modbus function code that you desire to use. Its not free but the pricing seems to be low. I also saw a few ports of the library to some popular microcontrollers and RTOS.</p>
| 7,847
|
<p>I just get the beach ball all day long (it's been doing nothing for hours). It's not taking CPU, not reading from disk, not using the network.</p>
<p>I'm using <strong>Java 1.6</strong> on <strong>Mac OS X 10.5.4</strong>. It worked once, now even restarts of the computer won't help. Activity Monitor says it's "(Not Responding)". Only thing that I can do is kill -9 that sucker.</p>
<p>When I sample the process I see this:</p>
<pre><code> mach_msg_trap 16620
read 831
semaphore_wait_trap 831
</code></pre>
<p>An acceptable answer that doesn't fix this would include a url for a decent free Oracle client for the Mac.</p>
<p>Edit:
@Mark Harrison sadly this happens every time I start it up, it's not an old connection. I'll like to avoid running Windows on my laptop. I'm giving some plugins for my IDE a whirl, but still no solution for me.
@Matthew Schinckel Navicat seems to only have a non-commercial Oracle product...I need a commercial friendly one (even if it costs money).</p>
|
<p>I get the same problem after there's been an active connection sitting idle for a while. I solve it by restarting sql developer every once in a while.</p>
<p>I also have Toad for Oracle running on a vmware XP session, and it works great. If you don't mind the money, try that.</p>
|
<p>The latest version of SQL Developer is very good and I have experienced no problems with it on my Mac Pro. DB Solo 3 is also quite good.</p>
| 3,395
|
<p>We are developing a little application that given a directory with PDF files creates a unique PDF file containing all the PDF files in the directory. This is a simple task using iTextSharp. The problem appears if in the directory exist some files like Word documents, or Excel documents.</p>
<p>My question is, is there a way to convert word, excel documents into PDF programmatically? And even better, is this possible without having the office suite installed on the computer running the application?</p>
|
<p>Office 2007 allows for this. I have found <a href="http://sourceforge.net/projects/pdfcreator/" rel="nofollow noreferrer">PDFCreator</a> to be good, the VBA is included in sample files, and have heard that <a href="http://www.cutepdf.com/" rel="nofollow noreferrer">CutePDF</a> is also good. PDFCreator and CutePDF are free.</p>
<p>To work without Office, you would need viewers, as far as I know:
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&displaylang=EN" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&displaylang=EN</a></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=95E24C87-8732-48D5-8689-AB826E7B8FDF&displaylang=en" rel="nofollow noreferrer">http://www.microsoft.com/downloads/details.aspx?familyid=95E24C87-8732-48D5-8689-AB826E7B8FDF&displaylang=en</a></p>
|
<p>You can also use a component like activePDF's <a href="http://www.activepdf.com/products/serverproducts/docconverter2009/" rel="nofollow noreferrer">DocConverter</a> to convert a <strong>lot</strong> formats to PDF. </p>
| 6,005
|
<p>What would be the best way to have a list of items with a checkbox each in Java Swing?</p>
<p>I.e. a JList with items that have some text and a checkbox each?</p>
|
<p>Create a custom <code>ListCellRenderer</code> and asign it to the <code>JList</code>.</p>
<p>This custom <code>ListCellRenderer</code> must return a <code>JCheckbox</code> in the implementantion of <code>getListCellRendererComponent(...)</code> method.</p>
<p>But this <code>JCheckbox</code> will not be editable, is a simple paint in the screen is up to you to choose when this <code>JCheckbox</code> must be 'ticked' or not, </p>
<p>For example, show it ticked when the row is selected (parameter <code>isSelected</code>), but this way the check status will no be mantained if the selection changes. Its better to show it checked consulting the data below the <code>ListModel</code>, but then is up to you to implement the method who changes the check status of the data, and notify the change to the <code>JList</code> to be repainted.</p>
<p>I Will post sample code later if you need it</p>
<p><a href="http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html" rel="noreferrer">ListCellRenderer</a></p>
|
<p>Here is just a little addition to the JCheckBoxList by Rawa. This will add the ability to select using space bar. If multiple items are selected, all will be set to inverted value of the first item.</p>
<pre><code> addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
int index = getSelectedIndex();
if (index != -1 && e.getKeyCode() == KeyEvent.VK_SPACE) {
boolean newVal = !((JCheckBox) (getModel()
.getElementAt(index))).isSelected();
for (int i : getSelectedIndices()) {
JCheckBox checkbox = (JCheckBox) getModel()
.getElementAt(i);
checkbox.setSelected(newVal);
repaint();
}
}
}
});
</code></pre>
| 4,014
|
<p>When I pluck the belts of my CoreXY printer, I feel significantly different tension between the two idlers on the back and the tension on the sides, between the gear on the stepper shaft and the idler on the back.</p>
<p>Is this normal? If not, what could be the cause?</p>
<p>For reference, I'm using this support for the idlers:</p>
<p><a href="https://i.stack.imgur.com/OMTPC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OMTPC.jpg" alt="enter image description here" /></a></p>
|
<p>If you are referring to the tension in a single belt, but ar different positions, the tension is everywhere the same. It is one belt, the force/tension is the same in the belt. If the length of the belt is shorter because of a carriage to idler, the plucked sound may differ but the tension is the same.</p>
<p>If you are referring to different belts, e.g. the top versus the bottom belt, for CoreXY machines, the tension in the two separate belts should be equal to allow equal force pulling the carriage. If uneven, this may lead to incorrect/skew prints or binding of linear bearings (from experience). A typical layout of the mechanism is shown below. Note that there are several solutions for placing the belts; they can be in the same plane (where the belts cross in the back, as depicted below) or have the belt each in their own plane (as in the HyperCube Evolution design as depicted in the image of the question).</p>
<p><a href="https://i.stack.imgur.com/NmPKH.png" rel="nofollow noreferrer" title="CoreXY reference mechanism"><img src="https://i.stack.imgur.com/NmPKH.png" alt="CoreXY reference mechanism" title="CoreXY reference mechanism" /></a></p>
<p><sup>Drawing published by Ilan E. Moyer, taken from <a href="http://corexy.com/theory.html" rel="nofollow noreferrer">http://corexy.com</a></sup>.</p>
<p>For both options, incorrect belt tension causes for different forces onto the the printhead carriage and result in a torque on the carriage (either in X-Y or in X-Z). E.g. a tight blue belt with a less tight red belt cause a resulting counter-clockwise torque on the carriage in the image below:</p>
<p><a href="https://i.stack.imgur.com/lSD6w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lSD6w.png" alt="enter image description here" /></a></p>
<p>I use <a href="https://www.thingiverse.com/thing:2589577" rel="nofollow noreferrer">a tool (gauge)</a> to determine the tension to compare both belts and make sure the tension in both is the same:</p>
<p><a href="https://i.stack.imgur.com/TZVpg.jpg" rel="nofollow noreferrer" title="Belt tension gauge"><img src="https://i.stack.imgur.com/TZVpg.jpg" alt="enter image description here" title="Belt tension gauge" /></a></p>
<p>Many CoreXY designs can adjust the tension of the belts at the carriage by screws. Some designs feature the stepper in the back and an adjustable pulley in the front.</p>
|
<p>The belts of a CoreXY should be identical in length and tensioned simultaneously to ensure proper operation. Any slack or springiness difference will result in prints that are askew. In that case, where the tension or springiness cannot be removed, the Marlin firmware allows for compensations for skewing as M-Code 852</p>
<p><a href="https://marlinfw.org/docs/gcode/M852.html" rel="nofollow noreferrer">https://marlinfw.org/docs/gcode/M852.html</a></p>
| 2,034
|
<p>Getting slanted or leaning prints when printing multiple parts.
I checked the eccentric nuts and belts aren't rubbing anything. All works well when printing a single part. But multiple parts:</p>
<p><a href="https://i.stack.imgur.com/d4BUR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d4BUR.jpg" alt="Two parts that should be straight"></a></p>
<p>What am I missing?</p>
|
<p><em>If you want a more detailed answer, you need to give more details, e.g.; "What filament are you using?" "How old is the printer?" "What mods have you made to it?"</em></p>
<hr>
<p>I can tell you two possibilities. Either your x or y axis is slipping which could be because of worn out belts, belts that need to be tightened, or because of too much jerk. The other is overheating of the stepper drivers so make sure the board is getting enough air over it.</p>
|
<p>It could also be backlash in the system. Your belts aren't tight enough. Apparently the Y belt is not tight enough. That's a pretty awesome effect though. </p>
| 1,365
|
<p>What are the best practices for checking in BIN directories in a collaborative development environment using SVN? Should project level references be excluded from checkin? Is it easier to just add all bin directories?</p>
<p>I develop a lot of DotNetNuke sites and it seems that in a multi-developer environment, it's always a huge task to get the environment setup correctly.</p>
<p>The ultimate goal (of course) is to have a new developer checkout the trunk from SVN, restore the DNN database and have it all just 'work'...</p>
|
<p>Any assemblies that are expected to be in the GAC should stay in the GAC. This includes System.web.dll or any other 3rd party dll that you'll deploy to the GAC in production. This means a new developer would have to install these assemblies.</p>
<p>All other 3rd party assemblies should be references through a relative path. My typical structure is:</p>
<pre><code>-Project
--Project.sln
--References
---StructureMap.dll
---NUnit.dll
---System.Web.Mvc.dll
--Project.Web
---Project.Web.Proj
---Project.Web.Proj files
--Project
---Project.Proj
---Project.Proj files
</code></pre>
<p>Project.Web and Project reference the assemblies in the root/References folder relatively. These .dlls are checked into subversion.</p>
<p>Aside from that, */bin */bin/* obj should be in your global ignore path.</p>
<p>With this setup, all references to assemblies are either through the GAC (so should work across all computers), or relative to each project within your solution.</p>
|
<p>We follow the practice of using a vendor directory which contains all vendor specific headers and binaries. The goal is that anybody should be able to build the product just by checking it out and running some top level build script. </p>
| 2,278
|
<p>Are there any browser extensions or printers with OctoPrint built in that would allow me to print straight from the browser?</p>
<p>Thinking of a workflow like this:</p>
<ol>
<li>Make something with Tinkercad (or other online service)</li>
<li>download stl or obj</li>
<li>select print from bookmark or dropdown menu</li>
<li>print is sent to printer and starts printing</li>
</ol>
|
<p>There was the <a href="https://plugins.octoprint.org/plugins/curalegacy/" rel="nofollow noreferrer">CuraEngine</a> plugin, but it's not really maintained anymore. It should still work though</p>
|
<p>This works for OctoPI (OctoPrint on a Raspberry Pi).</p>
<ol>
<li>Add the Samba package to your OctoPrint machine.</li>
<li>open an SMB connection to that machine from your browser machine</li>
<li>Save your STL to <code>/home/pi/.octoprint/uploads</code> on the Raspberry Pi.</li>
</ol>
<p>You can save directly from your slicer the same way.</p>
| 1,475
|
<p>What is the difference, if any, between these methods of indexing into a PHP array:</p>
<pre><code>$array[$index]
$array["$index"]
$array["{$index}"]
</code></pre>
<p>I'm interested in both the performance and functional differences.</p>
<h3>Update:</h3>
<p>(In response to @Jeremy) I'm not sure that's right. I ran this code:</p>
<pre><code> $array = array(100, 200, 300);
print_r($array);
$idx = 0;
$array[$idx] = 123;
print_r($array);
$array["$idx"] = 456;
print_r($array);
$array["{$idx}"] = 789;
print_r($array);
</code></pre>
<p>And got this output:</p>
<pre><code>Array
(
[0] => 100
[1] => 200
[2] => 300
)
Array
(
[0] => 123
[1] => 200
[2] => 300
)
Array
(
[0] => 456
[1] => 200
[2] => 300
)
Array
(
[0] => 789
[1] => 200
[2] => 300
)
</code></pre>
|
<p>see @svec and @jeremy above. All array indices are of type 'int' first, then type 'string', and will be cast to that as PHP sees fit.</p>
<p>Performance wise, $index should be faster than "$index" and "{$index}" (which are the same). </p>
<p>Once you start a double-quote string, PHP will go into interpolation mode and treat it as a string first, but looking for variable markers ($, {}, etc) to replace from the local scope. This is why in most discussions, true 'static' strings should always be single quotes unless you need the escape-shortcuts like "\n" or "\t", because PHP will not need to try to interpolate the string at runtime and the full string can be compiled statically.</p>
<p>In this case, doublequoting will first copy the $index into that string, then return the string, where directly using $index will just return the string.</p>
|
<p>I believe from a performance perspective that $array["$index"] is faster than $array[$index] See <a href="http://www.chazzuka.com/blog/?p=163" rel="nofollow noreferrer">Best practices to optimize PHP code performance</a></p>
<p>Another variation that I use sometimes when I have an array inside a string is:</p>
<pre><code>$str = "this is my string {$array["$index"]}";
</code></pre>
<p>Edit: What I meant to say is $row[’id’] is faster than $row[id]</p>
| 2,835
|
<p>Is there a way to auto discover a specific WCF service in the network? I don't want to config my client with the address if this is possible.</p>
|
<p>What you want to look at is the WS-Discovery protocol. I found a sample on <a href="http://wcf.netfx3.com/files/folders/protocol_channels/entry7909.aspx" rel="nofollow noreferrer">netfx3's</a> website of using the <a href="http://en.wikipedia.org/wiki/WS-Discovery" rel="nofollow noreferrer">specification</a>. I would recommend searching services based on scope, by probing for services based on a specific endpoint.</p>
|
<p>What you want to look at is the WS-Discovery protocol. I found a sample on <a href="http://wcf.netfx3.com/files/folders/protocol_channels/entry7909.aspx" rel="nofollow noreferrer">netfx3's</a> website of using the <a href="http://en.wikipedia.org/wiki/WS-Discovery" rel="nofollow noreferrer">specification</a>. I would recommend searching services based on scope, by probing for services based on a specific endpoint.</p>
| 8,949
|
<p>From what I've read, <a href="http://blogs.msdn.com/astebner/archive/2008/08/11/8849574.aspx" rel="nofollow noreferrer">VS 2008 SP1 and Team Foundation Server SP1 packages are traditional service packs that require you to first install the original versions before you will be able to install the SP</a>.</p>
<p>Is there a way, supported or not, to slipstream the install?</p>
|
<p>Here's an <a href="https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3337363&SiteID=1" rel="nofollow noreferrer">MSDN forum post</a> in which an MSFTie indicates it will be possible and that details are forthcoming. Another poster is relaying results of her almost-successful attempt. Looks like this will be doable soon.</p>
<p>Related: <a href="http://www.woodwardweb.com/tfs/000444.html" rel="nofollow noreferrer">how to slipstream Team Foundation Server 2008 SP1 (TFS 2008 SP1)</a></p>
|
<p>::Copy some file to make slipstream integration successful. copy "VS2k8WithSP1\Program Files\Microsoft Visual Studio 9.0\Common7\1033*.chm" "VS2k8WithSP1\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\"</p>
<p>there is a error here, should be:</p>
<p>::Copy some file to make slipstream integration successful. copy "VS2k8WithSP1\Program Files\Microsoft Visual Studio 9.0\Common7\1033\*.chm" "VS2k8WithSP1\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\"</p>
<p>"\" must be doubled in this case, coz one of them used as escape character of "*" </p>
| 3,346
|
<p>I'm trying to be better about unit testing my code, but right now I'm writing a lot of code that deals with remote systems. SNMP, WMI, that sort of thing. With most classes I can mock up objects to test them, but how do you deal with unit testing a real system? For example, if my class goes out and gets the Win32_LogicalDisk object for a server, how could I possibly unit test it?</p>
|
<p>Assuming you meant "How do I test against things that are hard/impossible to mock":</p>
<p>If you have a class that "goes out and gets the Win32_LogicalDisk object for a server" AND does something else (consumes the 'Win32_LogicalDisk' object in some way), assuming you want to test the pieces of the class that consume this object, you can use <a href="http://en.wikipedia.org/wiki/Dependency_injection" rel="noreferrer">Dependency Injection</a> to allow you to mock the 'Win32_LogicalDisk' object. For instance:</p>
<pre><code>class LogicalDiskConsumer(object):
def __init__(self, arg1, arg2, LogicalDiskFactory)
self.arg1=arg1
self.arg2=arg2
self.LogicalDisk=LogicalDiskFactory()
def consumedisk(self):
self.LogicalDisk.someaction()
</code></pre>
<p>Then in your unit test code, pass in a 'LogicalDiskFactory' that returns a mock object for the 'Win32_LogicalDisk'.</p>
|
<p>You might create a set of "test stubs" that replace the core library routines and return known values, perhaps after suitable delays.</p>
<p>As an example, I recently needed to develop code to run inside a 3rd-party product. The challenge was that our "partner" would be doing the compiling and integration with their base code: I wasn't allowed to <em>look at</em> their code in any form! My strategy was to build a very simple emulator that did what I <em>thought</em> their code did, based on information from their engineers. We used a language that made it easy to switch various pieces of the emulator in and out of each build, so I could do a tremendous amount of testing before involving our partner to build each new iteration.</p>
<p>I'd use the same method again, as software problems in that particular product are about an order of magnitude fewer than in our next most reliable product!</p>
| 6,607
|
<p>It wasn't that long ago that I was a beginning coder, trying to find good books/tutorials on languages I wanted to learn. Even still, there are times I need to pick up a language relatively quickly for a new project I am working on. The point of this post is to document some of the best tutorials and books for these languages. I will start the list with the best I can find, but hope you guys out there can help with better suggestions/new languages. Here is what I found:</p>
<p><em>Since this is now wiki editable, I am giving control up to the community. If you have a suggestion, please put it in this section. I decided to also add a section for general be a better programmer books and online references as well. Once again, all recommendations are welcome.</em></p>
<h2>General Programming</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://codebetter.com/blogs/karlseguin/archive/2008/06/24/foundations-of-programming-ebook.aspx" rel="nofollow noreferrer">Foundations of Programming</a> By Karl Seguin - From Codebetter, its C# based but the ideas ring true across the board, can't believe no-one's posted this yet actually.<br />
<a href="http://freeworld.thc.org/root/phun/unmaintain.html" rel="nofollow noreferrer">How to Write Unmaintainable Code</a> - An anti manual that teaches you how to write code in the most unmaintable way possible. It would be funny if a lot of these suggestions didn't ring so true.<br>
<a href="http://en.wikibooks.org/wiki/Wikibooks:Programming_languages_bookshelf" rel="nofollow noreferrer">The Programming Section of Wiki Books</a> - suggested by Jim Robert as having a large amount of books/tutorials on multiple languages in various stages of completion<br>
<a href="http://basics.wefoundland.com/" rel="nofollow noreferrer">Just the Basics</a> To get a feel for a language.</p>
<p><strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0735619670" rel="nofollow noreferrer" rel="nofollow noreferrer">Code Complete</a> - This book goes without saying, it is truely brilliant in too many ways to mention.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/020161622X" rel="nofollow noreferrer" rel="nofollow noreferrer">The Pragmatic Programmer</a> - The next best thing to working with a master coder, teaching you everything they know.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0596528124" rel="nofollow noreferrer" rel="nofollow noreferrer">Mastering Regular Expressions</a> - Regular Expressions are an essential tool in every programmer's toolbox. This book, recommended by Patrick Lozzi is a great way to learn what they are capable of.<br>
Algorithms in <a href="https://rads.stackoverflow.com/amzn/click/com/0201756080" rel="nofollow noreferrer" rel="nofollow noreferrer">C</a>, <a href="https://rads.stackoverflow.com/amzn/click/com/020172684X" rel="nofollow noreferrer" rel="nofollow noreferrer">C++</a>, and <a href="https://rads.stackoverflow.com/amzn/click/com/0201775786" rel="nofollow noreferrer" rel="nofollow noreferrer">Java</a> - A great way to learn all the classic algorithms if you find Knuth's books a bit too in depth.</p>
<h2>C</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://www.physics.drexel.edu/students/courses/Comp_Phys/General/C_basics/" rel="nofollow noreferrer">This</a> tutorial seems to pretty consise and thourough, looked over the material and seems to be pretty good. Not sure how friendly it would be to new programmers though.<br>
<strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0131103628" rel="nofollow noreferrer" rel="nofollow noreferrer">K&R C</a> - a classic for sure. It might be argued that all programmers should read it.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0672326965" rel="nofollow noreferrer" rel="nofollow noreferrer">C Primer Plus</a> - Suggested by Imran as being the ultimate C book for beginning programmers.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/013089592X" rel="nofollow noreferrer" rel="nofollow noreferrer">C: A Reference Manual</a> - A great reference recommended by Patrick Lozzi.</p>
<h2>C++</h2>
<p><strong>Online Tutorials</strong><br>
The tutorial on <a href="http://www.cplusplus.com/doc/tutorial/" rel="nofollow noreferrer">cplusplus.com</a> seems to be the most complete. I found another tutorial <a href="http://www.intap.net/~drw/cpp/" rel="nofollow noreferrer">here</a> but it doesn't include topics like polymorphism, which I believe is essential. If you are coming from C, <a href="http://www.4p8.com/eric.brasseur/cppcen.html" rel="nofollow noreferrer">this</a> tutorial might be the best for you. </p>
<p>Another useful tutorial, <a href="http://www.icce.rug.nl/documents/cplusplus/" rel="nofollow noreferrer">C++ Annotation</a>. In Ubuntu family you can get the ebook on multiple format(pdf, txt, Postscript, and LaTex) by installing <code>c++-annotation</code> package from Synaptic(installed package can be found in <code>/usr/share/doc/c++-annotation/</code>.</p>
<p><strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0201700735" rel="nofollow noreferrer" rel="nofollow noreferrer">The C++ Programming Language</a> - crucial for any C++ programmer.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0672326973" rel="nofollow noreferrer" rel="nofollow noreferrer">C++ Primer Plus</a> - Orginally added as a typo, but the amazon reviews are so good, I am going to keep it here until someone says it is a dud.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0321334876" rel="nofollow noreferrer" rel="nofollow noreferrer">Effective C++</a> - Ways to improve your C++ programs.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/020163371X" rel="nofollow noreferrer" rel="nofollow noreferrer">More Effective C++</a> - Continuation of Effective C++.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0201749629" rel="nofollow noreferrer" rel="nofollow noreferrer">Effective STL</a> - Ways to improve your use of the STL. <br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0139798099" rel="nofollow noreferrer" rel="nofollow noreferrer">Thinking in C++</a> - Great book, both volumes. Written by Bruce Eckel and Chuck Ellison. <br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0321543726" rel="nofollow noreferrer" rel="nofollow noreferrer">Programming: Principles and Practice Using C++</a> - Stroustrup's introduction to C++.
<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/020170353X" rel="nofollow noreferrer" rel="nofollow noreferrer">Accelerated C++</a> - Andy Koenig and Barbara Moo - An excellent introduction to C++ that doesn't treat C++ as "C with extra bits bolted on", in fact you dive straight in and start using STL early on.</p>
<h2>Forth</h2>
<p><strong>Books</strong><br>
FORTH, a text and reference. Mahlon G. Kelly and Nicholas
Spies. ISBN 0-13-326349-5 / ISBN 0-13-326331-2. 1986
Prentice-Hall. Leo Brodie's books are good but this book
is even better. For instance it covers defining words and
the interpreter in depth.</p>
<h2>Java</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://java.sun.com/docs/books/tutorial/" rel="nofollow noreferrer">Sun's Java Tutorials</a> - An official tutorial that seems thourough, but I am not a java expert. You guys know of any better ones?<br>
<strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0596009208" rel="nofollow noreferrer" rel="nofollow noreferrer">Head First Java</a> - Recommended as a great introductory text by Patrick Lozzi.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0321356683" rel="nofollow noreferrer" rel="nofollow noreferrer">Effective Java</a> - Recommended by pek as a great intermediate text.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0132354764" rel="nofollow noreferrer" rel="nofollow noreferrer">Core Java Volume 1</a> and <a href="https://rads.stackoverflow.com/amzn/click/com/0132354799" rel="nofollow noreferrer" rel="nofollow noreferrer">Core Java Volume 2</a> - Suggested by FreeMemory as some of the best java references available.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0321349601" rel="nofollow noreferrer" rel="nofollow noreferrer">Java Concurrency in Practice</a> - Recommended by MDC as great resource for concurrent programming in Java.</p>
<p><a href="https://rads.stackoverflow.com/amzn/click/com/0321349806" rel="nofollow noreferrer" rel="nofollow noreferrer">The Java Programing Language</a></p>
<h2>Python</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://www.python.org/doc/" rel="nofollow noreferrer">Python.org</a> - The online documentation for this language is pretty good. If you know of any better let me know.<br>
<a href="http://diveintopython3.ep.io/" rel="nofollow noreferrer">Dive Into Python</a> - Suggested by Nickola. Seems to be a python book online.</p>
<h2>Perl</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://perldoc.perl.org/perl.html" rel="nofollow noreferrer">perldoc perl</a> - This is how I personally got started with the language, and I don't think you will be able to beat it.<br>
<strong>Books</strong><br>
<a href="http://oreilly.com/catalog/9780596520106/" rel="nofollow noreferrer">Learning Perl</a> - a great way to introduce yourself to the language.<br>
<a href="http://oreilly.com/catalog/9780596000271/" rel="nofollow noreferrer">Programming Perl</a> - greatly referred to as the Perl Bible. Essential reference for any serious perl programmer.<br>
<a href="http://oreilly.com/catalog/9780596003135/" rel="nofollow noreferrer">Perl Cookbook</a> - A great book that has solutions to many common problems.<br>
<a href="http://onyxneon.com/books/modern_perl/" rel="nofollow noreferrer">Modern Perl Programming</a> - newly released, contains the latest wisdom on modern techniques and tools, including Moose and DBIx::Class.</p>
<h2>Ruby</h2>
<p><strong>Online Tutorials</strong><br>
Adam Mika suggested <a href="http://poignantguide.net/ruby/" rel="nofollow noreferrer">Why's (Poignant) Guide to Ruby</a> but after taking a look at it, I don't know if it is for everyone.
Found <a href="http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials" rel="nofollow noreferrer">this</a> site which seems to offer several tutorials for Ruby on Rails.<br>
<strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0974514055" rel="nofollow noreferrer" rel="nofollow noreferrer">Programming Ruby</a> - suggested as a great reference for all things ruby.</p>
<h2>Visual Basic</h2>
<p><strong>Online Tutorials</strong><br>
Found <a href="http://www.vb6.us/" rel="nofollow noreferrer">this</a> site which seems to devote itself to visual basic tutorials. Not sure how good they are though.</p>
<h2>PHP</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://us3.php.net/tut.php" rel="nofollow noreferrer">The main PHP site</a> - A simple tutorial that allows user comments for each page, which I really like.
<a href="http://www.phpfreaks.com/tutorials" rel="nofollow noreferrer">PHPFreaks Tutorials</a> - Various tutorials of different difficulty lengths.<br>
<a href="http://tut.php-quake.net/en/" rel="nofollow noreferrer">Quakenet/PHP tutorials</a> - PHP tutorial that will guide you from ground up.</p>
<h2>JavaScript</h2>
<p><strong>Online Tutorials</strong><br>
Found a decent tutorial <a href="http://www.webteacher.com/javascript/" rel="nofollow noreferrer">here</a> geared toward non-programmers. Found another more advanced one <a href="http://www.tizag.com/javascriptT/" rel="nofollow noreferrer">here</a>. Nickolay suggested <a href="http://developer.mozilla.org/en/A_re-introduction_to_JavaScript" rel="nofollow noreferrer">A reintroduction to javascript</a> as a good read here.</p>
<p><strong>Books</strong><br>
<a href="http://headfirstlabs.com/books/hfjs/" rel="nofollow noreferrer">Head first JavaScript</a><br>
<a href="http://oreilly.com/catalog/9780596517748/" rel="nofollow noreferrer">JavaScript: The Good Parts</a> (with a <a href="http://www.youtube.com/watch?v=hQVTIJBZook" rel="nofollow noreferrer">Google Tech Talk video</a> by the author) </p>
<h2>C#</h2>
<p><strong>Online Tutorials</strong><br>
<a href="http://www.csharp-station.com/Tutorial.aspx" rel="nofollow noreferrer">C# Station Tutorial</a> - Seems to be a decent tutorial that I dug up, but I am not a C# guy.<br>
<a href="http://www.ecma-international.org/publications/standards/Ecma-334.htm" rel="nofollow noreferrer">C# Language Specification</a> - Suggested by tamberg. Not really a tutorial, but a great reference on all the elements of C#<br>
<strong>Books</strong><br>
<a href="https://rads.stackoverflow.com/amzn/click/com/032125290X" rel="nofollow noreferrer" rel="nofollow noreferrer">C# to the point</a> - suggested by tamberg as a short text that explains the language in amazing depth</p>
<h2>ocaml</h2>
<p><strong>Books</strong><br>
nlucaroni suggested the following:<br>
<a href="http://www.ffconsultancy.com/products/ocaml_for_scientists/?so" rel="nofollow noreferrer">OCaml for Scientists</a>
<a href="http://www.seas.upenn.edu/~cis500/cis500-f02/resources/ocaml-intro.pdf" rel="nofollow noreferrer">Introduction to ocaml</a><br>
<a href="http://caml.inria.fr/pub/docs/u3-ocaml/index.html" rel="nofollow noreferrer">Using Understand and unraveling ocaml: practice to theory and vice versa</a><br>
<a href="http://caml.inria.fr/pub/docs/oreilly-book/" rel="nofollow noreferrer">Developing Applications using Ocaml - O'Reilly</a><br>
<a href="http://caml.inria.fr/pub/docs/manual-ocaml/index.html" rel="nofollow noreferrer">The Objective Caml System - Official Manua</a> </p>
<h2>Haskell</h2>
<p><strong>Online Tutorials</strong><br>
nlucaroni suggested the following:<br>
<a href="http://www-128.ibm.com/developerworks/java/library/j-cb07186.html?ca=dgr-lnxw07Haskell" rel="nofollow noreferrer">Explore functional programming with Haskell</a><br>
<strong>Books</strong><br>
<a href="http://book.realworldhaskell.org/" rel="nofollow noreferrer">Real World Haskell</a><br>
<a href="http://www.cs.mdx.ac.uk/staffpages/dat/sblp1.pdf" rel="nofollow noreferrer">Total Functional Programming</a> </p>
<h2>LISP/Scheme</h2>
<p><strong>Books</strong><br>
wfarr suggested the following:<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0262560992" rel="nofollow noreferrer" rel="nofollow noreferrer">The Little Schemer</a> - Introduction to Scheme and functional programming in general<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/026256100X" rel="nofollow noreferrer" rel="nofollow noreferrer">The Seasoned Schemer</a> - Followup to Little Schemer.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0262011530" rel="nofollow noreferrer" rel="nofollow noreferrer">Structure and Interpretation of Computer Programs</a> - The definitive book on Lisp (also <a href="http://mitpress.mit.edu/sicp/" rel="nofollow noreferrer">available online</a>).<br>
<a href="http://www.gigamonkeys.com/book/" rel="nofollow noreferrer">Practical Common Lisp</a> - A good introduction to Lisp with several examples of practical use.<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/0130305529" rel="nofollow noreferrer" rel="nofollow noreferrer">On Lisp</a> - Advanced Topics in Lisp<br>
<a href="http://www.htdp.org/" rel="nofollow noreferrer">How to Design Programs</a> - An Introduction to Computing and Programming<br>
<a href="https://rads.stackoverflow.com/amzn/click/com/1558601910" rel="nofollow noreferrer" rel="nofollow noreferrer">Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp</a> - an approach to high quality Lisp programming</p>
<p>What about you guys? Am I totally off on some of there? Did I leave out your favorite language? I will take the best comments and modify the question with the suggestions.</p>
|
<p>I know this is going to seem old-fashioned, but I don't think much of using online tutorials to learn programming languages or platforms. These generally give you no more than a little taste of the language. To really learn a language, you need the equivalent of a "book", and in many cases, this means a real dead-tree book.</p>
<p>If you want to learn C, read K&R. If you want to learn C++, read Stroustrup. If you want to learn Lisp/Scheme, read SICP. Etc.</p>
<p>If you're not willing to spend more than $30 and a few hours to learn a language, you probably aren't going to learn it.</p>
|
<p>MSDN<br>
<a href="http://msdn.microsoft.com/en-us/library/ms229335.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/ms229335.aspx</a></p>
| 4,288
|
<p>We are planning on moving for MS Source Safe (ouch) to SVN. We are working mostly in a Microsoft environment (windows, Visual Studio, .NET) and we have developers in multiple sites. I heard about VisualSVN and integration with visual studio. On the other hand I can get someone to host SVN for me and use TortoiseSVN. Any recommendations? Any pitfalls I should avoid?</p>
|
<blockquote>
<p>I heard about VisualSVN and
integration with visual studio</p>
</blockquote>
<p>Point to note, VisualSVN (the one that integrates with VStudio) is <em>not</em> a server technology at all, it is simply a integrated GUI front end to SVN, and in fact works <em>through</em> TortoiseSVN (which is <strong>required</strong> to be installed). However, VisualSVN is GREAT and defnitely worth the $50 per developer to use it. I used it daily and it saves me SO much time.</p>
<p>There is also VisualSVN Server, which will take care of the server side of things and the setup is absolutely dead simple. As long as you have an internet facing server and copious amounts of bandwidth (though SVN is not much of a bandwidth hog) you should be fine to host it yourself. Oh yeah, and VisualSVN <em>Server</em> is completely FREE!</p>
<p>However, having your repository hosted off-site is definitely always an option.
I use dreamhost for this now and couldn't be happier.</p>
|
<p>You can get hosting of secure svn repositories from a variety of sources: <a href="http://beanstalkapp.com/" rel="nofollow noreferrer">http://beanstalkapp.com/</a> and many others. Often free if the usage (users, data, etc.) is limited.</p>
<p>VisualSVN does integrate with Visual Studio but not like SourceSafe does (and I mean this in a good way). It requires TortoiseSVN so it's not not an either/or. VisualSVN and Tortoise is a great combination.</p>
| 3,599
|
<p>Is it any compilator option of flag?</p>
|
<p>You can if you setup an external tool pointing to MsBuild to build the solution with the multiple process flag /m.</p>
<p>Scott Hanselman wrote a <a href="http://www.hanselman.com/blog/FasterBuildsWithMSBuildUsingParallelBuildsAndMulticoreCPUs.aspx" rel="noreferrer">nice post</a> on how to accomplish this, so I won't repeat what he has already done.</p>
|
<p>MSDN answers your question:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb383805.aspx" rel="nofollow noreferrer">Using Multiple Processors to Build Projects</a></p>
| 7,505
|
<p>This is a continuation of <a href="https://3dprinting.stackexchange.com/questions/19523/filament-not-being-extruded">this question</a> where comments and answers were extremely helpful in diagnosing the issue, which I am still unable to solve.</p>
<p>I determined I have the problem shown in figure 3 on <a href="https://3dprinting.stackexchange.com/questions/15629/what-are-ways-to-avoid-heat-creep">this question</a>. How I confirmed that is I started a print and monitored it closely. As soon as the filament stopped coming out I paused the print and pulled out the filament - it looked like this:</p>
<p><a href="https://i.stack.imgur.com/OO4oZ.png" rel="nofollow noreferrer" title="Photo of filament with different sized diameter after being pulled from hotend"><img src="https://i.stack.imgur.com/OO4oZ.png" alt="Photo of filament with different sized diameter after being pulled from hotend" title="Photo of filament with different sized diameter after being pulled from hotend" /></a></p>
<p>I snipped the expanded part off and re-inserted the filament back in, hit resume print and it continued printing normally, except it had skipped a layer or two.</p>
<p>What I understand is there can be a few reasons for this problem:</p>
<ol>
<li>Filament moving too fast and not being able to melt at the nozzle</li>
<li>Too much heat in the radiator block causes the filament to soften up and unable to be pushed by the incoming filament.</li>
</ol>
<p>To combat case 1 I reduced the speed of the print using the knob down to 80 % which already felt like it is too slow, but that didn't seem to make a difference. I also tried printing at speeds of 85 %, 90 %, and 95 % as well and the problem occurred in all of them. So this leads me to believe that speed is probably not the issue.</p>
<p>I read that there could also be another thing causing case 1 and that is over-extrusion. To verify this I did the 100 mm extrusion test where I marked 0 mm and 100 mm and extruded 100 mm manually in steps of 0.1 mm. It took a while but eventually in the end I determined that it is under-extruding at 95 mm actual filament extruded which means there is less filament being pushed which should actually be working against the jam. I pulled the filament out after the test to see what it looks like and this was it:</p>
<p><a href="https://i.stack.imgur.com/bCDQp.png" rel="nofollow noreferrer" title="Photo of filament with significantly different sized diameter"><img src="https://i.stack.imgur.com/bCDQp.png" alt="Photo of filament with significantly different sized diameter" title="Photo of filament with significantly different sized diameter" /></a></p>
<p>Nevertheless, I adjusted my E-steps from 93 to 99 and repeated the 100 mm test again which this time was about 1 mm off (99 mm actual filament extruded) but I guess my markings could be off too so it should be good enough. I again checked the filament and it still had an expansion on the end.</p>
<p>At this point, I'm assuming that there is no issue with my extruder and print speed, so I'm on to case 2.</p>
<p>I tried printing at 180 °C but that had no effect.</p>
<p>I also tried printing without heating the bed as I read that could affect the cooling of the radiator as the fan will be blowing hot air, but that also didn't help and the filament seized.</p>
<p>I took the fan cover off and set the nozzle to 200 °C. After a few minutes, I measured the surface temperatures on the cooling block/radiator using a multimeter which showed 47 °C on the top-most fin and 65 °C on the bottom-most. I also tried reducing the nozzle to 180 °C and took measurements again which were pretty much the same with about a degree or 2 off. Ok so maybe something is fishy here because in <a href="https://youtu.be/ItJTrTX6HJw?t=308" rel="nofollow noreferrer">this video</a> you can see the temperatures he's reading are in the 35-40s range.</p>
<p>Just to confirm this was the problem I took quite a large home fan and directed it such that the stream is hitting the radiator from about 5 cm (this is while the hot end fan is not mounted with the screws but hanging on the side, which was also blowing at the radiator). I waited a couple of minutes and measured the temperatures again which this time showed 35 °C on the top and 50 °C on the bottom. That was as low as I could get it and the house fan was pretty strong. I extruded another 100 mm manually and this is what the filament looked like afterward:</p>
<p><a href="https://i.stack.imgur.com/g12ZN.png" rel="nofollow noreferrer" title="Photo of filament with a blob of filament a the end after being pulled from the hotend"><img src="https://i.stack.imgur.com/g12ZN.png" alt="Photo of filament with a blob of filament a the end after being pulled from the hotend" title="Photo of filament with a blob of filament a the end after being pulled from the hotend" /></a></p>
<p>It still had a blob on the end and I'm pretty confident given more time it would clog up again.</p>
<p>Honestly, at this point, I feel like I've put way too much time and effort into resolving this issue and that is frustrating me as I fail to see any results.</p>
<p>I'm even more confused by the fact that I have had a couple of 3h prints go flawless, then out of the blue, it starts doing this problem. Sometimes it doesn't happen, sometimes it happens 3-5 times per print. I had an 8h print which went very well until the last 30 min when it clogged, thankfully I was around and I did the snipping procedure so the print finished but it is visible where it skipped a bunch of layers and has a weak spot.</p>
<p>It is quite annoying to have to babysit the printer like that and I'm really reaching out to anyone who'd be able to help me.</p>
|
<p>Yes.</p>
<p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p>
<p>My special recipe for coating PLA prints with a fast-curing airtight thin layer is:</p>
<ol>
<li>Dissolve 1 g Paraloid B-72 in 20 ml acetone.</li>
<li>Dip or otherwise evenly coat the print and dry at room temperature for 10-20 minutes.</li>
</ol>
|
<p>Yes.</p>
<p>The issue is, that there are small gaps between the layers. But you can coat the print in an airtight material. While epoxy and similar materials work very well, they are somewhat too viscous and take a long time to cure.</p>
<p>My special recipe for coating PLA prints with a fast-curing airtight thin layer is:</p>
<ol>
<li>Dissolve 1 g Paraloid B-72 in 20 ml acetone.</li>
<li>Dip or otherwise evenly coat the print and dry at room temperature for 10-20 minutes.</li>
</ol>
| 2,166
|
<p>I've been playing with RSS feeds this week, and for my next trick I want to build one for our internal application log. We have a centralized database table that our myriad batch and intranet apps use for posting log messages. I want to create an RSS feed off of this table, but I'm not sure how to handle the volume- there could be hundreds of entries per day even on a normal day. An exceptional make-you-want-to-quit kind of day might see a few thousand. Any thoughts?</p>
|
<p>If you are building a system with notifications that must not be missed, then a pub-sub mechanism (using XMPP, one of the other protocols supported by ApacheMQ, or something similar) will be more suitable that a syndication mechanism. You need some measure of coupling between the system that is generating the notifications and ones that are consuming them, to ensure that consumers don't miss notifications.</p>
<p>(You can do this using RSS or Atom as a transport format, but it's probably not a common use case; you'd need to vary the notifications shown based on the consumer and which notifications it has previously seen.)</p>
|
<p>Without knowing your application, I can't offer specific advice. </p>
<p>That said, it's common in these sorts of systems to have a level of severity. You could have a query string parameter that you tack on to the end of the URL that specifies the severity. If set to "DEBUG" you would see every event, no matter how trivial. If you set it to "FATAL" you'd only see the events that that were "System Failure" in magnitude. </p>
<p>If there are still too many events, you may want to sub-divide your events in to some sort of category system. Again, I would have this as a query string parameter. </p>
<p>You can then have multiple RSS feeds for the various categories and severities. This should allow you to tune the level of alerts you get an acceptable level. </p>
| 8,478
|
<p>Trying to make a MySQL-based application support MS SQL, I ran into the following issue:</p>
<p>I keep MySQL's auto_increment as unsigned integer fields (of various sizes) in order to make use of the full range, as I know there will never be negative values. MS SQL does not support the unsigned attribute on all integer types, so I have to choose between ditching half the value range or creating some workaround.</p>
<p>One very naive approach would be to put some code in the database abstraction code or in a stored procedure that converts between negative values on the db side and values from the larger portion of the unsigned range. This would mess up sorting of course, and also it would not work with the auto-id feature (or would it some way?).</p>
<p>I can't think of a <em>good</em> workaround right now, is there any? Or am I just being fanatic and should simply forget about half the range?</p>
<p><i>Edit:<br>
@Mike Woodhouse: Yeah, I guess you're right. There's still a voice in my head saying that maybe I could reduce the field's size if I optimize its utilization. But if there's no easy way to do this, it's probably not worth worrying about it.</i></p>
|
<p>When is the problem likely to become a real issue?</p>
<p>Given current growth rates, how soon do you expect signed integer overflow to happen in the MS SQL version?</p>
<p>Be pessimistic.</p>
<p>How long do you expect the application to live?</p>
<p>Do you still think the factor of 2 difference is something you should worry about?</p>
<p>(I have no idea what the answers are, but I think we should be sure that we really have a problem before searching any harder for a solution)</p>
|
<p>I would say this.. "How do we normally deal with differences between components?"</p>
<p><strong>Encapsulate what varies</strong>..</p>
<p>You need to create an abstraction layer within you data access layer to get it to the point where it <em>doesn't care</em> whether or not the database is MySQL or MS SQL..</p>
| 4,942
|
<p>I have the task of developing an online examination software for a small university, I need to implement measures to prevent cheating...</p>
<p>What are your ideas on how to do this? </p>
<p>I would like to possibly disable all IE / firefox tabs, or some how log internet activity so I know if they are googling anwsers...is there any realistic way to do such things from a flex / web application?</p>
|
<p>Simply put, <strong>no</strong> there is no realistic way to accomplish this if it is an online exam (assuming they are using their own computers to take the exam).</p>
|
<p>Randomize questions, ask a random set of questions from a large bank... time the answers...</p>
<p>Unless you mean hacking your site, which is a different question.</p>
| 6,905
|
<p>I am looking for the best method to run a Java Application as a *NIX daemon or a Windows Service. I've looked in to the <a href="http://wrapper.tanukisoftware.org/" rel="noreferrer">Java Service Wrapper</a>, the <a href="http://commons.apache.org/daemon/jsvc.html" rel="noreferrer">Apache Commons project 'jsvc'</a>, and the <a href="http://commons.apache.org/daemon/procrun.html" rel="noreferrer">Apache Commons project 'procrun'</a>. So far, the Java Service Wrapper looks like it's the best option... but, I'm wondering if there are any other "Open Source friendly" licensed products out there.</p>
|
<p>I've had great success with Java Service Wrapper myself. I haven't looked at the others, but the major strengths of ServiceWrapper are:</p>
<ul>
<li>Great x-platform support - I've used it on Windows and Linux, and found it easy on both</li>
<li>Solid Documentation - The docs are clear and to the point, with great examples</li>
<li>Deep per-platform support - There are some unique features in the window service management system that are supported perfectly by service wrapper (w/o restarting). And on Windows, you will even see your app name in the process list instead of just "java.exe".</li>
<li>Standards Compliant - Unlike many ad-hoc Java init scripts, the scripts for service wrapper tend to be compliant with LSB standards. This can end up being very important if you ever want high availability management from something like Linux Heartbeat/HA.</li>
</ul>
<p>Anyway, just my 2 cents... :)</p>
|
<p>Are there any special attributes that you need to apply (like OS guided resource management) that you need to support? Otherwise, for Unix you should be able to daemonize your application by writing an appropriate init.d script and setting your app to start automatically.</p>
| 4,514
|
<p>Is it possible with the accuracy of current 3D printers to print a sound trace? </p>
<p>On a vinyl record the grooves in the record are an encoded sound. Is something like this doable with 3D printers? </p>
<p>If Vinyl-like isn't possible, could a sound be printed at desktop scale? I mean printing the waves out that if you ran your finger along it it would reproduce the encoded sound? Examples would be <a href="https://en.wikipedia.org/wiki/Rumble_strip" rel="noreferrer">Rumble Strips</a>, the <a href="https://en.wikipedia.org/wiki/Musical_road" rel="noreferrer">Musical Roads</a> or <a href="https://english.stackexchange.com/questions/44069/what-are-the-treads-on-the-side-of-the-highway-called">highway rumble strips</a>.</p>
|
<h2>Sound Encoding basics</h2>
<p>Sound is a compression wave, and any depiction of it has to be an encoding of it. You can encode it so you can recreate the sound using a contraption that oscillates in the right way to compress air again in the right pattern, but you can't just "print it out" like you can scale up a lightwave from the nanometer scale to a visible one as a representation.</p>
<p>Let's take a simple example: a 440 Hz tune is generally considered to be the A<sub>4</sub>, aka <em>concert pitch a</em> or A440.</p>
<p>It could be encoded in a various ways. The probably oldest is to encode it as a note in violin notation, which then could be reproduced by anyone using a properly tuned instrument. The actual result depends on the instrument used as much as on the skill of the player. Each instrument thus might decode this encoded note differently, based on the physical setup of the instrument. Each instrument <em>automatically</em> creates the appropriate overtones.</p>
<p><a href="https://i.stack.imgur.com/ms9Vl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ms9Vl.png" alt="A440 encoded as a note" /></a></p>
<p>In Midi, it is encoded as <code>Note 69</code> and any machine that can decode a midi file could use this instruction, paired with an instrument to use, to create the A<sub>4</sub> that is set for it. In Midi, the mere instruction of Note 69 does cut out skill, but how it sounds and feels comes from the instrument setup - which contains information about what overtones are to be created when playing this note.</p>
<p>For a physicist, the pure sound is encoded as just the notion of <code>440 Hz</code> and some amplitude to balance how loud it is. With those instructions, he'd be able to set up a device that has these creates a 440 Hz tune. To generate the sound and feel of an instrument, the encoding for a physicist would need to contain all the overtones that are to swing with this one sound.</p>
<p><a href="https://i.stack.imgur.com/cozUQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cozUQ.png" alt="880 Hz overtone at 0.2 Amplitude and 440 Hz tone at 0.8 Amplitude" /></a></p>
<h3>History of sound recording</h3>
<p>Let's look at the very first way of recording sound: The Phonautograph of 1857 used a piece of paper or a sheet of glass blackened and then a membrane move a needle. When the plate would be moved, the needle left a written path. The encoding was done via 2 factors: the setup of the stylus (mainly how long is the arm) and the speed of the movement of the plate. Changing either changed the encoding. A longer arm would record a larger amplitude (making fainter sounds recordable) while faster movement would alter the timescale recorded, allowing to look at short instances and better compare them.</p>
<p>These vibration-pattern records could be used to measure and compare sounds but not be used to recreate the sound, as lines on paper nor scratches in soot are a good way to keep a reading needle in boundaries. it took till 2000 and the use of scanners as well as digital processing to recreate these recorded sounds.</p>
<p>The solution to recreate sounds was found by the Edison Laps in 1877 with the phonograph, which used a piece of thick tinfoil to record the motion pattern of the membrane. Again, then encoding was done via the arm setup and the speed at which the tinfoil clad cylinder moved (or rather rotated). It would till the 1880s develop to a wax cylinder, which was easier to inscribe and reproduce from. One such machine was used by Carl Orff.</p>
<p>The first Gramophone came in 1889, mainly altering the shape of the recording medium from cylinders to the well-known shape of vinyl records but made from hard plastics and shellac. Around 1901, a 12-inch gramophone disk held only a 4 minutes track, speaking volumes about the problems of encoding the complex patterns of sound onto a disk. At the same time, an Edison Amberol Cylinder held 4 minutes 30 seconds but would spin at 160 rpm. Soon after, celluloid would become the recording medium of its time, and the disk the de-facto "standard" as it was much better storable.</p>
<p>In 1925 finally, a real standard was developed to record at around <span class="math-container">$78^{+0.26}_{-0.08}$</span> rpm, which lead to only a 0.34 rpm difference between areas of 60 or 50 Hz mains voltage (though they needed different encoder rings), making records interchangeable between both machine types. All these recordings were encoded naturally: the vibrations of the membrane in the recording tool would be 1:1 transmitted to the vibrating stylus that would then do the encoding in such a way that a machine would reproduce what the recording one "heard" quite accurately.</p>
<p>When Vinyl came to the playing field as a recording medium at the end of world war II, so came a swap in the reading needle type: instead of a needle that would agitate a membrane directily, sapphire needles that would agitate an electrical pickup which in turn would activate a speaker. But while the recording technology advanced, the track length of a 12-inch disk was still limited to about 4 minutes at 78 rpm. It would only reach more than this in the last years of its use by applying LP technologies to pack the track tighter in the 1950s, achieving 17 minutes.</p>
<p>1948 came the LP, what we know as a classic vinyl record. At its introduction it could cram 23 minutes onto one side, making this possible by only using 33.5 rpm as the recording speed and thinner, much tighter coiled groves, increasing the information density by a factor of 5.75 for a 12-inch disk. 7-inch 45 rpm "singles" came out 4 years later. Within 10 years, the 33.5 and 45 rpm encoded variants had almost completely replaced the 78 rpm market.</p>
<h2>Vinyl</h2>
<p>As the history of analogous recordings shows, encoding a sound signal is rather easy in theory, hard in practice. A typical 12-inch <a href="http://www.gzvinyl.com/About-vinyl.aspx" rel="nofollow noreferrer">LP Vinyl record</a> of 20 minutes is a grove that is 427 meters long and coiled up 667 times. That means a single groove is between 0.04 and 0.08 mm wide - with an equally thin wall between. That means, that to achieve a printed phonograph record, you'd have to print accurately down to 40 microns to get an <em>empty</em> track. However, we also need to add the signal atop. And here comes the real problem:</p>
<p>An empty track has some 22 µm deviations, which the needle will usually not pick up at all. Dust, which creates the crackling at times, is in the same area (1-100 µm). The actual sound signal is encoded to have features as small as 75 nanometers. That is 3 magnitudes lower than the mere geometry of the grove, and equally much lower than any printer - including SLS - can achieve today, as 50 µm is often considered a lower limit in 2019.</p>
<p>To show how much tiny defects would ruin the sound quality, look at <a href="https://www.youtube.com/watch?v=QDwN41Px_sY" rel="nofollow noreferrer">this rapid cast</a> of a vinyl record. The resolution of the negative and the subsequently cast record is good enough to recognize the music, but the resin cast did contain so many gas bubbles that the noise level of the copy is very high.</p>
<p>Bonus: Unlike on cylinders the encoding of the signal on disks changes from the start to the end! The vinyl spins at a constant rate, but the radius from the center changes, leading in the speed on any part of the grove to be different as <span class="math-container">$|v|=|\omega \vec r \sin(\theta)|$</span>, where omega is the speed in rad per second, theta is the angle of the reeding, so in this case, the sinus term becomes 1 and vanishes. This factor has to be taken into account for encoding so the pitch of the record doesn't change if the record is not created naturally by inscribing the signal onto a spinning disk.</p>
<h2>Other encoding</h2>
<h3>Rumble Strips</h3>
<p>However, it is quite easy to create a structure that creates sounds based on interaction with another body. Highway Sound Strips create sounds as the car tire bumps up and down, turning the car and tires into resonance bodies while the street "beats" upon it. In the case of a large percussion instrument like a car, we are talking centimeter scale.</p>
<h3>Peg-Cylinder</h3>
<p>A very simple method would be to go back to encoding and check out the note notation but limiting the length of notes to one unit. Encoding music this way results in pegs or ridges on a cylinder, which then can be used to actuate a mechanism to decode the music and create sounds like in a music box. In a music box of this kind, the demand for accuracy is about 3 to 5 magnitudes lower than in vinyl records: we speak about a tenth of a millimeter to centimeter scale.</p>
<p>Such a <a href="https://www.thingiverse.com/thing:1094636" rel="nofollow noreferrer">Musical box</a> or <a href="https://www.thingiverse.com/search?sort=relevant&q=noisemaker&type=things&dwh=955da117c1ada44" rel="nofollow noreferrer">noisemaker</a> can be easily printed and is pretty much a rumble strip coiled around a cylinder. The length of the sample is determined by the resolution, playback speed and diameter of the cylinder while the complexity is determined by the rows of pegs of it: a noisemaker is pretty much a 1-note, high speed, music box. Typically, one rotation stores about 25 to 30 seconds. Typical examples would be the first part of <em>Für Elise</em>, or the <a href="https://www.youtube.com/watch?v=IvUU8joBb1Q" rel="nofollow noreferrer">Marble Machine</a> (Between second 30 and 35 the encoding wheel rotates 1 fifth). Some barrel organs also use the peg method, like one can <a href="https://www.youtube.com/watch?v=4oRm1Dx5rDI" rel="nofollow noreferrer">see here</a>. With some trickery, one cylinder could be used to encode multiple parts that play one after another once a rotation is done by and silencing some parts of the machine depending on an extra encoder, like <a href="https://www.youtube.com/watch?v=suj-0GP7xzg" rel="nofollow noreferrer">this 3-part <em>Für Elise</em></a> music box.</p>
<p><a href="https://i.stack.imgur.com/mGLCG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mGLCG.jpg" alt="Musical Box Core" /></a></p>
<h3>Hole-Plate(-strip)</h3>
<p>A different method would be to encode the music as holes in a continuous strip and use air as a decoding method. If the air then gets directed into pipes, we have a street organ. Typically, one would use a paper strip as the encoded message, but it could be printed just as well, especially if one uses a setup that uses plates hinged to one another instead of a rolled-up paper as in <a href="https://www.youtube.com/watch?v=Tp5FpGrYWC0" rel="nofollow noreferrer">this example</a>. With such a way to stash away the extra length, the upper limit for music length rises from a couple of seconds to several minutes easily even with such a "bad" encoding.</p>
|
<p>I think this is just about doable. In this answer, I will assume you want to produce a "rumble strip" style of object that will reproduce a recording of human speech. I'll assume you don't care about sound quality, you just want the words to be intelligible.</p>
<p>The main things to consider are the printer's resolution, the size of the object to be printed, and the sample rate. Together, these factors determine the length of the sound, and the rate at which you need to move along it to reproduce the sound.</p>
<p>Let's start with sample rate. A CD has a sample rate of 44100 samples per second (Hz), but that might be a bit ambitious. Telephones use a lower sample rate of 8000, and it says <a href="http://www.hitl.washington.edu/projects/knowledge_base/virtual-worlds/EVE/I.B.3.a.SoundSampling.html" rel="nofollow noreferrer">here</a> that speech is still intelligible at a sample rate of 2500 Hz. Let's go with this rate.</p>
<p>Now let's consider the resolution of the printer. A typical nozzle size is 0.2mm, which probably limits the resolution to around that size, though you can probably do better with some care, and I imagine people in this community will be able to help with that. I am guessing that you would want to print the object horizontally, so you're dealing with xy resolution instead of z resolution. (Note that resin 3d printers have much better resolutions, so they might be ideal for this task, despite their smaller print volumes.) Let's start by assuming 0.2mm is our resolution, since this should be easy to achieve with any printer. </p>
<p>This means that every sample in the sound file takes up about 0.2mm. Let's say we have one second of speech - that's long enough to say "Hello!", for example - at 2500 Hz. That means we have 2500 samples. 2500 * 0.2mm = 500mm, so your rumble strip will be about 1/2 meter long. That's unlikely to fit on your print bed, but you can print it in sections and stick them together - you can probably print them all at the same time. You could even curl it round into a spiral, making it even more like a vinyl record.</p>
<p>Then all you have to do is take a rigid object like a guitar pick and slide it along the strip at the right speed, so that it takes about 1 second. Then you should hear the sound played back. Attaching a resonator to the pick or the strip should increase the volume.</p>
<p>Increasing the resolution will decrease the length of the strip, or allow you to play a longer sound for the same length of strip, or increase the sample rate. E.g. if you can get a resolution of 0.1mm then you could play a 2 second sound instead, using the same 0.5m length of rumble strip.</p>
<p>In principle, creating the object is not hard, but I don't know any software that can do it out of the box. You just need to make the surface height correspond to the waveform. If I was doing this I would probably write a Python script to turn the wave file into a list of numbers, then paste those into in OpenSCAD's polygon function, which I would then extrude to make the object. But others might know an easier way.</p>
| 1,484
|
<p>I'm looking at sessions in Django, and by default they are stored in the database. What are the benefits of filesystem and cache sessions and when should I use them?</p>
|
<p>The filesystem backend is only worth looking at if you're not going to use a database for any other part of your system. If you are using a database then the filesystem backend has nothing to recommend it.</p>
<p>The memcache backend is much quicker than the database backend, but you run the risk of a session being purged and some of your session data being lost.</p>
<p>If you're a really, really high traffic website and code carefully so you can cope with losing a session then use memcache. If you're not using a database use the file system cache, but the default database backend is the best, safest and simplest option in almost all cases.</p>
|
<p>If the database have a DBA that isn't you, you may not be allowed to use a database-backed session (it being a front-end matter only). Until django supports easily merging data from several databases, so that you can have frontend-specific stuff like sessions and user-messages (the messages in django.contrib.auth are also stored in the db) in a separate db, you need to keep this in mind.</p>
| 7,337
|
<p><strong>TL;DR:</strong> I'm looking to change the steps per mm but I'm not sure what to set it to. Do I decide on a temperature and change the rate based on the percentage for that temp? Or is there a more general setting I can put it to? Or is there a different underlying problem here?</p>
<p>I'm running into an issue with my Ender 3 where when I print PLA at different temperatures I'm getting different extrusion rates. I've done the test where marking it at 120 mm and then extruding using PronterFace 100 mm and measuring the distance and this is my results. I did two tests of each to confirm results</p>
<ul>
<li><p>185 °C 80 mm left = 60 % under extrusion</p></li>
<li><p>200 °C 31 mm Left = 11 % Under Extrusion</p></li>
<li><p>210 °C 32 mm Left = 12 % Under Extrusion</p></li>
<li><p>220 °C 28 mm Left = 8 % Under Extrusion</p></li>
<li><p>230 °C 25 mm Left = 5 % Under Extrusion</p></li>
</ul>
<p>When I feed 100 mm through the Bowden tube without the filament going through the hot end I get exactly 20 mm left meaning:</p>
<ul>
<li><p>0% under Extrusion</p>
<pre><code>echo: Steps per unit:
echo: M92 X80.00 Y80.00 Z400.00 E93.00
</code></pre></li>
</ul>
<p>I have been having this problem since I started. I normally print at 210 °C at 50 mm/s with a flow rate of 103 % which seems to work well for most prints but on flat walls on prints it under extrudes in the same spot each time it comes around to that point. </p>
<p>Steps I have taken so far:</p>
<ul>
<li><p>Different PLA filaments. All perform the same</p></li>
<li><p>Replaced the nozzle with a new one</p></li>
<li><p>Checked all fittings with the bowen tube system</p></li>
<li><p>Printed a spring spacer to make the spring tighter on the extruder gear</p></li>
<li><p>Changed the V<sub>ref</sub> from 0.75 to 1 for the extruder stepper</p></li>
</ul>
<p>The reason I changed the V<sub>ref</sub> on the extruder stepper is because the system would click back when printing as if the pressure was too great in the tube. Changing this has helped some of the under extrusion a bit.</p>
<p>So. depending on the temperature, it's harder or easier to push the filament by hand through the hot end. Maybe I need a better hot end?</p>
<p><a href="https://imgur.com/a/BhukLRb" rel="nofollow noreferrer">Examples</a>: </p>
<p>My test print to replicate the issue. The ripple bit is brittle and under extruded.</p>
<p><a href="https://i.stack.imgur.com/udUdz.jpg" rel="nofollow noreferrer" title="Test print - Image#1"><img src="https://i.stack.imgur.com/udUdz.jpg" alt="Test print - Image#1" title="Test print - Image#1"></a></p>
<p><a href="https://i.stack.imgur.com/br6vA.jpg" rel="nofollow noreferrer" title="Test print - Image#2"><img src="https://i.stack.imgur.com/br6vA.jpg" alt="Test print - Image#2" title="Test print - Image#2"></a></p>
<p>This was a Prototype piece for an up-sized print I was planning. After going around it under extrudes at the same point each time 210 °C</p>
<p><a href="https://i.stack.imgur.com/lPySW.jpg" rel="nofollow noreferrer" title="Prototype piece"><img src="https://i.stack.imgur.com/lPySW.jpg" alt="Prototype piece" title="Prototype piece"></a></p>
<p>Most of the print is fine just some parts are different. This is an inner wall.</p>
<p><a href="https://i.stack.imgur.com/qJNnr.jpg" rel="nofollow noreferrer" title="Inner wall"><img src="https://i.stack.imgur.com/qJNnr.jpg" alt="Inner wall" title="Inner wall"></a></p>
<p><a href="https://imgur.com/4THD6eY" rel="nofollow noreferrer">Heat towers</a></p>
|
<p>Obviously, your extrusion process is troubled by a lot of pressure. This can be seen from the extensive experiment you conducted with PLA extrusion at different temperatures. Please do note that 230 °C is considered pretty high for PLA! Usually it should be in the range of <a href="https://rigid.ink/blogs/news/3d-printing-basics-how-to-get-the-best-results-with-pla-filament" rel="nofollow noreferrer">185 - 205 °C</a>:</p>
<blockquote>
<p>In general, PLA filament settings have an optimal printing PLA
temperature range from about 185C to about 205C. If you’re using
1.75mm as opposed to thicker 2.85mm (or 3.00mm) your optimal print will be closer to the lower end of this PLA filament temperature
range.</p>
</blockquote>
<p>The temperature dependency of filament diameter is explained that small diameter filament warms up way faster in the heating zone of the hotend than large diameter filament as the heat travels less far to the filament core. Basically, with 1.75 mm filament you should be able to print at 195 °C. The pressure that the filament exerts on the hotend and extruder is clearly too much and leads to skipped steps.</p>
<p>It is <strong><em>strongly discouraged</em></strong> to create a function of steps per millimeter (or an over-extrusion by specifying a more than 100% flow modifier). This is a mechanical issue that needs to be fixed by addressing the hardware problem. Usually this is done by:</p>
<ul>
<li>fixing the extruder;
<ul>
<li>is it skipping steps? </li>
<li>does the filament tension get too high that it skips back pass the extruder gear?</li>
<li>does increase the stepper current work?</li>
</ul></li>
<li>fixing the Bowden tube;
<ul>
<li>is it clean?</li>
<li>is there too much friction?</li>
<li>are there kinks?</li>
</ul></li>
<li>fixing the hotend;
<ul>
<li>is the temperature that is reported the correct one? (thermistor problem?)</li>
<li>is the heat conducting properly to the nozzle?</li>
<li>is there a tolerance issue in the hotend/heatbreak?</li>
<li>is the coldend properly cooled?</li>
</ul></li>
</ul>
<p>A few of these you already explored, others you have not. Unfortunately, you have to do a little more troubleshooting the get to the bottom of the actual problem that is causing this pressure preventing the extruder to extrude the proper commanded length.</p>
|
<p>So I feel that I solved the problem thanks to a few sources. Thanks to 0scar for his quick response and help.</p>
<p>The problem was two fold. Mechanical problem causing blockage and slicer setting causing ripple.</p>
<ol>
<li>The PTFE tube wasn't pushed all the way in as far as it could go causing too much pressure in the hotend. This seems to be a really common problem with stock Ender 3's Because of the gap the hotend needed to heat up into the heat break to melt the lump in the gap between the hot end and the PTFE tube. </li>
<li>The slicing settings in cura had combing enabled. I set it to not comb on skin but what it was doing is combing just behind the skin and as a result would leak out filament in little blobs that when it printed the outer layer would be pushed out causing a ripple effect. This caused under extrusion once it finished the move because there wasnt enough filament left in the end.</li>
</ol>
<p>After I fixed these two things I was printing at 190c with no under extrusion, motor slipping, very little stringing and printing much better.</p>
| 1,109
|
<p>I have Windows File sharing enabled on an OS X 10.4 computer. It's accessible via \rudy\myshare for all the Windows users on the network, except for one guy running Vista Ultimate 64-bit edition. </p>
<p>All the other users are running Vista or XP, all 32-bit. All the workgroup information is the same, all login with the same username/password.</p>
<p>The Vista 64 guy can see the Mac on the network, but his login is rejected every time.</p>
<p>Now, I imagine that Vista Ultimate is has something configured differently to the Business version and XP but I don't really know where to look. Any ideas?</p>
|
<p>Try changing the local security policy on that Vista box for "Local Policies\Security Options\Network Security: LAN manager authentication level" from “Send NTLMv2 response only” to “Send LM & NTLM - use NTLMv2 session security if negotiated”.</p>
|
<p>No I have successfully done this with my Vista 64-bit machine. You may want to try using the IP Address of the machine and try connecting that way. Or maybe check out the log files on the Mac to see what the rejection error was.</p>
| 2,602
|
<p>I'm working on a project which uses .NET Remoting for communication between the client application and an object server. For development, the client, server, and MSSQL database are all running on my local development machine. </p>
<p>When I'm working at the office, the responsiveness is just fine. </p>
<p>However, when I work from home the speed is <strong><em>significantly</em></strong> slower. If I disconnect from the VPN, it speeds up (I believe, but maybe that's just wishful thinking). If I turn off my wireless connection completely it immediately speeds up to full throttle.</p>
<p>My assumption is that the remoting traffic is being routed through some point that is slowing everything down, albeit my home router and/or the VPN.</p>
<p>Does anyone have any ideas of how to force the remoting traffic to remain completely localized?</p>
|
<p>Perhaps during development you could use an IPC remoting channel which uses named pipes instead of TCP. If your remoting channels are set up via a config file then you won't even have to recompile.</p>
<p>I found the link below was useful when setting up an IPC channel.</p>
<p><a href="http://www.danielmoth.com/Blog/2004/09/ipc-with-remoting-in-net-20.html" rel="nofollow noreferrer">http://www.danielmoth.com/Blog/2004/09/ipc-with-remoting-in-net-20.html</a> </p>
|
<p>I worked on a project last summer that required some pretty heavy modifications to .NET Remoting. I don't remember all the specifics, but if we had more than one network interface, we couldn't get the out-of-the-box Remoting implementation to reliably detect which one the Remoting traffic came from, which did horrible things to performance. This sounds like a similar, if not the same, issue.</p>
| 2,698
|
<p>I'm looking to buy my first 3D Printer, on a tight budget of $250. Unfortunately, this printer that I found on Amazon comes with all the bells and whistles, <em>except</em> for a heated bed. </p>
<p>I want to know if this would affect printing severely, as I have read that the plastic/ filament cools down rather quickly, and that it results in Printer "fails". </p>
<p>I'm actually a bit nervous with this buy, as I don't want to spend $250 on a printer that produces 90% print fails.</p>
<p>An example of the printer I'm referring to is the <a href="http://rads.stackoverflow.com/amzn/click/B015FXQZ6O" rel="noreferrer">Cube 3 Printer, Grey
by 3D Systems</a>.</p>
|
<p>I've tried to reduce the "Extrusion multiplier" from 1 to 0.95, but that caused gaps. Now I've minimized the clicking by setting the Slic3r option "Infill before perimeters" on the "Print Settings > Infill" page.</p>
|
<p>I had this issue and it turned out to be the extruder cog rubbing on the inside of the hole in the heatsink, causing the stepper to slip. </p>
| 453
|
<p>I have a complete XML document in a string and would like a <code>Document</code> object. Google turns up all sorts of garbage. What is the simplest solution? (In Java 1.5)</p>
<p><strong>Solution</strong> Thanks to <a href="https://stackoverflow.com/users/1322/matt-mcminn">Matt McMinn</a>, I have settled on this implementation. It has the right level of input flexibility and exception granularity for me. (It's good to know if the error came from malformed XML - <code>SAXException</code> - or just bad IO - <code>IOException</code>.)</p>
<pre><code>public static org.w3c.dom.Document loadXMLFrom(String xml)
throws org.xml.sax.SAXException, java.io.IOException {
return loadXMLFrom(new java.io.ByteArrayInputStream(xml.getBytes()));
}
public static org.w3c.dom.Document loadXMLFrom(java.io.InputStream is)
throws org.xml.sax.SAXException, java.io.IOException {
javax.xml.parsers.DocumentBuilderFactory factory =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
javax.xml.parsers.DocumentBuilder builder = null;
try {
builder = factory.newDocumentBuilder();
}
catch (javax.xml.parsers.ParserConfigurationException ex) {
}
org.w3c.dom.Document doc = builder.parse(is);
is.close();
return doc;
}
</code></pre>
|
<p>This works for me in Java 1.5 - I stripped out specific exceptions for readability.</p>
<pre><code>import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import java.io.ByteArrayInputStream;
public Document loadXMLFromString(String xml) throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(new ByteArrayInputStream(xml.getBytes()));
}
</code></pre>
|
<p>To manipulate XML in Java, I always tend to use the Transformer API:</p>
<pre><code>import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
public static Document loadXMLFrom(String xml) throws TransformerException {
Source source = new StreamSource(new StringReader(xml));
DOMResult result = new DOMResult();
TransformerFactory.newInstance().newTransformer().transform(source , result);
return (Document) result.getNode();
}
</code></pre>
| 5,329
|
<p>I'm designing a few mechanisms with OpenSCAD, and one of the parameters that need adjustment between printers/filaments is allowances between pieces that need to be assembled together (for example, if I want a "5 mm diameter pin" to fasten two pieces together, how much larger than 5 mm will the holes / how much smaller than 5 mm will the pin need to be).</p>
<p>Currently I approach the problem by setting a global variable <code>allowance</code> and manually using it in the code, something like:</p>
<pre><code>module pin(radius) {
cylinder(r = radius + allowance)
}
module hole(radius) {
cylinder(r = radius - allowance)
}
</code></pre>
<p>I have no real world experience with design though, so I wonder if there are common or <strong>coding</strong> best practices to account for allowances when designing parts like for example:</p>
<ul>
<li>specific modules to be used,</li>
<li>conventional names for variables</li>
<li>specific techniques to be used (scaling? vectors?)</li>
<li>conventions (like only use tolerances on the fastener, not the fastened object)</li>
<li>...?</li>
</ul>
<p>To clarify: I'm not looking on advice on how to plan the dimensions of my designs. Rather, I am looking for advice on how to organise the OpenSCAD code generating them.</p>
|
<p>It helps to understand the different aspects of dimensions, so you can use the terminology correctly. This will help you define your variables in OpenSCAD with correct names. (Tolerance is the wrong term to use.) And once you have correct names, you'll understand how to specify the dimensions in OpenSCAD.</p>
<ul>
<li><em>Tolerance</em> is the amount of random deviation or variation permitted for a given dimension.</li>
<li><em>Allowance</em> is a planned difference between a nominal or reference value and an exact value. </li>
<li><em>Clearance</em> is the intentional space between two parts.</li>
<li><em>Interference</em> is the intentional overlap between two parts. </li>
</ul>
<p>Two other terms </p>
<ul>
<li><em>Accuracy</em> is the maximum dimensional variation between parts. A machine cannot produce parts with a tighter tolerance than its accuracy.</li>
<li><em>Precision</em> is the size of the steps your machine is capable of. It is often confused with accuracy.</li>
</ul>
<p>In your case you need to define the <em>allowance</em> in order to create the <em>clearance</em> you desire.</p>
<p>To design your 5 mm pin and 5 mm hole, you need to understand your machine's accuracy. The printer could print the pin larger than 5 mm or smaller than 5 mm. Or it could print the hole larger than 5 mm or smaller than 5 mm. You'll need to print some pins and holes and measure the differences between what you defined and what you printed. The difference between the largest and smallest measurements you take is your machine's accuracy. And be sure to check the accuracy in your X, Y, and Z dimensions; your printer might have a difference between them that would impact the roundness of the parts. </p>
<p>Let's say that your printer's measured accuracy is ± 0.2 mm.</p>
<p>Then, we move to clearance. What is the minimum gap between parts you are looking for, and what is the maximum you can accept?</p>
<p>Let's say you want a clearance of at least 0.2 mm between the pin and hole, but no more than 1.0 mm. Since your accuracy is ± 0.2 mm, your pin will be 5.0 ± 0.2 mm, so the hole must therefore be 5.6 mm ± 0.2 mm. The minimum tolerance condition would be an minimum sized hole (5.4 mm) and a maximum sized pin (5.2 mm); the maximum tolerance would be a maximum sized hole (5.8 mm) and a minimum sized pin (4.8 mm).</p>
<p>Note that a clearance of 1.0 mm might be too sloppy for your application. You might think to tighten the tolerances to 0.05 mm in order to reduce the clearance. But if your printer can't produce a part that meets your specified tolerances, you would need to find a different way to manufacture or finish the parts.</p>
|
<p>Well, the tolerances will depend on material to be used for fabrication of the required part and also where the part will go and fit. Remember the all parts need some clearance to fit properly.</p>
<p>Few years ago (10 years) I was working as Quality Engineer and some Design Engineers were complaining about a Dupont pin was not fitting on the PCB so they told me that I need to force the PCB manufacturing to increase the holes to the higher tolerance. Which I had to ask him firstly the pin size and told me 0.70 mm and hole size 0.80 and maximum 0.90
- hmmm and maximum size of the pin? I asked, and they told me proudly 0.78mm so the part will fit perfectly.
- Oh, so one square pin of 0.78mm will fit on one hole of 0.9mm, but what about the diagonal dimension? if the pin on the higher dimension is close to 1.2mm.</p>
<p>Imagine what happened later, engineering changes and modifying other designs due improper tolerances. pro-engineer software was unable to calculate what the designers needed.</p>
<p>Material has shrinkage, warpage, and other conditions that is needed to know like malleability and hardness and some of this data is on the specification material or the part specification.</p>
| 769
|
<p>I got a life size model of a signaling post (trains) where I scale it down to 1/87 model (in SketchUp). When I send the model to my 3D printer (with Cura 2.4) some parts of the model are lost in translation even when their dimensions exceed the printer minimal dimension of 0.7 mm. </p>
<p>Is this a known problem of Cura or is something else at hand?</p>
|
<p>Yes, with the proper equipment.</p>
<p>Printing wax filament (at 51 seconds): <a href="https://youtu.be/tibkVZB_n9c?t=51s" rel="noreferrer">https://youtu.be/tibkVZB_n9c?t=51s</a></p>
<p>There are also options for melting wax, filling a heated reservoir head, and printing with that. I recommend doing this with a cold ambient temperature, so that the wax solidifies quickly. There's no point in just printing a puddle. :)</p>
|
<p>Just make a silicone mold of any of your prints and pour you wax in the silicone,you silicone putty is pretty cheap so is wax ,no need to break the bank as printers have become less expensive and can do a pretty good job </p>
| 632
|
<p>I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in many browsers.</p>
<p>I might be able to solve this with a JavaScript trick (I'd like to see those answers, too) -- but I'm really hoping there's something in CSS/HTML directly that works across all browsers.</p>
|
<p>In most browsers, this can be achieved using CSS:</p>
<pre class="lang-css prettyprint-override"><code>*.unselectable {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
/*
Introduced in IE 10.
See http://ie.microsoft.com/testdrive/HTML5/msUserSelect/
*/
-ms-user-select: none;
user-select: none;
}
</code></pre>
<p>For IE < 10 and Opera, you will need to use the <code>unselectable</code> attribute of the element you wish to be unselectable. You can set this using an attribute in HTML:</p>
<pre><code><div id="foo" unselectable="on" class="unselectable">...</div>
</code></pre>
<p>Sadly this property isn't inherited, meaning you have to put an attribute in the start tag of every element inside the <code><div></code>. If this is a problem, you could instead use JavaScript to do this recursively for an element's descendants:</p>
<pre><code>function makeUnselectable(node) {
if (node.nodeType == 1) {
node.setAttribute("unselectable", "on");
}
var child = node.firstChild;
while (child) {
makeUnselectable(child);
child = child.nextSibling;
}
}
makeUnselectable(document.getElementById("foo"));
</code></pre>
|
<p>The following works in Firefox interestingly enough if I remove the write line it doesn't work.
Anyone have any insight why the write line is needed.</p>
<pre><code><script type="text/javascript">
document.write(".");
document.body.style.MozUserSelect='none';
</script>
</code></pre>
| 9,480
|
<p>I use Firebug and the Mozilla JS console heavily, but every now and then I run into an IE-only JavaScript bug, which is really hard to locate (ex: <em>error on line 724</em>, when the source HTML only has 200 lines).</p>
<p>I would love to have a lightweight JS tool (<em>a la</em> firebug) for Internet Explorer, something I can install in seconds on a client's PC if I run into an error and then uninstall. Some Microsoft tools take some serious download and configuration time.</p>
<p>Any ideas?</p>
|
<p>You might find <a href="http://getfirebug.com/lite.html" rel="noreferrer">Firebug Lite</a> useful for that. </p>
<p>Its bookmarklet should be especially useful when debugging on a user's machine.</p>
|
<ol>
<li>Go to Tools->Internet Options…->Advanced->Enable Script Debugging (Internet Explorer)</li>
</ol>
<p>then attach Visual Studio Debugger when an error occurs.</p>
<p>If you're using IE 8, install the developer toolbar because it has a built in debugger.</p>
| 2,553
|
<p>I've made a 9H-printing model tonight, and only a little part of it failed (because a support dropped off). I want to reprint only that little part.</p>
<p>How can I do that in Cura? <strong>How can I tell Cura to generate a gcode file so only that little part (inside the transparent cube below) will be printed?</strong></p>
<p><a href="https://i.stack.imgur.com/hJflC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hJflC.png" alt="The part I want to print is the one inside the transparent cube"></a></p>
<p>I've placed the model upside-down on the Cura plate to "cut off" what was well printed. I've made a simple 3D cube model in Blender and placed it so it intersect with the part I want to print (I've set the "mesh type" of that cube to "don't support overlaps" for that). I've tried using "Mesh fixes: disable Union Overlapping Volumes" and the "Merge meshes" option, but the merge aligns the cube origin and the model origin (which I don't want).</p>
<p>What's the proper way to do such partial printing?</p>
|
<p>The latest version of Ultimaker Cura can do that (version 3.6).</p>
<p>I have built models made of different material in the same model.</p>
<p>How to do this is:</p>
<ol>
<li>Select your CUBE and select the icon "Per Model Setting" in left side menu.</li>
<li>choice "Normal model", select the following settings: Top/bottom thickness, wall thickness and infill percentage</li>
<li>Very Important: all above settings must be set to 0!</li>
<li>Select the model you desire to print and select the icon "Per Model Setting" in left side menu</li>
<li>choice "Modify settings for overlap with other model" and select the following settings: Top/bottom thickness, wall thickness and infill percentage</li>
<li>Select the desired infill percentage and the wall top/bottom thickness for the portion you want print</li>
<li>slice the model</li>
</ol>
<p>Note: If you need to print supports, then in step 2 select "Modify settings for infill of other models" (instead of "Normal Model"), and in step 6 also select "Add Support" and any other support related parameters you may need. However, Cura needs at least one "Normal Model" to slice, so to fool it you need to also another Cube as "Normal Model" with the parameters of step 4 somewhere else in your build plate (it won't really print).</p>
|
<p>What you can also try is to separate the part from the rest of the model within your CAD software. In FreeCAD for example, you can use the mesh design workbench to cut the small part away from the rest, then you slice this small piece and print it.</p>
| 905
|
<p>How do I generate an ETag HTTP header for a resource file?</p>
|
<p>An etag is an arbitrary string that the server sends to the client that the client will send back to the server the next time the file is requested.</p>
<p>The etag should be computable on the server based on the file. Sort of like a checksum, but you might not want to checksum every file sending it out.</p>
<pre><code> server client
<------------- request file foo
file foo etag: "xyz" -------->
<------------- request file foo
etag: "xyz" (what the server just sent)
(the etag is the same, so the server can send a 304)
</code></pre>
<p>I built up a string in the format "datestamp-file size-file inode number". So, if a file is changed on the server after it has been served out to the client, the newly regenerated etag won't match if the client re-requests it.</p>
<pre class="lang-c prettyprint-override"><code>char *mketag(char *s, struct stat *sb)
{
sprintf(s, "%d-%d-%d", sb->st_mtime, sb->st_size, sb->st_ino);
return s;
}
</code></pre>
|
<p>I would recommend not using them and going for last-modified headers instead.</p>
<p>Askapache has a useful article on this. (as they do pretty much everything it seems!)</p>
<p><a href="http://www.askapache.com/htaccess/apache-speed-etags.html" rel="nofollow noreferrer">http://www.askapache.com/htaccess/apache-speed-etags.html</a></p>
| 2,652
|
<p>I'm trying to use maven2 to build an axis2 project. My project is configured as a parent project with AAR, WAR, and EAR modules. When I run the parent project's package goal, the console shows a successful build and all of the files are created. However the AAR file generated by AAR project is not included in the generated WAR project. The AAR project is listed as a dependency of WAR project. When I explicitly run the WAR's package goal, the AAR file is then included in the WAR file.</p>
<p>Why would the parent's package goal not include the necessary dependency while running the child's package goal does?</p>
<p>I'm using the maven-war-plugin v2.1-alpha-2 in my war project.</p>
<p>Parent POM:</p>
<pre><code><parent>
<groupId>companyId</groupId>
<artifactId>build</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.nationwide.nf</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>
<modules>
<module>ws-war</module>
<module>ws-aar</module>
<module>ws-ear</module>
</modules>
</code></pre>
<p>AAR POM:</p>
<pre><code><parent>
<artifactId>parent</artifactId>
<groupId>companyId</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>companyId</groupId>
<artifactId>ws-aar</artifactId>
<version>1.0.0-SNAPSHOT</version>
<description/>
<packaging>aar</packaging>
<dependencies>...</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-wsdl2code-maven-plugin</artifactId>
<version>1.4</version>
<configuration>...</configuration>
<executions>
<execution>
<goals>
<goal>wsdl2code</goal>
</goals>
<id>axis2-gen-sources</id>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-aar-maven-plugin</artifactId>
<version>1.4</version>
<extensions>true</extensions>
<configuration>...</configuration>
</plugin>
</plugins>
</build>
</code></pre>
<p>WAR POM:</p>
<pre><code><parent>
<artifactId>parent</artifactId>
<groupId>companyId</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>companyId</groupId>
<artifactId>ws-war</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<description/>
<dependencies>
<dependency>
<groupId>companyId</groupId>
<artifactId>ws-aar</artifactId>
<type>aar</type>
<version>1.0.0-SNAPSHOT</version>
</dependency>
.
.
.
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-2</version>
<configuration>
<warName>appName</warName>
</configuration>
</plugin>
</plugins>
</build>
</code></pre>
<p>Thanks,
Joe</p>
|
<p>I was able to get my maven build working correctly by adding the following plugin to the ws-war pom file:</p>
<pre><code> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/${project.build.finalName}/WEB-INF/services
</outputDirectory>
<includeArtifactIds>
ws-aar
</includeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
</code></pre>
|
<p>Have you tried using the "type" element in your dependencies? For example:</p>
<pre><code><dependency>
<groupId>group-a</groupId>
<artifactId>artifact-b</artifactId>
<version>1.0</version>
<type>aar</type>
</dependency>
</code></pre>
<p>Its hard to say for sure what your problem is without seeing your actual pom files.</p>
<p>Update:</p>
<p>What happens if, from the parent project, you run:</p>
<pre><code> mvn clean install
</code></pre>
<ol>
<li>Does "install" have any different behavior than "package" as far as your problem is concerned?</li>
<li>Do you see the .aar file in your local maven repository (~/.m2/repository/com/mycompany/.../)?</li>
</ol>
<p>As a side note, i've never been very happy with the maven war plugin. I've always ended up using the maven assembly plugin. It just seems to work better and is more consistent. Also, make sure you are using the latest version of maven (2.0.9). I spent half a day fighting a similar problem which was fixed in the latest version.</p>
| 9,918
|
<p>Testing my new Wanhao i3+. PLA plastic(Wanhao), basic normal quality settings in Cura (I guess 0.1 mm layer, 40 mm/s speed, 60c bed temp, 200c extruder temp). After 1.5 hours of printing quality degraded, it makes some loose structure. </p>
<p>Edit:
After finish I noticed that problem exists only in layers where it cycles printing/no printing. There is no problem on layers where it print continuously.</p>
<p>What is the reason can be and how can I fix that?</p>
<p><a href="https://i.stack.imgur.com/W90dj.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/W90dj.jpg" alt="enter image description here"></a></p>
|
<p><strong>It definitely looks like under extrusion.</strong> </p>
<ol>
<li>First thing I would check is the filament feeder to make sure it has
a good grip in the filament.</li>
<li>After that I would do another print to see if the problem is repeatable.</li>
</ol>
<p>If it doesn't repeat, it may have been </p>
<ul>
<li>A temporarily clogged nozzle</li>
<li>The filament was undersized in that segment and the filament feeder lost its grip.</li>
<li>The extruder got to cold for some reason in that segment and the feeder couldn't push the material through the extruder fast enough.</li>
</ul>
<p>If it does repeat:</p>
<ul>
<li>Re-inspect the filament feeder</li>
<li>Try increasing the the extruder temp to say, 225.</li>
<li>Try turning off retraction to see if it is related to those settings.</li>
</ul>
|
<p><strong>It definitely looks like under extrusion.</strong> </p>
<ol>
<li>First thing I would check is the filament feeder to make sure it has
a good grip in the filament.</li>
<li>After that I would do another print to see if the problem is repeatable.</li>
</ol>
<p>If it doesn't repeat, it may have been </p>
<ul>
<li>A temporarily clogged nozzle</li>
<li>The filament was undersized in that segment and the filament feeder lost its grip.</li>
<li>The extruder got to cold for some reason in that segment and the feeder couldn't push the material through the extruder fast enough.</li>
</ul>
<p>If it does repeat:</p>
<ul>
<li>Re-inspect the filament feeder</li>
<li>Try increasing the the extruder temp to say, 225.</li>
<li>Try turning off retraction to see if it is related to those settings.</li>
</ul>
| 649
|
<p>I've had a lot of good experiences learning about web development on <a href="http://www.w3schools.com/" rel="nofollow noreferrer">w3schools.com</a>. It's hit or miss, I know, but the PHP and CSS sections specifically have proven very useful for reference.</p>
<p>Anyway, I was wondering if there was a similar site for <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow noreferrer">jQuery</a>. I'm interested in learning, but I need it to be online/searchable, so I can refer back to it easily when I need the information in the future.</p>
<p>Also, as a brief aside, is jQuery worth learning? Or should I look at different JavaScript libraries? I know Jeff uses jQuery on Stack Overflow and it seems to be working well.</p>
<p>Thanks!</p>
<p><strong>Edit</strong>: jQuery's website has a <a href="http://docs.jquery.com/Tutorials" rel="nofollow noreferrer">pretty big list of tutorials</a>, and a seemingly comprehensive <a href="http://docs.jquery.com/Main_Page" rel="nofollow noreferrer">documentation page</a>. I haven't had time to go through it all yet, has anyone else had experience with it?</p>
<p><strong>Edit 2</strong>: It seems Google is now hosting the jQuery libraries. That should give jQuery a pretty big advantage in terms of publicity. </p>
<p>Also, if everyone uses a single unified aQuery library hosted at the same place, it should get cached for most Internet users early on and therefore not impact the download footprint of your site should you decide to use it.</p>
<h2>2 Months Later...</h2>
<p><strong>Edit 3</strong>: I started using jQuery on a project at work recently and it is great to work with! Just wanted to let everyone know that I have concluded it is <strong><em>ABSOLUTELY</em></strong> worth it to learn and use jQuery.</p>
<p>Also, I learned almost entirely from the Official jQuery <a href="http://docs.jquery.com/Main_Page" rel="nofollow noreferrer">documentation</a> and <a href="http://docs.jquery.com/Tutorials" rel="nofollow noreferrer">tutorials</a>. It's very straightforward.</p>
<h2>10 Months Later...</h2>
<p>jQuery is a part of just about every web app I've made since I initially wrote this post. It makes progressive enhancement a breeze, and helps make the code maintainable.</p>
<p>Also, all the jQuery plug-ins are an invaluable resource!</p>
<h2>3 Years Later...</h2>
<p>Still using jQuery just about every day. I now author jQuery plug-ins and consult full time. I'm primarily a Djangonaut but I've done several javascript only contracts with jQuery. It's a life saver.</p>
<p>From one jQuery user to another... You should look at <a href="http://api.jquery.com/category/plugins/templates/" rel="nofollow noreferrer">templating with jQuery</a> (or underscore -- see below).</p>
<p>Other things I've found valuable in addition to jQuery (with estimated portion of projects I use it on):</p>
<ul>
<li><a href="http://jquery.malsup.com/form/" rel="nofollow noreferrer">jQuery Form Plugin</a> (95%)</li>
<li><a href="http://mudge.github.com/jquery_example/" rel="nofollow noreferrer">jQuery Form Example Plugin</a> (75%)</li>
<li><a href="http://jqueryui.com/" rel="nofollow noreferrer">jQuery UI</a> (70%)</li>
<li><a href="http://documentcloud.github.com/underscore/" rel="nofollow noreferrer">Underscore.js</a> (80%)</li>
<li><a href="http://jashkenas.github.com/coffee-script/" rel="nofollow noreferrer">CoffeeScript</a> (30%)</li>
<li><a href="http://documentcloud.github.com/backbone/" rel="nofollow noreferrer">Backbone.js</a> (10%)</li>
</ul>
|
<p>Rick Strahl and Matt Berseth's blogs both tipped me into jQuery and man am I glad they did. jQuery completely changes a) your client programming perspective, b) the grief it causes it you, and c) how much fun it can be! </p>
<p><a href="http://www.west-wind.com/weblog/" rel="noreferrer">http://www.west-wind.com/weblog/</a></p>
<p><a href="http://mattberseth.com/" rel="noreferrer">http://mattberseth.com/</a></p>
<p>I used the book jQuery in Action
<a href="https://rads.stackoverflow.com/amzn/click/com/1933988355" rel="noreferrer" rel="nofollow noreferrer">http://www.amazon.com/jQuery-Action-Bear-Bibeault/dp/1933988355/ref=sr_1_1?ie=UTF8&s=books&qid=1219716122&sr=1-1</a> (I bought it used at Amazon for about $22). It has been a big help into bootstrapping me into jQuery. The documentation at jquery.com are also very helpful.</p>
<p>A place where jQuery falls a little flat is with its UI components. Those don't seem to be quite ready for primetime just yet. </p>
<p>It could be that <a href="http://en.wikipedia.org/wiki/Prototype_JavaScript_Framework" rel="noreferrer">Prototype</a> or <a href="http://en.wikipedia.org/wiki/MooTools" rel="noreferrer">MooTools</a> or <a href="http://en.wikipedia.org/wiki/Ext_%28JavaScript_library%29" rel="noreferrer">ExtJS</a> are as good as jQuery. But for me, jQuery seems to have a little more momentum behind it right now and that counts for something for me. </p>
<p>Check jQuery out. It is very cool! </p>
|
<p>I use <a href="http://prototypejs.org/" rel="nofollow noreferrer">Prototype</a>, which I like. I'm afraid I don't know jQuery, so I can't compare them, but I think Prototype is worth checking out. Their API docs are generally pretty good, in my experience (which certainly helps with learnability).</p>
| 4,687
|
<p>What is the best way to multi-thread in the C language? I want something that is very efficient and not a CPU hog. Thanks.</p>
|
<p>The correct (standard) way to do this on C and Windows is with <a href="http://msdn.microsoft.com/en-us/library/kdzttdcb.aspx" rel="nofollow noreferrer">__beginthreadex</a>.</p>
<p>This is usually preferred to calling <a href="http://msdn.microsoft.com/en-us/library/kdzttdcb.aspx" rel="nofollow noreferrer">CreateThread</a> directly as CreateThread doesn't init C runtime support for the thread. So if you create a thread using CreateThread, and call a CRT function, bad stuff can/will happen.</p>
<p>Note that __beginthreadex calls CreateThread internally, but performs some other work behind the scenes.</p>
|
<p>Your question is a bit general to answer effectively. You might look into such things as:</p>
<p>CreateThread in the windows SDK</p>
<p>boost::thread</p>
| 6,469
|
<p>There is a 3D desktop printer <a href="https://en.wikipedia.org/wiki/RepRap_project">RepRap</a> which can print most of its own components.</p>
<p>Assuming each printed printer will print the next one and so on. Are there any limitation how many times this can be achieved?</p>
<p>For example somebody printed for me printer and I do the same for my friends and they do the same for theirs. Can this go forever (since 3D model stays the same), or there are any serious side-effects/disadvantages of doing that continuously?</p>
|
<p>The files used to print these objects are digital, and do not degrade in any way after each printing. There are no side effects or degradation that occurs over time due simply to printing them multiple times.</p>
<p>This is the RepRap philosophy, and the machines are actually designed with enough tolerance for printing and building mistakes that even if the print isn't perfect, it will not only work fine, but it can print a printer better than it was printed, with some care and attention to calibration.</p>
<p>The process still takes a lot of human intervention, in the way of building the new printer and properly calibrating it. If there are errors in the printer or the prints it produces, they can almost always be attributed to the builder/calibrator/user, and not to the design or the fact it's the Nth generation of printer.</p>
|
<p>As long as you maintain each printer and keep a proper calibration, go for it, this is what they were designed to do, I've even made replacement parts for myself.</p>
<p>Unfortunately the <a href="https://en.wikipedia.org/wiki/RepRap_project#History" rel="nofollow">RepRap project just shut down on 1/15/16</a> due to their lack of sales.</p>
<p>I have a reprap that came from a reprap, and has made another reprap.</p>
<p>Just make sure that when printing out the pieces for the next you are properly calibrated, otherwise the next machine might be built crooked;</p>
<p>Your only limitations will be the electronics pieces and the small amount of hardware that you will need to buy.</p>
| 96
|
<p>I'm using the VBO extension for storing Vertex, normal and color buffers (glBindBufferARB)
For some reason when changing buffers or doing some operation the application crashes with an access violation. When attaching The debugger I see that the crash is in some thread that is not my main thread which performs the opengl call with the execution in some dll which is related to the nvidia graphics driver.</p>
<p>What probably happened is that I gave some buffer call a bad buffer or with a wrong size. So my question is, how do I debug this situation? The crash seem to happen some time after the actual call and in a different thread.</p>
|
<p>Assuming this is about Windows, NVIDIA has a <a href="http://developer.nvidia.com/object/glexpert_home.html" rel="nofollow noreferrer">GLExpert</a> tool. It can print various OpenGL warnings/errors.</p>
<p>In some other cases, using <a href="http://glintercept.nutty.org/" rel="nofollow noreferrer">GLIntercept</a> OpenGL call interceptor with error checking turned on can be useful.</p>
<p>If the tools do not help, well, then it's good old debugging. Try to narrow down the problem and locate what exactly causes a crash. If it's a NVIDIA specific problem, try installing different drivers and/or asking on NVIDIA developer forums.</p>
|
<p>One of the best OpenGl/D3D debugging tools is nVidia's NvPerfHUD. It won't help you find your exact problem, but it does provide another view of what you are sending into the rendering pipeline.</p>
<p>However, I will say that I've only used it with D3D applications so I don't know if it helps as much with OpenGL programs. </p>
<p>EDIT:</p>
<p>I'm not sure why this got voted down. I have debugged VB and IB problems with NvPerfHUD before. Simple things such as bad primitive counts and be diagnosed by looking at each individual draw call.</p>
| 9,154
|
<p>We're using Mercurial where I work and I want to have a setup similar to how I used SVN:</p>
<ul>
<li>Trunk</li>
<li>Tags
<ul>
<li>Production</li>
</ul></li>
<li>Branches</li>
</ul>
<p>Since Mercurial supports branches natively, I know how to create a named branch, but I can't find any documentation on how to repeatedly merge 'Trunk' with 'Production'. </p>
<p>Quite simply, I want to have a development branch for normal work and a production branch that I routinely pull changes from the development branch into. How do I do this with Mercurial?</p>
|
<p>As the previous poster mentioned, the transplant extension can be used for cherry-picking individual changes from one branch to another. If, however, you always want to pull <em>all</em> the latest changes, the <code>hg merge</code> command will get you there.</p>
<p>The simplest case is when you're using clones to implement branching (since that's the use case Mercurial is designed around). Assuming you've turned on the built-in <a href="http://www.selenic.com/mercurial/wiki/index.cgi/FetchExtension" rel="noreferrer">fetch</a> extension in your <code>.hgrc</code> / <code>Mercurial.ini</code>:</p>
<pre><code>cd ~/src/development
# hack hack hack
hg commit -m "Made some changes"
cd ../production
hg fetch ../development
</code></pre>
<p>If you're using local branches:</p>
<pre><code>hg update -C development
# hack hack hack
hg commit -m "Made some changes"
hg update -C production
hg merge development
hg commit -m "Merged from development"
</code></pre>
|
<p>Something like <a href="http://www.selenic.com/mercurial/wiki/index.cgi/TransplantExtension" rel="nofollow noreferrer"><code>hg transplant</code></a>? That's what we use on our dev and prod branches.</p>
| 7,294
|
<p>It seems obvious that some people have been able to figure out how to access the iPhone camera through the SDK (Spore Origins, for example). How can this be done?</p>
|
<p>You need to use the <code>UIImagePickerController</code> class, basically:</p>
<pre><code>UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = pickerDelegate
picker.sourceType = UIImagePickerControllerSourceTypeCamera
</code></pre>
<p>The <code>pickerDelegate</code> object above needs to implement the following method:</p>
<pre><code>- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
</code></pre>
<p>The dictionary <code>info</code> will contain entries for the original, and the edited image, keyed with <code>UIImagePickerControllerOriginalImage</code> and <code>UIImagePickerControllerEditedImage</code> respectively. (see <a href="https://developer.apple.com/documentation/uikit/uiimagepickercontrollerdelegate" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/uiimagepickercontrollerdelegate</a> and <a href="https://developer.apple.com/documentation/uikit/uiimagepickercontrollerinfokey" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/uiimagepickercontrollerinfokey</a> for more details)</p>
|
<p>Hmmmm.....Ever tried using an OverlayView? With this the camera might look customized but in actuality its just a view above it.</p>
<p>If the private API's are directly accessed it might result in the app being rejected by Apple.
See if the below link helps.</p>
<p><a href="http://www.articlesbase.com/programming-articles/custom-camera-applications-development-using-iphone-sdk-766832.html" rel="noreferrer">link text</a></p>
| 9,981
|
<p>I have been searching everywhere for the following functionality in Lisp, and have gotten nowhere:</p>
<ol>
<li><p>find the index of something in a list. example:</p>
<pre><code>(index-of item InThisList)
</code></pre></li>
<li><p>replace something at a specific spot in a list. example:</p>
<pre><code>(replace item InThisList AtThisIndex) ;i think this can be done with 'setf'?
</code></pre></li>
<li><p>return an item at a specific index. example:</p>
<pre><code>(return InThisList ItemAtThisIndex)
</code></pre></li>
</ol>
<p>Up until this point, I've been faking it with my own functions. I'm wondering if I'm just creating more work for myself.</p>
<p>This is how I've been faking number 1:</p>
<pre><code>(defun my-index (findMe mylist)
(let ((counter 0) (found 1))
(dolist (item mylist)
(cond
((eq item findMe) ;this works because 'eq' checks place in memory,
;and as long as 'findMe' was from the original list, this will work.
(setq found nil)
(found (incf counter))))
counter))
</code></pre>
|
<p>You can use <code>setf</code> and <code>nth</code> to replace and retrieve values by index.</p>
<pre><code>(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101); <----
myList)
(1 2 3 4 101 6)
</code></pre>
<p>To find by index you can use <a href="http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/node145.html" rel="nofollow noreferrer">the <code>position</code> function</a>.</p>
<pre><code>(let ((myList '(1 2 3 4 5 6)))
(setf (nth 4 myList) 101)
(list myList (position 101 myList)))
((1 2 3 4 101 6) 4)
</code></pre>
<p>I found these all <a href="http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/html/cltl/clm/index.html" rel="nofollow noreferrer">in this index of functions</a>.</p>
|
<p>I have to agree with Thomas. If you use lists like arrays then that's just going to be slow (and possibly awkward). So you should either use arrays or stick with the functions you've written but move them "up" in a way so that you can easily replace the slow lists with arrays later.</p>
| 6,703
|
<p>Imagine I have String in C#: "I Don’t see ya.."</p>
<p>I want to remove (replace to nothing or etc.) these "’" symbols. </p>
<p>How do I do this?</p>
|
<p>That 'junk' looks a lot like someone interpreted UTF-8 data as ISO 8859-1 or Windows-1252, probably repeatedly.</p>
<p>’ is the sequence C3 A2, E2 82 AC, E2 84 A2.</p>
<ul>
<li>UTF-8 C3 A2 = U+00E2 = â</li>
<li>UTF-8 E2 82 AC = U+20AC = €</li>
<li>UTF-8 E2 84 A2 = U+2122 = ™</li>
</ul>
<p>We then do it again: in Windows 1252 this sequence is E2 80 99, so the character should have been U+2019, RIGHT SINGLE QUOTATION MARK (’)</p>
<p>You could make multiple passes with byte arrays, Encoding.UTF8 and Encoding.GetEncoding(1252) to correctly turn the junk back into what was originally entered. You will need to check your processing to find the two places that UTF-8 data was incorrectly interpreted as Windows-1252.</p>
|
<p>The ASCII / Integer code for these characters would be out of the normal alphabetic Ranges. Seek and replace with empty characters. String has a Replace method I believe.</p>
| 9,830
|
<p>I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?</p>
<p>EDIT: There are 53 columns in this table (NOT MY DESIGN)</p>
|
<p>Actually there is a way, you need to have permissions of course for doing this ...</p>
<pre><code>SET @sql = CONCAT('SELECT ', (SELECT REPLACE(GROUP_CONCAT(COLUMN_NAME), '<columns_to_omit>,', '') FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '<table>' AND TABLE_SCHEMA = '<database>'), ' FROM <table>');
PREPARE stmt1 FROM @sql;
EXECUTE stmt1;
</code></pre>
<p>Replacing <code><table>, <database> and <columns_to_omit></code></p>
|
<p>Im pretty late at throing out an answer for this, put this is the way i have always done it and frankly, its 100 times better and neater than the best answer, i only hope someone will see it. And find it useful</p>
<pre><code> //create an array, we will call it here.
$here = array();
//create an SQL query in order to get all of the column names
$SQL = "SHOW COLUMNS FROM Table";
//put all of the column names in the array
foreach($conn->query($SQL) as $row) {
$here[] = $row[0];
}
//now search through the array containing the column names for the name of the column, in this case i used the common ID field as an example
$key = array_search('ID', $here);
//now delete the entry
unset($here[$key]);
</code></pre>
| 3,058
|
<p>What steps I need to perform in order to convert asp.net 2 application from IIS7 classic to integrated mode?</p>
|
<p>Here is a process:
<a href="http://www.west-wind.com/WebLog/posts/6075.aspx" rel="noreferrer">Rick Strahl's blog</a></p>
|
<p>Nothing really. ASP.NET 2.0 applications will run just as they have in IIS 6.0. If you want to take advantage of any of the new features then you just need to update your code. But unless you are changing the structure of the header of the response or intercepting requests for other applications you probably will not need to do anything.</p>
| 3,193
|
<p>Comparing string in C# is pretty simple. In fact there are several ways to do it. I have listed some in the block below. What I am curious about are the differences between them and when one should be used over the others? Should one be avoided at all costs? Are there more I haven't listed? </p>
<pre><code>string testString = "Test";
string anotherString = "Another";
if (testString.CompareTo(anotherString) == 0) {}
if (testString.Equals(anotherString)) {}
if (testString == anotherString) {}
</code></pre>
<p>(Note: I am looking for equality in this example, not less than or greater than but feel free to comment on that as well)</p>
|
<p>Here are the rules for how these functions work:</p>
<p><strong><code>stringValue.CompareTo(otherStringValue)</code></strong></p>
<ol>
<li><code>null</code> comes before a string</li>
<li>it uses <code>CultureInfo.CurrentCulture.CompareInfo.Compare</code>, which means it will use a culture-dependent comparison. This might mean that <code>ß</code> will compare equal to <code>SS</code> in Germany, or similar</li>
</ol>
<p><strong><code>stringValue.Equals(otherStringValue)</code></strong></p>
<ol>
<li><code>null</code> is not considered equal to anything</li>
<li>unless you specify a <code>StringComparison</code> option, it will use what looks like a direct ordinal equality check, i.e. <code>ß</code> is not the same as <code>SS</code>, in any language or culture</li>
</ol>
<p><strong><code>stringValue == otherStringValue</code></strong></p>
<ol>
<li>Is not the same as <code>stringValue.Equals()</code>.</li>
<li>The <code>==</code> operator calls the static <code>Equals(string a, string b)</code> method (which in turn goes to an internal <code>EqualsHelper</code> to do the comparison.</li>
<li>Calling <code>.Equals()</code> on a <code>null</code> string gets <code>null</code> reference exception, while on <code>==</code> does not.</li>
</ol>
<p><strong><code>Object.ReferenceEquals(stringValue, otherStringValue)</code></strong></p>
<p>Just checks that references are the same, i.e. it isn't just two strings with the same contents, you're comparing a string object with itself.</p>
<hr>
<p>Note that with the options above that use method calls, there are overloads with more options to specify how to compare.</p>
<p>My advice if you just want to check for equality is to make up your mind whether you want to use a culture-dependent comparison or not, and then use <code>.CompareTo</code> or <code>.Equals</code>, depending on the choice.</p>
|
<p>Using .Equals is also a lot easier to <em>read</em>.</p>
| 6,603
|
<p>I have a Flashforge Creator Dual.</p>
<p>One corner of my print bed is warped down. I am thinking about having a steel print bed made so it would tend to stay flat. </p>
<p>Has anyone tried this?</p>
|
<p>Whether you should use steel or aluminum depends on the construction of your print bed stack. Either will work, but there are trade-offs involved.</p>
<p>Various considerations that may come into play:</p>
<ul>
<li>A flat sheet of aluminum has better <strong>stiffness/weight ratio</strong> than a flat sheet of steel. If weight/mass is a concern, such as with a Mendel style moving Y-bed, aluminum may be superior to an equivalent stiffness steel sheet. On the other hand, steel has the superior <strong>stiffness/thickness ratio</strong>, so if the total thickness of the plate is constrained, such as by the printer's mounting hardware, steel may be higher performance. In short, for sheets of equivalent stiffness, aluminum will be thicker but lighter. That may or may not matter for your specific printer. </li>
<li>Differential thermal expansion can be an issue, depending on what the plate is attached to. For example, rigidly bolting a steel sheet to an aluminum sub-frame will cause the structure to warp when its temperature changes. Likewise for bolting an aluminum sheet to a steel sub-frame. Bed mounts that "float" will not cause warping in either case. </li>
<li>All kinds of rolled sheet metal may have a tendency to warp when heated/cooled, due to residual stresses and grain alignment effects from manufacture. When people want extreme dimensional stability for the flattest and lowest-warp print bed possible, an aluminum cast tooling plate material such as MIC 6 is usually used. The MIC 6 sheet is then precision ground to be flat. Of course, that adds cost. </li>
<li>Neither aluminum nor steel is a particularly good <em>bare</em> print surface. Either will need some kind of adhesion layer, like Kapton tape or gluestick. The adhesion layer matters far more than the type of metal underneath.</li>
<li>Aluminum sheets are often used as <strong>heat-spreaders</strong> to even out the bed temperature of heated beds. This is very important when heaters are smaller than the total bed size, or have hot spots. (Most heaters do have hot spots.) Steel is a relatively poor conductor of heat, so the surface of the bed will take longer to heat up and will be less even. That may or may not be an issue, depending on the printer and desired materials. </li>
</ul>
<p>So, it's really a holistic design decision. Aluminum is far more common because of its thermal properties and lower weight, but steel print beds (particularly with permanent adhesion coatings) are often used too. </p>
|
<p>I would consider getting another aluminum build plate for the following reasons:</p>
<ul>
<li><strong>Lightweight</strong>. Aluminum is a very lightweight metal, making it suitable for most machines that have injection molded platform arms. This reduces potential sagging of the arms and overall load on the -Z- axis stepper motor.</li>
<li><strong>Conductivity</strong>. Referring to <a href="http://www.engineeringtoolbox.com/thermal-conductivity-d_429.html" rel="noreferrer">this</a> simple Google search for heat conductivity, aluminum is significantly more conductive than steel (205 vs 43 respectively) with copper at about double that of aluminum.</li>
<li><strong>Availability</strong>. Aluminum is already a widely used material for 3D printing, so finding one will be relatively easy and probably cheaper than having a steel build plate custom made.</li>
</ul>
<p>In conclusion, I personally would not recommend using steel for your build plate as aluminum seems to have the most benefits. Yes, steel will be more rigid and durable, but I don't think that these should be variables that are significantly more beneficial over aluminum.</p>
| 287
|
<p>In my previous research for mods for my Ender 3v2, I came across the topic of part cooling mods. The two most common are the Petsfang and Hero Me sets.</p>
<ol>
<li><p>What are the pros and cons of third-party/DIY part cooling mods?</p>
</li>
<li><p>What benefit does having a third-party/DIY part cooling mod provide?</p>
</li>
</ol>
|
<p>Cooling duct design is not well understood by either the 3D printer OEMs (exceptions may apply) nor by the aftermarket cooling options or most of the homebrew designs.</p>
<p>The problem is the lack of the understanding in aerodynamic design. Note that the fans that we use to produce the cooling flows are pushing flow, they do not create a large pressure difference. So with not too much pressure difference you should avoid long ducts and sharp bends in the flow path, narrowing of duct annuli or (you should) narrowing the duct annuli when air is bled out.</p>
<p>Looking at many of the options available, it is clear that many of these design rules are not taken into account.</p>
|
<p>Part cooling is essential to print at any decent <em>vertical speed</em> (layers per second), which is critical if you do rapid prototyping of small parts or vase mode prints. This is because you can't (repeatedly) print on top of material that hasn't yet cooled enough to be rigid; if you do, after a few layers, you'll find nothing is in the right place and it's all a bunch of goo getting dragged around by the nozzle. In fact, if the part is small enough you might not be able to print it at all. That's because, while slicers have features to slow down to guarantee a minimum layer time for cooling purposes, if the hot nozzle sticks around in the vicinity of a tiny part the whole time, just the heat from the nozzle will keep it from properly solidifying.</p>
<p>The Ender 3 (and as far as I know, the v2 as well, along with just about every other Creality printer) has <em>pitiful</em> stock cooling. It's off-center from the nozzle, and aimed more at the nozzle itself rather than the part below it, so that it saps heat out of the hotend (making the heater work harder and reducing your max achievable flow) at the same time it's (barely) cooling the print. So upgrading it is desirable. But, as you've guessed, there are cons too.</p>
<ol>
<li><p>Some, especially those utilizing the stock 4010 fan, <em>reduce airflow</em> by constricting the airway too much. The 4010 does not really have the power to compress the air much, so if the airway cross-sectional area decreases along the way, that will reduce flow. Does the increase in focus/delivery to the right place make up for the lost flow? Maybe.</p>
</li>
<li><p>Some <em>focus the air too narrowly</em> while increasing its pressure, delivering high-pressure air to a still molten point on the print. This can actually cause the extruded material to bend in the direction the air is pressing it before it cools enough to solidify, giving an inaccurate print.</p>
</li>
<li><p>Large fans and ducts add mass to the toolhead, which can increase ringing, especially if they're not sufficiently rigid.</p>
</li>
<li><p>Many of the cooling mods mount awkwardly to the toolhead in ways that interfere with the motion of the carriage, reducing total build volume.</p>
</li>
<li><p>If the cooling mod blows on/over the heater block, it can reduce melting performance and pour heat onto the part you're trying to cool. Most try to avoid doing this, but you may find you want additional insulation around the block if you use more powerful part cooling.</p>
</li>
</ol>
<p>Some people will also tell you that "too much cooling" will harm your print quality, hurting layer adhesion, making the print warp, etc. I use a rather extreme cooling system and have not encountered such problems that can't be remedied with a slight increase to the nozzle temperature, yielding better overall quality and equal strength to what I would have gotten with lower fan. But I print just PLA, PETG, and TPU, so it's likely that this could be an issue with other materials like ABS or nylon. If so you can always reduce the fan speed.</p>
| 2,132
|
<p>It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work</p>
<pre><code>/something to search for/i
</code></pre>
|
<p>You can also type command <code>-I</code> while less is running. It toggles case sensitivity for searches.</p>
|
<p>When using -i flag, be sure to enter the search string completely in lower case, because if any letter is upper case, then its an exact match.</p>
<p>See also: the -I (capital i) flag of less(1) to change this behavior.</p>
| 3,751
|
<p>So, you are all ready to do a big SVN Commit and it bombs because you have inconsistent line endings in some of your files. Fun part is, you're looking at 1,000s of files spanning dozens of folders of different depths.</p>
<p>What do you do?</p>
|
<p>I don't think the <a href="http://svnbook.red-bean.com/nightly/en/svn.ref.reposhooks.pre-commit.html" rel="noreferrer">pre-commit</a> hook can actually change the data that is being committed - it can disallow a commit, but I don't think it can do the conversion for you.</p>
<p>It sounds like you want the <a href="http://svnbook.red-bean.com/nightly/en/svn.ref.properties.html" rel="noreferrer">property</a> 'svn:eol-style' set to 'native' - this will automatically convert newlines to whatever is used on your platform (use 'CRLF', 'CR' or 'LF' to get those regardless of what the OS wants).</p>
<p>You can use <a href="http://subversion.apache.org/faq.html#auto-props" rel="noreferrer">auto-properties</a> so that all future files you create will have this property set (auto props are handled client-side, so you'd have to set this up for each user).</p>
|
<p>you can use notepad++ to batch convert line endings.
Make regex search:</p>
<p><code>([^\r])\n</code></p>
<p>and replace it with</p>
<p><code>$1\r\n</code></p>
<p>you then should choose a bunch of test files like:</p>
<p><code>*.xml;*.txt;*.csv;...</code>asf.</p>
<p>this avoids that you accidently modify binary files</p>
<p><em>NOTE</em>: the regex patterns skip empty lines, so you have to run a second replace job with <code>\n\n</code> and replace it with <code>\n\r\n</code></p>
| 3,646
|
<p>About two days ago, I started seeing that my hotend was heating up erratically. I first noticed this while printing a part in PETG and the temp jumped to 260 °C. I shut down the printer at that time and first started checking the hardware. I noticed that the E3D V6 thermistor had been tightened too much. I disassembled the entire hotend, cleaned everything and then reassembled everything. I thought to retune the hotend and when I tried tuning it at 240 °C. </p>
<p>This is where the strange behavior occurs. The hotend steadily climbed up till about 200 °C. After that it just went nuts. I started seeing unreal temps such as 646 °C and such. At this point I thought the MEGA might be at fault. I replaced it and the hotend (an E3D V6 clone). This had the screw on glass thermistor. Again the same erratic behavior and unreal temp readings. </p>
<p>What could be wrong here? What am I missing? Can this be the heater cartridge? </p>
|
<p>One of the thermistor wires had come loose from the crimp ferrules. I re-crimped it and it works fine now. </p>
|
<p>This can come from several sources:</p>
<h1>Hardware</h1>
<p>The thermistor or its connections might be damaged, and the fault is only observable when the hotend is hot or moved to a certain area. Start by checking the wiring! You may be able to repair a bad connection easily, but depending what was broken, you may need to replace something. In some cases squishing a thermistor cartridge too much can destroy the internals, so a replacement is needed.</p>
<p>A mainboard failure is more likely to just show a static temperature, and a heater failure would show as maybe not getting past a certain point.</p>
<h1>Firmware</h1>
<p>If it had not worked before or you changed the firmware, the firmware should also be a suspect. The firmware can 'fail' when using the wrong thermistor type/table which can result in a very big offset or bad slope, resulting in wrong or unaccurate readings.</p>
| 844
|
<p>We're printing on a WASP 3MT pellet extruder with PLA. To save time, we're leaving the hotend at 160 °C between prints but realized that the print quality varies, from one print to the another, when using the same G-code file. </p>
<p>Could it be that leaving the temperature at 160 °C constantly creates more fluid PLA and therefore affects the following print?</p>
|
<p>PLA starts to change its properties at above its glass transition temperature of 60-65 °C, if stored there too long. Keeping it at 160°C, close to the melting temperature (173-178 °C) can degrade the material relatively rapidly. During an extrusion, this is usually mitigated by filling fresh material into the melt while the older material gets extruded, but keeping the machine stagnant at the high temperature has not only creep the heat up from the designated melt zone (thus preheating material that should not be preheated yet) but also can damage the material deep in the melt zone. Together with this possible material degradation, the preheated material melts faster and might overshoot the aimed at print temperature until the normal temperature is reached again. Both effects can lead to reduced print quality in the lower layers.</p>
<p>The time saving from keeping the filament heated up for an extended period of time is, <strong>in my opinion</strong>, not worth the quality reduction that can come from using non-uniform material. You pay <em>more</em> in lost prints than you save in time for heating up the head.</p>
<p>If it is impossible to not keep the hotend heated between prints, it might be advisable try these:</p>
<ul>
<li>Starting every print with a larger purging operation might get rid of degraded material. It would be as simple as extruding some quantity of material before starting the actual print at the edge of the build plate.</li>
<li>Aside from purging, it might be a good idea to reduce the hold temperature from 160 °C to a lower temperature, allowing the melt to partly solidify and keep the heat creep in check.</li>
</ul>
|
<p>I leave the extruder working at 190°C between printings up to for 20 minutes while I made the change; this only provoques that the nozzle gets empty; nothing gets burned or clogged. Once to start againg just feed a little more of filament manualy or waits to the skirt do the cleaning and refilling the nozzle. </p>
<p>Normally at this temperature (190°C) the nozzle gets empty in the next 2 minutes due normal melting flow. I can assure that your printings will be like water drops.</p>
| 1,123
|
<p>Coming from <code>J2ME</code> programming are there any similarities that would make it easy to adapt to <code>Android API</code>. Or is <code>Android API</code> completely different from the <code>J2ME</code> way of programming mobile apps. </p>
|
<p>Actually the Android API is much more powerful than the J2ME.</p>
<p>It is much easier to create an application for the Android.</p>
<p>Using the J2ME you are limited to simple forms due to the absent of swing-like libraries (though now there exists a library called LWUIT, avoiding the need to recreate from scratch a swing-like library).</p>
<p>In Android you will be able to create complex form very quickly, and software package for the android SDK is easy to install (while in J2ME you have to install the wireless development toolkit from sun, or install one of Nokia's, Samsung's or SonyEricsson's... it gets a bit confusing sometimes).</p>
<p>The things I had to change when switching from j2me to android were:</p>
<p>1/ The font and graphics class is easier to use on j2me. The API is more thorough on Android, but also more complicated.</p>
<p>2/ If you are used to the database storage of j2me (RecordStore), well you can forget it in Android. You will have to use a SQL-like databased, so be prepared to rethink your data model.</p>
|
<p>Well, you may not actually need to adapt.</p>
<p>There is a good chance that a J2ME stack will become available for Android before long since Android is not supposed to become as restrictive of third-party runtimes as the iPhone.</p>
<p>I know one guy who has been working on just that:
<a href="http://justanapplication.wordpress.com/" rel="nofollow noreferrer">http://justanapplication.wordpress.com/</a></p>
<p>Now, of course, that doesn't mean you shouldn't have a look at the Android APIs and application lifecycle.</p>
| 9,031
|
<p>I've always found checkin (commit) mails to be very useful for keeping track of what work other people are doing in the codebase / repository. How do I set up SVN to email a distribution list on each commit?</p>
<p>I'm running clients on Windows and the Apache Subversion server on Linux. The answers below for various platforms will likely be useful to other people though.</p>
|
<p>You use the <a href="http://svnbook.red-bean.com/en/1.7/svn.reposadmin.create.html#svn.reposadmin.create.hooks" rel="noreferrer">post-commit hooks</a>. Here's a <a href="http://builddeploy.blogspot.com/2008/01/implementing-subversion-post-commit.html" rel="noreferrer">guide</a>.</p>
<p>Here's a sample Ruby script that sends an email after each commit: <a href="http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/commit-email.rb" rel="noreferrer">commit-email.rb</a></p>
|
<p>There is a (large) example written in Perl included in the Subversion source (it can be <a href="http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/commit-email.pl.in" rel="nofollow noreferrer">viewed here</a>).</p>
| 2,946
|
<p>I want to highlight C/C++/Java/C# etc source codes in my website.</p>
<p>How can I do this?</p>
<p>Is it a CPU intensive job to highlight the source code?</p>
|
<p>You can either do this server-side or client-side. It's not very processor intensive, but if you do it client side (using Javascript) there will be a noticeable lag. Most client side solutions revolve around Google Code's syntax highlighting engine. This seems to be the most popular one: <a href="http://alexgorbatchev.com/SyntaxHighlighter/" rel="nofollow noreferrer">SyntaxHighlighter</a></p>
<p>Server-side solutions tend to be more flexible, especially in the way of defining new languages and configuring how they are highlighted (e.g. colors used). I use GeSHi, which is a PHP solution with a moderately nice plugin for Wordpress. There are also a few libraries built for Java, and even some that are based upon VIM (usually requiring a Perl module to be installed from CPAN).</p>
<p>In short: you have quite a few options, what are your criteria? It's hard to make a solid recommendation without knowing your requirements.</p>
|
<p>I use <a href="http://code.google.com/p/syntaxhighlighter/wiki/Usage" rel="nofollow noreferrer">SyntaxHighligher</a> on <a href="http://bradwilson.typepad.com" rel="nofollow noreferrer">my blog</a>.</p>
| 9,557
|
<p>Here is some code I could not get to format properly in markdown, this is straight C code, pasted into the text box with the '4 spaces' format to denote code:</p>
<pre><code>#define PRINT(x, format, ...) \
if ( x ) { \
if ( debug_fd != NULL ) { \
fprintf(debug_fd, format, ##__VA_ARGS__); \
} \
else { \
fprintf(stdout, format, ##__VA_ARGS__); \
} \
}
</code></pre>
<p>It seems as though the '\' causes the newlines to be ignored. Ok fine, I am used to this in bash, but if I put '\' the second one doesn't show up. As if the second one is absorbed. Am I missing something?</p>
|
<p>You can also use the HTML tags <pre><code> in succession. I find this easier for pasting code into the window.</p>
<p><pre><code>#define PRINT(x, format, ...)
if ( x )
{
if ( debug_fd != NULL )
{
fprintf(debug_fd, format, ##VA_ARGS);
}
else
{
fprintf(stdout, format, ##VA_ARGS);
}
}</pre></code></p>
|
<pre><code>#define PRINT(x, format, ...)
if ( x )
{
if ( debug_fd != NULL )
{
fprintf(debug_fd, format, ##VA_ARGS);
}
else
{
fprintf(stdout, format, ##VA_ARGS);
}
}
</code></pre>
| 6,432
|
<p>In handling a form post I have something like</p>
<pre><code> public ActionResult Insert()
{
Order order = new Order();
BindingHelperExtensions.UpdateFrom(order, this.Request.Form);
this.orderService.Save(order);
return this.RedirectToAction("Details", new { id = order.ID });
}
</code></pre>
<p>I am not using explicit parameters in the method as I anticipate having to adapt to variable number of fields etc. and a method with 20+ parameters is not appealing.</p>
<p>I suppose my only option here is mock up the whole HttpRequest, equivalent to what Rob Conery has done. Is this a best practice? Hard to tell with a framework which is so new.</p>
<p>I've also seen solutions involving using an ActionFilter so that you can transform the above method signature to something like</p>
<pre><code>[SomeFilter]
public Insert(Contact contact)
</code></pre>
|
<p>I'm now using <a href="https://stackoverflow.com/questions/34709/how-do-you-use-the-new-modelbinder-classes-in-aspnet-mvc-preview-5#34725">ModelBinder</a> so that my action method can look (basically) like:</p>
<pre><code> public ActionResult Insert(Contact contact)
{
if (this.ViewData.ModelState.IsValid)
{
this.contactService.SaveContact(contact);
return this.RedirectToAction("Details", new { id = contact.ID });
}
else
{
return this.RedirectToAction("Create");
}
}
</code></pre>
|
<p>Wrap it in an interface and mock it.</p>
| 4,835
|
<p>I've been reading a lot lately about the next release of Java possibly supporting <a href="http://en.wikipedia.org/wiki/Closure_%28computer_science%29" rel="noreferrer">closures</a>. I feel like I have a pretty firm grasp on what closures are, but I can't think of a solid example of how they would make an Object-Oriented language "better". Can anyone give me a specific use-case where a closure would be needed (or even preferred)?</p>
|
<p>As a Lisp programmer I would wish that the Java community understands the following difference: <strong>functions as objects vs. closures</strong>.</p>
<p>a) <strong>functions can be named or anonymous</strong>. But they can also be objects of themselves. This allows functions to be passed around as arguments, returned from functions or stored in data structures. This means that functions are first class objects in a programming language.</p>
<p>Anonymous functions don't add much to the language, they just allow you to write functions in a shorter way.</p>
<p>b) <strong>A closure is a function plus a binding environment</strong>. Closures can be passed <em>downwards</em> (as parameters) or returned <em>upwards</em> (as return values). This allows the function to refer to variables of its environment, even if the surrounding code is no longer active.</p>
<p>If you have <strong>a)</strong> in some language, then the question comes up what to do about <strong>b)</strong>? There are languages that have <strong>a)</strong>, but not <strong>b)</strong>. In the functional programming world <strong>a)</strong> (functions) and <strong>b</strong> (functions as closures) is nowadays the norm. Smalltalk had <strong>a)</strong> (<em>blocks</em> are anonymous functions) for a long time, but then some dialects of Smalltalk added support for <strong>b)</strong> (blocks as closures).</p>
<p>You can imagine that you get a slightly different programming model, if you add functions and closures to the language. </p>
<p>From a pragmatic view, the anonymous function adds some short notation, where you pass or invoke functions. That can be a good thing.</p>
<p>The closure (function plus binding) allows you for example to create a function that has access to some variables (for example to a counter value). Now you can store that function in an object, access it and invoke it. The context for the function object is now not only the objects it has access to, but also the variables it has access to via bindings. This is also useful, but you can see that variable bindings vs. access to object variables now is an issue: when should be something a <em>lexical</em> variable (that can be accessed in a closure) and when should it be a variable of some object (a <em>slot</em>). When should something be a closure or an object? You can use both in the similar ways. A usual programming exercise for students learning Scheme (a Lisp dialect) is to write a simple object system using closures.</p>
<p>The result is a more complicated programming language and a more complicated runtime model. Too complicated?</p>
|
<p>Not only that benjismith, but I love how you can just do...</p>
<p>myArray.sort{ it.myProperty }</p>
<p>You only need the more detailed comparator you've shown when the natural language comparison of the property doesn't suit your needs.</p>
<p>I absolutely love this feature.</p>
| 7,299
|
<p>I currently use AnkhSVN to integrate subversion into Visual Studio. Is there any reason I should switch to VisualSVN?</p>
<p>AnkhSVN is free (in more than one sense of the word) while VisualSVN costs $50. So right there unless I'm missing some great feature of VisualSVN I don't see any reason to switch.</p>
|
<p>I used VisualSVN until Ankh hit 2.0, and ever since, I've abandoned VisualSVN. Ankh has surpassed VisualSVN in functionality, in my mind, and all the 1.x perf and integration issues are gone.</p>
|
<p>The main thing is that VisualSVN uses TortoiseSVN for nearly all of its UI. So you only really have to set up one client (preferred diff viewer, etc), and you can take advantage of things like the same "Previous messages" button on the Commit dialog, whether you're committing from Explorer or Visual Studio.</p>
| 4,383
|
<p>I wish Subversion had a better way of moving tags. The only way that I know to move a tag is to remove the file from the tag and then copy it again. Revision tree browsers don't seem to handle that very well. This also requires keeping the directory structure under the trunk and tag in sync.</p>
<p>Use case: We have thousands of "maps" and we want to tag which version of each map is the "production" version. We need to be able to easily get the production version of all maps.</p>
<p>Can anyone suggest a better way to address our use case?
I have considered properties also but then we can't get the prod version of all files easily. Merging to the tag doesn't appear to be very easy either.
(Originally posted to <a href="http://jamesjava.blogspot.com/2007/12/subversion-moving-tags.html" rel="nofollow noreferrer">http://jamesjava.blogspot.com/2007/12/subversion-moving-tags.html</a>)</p>
|
<p>I don't think you can ever do this with the way that subversion operates. I believe the best solution would be to look at a tool like <a href="http://git.or.cz/" rel="nofollow noreferrer">git</a> which seems like it fits into your use case. You're production system could 'pull' in the "maps" that are accepted. While I realize this isn't subversion, using git might be closer match to your use pattern than svn.</p>
<p>A really good write up on why git's pull based development model is a better match to your scenario is <a href="http://utsl.gen.nz/talks/git-svn/intro.html" rel="nofollow noreferrer">here</a>.</p>
<p>There are also tutorials on how to start migrating like <a href="http://git.or.cz/course/svn.html" rel="nofollow noreferrer">this</a>.</p>
|
<p>Why don't you make a new tag for the current production version? Remember, Subversion is not CVS. So making a copy of the complete directory tree doesn't cost you anything.</p>
| 8,797
|
<p>One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?</p>
|
<p>I would start by reading this article:</p>
<p><a href="http://decipherinfosys.wordpress.com/2007/03/27/using-stored-procedures-vs-dynamic-sql-generated-by-orm/" rel="nofollow noreferrer">http://decipherinfosys.wordpress.com/2007/03/27/using-stored-procedures-vs-dynamic-sql-generated-by-orm/</a></p>
<p>Here is a speed test between the two:</p>
<p><a href="http://www.blackwasp.co.uk/SpeedTestSqlSproc.aspx" rel="nofollow noreferrer">http://www.blackwasp.co.uk/SpeedTestSqlSproc.aspx</a></p>
|
<p>Measure it. </p>
<p>Really, any discussion on this topic is probably futile until you've measured it.</p>
| 7,312
|
<p>Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however. What are people's opinions on label statements?</p>
|
<p>Many algorithms are expressed more easily if you can jump across two loops (or a loop containing a switch statement). Don't feel bad about it. On the other hand, it may indicate an overly complex solution. So stand back and look at the problem.</p>
<p>Some people prefer a "single entry, single exit" approach to all loops. That is to say avoiding break (and continue) and early return for loops altogether. This may result in some duplicate code.</p>
<p>What I would strongly avoid doing is introducing auxilary variables. Hiding control-flow within state adds to confusion.</p>
<p>Splitting labeled loops into two methods may well be difficult. Exceptions are probably too heavyweight. Try a single entry, single exit approach.</p>
|
<p>Personally whenever I need to use nested loops with the innermost one having to break out of all the parent loops, I just write everything in a method with a return statement when my condition is met, it's far more readable and logical.</p>
<p>Example Using method:</p>
<pre class="lang-java prettyprint-override"><code> private static boolean exists(int[][] array, int searchFor) {
for (int[] nums : array) {
for (int num : nums) {
if (num == searchFor) {
return true;
}
}
}
return false;
}
</code></pre>
<p>Example Using label (less readable imo):</p>
<pre class="lang-java prettyprint-override"><code>boolean exists = false;
existenceLoop:
for (int[] nums : array) {
for (int num : nums) {
if (num == searchFor) {
exists = true;
break existenceLoop;
}
}
}
return exists;
</code></pre>
| 6,864
|
<p>I have a quad core machine and would like to write some code to parse a text file that takes advantage of all four cores. The text file basically contains one record per line.</p>
<p>Multithreading isn't my forte so I'm wondering if anyone could give me some patterns that I might be able to use to parse the file in an optimal manner.</p>
<p>My first thoughts are to read all the lines into some sort of queue and then spin up threads to pull the lines off the queue and process them, but that means the queue would have to exist in memory and these are fairly large files so I'm not so keen on that idea.</p>
<p>My next thoughts are to have some sort of controller that will read in a line and assign it a thread to parse, but I'm not sure if the controller will end up being a bottleneck if the threads are processing the lines faster than it can read and assign them.</p>
<p>I know there's probably another simpler solution than both of these but at the moment I'm just not seeing it.</p>
|
<p>I'd go with your original idea. If you are concerned that the queue might get too large implement a buffer-zone for it (i.e. If is gets above 100 lines the stop reading the file and if it gets below 20 then start reading again. You'd need to do some testing to find the optimal barriers). Make it so that any of the threads can potentially be the "reader thread" as it has to lock the queue to pull an item out anyway it can also check to see if the "low buffer region" has been hit and start reading again. While it's doing this the other threads can read out the rest of the queue.</p>
<p>Or if you prefer, have one reader thread assign the lines to three other <em>processor</em> threads (via their own queues) and implement a <a href="http://portal.acm.org/citation.cfm?doid=324133.324234" rel="noreferrer">work-stealing strategy</a>. I've never done this so I don't know how hard it is.</p>
|
<p>@lomaxx</p>
<blockquote>
<p>@Derek & Mark: I wish there was a way to accept 2 answers. I'm going to have to end up going with Wolfbyte's solution because if I split the file into n sections there is the potential for a thread to come across a batch of "slow" transactions, however if I was processing a file where each process was guaranteed to require an equal amount of processing then I really like your solution of just splitting the file into chunks and assigning each chunk to a thread and being done with it.</p>
</blockquote>
<p>No worries. If clustered "slow" transactions is a issue, then the queuing solution is the way to go. Depending on how fast or slow the average transaction is, you might also want to look at assigning multiple lines at a time to each worker. This will cut down on synchronization overhead. Likewise, you might need to optimize your buffer size. Of course, both of these are optimizations that you should probably only do after profiling. (No point in worrying about synchronization if it's not a bottleneck.)</p>
| 2,866
|
<p>How would I change the initial templates created by Xcode when creating a new Cocoa Class.</p>
<p>I am referring to the comments and class name created when using Xcode's new class wizard.</p>
|
<p>You wouldn't change the existing templates. In other words, don't <em>modify</em> anything under the <code>/Developer</code> hierarchy (or wherever you installed your developer tools).</p>
<p>Instead, clone the templates you want to have customized variants of. Then change their names and the information in them. Finally, put them in the appropriate location in your account's <code>Library/Application Support</code> folder, specifically:</p>
<ul>
<li>File templates: <code>~/Library/Application Support/Developer/Shared/Xcode/File Templates/</code></li>
<li>Target templates: <code>~/Library/Application Support/Developer/Shared/Xcode/Target Templates/</code></li>
<li>Project templates: <code>~/Library/Application Support/Developer/Shared/Xcode/Project Templates/</code></li>
</ul>
<p>That way they won't be overwritten when you install new developer tools, and you can tweak them to your heart's content.</p>
<p><strong>Update</strong>
For newer versions of Xcode the updated path will be:
<code>~/Library/Developer/Xcode/Templates/File Templates/Source</code></p>
|
<p>In XCode 4.5 right click on project, click Show File Inspector, then change Organization name in the file inspector's second tab (Project Document group)</p>
| 5,378
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.