Search Results

Search found 834 results on 34 pages for 'fragment'.

Page 2/34 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • FragmentStatePagerAdapter IllegalStateException: <MyFragment> is not currently in the FragmentManager

    - by Ixx
    I'm getting this on some cases, when going back to the activity, which uses a FragmentStatePagerAdapter, using back button of the devices. Not always. Not reproducible. I'm using support package v4, last revision (8). Already searched with google, no success finding a useful answer. Looking in the source, it's thrown here: FragmentManager.java @Override public void putFragment(Bundle bundle, String key, Fragment fragment) { if (fragment.mIndex < 0) { throw new IllegalStateException("Fragment " + fragment + " is not currently in the FragmentManager"); } bundle.putInt(key, fragment.mIndex); } But why is the index of fragment < 0 there? The code instantiating the fragments: @Override public Fragment getItem(int position) { Fragment fragment = null; switch(position) { case 0: fragment = Fragment1.newInstance(param1); break; case 1: fragment = MyFragment2.newInstance(param2, param3); break; } return fragment; } @Override public int getCount() { return 2; } I also can't debug through the source since the support package doesn't let me attach the source, for some reason... but that's a different question...

    Read the article

  • Replace a fragment programmatically

    - by Vishal
    I have three fragments as shown in below figure. I have added all these three fragments in LinearLayout using .xml file and when my launcher activity starts I load that .xml layout using setContentView.I have some controls on fragment2. Clicking on any one loads the fragment4 programmatically using FragmentTransaction and commit method. This fragments is added to the screen but the problem is it take the whole screen area. What can be the problem?

    Read the article

  • OpenGL ES 2.0: Vertex and Fragment Shader for 2D with Transparency

    - by Bunkai.Satori
    Could I knindly ask for correct examples of OpenGL ES 2.0 Vertex and Fragment shader for displaying 2D textured sprites with transparency? I have fairly simple shaders that display textured polygon pairs but transparency is not applied despite: texture map contains transparency information Blending is enabled: glEnable(GL_BLEND); glEnable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); My Vertex Shader: uniform mat4 uOrthoProjection; uniform vec3 Translation; attribute vec4 Position; attribute vec2 TextureCoord; varying vec2 TextureCoordOut; void main() { gl_Position = uOrthoProjection * (Position + vec4(Translation, 0)); TextureCoordOut = TextureCoord; } My Fragment Shader: varying mediump vec2 TextureCoordOut; uniform sampler2D Sampler; void main() { gl_FragColor = texture2D(Sampler, TextureCoordOut); }

    Read the article

  • Problems with Android Fragment back stack

    - by DexterMoon
    I've got a massive problem with the way the android fragment backstack seems to work and would be most grateful for any help that is offered. Imagine you have 3 Fragments [1] [2] [3] I want the user to be able to navigate [1] > [2] > [3] but on the way back (pressing back button) [3] > [1]. As I would have imagined this would be accomplished by not calling addToBackStack(..) when creating the transaction that brings fragment [2] into the fragment holder defined in XML. The reality of this seems as though that if I dont want [2] to appear again when user presses back button on [3], I must not call addToBackStack in the transaction that shows fragment [3]. This seems completely counter-intuitive (perhaps coming from the iOS world). Anyway if i do it this way, when I go from [1] > [2] and press back I arrive back at [1] as expected. If I go [1] > [2] > [3] and then press back I jump back to [1] (as expected). Now the strange behavior happens when I try and jump to [2] again from [1]. First of all [3] is briefly displayed before [2] comes into view. If I press back at this point [3] is displayed, and if I press back once again the app exits. Can anyone help me to understand whats going on here? And here is the layout xml file for my main activity: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <fragment android:id="@+id/headerFragment" android:layout_width="match_parent" android:layout_height="wrap_content" class="com.fragment_test.FragmentControls" > <!-- Preview: layout=@layout/details --> </fragment> <FrameLayout android:id="@+id/detailFragment" android:layout_width="match_parent" android:layout_height="fill_parent" /> Update This is the code I'm using to build by nav heirarchy Fragment frag; FragmentTransaction transaction; //Create The first fragment [1], add it to the view, BUT Dont add the transaction to the backstack frag = new Fragment1(); transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.detailFragment, frag); transaction.commit(); //Create the second [2] fragment, add it to the view and add the transaction that replaces the first fragment to the backstack frag = new Fragment2(); transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.detailFragment, frag); transaction.addToBackStack(null); transaction.commit(); //Create third fragment frag = new Fragment3(); transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.detailFragment, frag); transaction.commit(); //END OF SETUP CODE------------------------- //NOW: //Press back once and then issue the following code: frag = new Fragment2(); transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.detailFragment, frag); transaction.addToBackStack(null); transaction.commit(); //Now press back again and you end up at fragment [3] not [1] Many thanks

    Read the article

  • Does OpenGL stencil test happen before or after fragment program runs?

    - by david
    When I set glStencilFunc( GL_NEVER, . . . ) effectively disabling all drawing, and then run my [shader-bound] program I get no performance increase over letting the fragment shader run. I thought the stencil test happened before the fragment program. Is that not the case, or at least not guaranteed? Replacing the fragment shader with one that simply writes a constant to gl_FragColor does result in a higher FPS.

    Read the article

  • fragment shader directional light positioning with camera

    - by meWantToLearn
    Im trying to set up directional lighting in the fragment shader. So the direction of my light moves with the camera position. #version 150 core uniform sampler2D diffuseTex; uniform vec4 lightColour; uniform vec3 lightDirection; vec3 LNorm = normalize(lightDirection); vec3 normal = normalize(IN.normal); vec3 calColour = lightColour[i].rgb * intensity; gl_FragColor = vec4(diffuse.rbg * calColour, diffuse.a); It lights the entire scene.

    Read the article

  • Per fragment lighting with OpenGL 4.x tessellated model

    - by Finlaybob
    I'm experienced with OpenGL 3+. I'm dabbling with tessellation shaders and have now got to a point where I have a nicely tessellated teapot/plane demo (quick look here) As can be seen from the screenshots, the lighting is broken (though admittedly doesn't look too bad in the image) I've tried to add a normal map to the equation but it still doesn't come out right, I can calculate the normals, tangents and binormals per triangle in the geometry shader but still looks wrong. I think the question would be; How do I add per fragment lighting to a tessellated model? The teapot is 32 16-point patches, the plane is one single 16 point patch. The shaders are here, but they are a complete mess, so I don't blame anyone who cant make sense of them. But peruse at your leisure if you like. Also, if this question is more suited to be somewhere else i.e. Stack Overflow or the Programming stack please let me know.

    Read the article

  • Are the contents of a fragment visible outside the host plugin?

    - by Mike Daniels
    I have never worked with plug-in fragments before. I thought that by creating a new class within a fragment and exporting the package that contains it in the fragment's manifest, I'd be able to access that class from another plug-in that already has a dependency on the host plug-in. However, I cannot seem to make this work. Are the contents of a fragment ever visible to any plug-in besides the host plug-in? If so, is there something special I have to do to allow this?

    Read the article

  • List of valid characters for the fragment identifier in an URL?

    - by sohtimsso1970
    I'm using the fragment identifier to create a permalink for AJAX events in my web app similar to this guy. Something like: http://www.myapp.com/calendar#filter:year/2010/month/5 I've done quite a bit of searching but can't find a list of valid characters for the fragment idenitifer. The W3C spec doesn't offer anything. Do I need to encode the characters the same as the URL in has in general? There doesn't seem to be any good information on this anywhere.

    Read the article

  • ViewPager and Fragment Pager adapter implementation

    - by Rohit Deshmukh
    So I am trying to implement sliding views/fragments using viewpager and fragment pager adapter. convert_home is my main xml file that has android.support.v4.view.PagerTitleStrip and temperature.xml and velocity.xml are my two other views. I have no clue where I am going wrong. package app.converto; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; public class ConverTo extends FragmentActivity { SectionsPagerAdapter mSectionsPagerAdapter; ViewPager mViewPager; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); mViewPager.setAdapter(mSectionsPagerAdapter); setContentView(R.layout.converto_home); mViewPager = (ViewPager) findViewById(R.id.pager); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.converto_home, menu); return true; } public class SectionsPagerAdapter extends FragmentPagerAdapter { public SectionsPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int i) { switch(i){ case 0: Fragment1 fragment = new Fragment1(); return fragment; case 1: Fragment2 fragment2 = new Fragment2(); return fragment2; } defaultFragment fragment3 = new defaultFragment(); return fragment3; } @Override public int getCount() { return 2; } // // @Override // public CharSequence getPageTitle(int position) { // switch (position) { // case 0: return getString(R.string.velocity); // case 1: return getString(R.string.temperature); // case 2: return getString(R.string.distance); // } // return null; // } } public static class Fragment1 extends Fragment{ public Fragment1(){ } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //return inflater.inflate(R.layout.temperature, container, false); View view = inflater.inflate(R.layout.temperature, container, false); TextView textView = (TextView) view.findViewById(R.id.sample); textView.setText(getArguments().getString("title")); return view; } } public static class Fragment2 extends Fragment{ public Fragment2(){ } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //return inflater.inflate(R.layout.velocity, container, false); View view = inflater.inflate(R.layout.temperature, container, false); TextView textView = (TextView) view.findViewById(R.id.sample); textView.setText(getArguments().getString("title")); return view; } } public static class defaultFragment extends Fragment{ public defaultFragment(){ }//end constructor @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // return inflater.inflate(R.layout.temperature, container, false); View view = inflater.inflate(R.layout.temperature, container, false); TextView textView = (TextView) view.findViewById(R.id.sample); textView.setText(getArguments().getString("title")); return view; }//end oncreate }//end default fragment }

    Read the article

  • Get starting and end index of a highlighted fragment in a searched field

    - by Umer
    "My search returns a highlighted fragment from a field. I want to know that in that field of particular searched document, where does that fragment starts and ends ?" for instance. consider i am searching "highlighted fragment" in above lines (consider the above para as single document). I am setting my fragmenter as : SimpleFragmenter fragmenter = new SimpleFragmenter(30); now the output of GetBestFragment is somewhat like : "returns a highlighted fragment from" Is it possible to get the starting and ending index of this fragment in the text above (say starting is 10 and ending is 45)

    Read the article

  • Can Nokogiri use a SAX parser to parse an HTML fragment?

    - by .yahoo.co.jpaqwsykcj3aulh3h1k0cy6nzs3isj
    I have this code. class MyParser < Nokogiri::XML::SAX::Document def characters(string) LOG.debug("characters #{string}") end def start_element(name, attrs = []) LOG.debug("start_element #{name}") end def end_element(name) LOG.debug("end_element #{name}") end end parser = Nokogiri::HTML::SAX::Parser.new(MyParser.new) parser.parse(File.new($*[0], 'rb')) Run on an HTML fragment like this, <h1>Hello</h1> <p>Hi.</p> the output shows that only the first element is processed: start_element h1 characters Hello end_element h1 If I wrap the fragment in html and body tags, the whole input is parsed. Is there a way to use a SAX style parser on HTML fragments?

    Read the article

  • How do I get the current color of a fragment?

    - by Mason Wheeler
    I'm trying to wrap my head around shaders in GLSL, and I've found some useful resources and tutorials, but I keep running into a wall for something that ought to be fundamental and trivial: how does my fragment shader retrieve the color of the current fragment? You set the final color by saying gl_FragColor = whatever, but apparently that's an output-only value. How do you get the original color of the input so you can perform calculations on it? That's got to be in a variable somewhere, but if anyone out there knows its name, they don't seem to have recorded it in any tutorial or documentation that I've run across so far, and it's driving me up the wall.

    Read the article

  • How does twitter server get to know single tweet ID from URL fragment segment?

    - by Morgan Cheng
    Each tweet has a single URL such as http://twitter.com/#!/DeliciousHot/status/23189589820702720. The tweet identification (/DeliciousHot/status/23189589820702720) is in the URL fragment segment which is not actually sent to server. Originally, I thought it works this way: The URL response doesn't have this tweet specific info. It is JavaScript module that extracts tweet id from current browser URL and fetch tweet payload with AJAX. The page content is then updated with the tweet payload. To my surprise, it is doesn't work this way! With Firebug, you can view that response of http://twitter.com/#!/DeliciousHot/status/23189589820702720 has tweet payload "10 Signs of a True Gentleman" text in inline JavaScript. The tweet payload is not fetched by another AJAX. So, how does Twitter server get to know the expected tweet ID even it is in URL fragment segment?

    Read the article

  • OpenGL ES Basic Fragment Shader help with transparency

    - by Chris
    I have just spent my first half hour playing with the shader language. I have modified the basic program I have which renders the texture, to allow me to colour the texture. varying vec2 texCoord; uniform sampler2D texSampler; /* Given the texture coordinates, our pixel shader grabs the corresponding * color from the texture. */ void main() { //gl_FragColor = texture2D(texSampler, texCoord); gl_FragColor = vec4(0,1,0,1)*vec4(texture2D(texSampler,texCoord).xyz,1); } I have noticed how this affects my transparent textures, and I believe I am loosing the alpha channel which would explain why previously transparent area's appear totally black. If I use the following line instead, I am shown the transparent area's gl_FragColor = vec4(0,1,0,1)*vec4(texture2D(texSampler,texCoord).aaa,1); How can I retain the transparency after this modification to the colour? I have seen various things about a .w property, and also luminous, but my tweaks with those and the .aaa property are not working XD

    Read the article

  • How to refresh a fragment in a viewpager?

    - by aut_silvia
    I know there are already some questions to this problem. But I am really new in Android and ecspecially to Fragments and Viewpager. Pls have passion with me. I didn't found a answer which fits to my code. I dont know how to refresh a fragment or reload it when it's "active" again. TabsPagerAdapter.java: public class TabsPagerAdapter extends FragmentPagerAdapter{ public TabsPagerAdapter(FragmentManager fm){ super(fm); } @Override public Fragment getItem(int index) { switch (index) { case 0: return new KFZFragment(); case 1: return new LogFragment(); case 2: return new TrackFragment(); } return null; } @Override public int getCount() { // get item count - equal to number of tabs return 3; } } I have this 3 Fragments (KFZFragment,LogFragment,TrackFragment) and on the TrackFragment I calculate some data and this data should be display in a ListView in LogFragment. But when I change to LogFragment it's not the latest data. So it doesnt refresh. Now how should I modify my code to refresh the fragments when it's "active"? MainActivityFragment.java: public class MainActivityFragment extends FragmentActivity implements ActionBar.TabListener{ private ViewPager viewPager; private TabsPagerAdapter mAdapter; private ActionBar actionBar; List<Fragment> fragments; private String[] tabs = { "KFZ", "Fahrten Log", "Kosten Track" }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_fragment); // Initilization viewPager = (ViewPager) findViewById(R.id.pager); actionBar = getActionBar(); mAdapter = new TabsPagerAdapter(getSupportFragmentManager()); fragments = new Vector<Fragment>(); fragments.add(Fragment.instantiate(this, KFZFragment.class.getName(),savedInstanceState)); fragments.add(Fragment.instantiate(this, LogFragment.class.getName(),savedInstanceState)); viewPager.setAdapter(mAdapter); actionBar.setHomeButtonEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); // Adding Tabs for (String tab_name : tabs) { actionBar.addTab(actionBar.newTab().setText(tab_name) .setTabListener(this)); } viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageSelected(int position) { // on changing the page // make respected tab selected actionBar.setSelectedNavigationItem(position); } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageScrollStateChanged(int arg0) { } }); } @Override public void onTabReselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub } @Override public void onTabSelected(Tab tab, FragmentTransaction ft) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(Tab tab, FragmentTransaction ft) { // TODO Auto-generated method stub } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { } return super.onKeyDown(keyCode, event); } } Pls help me out.

    Read the article

  • Fill listview from fragment

    - by Bohsen
    I have a layout file containing a listview that I would like to fill with the help of a Fragment. But it continues to give me errors. The layout file: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" > </ListView> <TableLayout android:id="@+id/details" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:stretchColumns="1" > <Button android:id="@+id/create_patient_button" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/create_patient_button" /> </TableLayout> </RelativeLayout> My fragmentActivity: public class BasicFragmentActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.create_patient_view); FragmentManager fm = getSupportFragmentManager(); Fragment fragment = fm.findFragmentById(R.id.list); if (fragment == null) { FragmentTransaction ft = fm.beginTransaction(); ft.add(R.id.list, new BasicFragment()); ft.commit(); // Make sure you call commit or your Fragment will not be added. // This is very common mistake when working with Fragments! } } } My ListFragment: public class BasicFragment extends ListFragment { private PatientAdapter pAdapter; @Override public void onActivityCreated(Bundle savedState) { super.onActivityCreated(savedState); pAdapter = new PatientAdapter(getActivity(), GFRApplication.dPatients); setListAdapter(pAdapter); } } The error: java.lang.UnsupportedOperationException: addView(View) is not supported in AdapterView

    Read the article

  • How to run Cg vertex/fragment shader on CPU?

    - by Andy
    Hi all, I'm playing about with some vertex and fragment shaders using Cg on my little netbook (running Linux). Clearly I'm going to frequently hit resource limits for my graphics controller, so was wondering if there's a nice way to run the shaders on the CPU, just to test them. Something like D3D's refrast... TIA Andy

    Read the article

  • How to read BC4 texture in GLSL?

    - by Question
    I'm supposed to receive a texture in BC4 format. In OpenGL, i guess this format is called GL_COMPRESSED_RED_RGTC1. The texture is not really a "texture", more like a data to handle at fragment shader. Usually, to get colors from a texture within a fragment shader, i do : uniform sampler2D TextureUnit; void main() { vec4 TexColor = texture2D(TextureUnit, vec2(gl_TexCoord[0])); (...) the result of which is obviously a v4, for RGBA. But now, i'm supposed to receive a single float from the read. I'm struggling to understand how this is achieved. Should i still use a texture sampler, and expect the value to be in a specific position (for example, within TexColor.r ?), or should i use something else ?

    Read the article

  • Very basic OpenGL ES 2 error

    - by user16547
    This is an incredibly simple shader, yet I'm having a lot of trouble understanding what's wrong with it. I'm trying to send a float to my fragment shader. Its purpose is to adjust the alpha of the fragment colour. Here is my fragment shader: precision mediump float; uniform sampler2D u_Texture; uniform float u_Alpha; varying vec2 v_TexCoordinate; void main() { gl_FragColor = texture2D(u_Texture, v_TexCoordinate); gl_FragColor.a *= u_Alpha; } and below is my rendering method. I get a 1282 (invalid operation) on the GLES20.glUniform1f(u_Alpha, alpha); line. alpha is 1 (but I tried other values as well) and transparent is true: public void render() { GLES20.glUseProgram(mProgram); if(transparent) { GLES20.glEnable(GLES20.GL_BLEND); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); GLES20.glUniform1f(u_Alpha, alpha); } Matrix.setIdentityM(mModelMatrix, 0); Matrix.rotateM(mModelMatrix, 0, angle, 0, 0, 1); Matrix.translateM(mModelMatrix, 0, x, y, z); Matrix.multiplyMM(mMVPMatrix, 0, mViewMatrix, 0, mModelMatrix, 0); Matrix.multiplyMM(mMVPMatrix, 0, mProjectionMatrix, 0, mMVPMatrix, 0); GLES20.glUniformMatrix4fv(u_MVPMatrix, 1, false, mMVPMatrix, 0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo[0]); GLES20.glVertexAttribPointer(a_Position, 3, GLES20.GL_FLOAT, false, 12, 0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vbo[1]); GLES20.glVertexAttribPointer(a_TexCoordinate, 2, GLES20.GL_FLOAT, false, 8, 0); //snowTexture start GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); GLES20.glUniform1i(u_Texture, 0); GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, ibo[0]); GLES20.glDrawElements(GLES20.GL_TRIANGLE_STRIP, indices.capacity(), GLES20.GL_UNSIGNED_BYTE, 0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0); GLES20.glBindBuffer(GLES20.GL_ELEMENT_ARRAY_BUFFER, 0); if(transparent) { GLES20.glDisable(GLES20.GL_BLEND); } GLES20.glUseProgram(0); }

    Read the article

  • Rails ActionCaching with Memcached fragment hit but action gets called anyway

    - by baldtrol
    Hi stackoverflow. I'm running into something strange. I'm using memcached with a caches_action setup. I'm doing this in 4 different controllers. In two of them, it works flawlessly (so far), though admittedly those two controllers are less complicated than the two in which it doesn't seem to work. I'm doing something like this: caches_action :index, :expires_in => 6.hours, :cache_path => Proc.new {|controller| controller.send(:generate_cache_path) }, :layout => false, :if => Proc.new { |c| c.request.format.js? } The intention behind the above is to cache some results that are dependent on the params. my :generate_cache_path method just takes into account some params and session vars and creates a unique key for memcached. I can see in memcached -vv that this is working. What's weird is that I get my request from the rails app for a given key, and I see memcached (with -vv) get the request and send back the response. But then my action runs anyway, and a new value is then set for the same key, even when all the same params are given. I can watch it happen. In the controllers where everything is working, the request is made for the fragment, it gets it, and the action in the controller is halted, and the fragment is passed back. These lines come from the exact same request: Cached fragment hit: views/items/?page=1&rp=10&srtn=created_at&srto=DESC.js And then: Cached fragment miss: views/items/?page=1&rp=10&srtn=created_at&srto=DESC.js I don't know what to make of it, or if I'm doing something stupid. Any help or ideas where I could start looking for trouble would be greatly appreciated.

    Read the article

  • Toon/cel shading with variable line width?

    - by Nick Wiggill
    I see a few broad approaches out there to doing cel shading: Duplication & enlargement of model with flipped normals (not an option for me) Sobel filter / fragment shader approaches to edge detection Stencil buffer approaches to edge detection Geometry (or vertex) shader approaches that calculate face and edge normals Am I correct in assuming the geometry-centric approach gives the greatest amount of control over lighting and line thickness, as well eg. for terrain where you might see the silhouette line of a hill merging gradually into a plain? What if I didn't need pixel lighting on my terrain surfaces? (And I probably won't as I plan to use cell-based vertex- or texturemap-based lighting/shadowing.) Would I then be better off sticking with the geometry-type approach, or go for a screen space / fragment approach instead to keep things simpler? If so, how would I get the "inking" of hills within the mesh silhouette, rather than only the outline of the entire mesh (with no "ink" details inside that outline? Lastly, is it possible to cheaply emulate the flipped-normals approach, using a geometry shader? Is that exactly what the GS approaches do? What I want - varying line thickness with intrusive lines inside the silhouette... What I don't want...

    Read the article

  • XML fragment with multiple roots: suppressing VS error

    - by Laurent
    In Visual Studio, I have an XML file (with .xml extension) which contains an XML fragment that I use in my program: <tag1> data ... </tag1> <tag2> data ... </tag2> Visual Studio shows me an error in the error list: "XML document cannot contain multiple root level elements". But this is not a complete document, just a fragment that will be reused. I want to keep my 2 roots in my fragment. How can I get rid of the error message? Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >