I sew the Google Pacmen and I think it's the most amazing JavaScript application that I ever sew!
What other application do you sew, that are in this level of profession?
Having a string of whitespaces:
string *str = new string();
str->resize(width,' ');
I'd like to
fill length chars at a position.
In C it would look like
memset(&str[pos],'#', length );
How can i achieve this with c++ string, I tried
string& assign( const string& str, size_type index, size_type len );
but this seems to truncat the original string.
Is there an easy C++ way to do this?
Thanks.
This code isn't compiled for me: let countDown = [5L .. -1L .. 0L];;
I have a book that says it should return this:
val countDown : int list = [5L; 4L; 3L; 2L; 1L; 0L]
In a customized servlet (seam 2.1.2) this works fine
TableNameHome tableNameHome = (TableNameHome) Component.getInstance( "tableNameHome " );
tableName entity = tableNameHome.getInstance();
entity.setXXX();
tableNameHome.persit();
However this one fails:
entityManager = tableNameHome .getEntityManager();
Query query = entityManager.createQuery( "SELECT b FROM tablename b WHERE b.box_id = :key2nd" );
query.setParameter( "key2nd", value);
List results = query.getResultList();
and leads to this error message:
org.hibernate.hql.ast.QuerySyntaxException: tablename is not mapped
[SELECT b FROM tablename b WHERE b.key2nd = :key2nd]
In EJB 2.1 I could implement other finder-methods.
EntityHome.find() searches only by primary key.
What do I need to do in order to query by a different criteria than primary key?
[HttpGet]
public ActionResult LogIn(string username)
{
if (username == null)
return View("404");
return View("LogInAdvanced");
}
Inside the view a want to get the view file name: LogInAdvanced or 404.
I created a plain servlet within a seam-gen (2.1.2) application, now I would like to use injection. Thus I annotated it with @Name and it's recognized as component:
INFO [Component] Component: ConfigReport,
scope: EVENT, type: JAVA_BEAN, class: com.mycompany.servlet.ConfigReport
Unfortunatly the injection of the logger doesn't work NullPointerException in init()
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.log.Log;
@Name("ConfigReport")
public class ConfigReport extends HttpServlet {
@Logger
private Log log;
public void init(ServletConfig config) throws ServletException {
log.info( "BOOM" );
}
}
Is my approach abusive?
What would be the alternatives (the client sending requests to the servlet is curl, not a browser)?
Using Seam 2.1.2 and JSF 1.2 I wonder how to store the users login name in the database.
In plain JSF I would simply lookup FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();in a backing bean and set the value into a persistent object.
How can I achieve that the users name will be stored in the DB?
lets say i have a web request:
WebRequest webRequest = WebRequest.Create(Url);
webRequest.BeginGetResponse(this.RespCallback, webRequest);
now is there is any way to do retierve the URL in
private void RespCallback(IAsyncResult asynchronousResult)
{
// here
}
the idea is i want to provide a squence id in the url while doing webrequest and then reterive it on the call back and match it to know that this call back is from that request.
any idea?
I found so far iCode as a code Editor.
Remotedesktop, and mides IDE (PHP).
Goodreader for my dev. Ebooks.
Are there any other must haves for developers?
If I forgot to add mappings to a persister object, NHibernate will throw an exception when I'll run the application.
I want to write an integration tests, that test that all mappings are provided to NHibernate.
I'm browsing through OpenJDK sources and cannot find the place where optimized code is replaced.
I wonder how this can be done in protected mode, isn't it some kind of selfmodifing code which should be prevented by the OS?
I created a plain servlet within a seam-gen (2.1.2) application, now I would like to use injection. Thus I annotated it with @Name and it's recognized as component:
INFO [Component] Component: ConfigReport,
scope: EVENT, type: JAVA_BEAN, class: com.mycompany.servlet.ConfigReport
Unfortunatly the injection of the logger doesn't work NullPointerException in init()
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.log.Log;
@Name("ConfigReport")
public class ConfigReport extends HttpServlet {
@Logger
private Log log;
public void init(ServletConfig config) throws ServletException {
log.info( "BOOM" );
}
}
Is my approach abusive?
What would be the alternatives (the client sending requests to the servlet is curl, not a browser)?
What ways do I have in .net to run code from string?
Console.WriteLine("1 + 2 * 3"); // results is 7.
What other options do we have?
C# - Compile the code on runtime?
IronRuby / IronPython?
F#?
I used to see any .net source code (like System.String) with ReSharper and Visual Studio 2008. since I migrated to Visual studio 2010, this option doesn't give the full source code but just the definitions of the class.
How can I fix this, to use the microsoft's symbols server again?
I created an application using seam-gen. The created operation to search the DB ends with and exception (syntax error). The query has a where clause like this:
lower(barcode0_.barcode_ean) like lower((?||'%')) limit ?
Does hibnerate or seam create the where clause which my DB can't understand?
Or is there a workaround for SQL statement related issues in seam?
http://site.com/page%3fcharacter
This URL will return the following error:
Illegal characters in path.
I'm already put this in web.config:
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />
<pages validateRequest="false">
...
How can I fix this error?
The stack is initialized with a int MaxSize =3. Then I push one int onto the list. " Pushed:" is returned to the console. Program crashes here. I think my logic is flawed but unsure. Maybe an infinite loop or unmet condition? Thanks for your help.
I'm trying to traverse the list to the last node in the second part of the full() method. I implemented this stack as array based so must implement this method full() as this method is inside of main class.
while(!stacker.full()) {
cout << "Enter number = ";
cin >> intIn;
stacker.push(intIn);
cout << "Pushed: " << intIn << endl;
}//while
Call to LinkListStack.cpp to class LinkList full().
int LinkList::full() {
if(head == NULL) {
top = 0;
} else {
LinkNode * tmp1;
LinkNode * tmp2;
tmp1 = head;
while(top != MaxSize) {
if(tmp1->next != NULL){
tmp2 = tmp1->next;
tmp1 = tmp2;
++top;
}//if
}//while
}//else
return (top + 1 == MaxSize);
}
Hmmm...Is it a good idea to use a LibGDX parallax background for making a stacking game (i.e. PAPA STACKer Lite)? For example, I'm starting to use the blocks to drag-n-drop it. Next, when the next piece reaches the top of the screen, it automatically scrolls to the next one where the available space left. Aside from that, is it also involved with the camera code (Orthographic Camera) that the screen size appeared like 720x1280 but actually it's 1440x2560 for example?
And another thing, does the background scrolling have the option to scroll from start to finish and infinite?
I'm having a problem with my TextBoxs not "Auto" resizing. I'm trying to create a form that behaves and looks like the Properties Editor in Visual Studio. What appears to be happening is that the third column is not expanding to fill all of the available remaining space in the grid. Image below is how my form looks on startup.
The width of the textboxs is determined by the MinWidth setting on the third ColumnDefinition statement. Also, the Width is set to "*". With any other setting, the resizing done with the GridSplitter doesn't work correctly.
<StackPanel Orientation="Vertical" VerticalAlignment="Top" x:Name="Stacker" Grid.IsSharedSizeScope="True">
<Expander x:Name="Expand" IsExpanded="True" Header="This is a test of a Second Panel" Width="{Binding Width, ElementName=Stacker}">
<Grid x:Name="EditGrid1" Margin="3" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50" SharedSizeGroup="SharedSize1" />
<ColumnDefinition Width="Auto" SharedSizeGroup="SharedSize2" />
<ColumnDefinition Width="*" MinWidth="50" x:Name="ValueCol" />
</Grid.ColumnDefinitions>
<GridSplitter Grid.Column="1" x:Name="ToolBoxSplitter1" Grid.Row="1" Grid.RowSpan="6" Panel.ZIndex="1" HorizontalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Width="3"/>
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="1" Text="{x:Static lex:DoSomeThingView.Name}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="2" Text="{x:Static lex:DoSomeThingView.Address}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="3" Text="{x:Static lex:DoSomeThingView.Zip}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="4" Text="{x:Static lex:DoSomeThingView.NumberOfDoors}" TextTrimming="CharacterEllipsis" Grid.IsSharedSizeScope="True" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="5" Text="{x:Static lex:DoSomeThingView.DoubleNumber}" />
<TextBox Grid.Column="2" Grid.Row="1" x:Name="UserName1" MaxHeight="50" TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" SpellCheck.IsEnabled="True" />
<TextBox Grid.Column="2" Grid.Row="2" x:Name="Address1" />
<TextBox Grid.Column="2" Grid.Row="3" x:Name="Zip1" />
<TextBox Grid.Column="2" Grid.Row="4" x:Name="NumberOfDoors1" />
<TextBox Grid.Column="2" Grid.Row="5" x:Name="DoubleNumber1" />
</Grid>
</Expander>
</StackPanel>
Any suggestions on how to correct this?