プログラミング

プロおよび熱狂的プログラマーのためのQ&A

4
string.split-複数の文字区切り文字による
"] ["の区切り文字でc#の文字列を分割するのに問題があります。 たとえば、文字列 "abc] [rfd] [5] [、] [。"です。 含む配列を生成する必要があります。 ABCは RFD 5を 、 。 しかし、RegExを試しても、区切り文字が分割されないので、動作しないようです。 編集:本質的に私は正規表現を必要とせずにこの問題を解決したいと思いました。私が受け入れる解決策は次のとおりです。 string Delimiter = "]["; var Result[] = StringToSplit.Split(new[] { Delimiter }, StringSplitOptions.None); この分割された質問を解決できてうれしいです。
151 c#  split 



11
3つの関数を順番に実行するには、どのように呼び出す必要がありますか?
この関数を次々と呼び出す必要がある場合は、 $('#art1').animate({'width':'1000px'},1000); $('#art2').animate({'width':'1000px'},1000); $('#art3').animate({'width':'1000px'},1000); 私はjQueryで次のようなことができることを知っています: $('#art1').animate({'width':'1000px'},1000,'linear',function(){ $('#art2').animate({'width':'1000px'},1000,'linear',function(){ $('#art3').animate({'width':'1000px'},1000); }); }); しかし、jQueryを使用しておらず、呼び出したいとしましょう。 some_3secs_function(some_value); some_5secs_function(some_value); some_8secs_function(some_value); どのように私は実行するために、この関数を呼び出す必要がありsome_3secs_function、そのコールが終了した後、その後、実行some_5secs_functionし、そのコールが終了した後、コールsome_8secs_function? 更新: これはまだ機能しません: (function(callback){ $('#art1').animate({'width':'1000px'},1000); callback(); })((function(callback2){ $('#art2').animate({'width':'1000px'},1000); callback2(); })(function(){ $('#art3').animate({'width':'1000px'},1000); })); 3つのアニメーションが同時に開始します 私の間違いはどこですか?

5
変数が設定されていない場合はメイクファイルを中止します
makefileの変数が設定/評価されていないことに基づいて、make / makefileの実行をどのように中止できますか? 私はこれを思いつきましたが、呼び出し側が明示的にターゲットを実行しない場合(つまり、実行makeのみ)にのみ機能します。 ifeq ($(MY_FLAG),) abort: ## This MUST be the first target :( ugly @echo Variable MY_FLAG not set && false endif all: @echo MY_FLAG=$(MY_FLAG) 私はこのようなものが良い考えだと思いますが、makeのマニュアルには何も見つかりませんでした: ifndef MY_FLAG .ABORT endif
151 makefile 

10
引数のあるSwiftブロックで弱い自己を正しく処理する方法
私のTextViewTableViewCellには、ブロックを追跡する変数と、ブロックが渡されて割り当てられるconfigureメソッドがあります。 これが私のTextViewTableViewCellクラスです: // // TextViewTableViewCell.swift // import UIKit class TextViewTableViewCell: UITableViewCell, UITextViewDelegate { @IBOutlet var textView : UITextView var onTextViewEditClosure : ((text : String) -> Void)? func configure(#text: String?, onTextEdit : ((text : String) -> Void)) { onTextViewEditClosure = onTextEdit textView.delegate = self textView.text = text } // #pragma mark …
151 ios  swift  retain-cycle 


8
文字列を分割して変数に割り当てる方法
Pythonでは、文字列を分割して変数に割り当てることができます。 ip, port = '127.0.0.1:5432'.split(':') しかし、Goでは機能しないようです: ip, port := strings.Split("127.0.0.1:5432", ":") // assignment count mismatch: 2 = 1 質問:文字列を分割し、1つのステップで値を割り当てる方法は?
151 string  go  split 

5
JavaのtoStringに相当するC ++?
ストリームに書き込まれるもの、つまりcoutカスタムクラスのオブジェクトを制御する必要があります。C ++では可能ですか?JavaではtoString()、同様の目的でメソッドをオーバーライドできます。
151 c++ 

20
PSQLException:現在のトランザクションは中止され、トランザクションブロックが終了するまでコマンドは無視されます
JBoss 7.1.1 Finalのserver.logファイルに次の(切り捨てられた)スタックトレースが表示されます。 Caused by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:512) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:302) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_23] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_23] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_23] at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_23] at org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:455) at $Proxy49.executeUpdate(Unknown Source) at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:371) …

4
EJBとは何ですか?
EJB豆が何であるかを学ぶことを試みてきました、それは彼らのインスタンスが何とか何とかプールで管理されていることをどういう意味ですか?本当にそれらをうまくつかむことができません。 それらが実際に何であるかを説明できますか(実際にはJavaプログラマーにとって)。彼らは何をしますか?彼らの目的は何ですか?なぜ実際に使用するのですか?(なぜ固執しないのPOJOですか?)おそらくサンプルアプリケーションですか? 更新された情報、つまりのみを参照してくださいEJB 3.1。EJBに関する日付の情報は誤解を招く可能性があります。 EJB学習初心者の方は注意してください: EJBは分散オブジェクトに基づいています。これは、ネットワークでリンクされた複数のマシン(仮想または物理)で実行されているソフトウェアを指します。
151 jakarta-ee  ejb  ejb-3.1 

8
列挙可能とはどういう意味ですか?
MDNのfor..inページに誘導されましたに「for..inはオブジェクトの列挙可能なプロパティを反復処理する」と表示されました。 次に、「列挙可能なプロパティはfor..inループで反復できるプロパティです」と記載されているプロパティの列挙可能性と所有権のページに行きました。 辞書では、列挙可能を可算として定義していますが、それが何を意味するのかを実際に視覚化することはできません。列挙可能なものの例を入手できますか?


30
android.view.InflateException:Binary XML file:Error inflatating class fragment
説明できない非常にイライラするエラーがあります。Android AppCompat古いバージョンとの互換性を維持するために使用するAndroidアプリケーションを作成しました。ここに私の主な活動レイアウトファイルがあります: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <!-- As the main content view, the view below consumes the entire space available using match_parent in both dimensions. --> <FrameLayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" /> <!-- android:layout_gravity="start" tells DrawerLayout to treat this as a sliding drawer on the left side for …
151 android 

11
EFで親エンティティを更新するときに子エンティティを追加/更新する方法
2つのエンティティは1対多の関係です(コードが最初に流れるAPIによって構築されます)。 public class Parent { public Parent() { this.Children = new List<Child>(); } public int Id { get; set; } public virtual ICollection<Child> Children { get; set; } } public class Child { public int Id { get; set; } public int ParentId { get; set; } public string Data …

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.