プログラミング

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


21
値とキーの両方をPHP配列にプッシュする方法
このコードを見てください: $GET = array(); $key = 'one=1'; $rule = explode('=', $key); /* array_push($GET, $rule[0] => $rule[1]); */ 私はこのようなものを探していますので: print_r($GET); /* output: $GET[one => 1, two => 2, ...] */ これを行う機能はありますか?(array_pushこの方法では機能しないため)
355 php  arrays 

3
C#で現在のユーザーのデスクトップへのパスを取得する方法
C#で現在のユーザーのデスクトップへのパスを取得するにはどうすればよいですか? 私が見つけることができた唯一のものは、SpecialDirectoriesこのプロパティを持つVB.NETのみのクラスでした: My.Computer.FileSystem.SpecialDirectories.Desktop C#でこれを行うにはどうすればよいですか?

9
シェルコマンドの「&&」の目的は何ですか?
私の知る限り&、コマンドの後に使用することは、コマンドをバックグラウンドで実行するためです。 &使用例:tar -czf file.tar.gz dirname & しかし、どう&&ですか?(この例を見てください:https : //serverfault.com/questions/215179/centos-100-disk-full-how-to-remove-log-files-history-etc#answer-215188)


25
Android Emulatorでランドスケープモードに切り替える
これはおそらく質問に答えるのはかなり簡単ですが、ドキュメントとGoogleを検索して数時間たっても、自分で解決策を見つけることができません。ファイルlandscapeでAndroidアプリの向きをに設定しましたAndroidManifest.xml: android:screenOrientation="landscape" ただし、シミュレーターでアプリを実行すると、アプリが横向きで縦向きに表示されます。エミュレータをlandscapeモードに切り替えるにはどうすればよいmacですか?1.6 SDKを実行しています。

9
jQueryで要素にバインドされたイベントを見つけることはできますか?
このリンクに2つのイベントハンドラーをバインドします。 <a href='#' id='elm'>Show Alert</a> JavaScript: $(function() { $('#elm').click(_f); $('#elm').mouseover(_m); }); function _f(){alert('clicked');} function _m(){alert('mouse over');} 要素にバインドされているすべてのイベントのリストを取得する方法はありますid="elm"か?

2
gitの「rebase --preserve-merges」は正確には何をするのですか(なぜですか?)
コマンドに関するrebase Gitのドキュメントは非常に簡潔です。 --preserve-merges Instead of ignoring merges, try to recreate them. This uses the --interactive machinery internally, but combining it with the --interactive option explicitly is generally not a good idea unless you know what you are doing (see BUGS below). では、実際に使用すると--preserve-mergesどうなりますか?デフォルトの動作(そのフラグなし)とどう違うのですか?マージなどを「再作成」するとはどういう意味ですか。
355 git  git-rebase 

30
例外「IllegalStateException:onSaveInstanceStateの後でこのアクションを実行できません」が発生する
私はライブAndroidアプリケーションを持っていますが、市場から次のスタックトレースを受け取りましたが、アプリケーションコードでは発生していないのになぜ発生しているのかわかりませんが、アプリケーションからの何らかのイベント(その他のイベント)によって発生します 私はFragmentsを使用していませんが、それでもFragmentManagerの参照があります。このタイプの問題を回避するために、何らかの身体がいくつかの隠された事実に何らかの光を当てることができる場合: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1109) at android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:399) at android.app.Activity.onBackPressed(Activity.java:2066) at android.app.Activity.onKeyDown(Activity.java:1962) at android.view.KeyEvent.dispatch(KeyEvent.java:2482) at android.app.Activity.dispatchKeyEvent(Activity.java:2274) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1668) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1112) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1720) at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1258) at android.app.Activity.dispatchKeyEvent(Activity.java:2269) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1668) at android.view.ViewRoot.deliverKeyEventPostIme(ViewRoot.java:2851) at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2824) at android.view.ViewRoot.handleMessage(ViewRoot.java:2011) …

8
HTTP Cookieはポート固有ですか?
1台のマシンで2つのHTTPサービスを実行しています。Cookieを共有しているかどうか、またはブラウザが2つのサーバーソケットを区別しているかどうかを知りたいだけです。
355 security  http  cookies 

30
Gitプッシュエラー:リポジトリが見つかりません
とで非常に奇妙な問題が発生しgitていgithubます。私が試してプッシュすると、次のようになります。 git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly 私はリモコンを追加しました: git remote add origin git@github.com:account-name/repo-name.git 何か案は?
355 git  github  git-push 


30
Android:java.lang.OutOfMemoryError:OOMまで2097152の空きバイトと2MBの23970828バイトの割り当てに失敗しました
すでに保存されているSDカードのImageViewでビットマップ画像を表示したい。実行後、アプリケーションがクラッシュし、次のOutOfMemoryErrorエラーが発生します。 (java.lang.OutOfMemoryError:23970828バイトの割り当てに2097152フリーバイト、OOMまで2 MBを割り当てることができませんでした) 私はそれがメモリ不足であるか、なぜかわかりません。画像サイズが非常に大きいと思いますので、変更してみました。 Iterator<String> it = imageArray.iterator(); while (it.hasNext()) { Object element = it.next(); String objElement = element.toString(); Log.e("objElement ", " = " + objElement); final ImageView imageView = new ImageView (getContext()); final ProgressBar pBar = new ProgressBar(getContext(), null, android.R.attr.progressBarStyleSmall); imageView.setTag(it); pBar.setTag(it); imageView.setImageResource(R.drawable.img_placeholder); pBar.setVisibility(View.VISIBLE); if (objElement.endsWith(mp3_Pattern)) { Log.e("Mp3 ", …

8
角度の例外:既知のネイティブプロパティではないため、「ngForIn」にバインドできません
何が悪いのですか? import {bootstrap, Component} from 'angular2/angular2' @Component({ selector: 'conf-talks', template: `<div *ngFor="let talk in talks"> {{talk.title}} by {{talk.speaker}} <p>{{talk.description}} </div>` }) class ConfTalks { talks = [ {title: 't1', speaker: 'Brian', description: 'talk 1'}, {title: 't2', speaker: 'Julie', description: 'talk 2'}]; } @Component({ selector: 'my-app', directives: [ConfTalks], template: '<conf-talks></conf-talks>' }) …

4
'form'は 'input'の既知のプロパティではないため、バインドできません-Angular2 Material Autocomplete issue
Angular 2プロジェクトでAngular Material Autocompleteコンポーネントを使用しようとしています。テンプレートに以下を追加しました。 <md-input-container> <input mdInput placeholder="Category" [mdAutocomplete]="auto" [formControl]="stateCtrl"> </md-input-container> <md-autocomplete #auto="mdAutocomplete"> <md-option *ngFor="let state of filteredStates | async" [value]="state"> {{ state }} </md-option> </md-autocomplete> 以下は私のコンポーネントです。 import {Component, OnInit} from "@angular/core"; import {ActivatedRoute, Router} from "@angular/router"; import {FormControl} from "@angular/forms"; @Component({ templateUrl: './edit_item.component.html', styleUrls: ['./edit_item.component.scss'] }) export class EditItemComponent …

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